aboutsummaryrefslogtreecommitdiff
path: root/engines/lilliput
diff options
context:
space:
mode:
authorStrangerke2012-07-06 15:14:04 +0200
committerEugene Sandulenko2018-03-28 17:36:57 +0200
commitb387257138ccb19eee1ae0fd264567a8c40f1f5d (patch)
tree0c821d931cf555f26f7884b30bee0340a0345335 /engines/lilliput
parent7554c07be1883e54ab1946cbda881bef272e57f5 (diff)
downloadscummvm-rg350-b387257138ccb19eee1ae0fd264567a8c40f1f5d.tar.gz
scummvm-rg350-b387257138ccb19eee1ae0fd264567a8c40f1f5d.tar.bz2
scummvm-rg350-b387257138ccb19eee1ae0fd264567a8c40f1f5d.zip
LILLIPUT: Some renaming, fix regression in intro introduced in the two previous commits
Diffstat (limited to 'engines/lilliput')
-rw-r--r--engines/lilliput/lilliput.cpp27
-rw-r--r--engines/lilliput/lilliput.h4
2 files changed, 16 insertions, 15 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 4af671ce27..7c6cd8fe52 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -541,7 +541,7 @@ void LilliputEngine::displaySpeechLine(int vgaIndex, byte *srcBuf, int &bufIndex
++var3;
}
- var1 = (0x3D - var3) << 1;
+ var1 = (0x3D - var3) * 2;
vgaIndex += var1;
bufIndex = bckIndex;
@@ -1909,7 +1909,7 @@ void LilliputEngine::sub13156(bool &forceReturnFl) {
byte button = 1;
if (event.type == Common::EVENT_KEYUP)
button = 2;
- sub1305C(index, button);
+ handleInterfaceHotspot(index, button);
forceReturnFl = true;
}
}
@@ -1993,7 +1993,7 @@ void LilliputEngine::handleGameMouseClick() {
if (button == 2) {
if (_lastInterfaceHotspotIndex != -1)
- sub1305C(_lastInterfaceHotspotIndex, button);
+ handleInterfaceHotspot(_lastInterfaceHotspotIndex, button);
return;
}
@@ -2060,7 +2060,7 @@ void LilliputEngine::checkInterfaceHotspots(bool &forceReturnFl) {
forceReturnFl = false;
for (int index = _interfaceHotspotNumb - 1; index >= 0; index--) {
if (isMouseOverHotspot(_mousePos, Common::Point(_interfaceHotspotsX[index], _interfaceHotspotsY[index]))) {
- sub1305C(index, 1);
+ handleInterfaceHotspot(index, 1);
forceReturnFl = true;
return;
}
@@ -2076,8 +2076,8 @@ bool LilliputEngine::isMouseOverHotspot(Common::Point mousePos, Common::Point ho
return true;
}
-void LilliputEngine::sub1305C(byte index, byte button) {
- debugC(2, kDebugEngine, "sub1305C(%d, %d)", index, button);
+void LilliputEngine::handleInterfaceHotspot(byte index, byte button) {
+ debugC(2, kDebugEngine, "handleInterfaceHotspot(%d, %d)", index, button);
if (_scriptHandler->_interfaceHotspotStatus[index] < kHotspotEnabled)
return;
@@ -2101,7 +2101,7 @@ void LilliputEngine::sub1305C(byte index, byte button) {
unselectInterfaceHotspots();
_scriptHandler->_interfaceHotspotStatus[index] = kHotspotSelected;
- if (_rulesBuffer13_1[index] == 1) {
+ if (_interfaceTwoStepAction[index] == 1) {
_delayedReactivationAction = true;
_displayGreenHand = true;
} else {
@@ -2114,7 +2114,7 @@ void LilliputEngine::sub1305C(byte index, byte button) {
void LilliputEngine::sub16685(int idx, Common::Point var1) {
debugC(2, kDebugEngine, "sub16685(%d, %d - %d)", idx, var1.x, var1.y);
- int index = (idx << 5) + var1.y;
+ int index = (idx * 32) + var1.y;
_scriptHandler->_array10AB1[idx] = _rulesBuffer2_16[index];
}
@@ -2696,22 +2696,23 @@ void LilliputEngine::loadRules() {
assert((_rectNumb >= 0) && (_rectNumb <= 40));
for (int i = 0; i < _rectNumb; i++) {
- _rectXMinMax[i].min = (int16)f.readByte();
_rectXMinMax[i].max = (int16)f.readByte();
- _rectYMinMax[i].min = (int16)f.readByte();
+ _rectXMinMax[i].min = (int16)f.readByte();
_rectYMinMax[i].max = (int16)f.readByte();
- int16 tmpValX = (int16)f.readByte();
+ _rectYMinMax[i].min = (int16)f.readByte();
int16 tmpValY = (int16)f.readByte();
+ int16 tmpValX = (int16)f.readByte();
_rulesBuffer12Pos3[i] = Common::Point(tmpValX, tmpValY);
- tmpValX = (int16)f.readByte();
tmpValY = (int16)f.readByte();
+ tmpValX = (int16)f.readByte();
+ // _rulesBuffer12Pos4 is used by the into
_rulesBuffer12Pos4[i] = Common::Point(tmpValX, tmpValY);
}
// Chunk 13
_interfaceHotspotNumb = f.readUint16LE();
for (int i = 0 ; i < 20; i++)
- _rulesBuffer13_1[i] = f.readByte();
+ _interfaceTwoStepAction[i] = f.readByte();
for (int i = 0 ; i < 20; i++)
_interfaceHotspotsX[i] = f.readSint16LE();
diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h
index 5713ab2591..eca467980f 100644
--- a/engines/lilliput/lilliput.h
+++ b/engines/lilliput/lilliput.h
@@ -200,7 +200,7 @@ public:
Common::Point _rulesBuffer12Pos3[40];
Common::Point _rulesBuffer12Pos4[40];
int _interfaceHotspotNumb;
- byte _rulesBuffer13_1[20];
+ byte _interfaceTwoStepAction[20];
int16 _interfaceHotspotsX[20];
int16 _interfaceHotspotsY[20];
Common::KeyCode _keyboardMapping[20];
@@ -297,7 +297,7 @@ public:
void restoreMapPoints();
void displayHeroismIndicator();
void handleGameMouseClick();
- void sub1305C(byte index, byte var2);
+ void handleInterfaceHotspot(byte index, byte button);
void checkInterfaceHotspots(bool &forceReturnFl);
bool isMouseOverHotspot(Common::Point mousePos, Common::Point hotspotPos);
void checkClickOnCharacter(Common::Point pos, bool &forceReturnFl);