aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/lilliput/lilliput.cpp16
-rw-r--r--engines/lilliput/lilliput.h4
-rw-r--r--engines/lilliput/script.cpp16
-rw-r--r--engines/lilliput/script.h2
4 files changed, 19 insertions, 19 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 7bec9ba24f..9b1b2fd679 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -135,7 +135,7 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd)
_byte1714E = 0;
_byte12FCE = false;
- _byte129A0 = -1;
+ _selectedCharacterId = -1;
_numCharactersToDisplay = 0;
_nextDisplayCharacterPos = Common::Point(0, 0);
_animationTick = 0;
@@ -975,9 +975,9 @@ int16 LilliputEngine::sub16DD5(int x1, int y1, int x2, int y2) {
void LilliputEngine::sub15F75() {
debugC(2, kDebugEngineTBC, "sub15F75()");
- _byte129A0 = -1;
+ _selectedCharacterId = -1;
_savedMousePosDivided = Common::Point(-1, -1);
- byte newX = _mousePos.x >> 2;
+ byte newX = _mousePos.x / 4;
byte newY = _mousePos.y / 3;
if ((newX >= 64) || (newY >= 64))
@@ -2011,7 +2011,7 @@ void LilliputEngine::sub130EE() {
return;
forceReturnFl = false;
- sub131B2(pos, forceReturnFl);
+ checkClickOnCharacter(pos, forceReturnFl);
if (forceReturnFl)
return;
@@ -2038,14 +2038,14 @@ void LilliputEngine::sub131FC(Common::Point pos) {
}
}
-void LilliputEngine::sub131B2(Common::Point pos, bool &forceReturnFl) {
- debugC(2, kDebugEngine, "sub131B2(%d, %d)", pos.x, pos.y);
+void LilliputEngine::checkClickOnCharacter(Common::Point pos, bool &forceReturnFl) {
+ debugC(2, kDebugEngine, "checkClickOnCharacter(%d, %d)", pos.x, pos.y);
forceReturnFl = false;
for (int8 i = 0; i < _numCharacters; i++) {
if ((pos.x >= _characterDisplayX[i]) && (pos.x <= _characterDisplayX[i] + 17) && (pos.y >= _characterDisplayY[i]) && (pos.y <= _characterDisplayY[i] + 17) && (i != _word10804)) {
- _byte129A0 = i;
+ _selectedCharacterId = i;
_byte16F07_menuId = 4;
if (_byte12FCE)
_byte16F07_menuId = 3;
@@ -2817,7 +2817,7 @@ void LilliputEngine::handleMenu() {
_scriptHandler->runMenuScript(ScriptStream(_menuScript, _menuScriptSize));
debugC(1, kDebugScriptTBC, "========================== End of Menu Script==============================");
_savedMousePosDivided = Common::Point(-1, -1);
- _byte129A0 = -1;
+ _selectedCharacterId = -1;
if (_byte16F07_menuId == 3)
unselectInterfaceButton();
diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h
index 02ed0c6dc1..190d8bc979 100644
--- a/engines/lilliput/lilliput.h
+++ b/engines/lilliput/lilliput.h
@@ -295,7 +295,7 @@ public:
void sub1305C(byte index, byte var2);
void checkInterfaceHotspots(bool &forceReturnFl);
bool isMouseOverHotspot(Common::Point mousePos, Common::Point hotspotPos);
- void sub131B2(Common::Point pos, bool &forceReturnFl);
+ void checkClickOnCharacter(Common::Point pos, bool &forceReturnFl);
void sub131FC(Common::Point pos);
void displaySpeechBubbleTail(Common::Point displayPos);
void displaySpeechBubbleTailLine(Common::Point pos, int var2);
@@ -348,7 +348,7 @@ public:
byte _byte16F07_menuId;
bool _byte12FCE;
- int8 _byte129A0;
+ int8 _selectedCharacterId;
byte _numCharactersToDisplay;
int16 _word10804;
bool _shouldQuit;
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index 72d1306c87..c842331843 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -217,7 +217,7 @@ byte LilliputScript::handleOpcodeType1(int curWord) {
return OC_checkLastInterfaceHotspotIndex();
break;
case 0x2C:
- return OC_checkSavedMousePos();
+ return OC_checkSelectedCharacter();
break;
case 0x2D:
return OC_sub179AE();
@@ -600,7 +600,7 @@ static const OpCode opCodes1[] = {
{ "OC_CurrentCharacterVar3Equals1", 0, kNone, kNone, kNone, kNone, kNone },
{ "OC_sub1796E", 2, kGetValue1, kImmediateValue, kNone, kNone, kNone },
{ "OC_checkLastInterfaceHotspotIndex", 2, kImmediateValue, kImmediateValue, kNone, kNone, kNone },
- { "OC_checkSavedMousePos", 0, kNone, kNone, kNone, kNone, kNone },
+ { "OC_checkSelectedCharacter", 0, kNone, kNone, kNone, kNone, kNone },
{ "OC_sub179AE", 0, kNone, kNone, kNone, kNone, kNone },
{ "OC_sub179C2", 1, kgetPosFromScript, kNone, kNone, kNone, kNone },
{ "OC_checkFunctionKeyPressed", 1, kImmediateValue, kNone, kNone, kNone, kNone },
@@ -726,7 +726,7 @@ Common::String LilliputScript::getArgumentString(KValueType type, ScriptStream&
} else if (val > 1004) {
str = Common::String::format("getValue1(0x%x)", val);
} else if (val == 1000) {
- str = Common::String("_byte129A0");
+ str = Common::String("_selectedCharacterId");
} else if (val == 1001) {
str = Common::String("characterIndex");
} else if (val == 1002) {
@@ -1284,7 +1284,7 @@ int16 LilliputScript::getValue1() {
switch (curWord) {
case 1000:
- return _vm->_byte129A0;
+ return _vm->_selectedCharacterId;
case 1001:
return _vm->_currentScriptCharacter;
case 1002:
@@ -2026,10 +2026,10 @@ byte LilliputScript::OC_checkLastInterfaceHotspotIndex() {
return 0;
}
-byte LilliputScript::OC_checkSavedMousePos() {
- debugC(1, kDebugScript, "OC_checkSavedMousePos()");
+byte LilliputScript::OC_checkSelectedCharacter() {
+ debugC(1, kDebugScript, "OC_checkSelectedCharacter()");
- if ((_vm->_byte129A0 != -1) || (_vm->_savedMousePosDivided == Common::Point(-1, -1)))
+ if ((_vm->_selectedCharacterId != -1) || (_vm->_savedMousePosDivided == Common::Point(-1, -1)))
return 0;
return 1;
@@ -2038,7 +2038,7 @@ byte LilliputScript::OC_checkSavedMousePos() {
byte LilliputScript::OC_sub179AE() {
debugC(1, kDebugScript, "OC_sub179AE()");
- if (_vm->_byte12FCE || (_vm->_byte129A0 == -1))
+ if (_vm->_byte12FCE || (_vm->_selectedCharacterId == -1))
return 0;
return 1;
diff --git a/engines/lilliput/script.h b/engines/lilliput/script.h
index 96bd837d87..b796e8533c 100644
--- a/engines/lilliput/script.h
+++ b/engines/lilliput/script.h
@@ -186,7 +186,7 @@ private:
byte OC_CurrentCharacterVar3Equals1();
byte OC_checkCharacterDirection();
byte OC_checkLastInterfaceHotspotIndex();
- byte OC_checkSavedMousePos();
+ byte OC_checkSelectedCharacter();
byte OC_sub179AE();
byte OC_sub179C2();
byte OC_checkFunctionKeyPressed();