aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2012-05-24 21:11:00 +0200
committerEugene Sandulenko2018-03-28 17:36:57 +0200
commit3103cf448a586045469e328a11e680d2cb3ace48 (patch)
tree5d559206c5144890e6c40ede2823619ac0806de7
parentf602ca7408fb35d8c18330e9e53c20a9fdb78898 (diff)
downloadscummvm-rg350-3103cf448a586045469e328a11e680d2cb3ace48.tar.gz
scummvm-rg350-3103cf448a586045469e328a11e680d2cb3ace48.tar.bz2
scummvm-rg350-3103cf448a586045469e328a11e680d2cb3ace48.zip
LILLIPUT: Fix a bug in sub171AF
-rw-r--r--engines/lilliput/lilliput.cpp6
-rw-r--r--engines/lilliput/script.cpp17
-rw-r--r--engines/lilliput/script.h4
3 files changed, 14 insertions, 13 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 68a4e32910..ee37f02c18 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -343,7 +343,7 @@ void LilliputEngine::display16x16IndexedBuf(byte *buf, int index, Common::Point
int index1 = index * 16 * 16;
byte *newBuf = &buf[index1];
- int index2 = pos.x + (pos.y * 320);
+ int vgaIndex = pos.x + (pos.y * 320);
for (int i = 0; i < 16; i++) {
// clip on y
@@ -351,10 +351,10 @@ void LilliputEngine::display16x16IndexedBuf(byte *buf, int index, Common::Point
for (int j = 0; j < 16; j++) {
// clip on x
if ((newBuf[j] != 0) && (pos.x + j < 320))
- ((byte *)_mainSurface->getPixels())[index2 + j] = newBuf[j];
+ ((byte *)_mainSurface->getPixels())[vgaIndex + j] = newBuf[j];
}
}
- index2 += 320;
+ vgaIndex += 320;
newBuf += 16;
}
_system->copyRectToScreen((byte *)_mainSurface->getPixels(), 320, 0, 0, 320, 200);
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index 1eda4235e3..ecdf1ac1f6 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -64,7 +64,7 @@ LilliputScript::LilliputScript(LilliputEngine *vm) : _vm(vm), _currScript(NULL)
_array128EF[i] = 15;
_array10AB1[i] = 0;
_array12811[i] = 16;
- _array12839[i] = 0xFF;
+ _array12839[i] = -1;
_array16123PosX[i] = 0;
_array1614BPosY[i] = 0;
_array122C1[i] = 0;
@@ -1066,7 +1066,7 @@ void LilliputScript::sub16C86(int index, byte *buf) {
}
}
-void LilliputScript::sub16C5C(int index, byte var3) {
+void LilliputScript::sub16C5C(int index, int8 var3) {
debugC(1, kDebugScript, "sub16C5C(%d, %d)", index, var3);
assert(index < 40);
@@ -1744,9 +1744,9 @@ byte LilliputScript::OC_compWord10804() {
}
byte LilliputScript::OC_sub17766() {
- debugC(1, kDebugScriptTBC, "OC_sub17766()");
+ debugC(1, kDebugScript, "OC_sub17766()");
- byte var1 = (_currScript->readUint16LE() & 0xFF);
+ int8 var1 = (_currScript->readUint16LE() & 0xFF);
if ((var1 == _array12839[_vm->_currentScriptCharacter]) && (_array12811[_vm->_currentScriptCharacter] != 16))
return 1;
@@ -1756,7 +1756,7 @@ byte LilliputScript::OC_sub17766() {
byte LilliputScript::OC_sub17782() {
debugC(1, kDebugScript, "OC_sub17782()");
- byte var1 = (_currScript->readUint16LE() & 0xFF);
+ int8 var1 = (_currScript->readUint16LE() & 0xFF);
if ((var1 == _array12839[_vm->_currentScriptCharacter]) && (_array12811[_vm->_currentScriptCharacter] == 16))
return 1;
@@ -2394,14 +2394,14 @@ void LilliputScript::OC_resetByte16F04() {
void LilliputScript::OC_sub17AE1() {
debugC(1, kDebugScript, "OC_sub17AE1()");
- byte var3 = (_currScript->readUint16LE() & 0xFF);
+ int8 var3 = (_currScript->readUint16LE() & 0xFF);
sub16C5C(_vm->_currentScriptCharacter, var3);
}
void LilliputScript::OC_sub17AEE() {
debugC(1, kDebugScript, "OC_sub17AEE()");
- byte var3 = (_currScript->readUint16LE() & 0xFF);
+ int8 var3 = (_currScript->readUint16LE() & 0xFF);
sub16C5C(_vm->_currentScriptCharacter + 1, var3);
}
@@ -2460,7 +2460,7 @@ void LilliputScript::OC_setCurrentCharacter() {
}
void LilliputScript::sub171AF(int16 var1, int16 var2, int16 var4) {
- debugC(2, kDebugScriptTBC, "sub171AF()");
+ debugC(2, kDebugScript, "sub171AF()");
int index = 0;
for (int i = 0; i < 10; i++) {
@@ -2468,6 +2468,7 @@ void LilliputScript::sub171AF(int16 var1, int16 var2, int16 var4) {
_vm->_array12861[index + 1] = var1;
_vm->_array12861[index + 2] = var2;
_vm->_array12861[index + 0] = _vm->_word1289D + var4;
+ return;
}
index += 3;
}
diff --git a/engines/lilliput/script.h b/engines/lilliput/script.h
index d858fe57c7..1196035886 100644
--- a/engines/lilliput/script.h
+++ b/engines/lilliput/script.h
@@ -80,7 +80,7 @@ public:
Common::Point _array12311[640];
byte _array128EF[40];
- byte _array12839[40];
+ int8 _array12839[40];
Common::Point _array1813BPos[32];
LilliputScript(LilliputEngine *vm);
@@ -120,7 +120,7 @@ private:
void enableCharacterScript(byte index, byte var1, byte *curBufPtr);
void sub17B6C(int var1);
void sub16C86(int index, byte *buf);
- void sub16C5C(int index, byte var3);
+ void sub16C5C(int index, int8 var3);
void checkSpeechAllowed(bool &forceReturnFl);
void decodePackedText(char *buf);
void startSpeech(int var);