aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/lilliput/lilliput.cpp37
-rw-r--r--engines/lilliput/lilliput.h6
-rw-r--r--engines/lilliput/script.cpp34
3 files changed, 43 insertions, 34 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 8ab326ea21..f2ba0ce231 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -1122,6 +1122,7 @@ void LilliputEngine::displayCharacterStatBar(int8 type, int16 averagePosX, int8
if (score == 0)
++score;
+ // Draw bar, color green, high = 4, width = score
for (int i = 0; i < 4; i++) {
for (int j = 0; j < score; j++) {
vgaBuf[vgaIndex + j] = 2;
@@ -1980,7 +1981,7 @@ void LilliputEngine::sub1305C(byte index, byte button) {
}
if (_byte12FCE == 1) {
- sub130DD();
+ unselectInterfaceButton();
return;
}
@@ -2169,12 +2170,11 @@ void LilliputEngine::sub16B8F_moveCharacter(int index, Common::Point pos, int di
_characterPositionY[index] = pos.y;
}
-void LilliputEngine::sub17224(int var1, int var4) {
- debugC(2, kDebugEngine, "sub17224(%d, %d)", var1, var4);
+void LilliputEngine::sub17224(byte type, byte index, int var4) {
+ debugC(2, kDebugEngine, "sub17224(%d, %d, %d)", type, index, var4);
- byte type = (var1 >> 8);
if (type == 0) {
- sub17264(var1, var4);
+ sub17264(index, var4);
return;
}
@@ -2184,15 +2184,15 @@ void LilliputEngine::sub17224(int var1, int var4) {
return;
}
- int index = var4 & 0xFF;
+ int index2 = var4 & 0xFF;
for (int i = 0; i < _numCharacters; i++) {
- if ((_scriptHandler->_array10B51[index] & 0xFF) >= type)
+ if ((_scriptHandler->_array10B51[index2] & 0xFF) >= type)
sub17264(i, var4);
- index += 40;
+ index2 += 40;
}
}
-void LilliputEngine::sub17264(int index, int var4) {
+void LilliputEngine::sub17264(byte index, int var4) {
debugC(2, kDebugEngine, "sub17264(%d, %d)", index, var4);
if (_array11D49[index] != -1) {
@@ -2218,11 +2218,14 @@ void LilliputEngine::sub171CF() {
for (int i = 0; i < 10; i++) {
if ((_array12861[(3 * i) + 1] != -1) && (_array12861[3 * i] == _word1289D)) {
- int var1 = _array12861[(3 * i) + 1];
+ int16 var1 = _array12861[(3 * i) + 1];
int var4 = _array12861[(3 * i) + 2];
_array12861[(3 * i) + 1] = -1;
- sub17224(var1, var4);
+ byte type = var1 >> 8;
+ byte index = var1 & 0xFF;
+
+ sub17224(type, index, var4);
}
}
}
@@ -2625,8 +2628,14 @@ void LilliputEngine::setCurrentCharacter(int index) {
_currentCharacterVariables = getCharacterVariablesPtr(_currentScriptCharacter * 32);
}
-void LilliputEngine::sub130DD() {
- warning("sub130DD()");
+void LilliputEngine::unselectInterfaceButton() {
+ debugC(1, kDebugEngine, "unselectInterfaceButton()");
+
+ _byte12FCE = 0;
+ _word15AC2 = 0;
+ _lastInterfaceHotspotButton = 0;
+ unselectInterfaceHotspots();
+ displayInterfaceHotspots();
}
void LilliputEngine::handleMenu() {
@@ -2646,7 +2655,7 @@ void LilliputEngine::handleMenu() {
_byte129A0 = 0xFF;
if (_byte16F07_menuId == 3)
- sub130DD();
+ unselectInterfaceButton();
_byte16F07_menuId = 0;
}
diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h
index 5bcc229db6..ea6159c1b0 100644
--- a/engines/lilliput/lilliput.h
+++ b/engines/lilliput/lilliput.h
@@ -261,8 +261,8 @@ public:
void sub16626();
void sub16A08(int index);
byte sub16A76(int indexb, int indexs);
- void sub17224(int var1, int var4);
- void sub17264(int index, int var4);
+ void sub17224(byte type, byte index, int var4);
+ void sub17264(byte index, int var4);
int16 findHotspot(Common::Point pos);
int16 reverseFindHotspot(Common::Point pos);
byte sub16722(int index, Common::Point var1);
@@ -350,7 +350,7 @@ public:
void pollEvent();
void setCurrentCharacter(int index);
- void sub130DD();
+ void unselectInterfaceButton();
void moveCharacters();
void setNextDisplayCharacter(int var1);
void handleGameScripts();
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index a6dd51c31a..68352eda47 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -2460,7 +2460,7 @@ void LilliputScript::OC_setCurrentCharacter() {
}
void LilliputScript::sub171AF(int16 var1, int16 var2, int16 var4) {
- debugC(2, kDebugScript, "sub171AF()");
+ debugC(2, kDebugScriptTBC, "sub171AF()");
int index = 0;
for (int i = 0; i < 10; i++) {
@@ -2476,23 +2476,23 @@ void LilliputScript::sub171AF(int16 var1, int16 var2, int16 var4) {
void LilliputScript::OC_sub17C8B() {
debugC(1, kDebugScriptTBC, "OC_sub17C8B()");
- int var1 = 2 << 8;
- int var4 = _currScript->readUint16LE();
- int var2 = _currScript->readUint16LE();
- var2 = ((var2 & 0xFF) << 8) + _vm->_currentScriptCharacter;
+ int16 type = 2 << 8;
+ int16 var4 = _currScript->readSint16LE();
+ byte tmpVal = (_currScript->readUint16LE() & 0xFF);
+ uint16 var2 = (tmpVal << 8) + _vm->_currentScriptCharacter;
- sub171AF(var1, var2, var4);
+ sub171AF(type, var2, var4);
}
void LilliputScript::OC_sub17CA2() {
debugC(1, kDebugScript, "OC_sub17CA2()");
- int16 var1 = 1 << 8;
+ int16 type = 1 << 8;
int16 var4 = _currScript->readSint16LE();
- uint16 var2 = _currScript->readUint16LE();
- var2 = ((var2 & 0xFF) << 8) + _vm->_currentScriptCharacter;
+ byte tmpVal = (_currScript->readUint16LE() & 0xFF);
+ uint16 var2 = (tmpVal << 8) + _vm->_currentScriptCharacter;
- sub171AF(var1, var2, var4);
+ sub171AF(type, var2, var4);
}
void LilliputScript::OC_sub17CB9() {
@@ -2500,8 +2500,8 @@ void LilliputScript::OC_sub17CB9() {
int16 var4 = _currScript->readSint16LE();
int16 var1 = getValue1();
- int16 var2 = _currScript->readSint16LE();
- var2 = ((var2 & 0xFF) << 8) + _vm->_currentScriptCharacter;
+ byte tmpVal = (_currScript->readUint16LE() & 0xFF);
+ uint16 var2 = (tmpVal << 8) + _vm->_currentScriptCharacter;
sub171AF(var1, var2, var4);
}
@@ -2509,12 +2509,12 @@ void LilliputScript::OC_sub17CB9() {
void LilliputScript::OC_sub17CD1() {
debugC(1, kDebugScriptTBC, "OC_sub17CD1()");
- int var1 = 3 << 8;
- int var4 = _currScript->readUint16LE();
- int var2 = _currScript->readUint16LE();
- var2 = ((var2 & 0xFF) << 8) + _vm->_currentScriptCharacter;
+ int16 type = 3 << 8;
+ int16 var4 = _currScript->readSint16LE();
+ int tmpVal = (_currScript->readUint16LE() & 0xFF);
+ uint16 var2 = (tmpVal << 8) + _vm->_currentScriptCharacter;
- sub171AF(var1, var2, var4);
+ sub171AF(type, var2, var4);
}
void LilliputScript::OC_resetWord16EFE() {