aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Montoir2009-03-01 00:51:59 +0000
committerGregory Montoir2009-03-01 00:51:59 +0000
commit478fa21838a87aed89260b9a53e3ca74e605610b (patch)
tree321db3aed6a9f47502894e62b351f0bbf0fe77aa
parent40a2485050db287e36162f80848a115df87a5b2a (diff)
downloadscummvm-rg350-478fa21838a87aed89260b9a53e3ca74e605610b.tar.gz
scummvm-rg350-478fa21838a87aed89260b9a53e3ca74e605610b.tar.bz2
scummvm-rg350-478fa21838a87aed89260b9a53e3ca74e605610b.zip
fix for tracker item #2628896 TUCKER: Invisible Raincoat bug
svn-id: r38991
-rw-r--r--engines/tucker/resource.cpp30
-rw-r--r--engines/tucker/tucker.h2
2 files changed, 15 insertions, 17 deletions
diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp
index b80202f95b..64dc567d51 100644
--- a/engines/tucker/resource.cpp
+++ b/engines/tucker/resource.cpp
@@ -335,8 +335,7 @@ void TuckerEngine::loadPanel() {
}
void TuckerEngine::loadBudSpr(int startOffset) {
- int endOffset;
- loadCTable01(0, startOffset, endOffset);
+ int endOffset = loadCTable01(0, startOffset);
loadCTable02(0);
int frame = 0;
int spriteOffset = 0;
@@ -367,12 +366,12 @@ void TuckerEngine::loadBudSpr(int startOffset) {
}
}
-void TuckerEngine::loadCTable01(int locationNum, int firstSpriteNum, int &lastSpriteNum) {
+int TuckerEngine::loadCTable01(int index, int firstSpriteNum) {
loadFile("ctable01.c", _loadTempBuf);
DataTokenizer t(_loadTempBuf, _fileLoadSize);
- lastSpriteNum = firstSpriteNum;
+ int lastSpriteNum = firstSpriteNum;
int count = 0;
- if (t.findIndex(_locationNum)) {
+ if (t.findIndex(index)) {
while (t.findNextToken(kDataTokenDw)) {
const int x = t.getNextInteger();
if (x < 0) {
@@ -398,6 +397,7 @@ void TuckerEngine::loadCTable01(int locationNum, int firstSpriteNum, int &lastSp
}
}
_ctable01Table_sprite[count] = -1;
+ return lastSpriteNum;
}
void TuckerEngine::loadCTable02(int fl) {
@@ -593,21 +593,19 @@ void TuckerEngine::loadData3() {
LocationAnimation *d = &_locationAnimationsTable[_locationAnimationsCount++];
d->graphicNum = num;
const int seqNum = t.getNextInteger();
- int i = 0;
- int j = 1;
if (seqNum > 0) {
- while (j < seqNum) {
- while (_staticData3Table[i] != 999) {
- ++i;
+ int anim = 0;
+ for (int i = 1; i < seqNum; ++i) {
+ while (_staticData3Table[anim] != 999) {
+ ++anim;
}
- ++i;
- ++j;
+ ++anim;
}
- d->animCurrentCounter = d->animInitCounter = i;
- while (_staticData3Table[i + 1] != 999) {
- ++i;
+ d->animCurrentCounter = d->animInitCounter = anim;
+ while (_staticData3Table[anim + 1] != 999) {
+ ++anim;
}
- d->animLastCounter = i;
+ d->animLastCounter = anim;
} else {
d->animLastCounter = 0;
}
diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h
index 3fbafcd74f..65f1dfbb2d 100644
--- a/engines/tucker/tucker.h
+++ b/engines/tucker/tucker.h
@@ -551,7 +551,7 @@ protected:
void loadCharSizeDta();
void loadPanel();
void loadBudSpr(int startOffset);
- void loadCTable01(int firstObjNum, int firstSpriteNum, int &lastSpriteNum);
+ int loadCTable01(int index, int firstSpriteNum);
void loadCTable02(int fl);
void loadLoc();
void loadObj();