[Scummvm-git-logs] scummvm master -> 83412c91af9d66084923150df2bb1ded3a67824a
Strangerke
Strangerke at scummvm.org
Sat Mar 31 01:57:49 CEST 2018
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
467cfbc42a LILLIPUT: More renaming work
3720c04cb6 LILLIPUT: Refactor a bit sequenceMoveCharacter to use 3 parameters instead of 2
566f6a6443 LILLIPUT: some more renaming in the sequencer
83412c91af LILLIPUT: Change the type of _characterTilePos
Commit: 467cfbc42a16fdac59a8a21d0d6ae9c411bbaa3b
https://github.com/scummvm/scummvm/commit/467cfbc42a16fdac59a8a21d0d6ae9c411bbaa3b
Author: Strangerke (strangerke at scummvm.org)
Date: 2018-03-31T01:55:40+02:00
Commit Message:
LILLIPUT: More renaming work
Changed paths:
engines/lilliput/lilliput.cpp
engines/lilliput/lilliput.h
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 24cda34..3264fca 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -714,7 +714,7 @@ void LilliputEngine::displayRefreshScreen() {
return;
restoreMapPoints();
- sub16626();
+ updateCharPosSequence();
sub12F37();
sub16CA0();
sub16EBC();
@@ -725,7 +725,7 @@ void LilliputEngine::displayRefreshScreen() {
checkSpeechClosing();
prepareGameArea();
displayGameArea();
- sub16626();
+ updateCharPosSequence();
sub12F37();
sub16CA0();
sub16EBC();
@@ -1605,8 +1605,8 @@ void LilliputEngine::numberToString(int param1) {
}
}
-void LilliputEngine::sub16626() {
- debugC(2, kDebugEngine, "sub16626()");
+void LilliputEngine::updateCharPosSequence() {
+ debugC(2, kDebugEngine, "updateCharPosSequence()");
int index = _numCharacters - 1;
byte result;
@@ -1623,10 +1623,11 @@ void LilliputEngine::sub16626() {
int16 var2 = var1.x / 16;
switch (var2) {
- case 0:
- result = sub16675_moveCharacter(index, var1);
+ case 0: // Move
+ sequenceMoveCharacter(index, var1);
+ result = 0;
break;
- case 1:
+ case 1: // Face
result = sub166DD(index, var1);
break;
case 2:
@@ -1639,26 +1640,26 @@ void LilliputEngine::sub16626() {
case 9:
result = 0;
break;
- case 10:
+ case 10: // Seek
result = sub1675D(index, var1);
break;
- case 11:
+ case 11: // Sound
result = sub16729(index, var1);
break;
- case 12:
+ case 12: // Home
result = sub16799(index, var1);
break;
- case 13:
+ case 13: // Character
result = sub16722(index, var1);
break;
- case 14:
+ case 14: // ??
result = sub166F7(index, var1, index2);
break;
- case 15:
+ case 15: // End
result = sub166EA(index);
break;
default:
- error("sub16626 - unexpected value %d", var2);
+ error("updateCharPosSequence - unexpected value %d", var2);
break;
}
@@ -1704,7 +1705,7 @@ byte LilliputEngine::sub166DD(int index, Common::Point var1) {
char var1h = var1.x & 3;
_characterDirectionArray[index] = var1h;
- sub16685(index, Common::Point(var1h, var1.y));
+ setCharacterPose(index, Common::Point(var1h, var1.y));
return 0;
}
@@ -2010,21 +2011,22 @@ void LilliputEngine::handleInterfaceHotspot(byte index, byte button) {
displayInterfaceHotspots();
}
-void LilliputEngine::sub16685(int idx, Common::Point var1) {
- debugC(2, kDebugEngine, "sub16685(%d, %d - %d)", idx, var1.x, var1.y);
+void LilliputEngine::setCharacterPose(int charIdx, Common::Point var1) {
+ debugC(2, kDebugEngine, "setCharacterPose(%d, poseIdx %d)", charIdx, var1.y);
- int index = (idx * 32) + var1.y;
- _scriptHandler->_characterPose[idx] = _poseArray[index];
+ int index = (charIdx * 32) + var1.y;
+ _scriptHandler->_characterPose[charIdx] = _poseArray[index];
}
-byte LilliputEngine::sub16675_moveCharacter(int idx, Common::Point var1) {
- debugC(2, kDebugEngine, "sub16675_moveCharacter(%d, %d - %d)", idx, var1.x, var1.y);
+void LilliputEngine::sequenceMoveCharacter(int idx, Common::Point var1) {
+ debugC(2, kDebugEngine, "sequenceMoveCharacter(%d, %d - %d)", idx, var1.x, var1.y);
- sub16685(idx, var1);
+ setCharacterPose(idx, var1);
int index = idx;
switch (var1.x) {
case 0:
+ // No movement
break;
case 1:
moveCharacterSpeed2(index);
@@ -2057,10 +2059,9 @@ byte LilliputEngine::sub16675_moveCharacter(int idx, Common::Point var1) {
moveCharacterSpeed3(index);
break;
default:
- warning("sub16675_moveCharacter - Unexpected value %d", var1.x);
+ // CHECKME: It's so bad it could be an error()
+ warning("sequenceMoveCharacter - Unexpected value %d", var1.x);
}
-
- return 0;
}
void LilliputEngine::turnCharacter1(int index) {
diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h
index 573fd79..79f5608 100644
--- a/engines/lilliput/lilliput.h
+++ b/engines/lilliput/lilliput.h
@@ -265,7 +265,7 @@ public:
void scrollToViewportCharacterTarget();
void viewportScrollTo(Common::Point goalPos);
void checkSpeechClosing();
- void sub16626();
+ void updateCharPosSequence();
void sub16A08(int index);
byte sub16A76(int indexb, int indexs);
void sub17224(byte type, byte index, int var4);
@@ -285,8 +285,8 @@ public:
void addCharToBuf(byte character);
void numberToString(int param1);
void sub12F37();
- byte sub16675_moveCharacter(int idx, Common::Point var1);
- void sub16685(int idx, Common::Point var1);
+ void sequenceMoveCharacter(int idx, Common::Point var1);
+ void setCharacterPose(int idx, Common::Point var1);
void sub16EBC();
void sub16CA0();
byte sub166DD(int index, Common::Point var1);
Commit: 3720c04cb642f42f5bda9df7e9e4679f38526249
https://github.com/scummvm/scummvm/commit/3720c04cb642f42f5bda9df7e9e4679f38526249
Author: Strangerke (strangerke at scummvm.org)
Date: 2018-03-31T01:55:40+02:00
Commit Message:
LILLIPUT: Refactor a bit sequenceMoveCharacter to use 3 parameters instead of 2
Changed paths:
engines/lilliput/lilliput.cpp
engines/lilliput/lilliput.h
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 3264fca..a3a26ed 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -1620,11 +1620,12 @@ void LilliputEngine::updateCharPosSequence() {
Common::Point var1 = _scriptHandler->_sequenceArr[index2];
// /8, then /2 as the function array is a word array
- int16 var2 = var1.x / 16;
+ int16 posSeqType = var1.x / 16;
- switch (var2) {
+ switch (posSeqType) {
case 0: // Move
- sequenceMoveCharacter(index, var1);
+ // x stands for moveType, y for poseType
+ sequenceMoveCharacter(index, var1.x, var1.y);
result = 0;
break;
case 1: // Face
@@ -1659,7 +1660,7 @@ void LilliputEngine::updateCharPosSequence() {
result = sub166EA(index);
break;
default:
- error("updateCharPosSequence - unexpected value %d", var2);
+ error("updateCharPosSequence - unexpected value %d", posSeqType);
break;
}
@@ -1705,7 +1706,7 @@ byte LilliputEngine::sub166DD(int index, Common::Point var1) {
char var1h = var1.x & 3;
_characterDirectionArray[index] = var1h;
- setCharacterPose(index, Common::Point(var1h, var1.y));
+ setCharacterPose(index, var1.y);
return 0;
}
@@ -2011,20 +2012,21 @@ void LilliputEngine::handleInterfaceHotspot(byte index, byte button) {
displayInterfaceHotspots();
}
-void LilliputEngine::setCharacterPose(int charIdx, Common::Point var1) {
- debugC(2, kDebugEngine, "setCharacterPose(%d, poseIdx %d)", charIdx, var1.y);
+void LilliputEngine::setCharacterPose(int charIdx, int poseIdx) {
+ debugC(2, kDebugEngine, "setCharacterPose(%d, %d)", charIdx, poseIdx);
- int index = (charIdx * 32) + var1.y;
+ // CHECKME: Add an assert on poseIdx to check if it's between 0 and 31?
+ int index = (charIdx * 32) + poseIdx;
_scriptHandler->_characterPose[charIdx] = _poseArray[index];
}
-void LilliputEngine::sequenceMoveCharacter(int idx, Common::Point var1) {
- debugC(2, kDebugEngine, "sequenceMoveCharacter(%d, %d - %d)", idx, var1.x, var1.y);
+void LilliputEngine::sequenceMoveCharacter(int idx, int moveType, int poseType) {
+ debugC(2, kDebugEngine, "sequenceMoveCharacter(%d, %d - %d)", idx, moveType, poseType);
- setCharacterPose(idx, var1);
+ setCharacterPose(idx, poseType);
int index = idx;
- switch (var1.x) {
+ switch (moveType) {
case 0:
// No movement
break;
@@ -2060,7 +2062,7 @@ void LilliputEngine::sequenceMoveCharacter(int idx, Common::Point var1) {
break;
default:
// CHECKME: It's so bad it could be an error()
- warning("sequenceMoveCharacter - Unexpected value %d", var1.x);
+ warning("sequenceMoveCharacter - Unexpected value %d", moveType);
}
}
diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h
index 79f5608..02234fa 100644
--- a/engines/lilliput/lilliput.h
+++ b/engines/lilliput/lilliput.h
@@ -285,8 +285,8 @@ public:
void addCharToBuf(byte character);
void numberToString(int param1);
void sub12F37();
- void sequenceMoveCharacter(int idx, Common::Point var1);
- void setCharacterPose(int idx, Common::Point var1);
+ void sequenceMoveCharacter(int idx, int moveType, int poseType);
+ void setCharacterPose(int idx, int poseIdx);
void sub16EBC();
void sub16CA0();
byte sub166DD(int index, Common::Point var1);
Commit: 566f6a644364665718bd6c9b6197cbece7b0171b
https://github.com/scummvm/scummvm/commit/566f6a644364665718bd6c9b6197cbece7b0171b
Author: Strangerke (strangerke at scummvm.org)
Date: 2018-03-31T01:55:40+02:00
Commit Message:
LILLIPUT: some more renaming in the sequencer
Changed paths:
engines/lilliput/lilliput.cpp
engines/lilliput/lilliput.h
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index a3a26ed..aff6104 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -1328,8 +1328,8 @@ byte LilliputEngine::getDirection(Common::Point param1, Common::Point param2) {
return _directionsArray[var2l];
}
-byte LilliputEngine::sub16799(int index, Common::Point param1) {
- debugC(2, kDebugEngine, "sub16799(%d, %d - %d)", index, param1.x, param1.y);
+byte LilliputEngine::sequenceCharacterHomeIn(int index, Common::Point param1) {
+ debugC(2, kDebugEngine, "sequenceCharacterHomeIn(%d, %d - %d)", index, param1.x, param1.y);
Common::Point var3 = Common::Point(_characterSubTargetPosX[index], _characterSubTargetPosY[index]);
@@ -1625,11 +1625,11 @@ void LilliputEngine::updateCharPosSequence() {
switch (posSeqType) {
case 0: // Move
// x stands for moveType, y for poseType
- sequenceMoveCharacter(index, var1.x, var1.y);
- result = 0;
+ result = sequenceMoveCharacter(index, var1.x, var1.y);
break;
- case 1: // Face
- result = sub166DD(index, var1);
+ case 1: // Face direction
+ // x stands for the next direction, y for the poseType
+ result = sequenceSetCharacterDirection(index, var1.x, var1.y);
break;
case 2:
case 3:
@@ -1641,14 +1641,14 @@ void LilliputEngine::updateCharPosSequence() {
case 9:
result = 0;
break;
- case 10: // Seek
- result = sub1675D(index, var1);
+ case 10: // Seek move target
+ result = sequenceSeekMovingCharacter(index, var1);
break;
case 11: // Sound
- result = sub16729(index, var1);
+ result = sequenceSound(index, var1);
break;
- case 12: // Home
- result = sub16799(index, var1);
+ case 12: // Home in target
+ result = sequenceCharacterHomeIn(index, var1);
break;
case 13: // Character
result = sub16722(index, var1);
@@ -1701,12 +1701,12 @@ byte LilliputEngine::sub166F7(int index, Common::Point var1, int tmpVal) {
return 3;
}
-byte LilliputEngine::sub166DD(int index, Common::Point var1) {
- debugC(2, kDebugEngine, "sub166DD(%d, %d - %d)", index, var1.x, var1.y);
+byte LilliputEngine::sequenceSetCharacterDirection(int index, int direction, int poseType) {
+ debugC(2, kDebugEngine, "sequenceSetCharacterDirection(%d, %d - %d)", index, direction, poseType);
- char var1h = var1.x & 3;
- _characterDirectionArray[index] = var1h;
- setCharacterPose(index, var1.y);
+ char newDir = direction & 3;
+ _characterDirectionArray[index] = newDir;
+ setCharacterPose(index, poseType);
return 0;
}
@@ -1717,17 +1717,19 @@ byte LilliputEngine::sub16722(int index, Common::Point var1) {
return 2;
}
-byte LilliputEngine::sub16729(int index, Common::Point var1) {
- debugC(2, kDebugEngine, "sub16729(%d, %d - %d)", index, var1.x, var1.y);
+byte LilliputEngine::sequenceSound(int index, Common::Point var1) {
+ debugC(2, kDebugEngine, "sequenceSound(%d, %d - %d)", index, var1.x, var1.y);
int param4x = ((index | 0xFF00) >> 8);
int param1 = var1.y;
- _soundHandler->contentFct2(param1, _scriptHandler->_viewportPos, Common::Point(_scriptHandler->_characterTilePosX[index], _scriptHandler->_characterTilePosY[index]), Common::Point(param4x, 0));
+ _soundHandler->contentFct2(param1, _scriptHandler->_viewportPos,
+ Common::Point(_scriptHandler->_characterTilePosX[index], _scriptHandler->_characterTilePosY[index]),
+ Common::Point(param4x, 0));
return 2;
}
-byte LilliputEngine::sub1675D(int index, Common::Point var1) {
- debugC(2, kDebugEngine, "sub1675D(%d, %d - %d)", index, var1.x, var1.y);
+byte LilliputEngine::sequenceSeekMovingCharacter(int index, Common::Point var1) {
+ debugC(2, kDebugEngine, "sequenceSeekMovingCharacter(%d, %d - %d)", index, var1.x, var1.y);
int charIndex = _scriptHandler->_characterSeek[index];
Common::Point charPos = Common::Point(_scriptHandler->_characterTilePosX[charIndex], _scriptHandler->_characterTilePosY[charIndex]);
@@ -1740,7 +1742,7 @@ byte LilliputEngine::sub1675D(int index, Common::Point var1) {
_characterTargetPosX[index] = charPos.x;
_characterTargetPosY[index] = charPos.y;
- return sub16799(index, var1);
+ return sequenceCharacterHomeIn(index, var1);
}
void LilliputEngine::sub16EBC() {
@@ -2020,7 +2022,7 @@ void LilliputEngine::setCharacterPose(int charIdx, int poseIdx) {
_scriptHandler->_characterPose[charIdx] = _poseArray[index];
}
-void LilliputEngine::sequenceMoveCharacter(int idx, int moveType, int poseType) {
+byte LilliputEngine::sequenceMoveCharacter(int idx, int moveType, int poseType) {
debugC(2, kDebugEngine, "sequenceMoveCharacter(%d, %d - %d)", idx, moveType, poseType);
setCharacterPose(idx, poseType);
@@ -2064,6 +2066,8 @@ void LilliputEngine::sequenceMoveCharacter(int idx, int moveType, int poseType)
// CHECKME: It's so bad it could be an error()
warning("sequenceMoveCharacter - Unexpected value %d", moveType);
}
+
+ return 0;
}
void LilliputEngine::turnCharacter1(int index) {
diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h
index 02234fa..b7b2cc5 100644
--- a/engines/lilliput/lilliput.h
+++ b/engines/lilliput/lilliput.h
@@ -280,16 +280,16 @@ public:
void checkNumericCode();
void keyboard_handleInterfaceShortcuts(bool &forceReturnFl);
- byte sub16799(int index, Common::Point param1);
+ byte sequenceCharacterHomeIn(int index, Common::Point param1);
byte getDirection(Common::Point param1, Common::Point param2);
void addCharToBuf(byte character);
void numberToString(int param1);
void sub12F37();
- void sequenceMoveCharacter(int idx, int moveType, int poseType);
+ byte sequenceMoveCharacter(int idx, int moveType, int poseType);
void setCharacterPose(int idx, int poseIdx);
void sub16EBC();
void sub16CA0();
- byte sub166DD(int index, Common::Point var1);
+ byte sequenceSetCharacterDirection(int index, int direction, int poseType);
void sub171CF();
void checkInterfaceActivationDelay();
int16 sub16DD5(int x1, int y1, int x2, int y2);
@@ -318,8 +318,8 @@ public:
void moveCharacterSpeed3(int index);
void sub16B31_moveCharacter(int index, int16 speed);
void sub16B8F_moveCharacter(int index, Common::Point pos, int direction);
- byte sub1675D(int index, Common::Point var1);
- byte sub16729(int index, Common::Point var1);
+ byte sequenceSeekMovingCharacter(int index, Common::Point var1);
+ byte sequenceSound(int index, Common::Point var1);
byte sub166F7(int index, Common::Point var1, int tmpVal);
void sub1693A_chooseDirections(int index);
Commit: 83412c91af9d66084923150df2bb1ded3a67824a
https://github.com/scummvm/scummvm/commit/83412c91af9d66084923150df2bb1ded3a67824a
Author: Strangerke (strangerke at scummvm.org)
Date: 2018-03-31T01:55:40+02:00
Commit Message:
LILLIPUT: Change the type of _characterTilePos
Changed paths:
engines/lilliput/lilliput.cpp
engines/lilliput/script.cpp
engines/lilliput/script.h
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index aff6104..70b729c 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -586,9 +586,9 @@ void LilliputEngine::displayCharactersOnMap() {
byte *buf = (byte *)_mainSurface->getPixels();
for (int index = _numCharacters - 1; index >= 0; index--) {
- if (((_characterTypes[index] & 2) == 0) && (_scriptHandler->_characterTilePosY[index] != -1)) {
+ if (((_characterTypes[index] & 2) == 0) && (_scriptHandler->_characterTilePos[index].y != -1)) {
// FIXME: This is still wrong, but less. The values in both arrays should be verified now!
- int pixIndex = 320 + ((15 * _scriptHandler->_characterTilePosY[index]) / 4) + (_scriptHandler->_characterTilePosX[index] * 4) + 1;
+ int pixIndex = 320 + ((15 * _scriptHandler->_characterTilePos[index].y) / 4) + (_scriptHandler->_characterTilePos[index].x * 4) + 1;
_mapSavedPixelIndex[index] = pixIndex;
_mapSavedPixel[index] = buf[pixIndex];
@@ -632,8 +632,7 @@ void LilliputEngine::moveCharacters() {
_characterPositionY[i] = var4;
}
- _scriptHandler->_characterTilePosX[i] = (_characterPositionX[i] >> 3);
- _scriptHandler->_characterTilePosY[i] = (_characterPositionY[i] >> 3);
+ _scriptHandler->_characterTilePos[i] = Common::Point(_characterPositionX[i] >> 3, _characterPositionY[i] >> 3);
_characterRelativePositionX[i] = -1;
_characterRelativePositionY[i] = -1;
_characterDisplayX[i] = -1;
@@ -937,8 +936,8 @@ void LilliputEngine::sub16CA0() {
if (_characterTypes[index] & 1)
continue;
- int c1 = _scriptHandler->_characterTilePosX[index];
- int c2 = _scriptHandler->_characterTilePosY[index];
+ int c1 = _scriptHandler->_characterTilePos[index].x;
+ int c2 = _scriptHandler->_characterTilePos[index].y;
// Hack: Skip if disabled (c2 negative)
if (c2 == -1)
@@ -950,8 +949,8 @@ void LilliputEngine::sub16CA0() {
(_characterCarried[index] != index2) &&
(_characterCarried[index2] != index) &&
(_characterTypes[index2] & 2) == 0) {
- int d1 = _scriptHandler->_characterTilePosX[index2];
- int d2 = _scriptHandler->_characterTilePosY[index2];
+ int d1 = _scriptHandler->_characterTilePos[index2].x;
+ int d2 = _scriptHandler->_characterTilePos[index2].y;
if (d1 != -1) {
int x = c1 - d1;
@@ -1334,7 +1333,7 @@ byte LilliputEngine::sequenceCharacterHomeIn(int index, Common::Point param1) {
Common::Point var3 = Common::Point(_characterSubTargetPosX[index], _characterSubTargetPosY[index]);
if (var3.x != -1) {
- if ((var3.x != _scriptHandler->_characterTilePosX[index]) || (var3.y != _scriptHandler->_characterTilePosY[index])) {
+ if (var3 != _scriptHandler->_characterTilePos[index]) {
sub1693A_chooseDirections(index);
_scriptHandler->_characterNextSequence[index] -= (param1.x & 0x0F);
return 3;
@@ -1346,7 +1345,7 @@ byte LilliputEngine::sequenceCharacterHomeIn(int index, Common::Point param1) {
sub167EF(index);
- Common::Point pos1 = Common::Point(_scriptHandler->_characterTilePosX[index], _scriptHandler->_characterTilePosY[index]);
+ Common::Point pos1 = _scriptHandler->_characterTilePos[index];
Common::Point pos2 = Common::Point(_characterSubTargetPosX[index], _characterSubTargetPosY[index]);
_characterDirectionArray[index] = getDirection(pos1, pos2);
@@ -1360,7 +1359,7 @@ byte LilliputEngine::sequenceCharacterHomeIn(int index, Common::Point param1) {
void LilliputEngine::sub167EF(int index) {
debugC(2, kDebugEngine, "sub167EF(%d)", index);
- int16 word167EB = findHotspot(Common::Point(_scriptHandler->_characterTilePosX[index], _scriptHandler->_characterTilePosY[index]));
+ int16 word167EB = findHotspot(_scriptHandler->_characterTilePos[index]);
int16 word167ED = findHotspot(Common::Point(_characterTargetPosX[index], _characterTargetPosY[index]));
if (word167EB == word167ED) {
@@ -1445,7 +1444,7 @@ void LilliputEngine::sub1693A_chooseDirections(int index) {
static const int16 mapArrayMove[4] = {4, -256, 256, -4};
- _word16937Pos = Common::Point(_scriptHandler->_characterTilePosX[index], _scriptHandler->_characterTilePosY[index]);
+ _word16937Pos = _scriptHandler->_characterTilePos[index];
sub16A08(index);
@@ -1723,8 +1722,7 @@ byte LilliputEngine::sequenceSound(int index, Common::Point var1) {
int param4x = ((index | 0xFF00) >> 8);
int param1 = var1.y;
_soundHandler->contentFct2(param1, _scriptHandler->_viewportPos,
- Common::Point(_scriptHandler->_characterTilePosX[index], _scriptHandler->_characterTilePosY[index]),
- Common::Point(param4x, 0));
+ _scriptHandler->_characterTilePos[index], Common::Point(param4x, 0));
return 2;
}
@@ -1732,9 +1730,11 @@ byte LilliputEngine::sequenceSeekMovingCharacter(int index, Common::Point var1)
debugC(2, kDebugEngine, "sequenceSeekMovingCharacter(%d, %d - %d)", index, var1.x, var1.y);
int charIndex = _scriptHandler->_characterSeek[index];
- Common::Point charPos = Common::Point(_scriptHandler->_characterTilePosX[charIndex], _scriptHandler->_characterTilePosY[charIndex]);
+ Common::Point charPos = _scriptHandler->_characterTilePos[charIndex];
- if ((_characterSubTargetPosX[index] != -1) && (_characterSubTargetPosX[index] == _characterTargetPosX[index]) && (_characterSubTargetPosY[index] == _characterTargetPosY[index])) {
+ if ((_characterSubTargetPosX[index] != -1)
+ && (_characterSubTargetPosX[index] == _characterTargetPosX[index])
+ && (_characterSubTargetPosY[index] == _characterTargetPosY[index])) {
_characterSubTargetPosX[index] = charPos.x;
_characterSubTargetPosY[index] = charPos.y;
}
@@ -1750,11 +1750,11 @@ void LilliputEngine::sub16EBC() {
for (int index1 = _numCharacters - 1; index1 >= 0; index1--) {
// Hack: The original doesn't check if it's disabled, which looks wrong
- if ((_scriptHandler->_characterTilePosX[index1] == -1) || (_scriptHandler->_characterTilePosY[index1] == -1))
+ if ((_scriptHandler->_characterTilePos[index1].x == -1) || (_scriptHandler->_characterTilePos[index1].y == -1))
continue;
//
- int mapIndex = 3 + (_scriptHandler->_characterTilePosY[index1] * 64 + _scriptHandler->_characterTilePosX[index1]) * 4;
+ int mapIndex = 3 + (_scriptHandler->_characterTilePos[index1].y * 64 + _scriptHandler->_characterTilePos[index1].x) * 4;
assert((mapIndex >= 0) && (mapIndex < 16384));
byte var1 = _bufferIsoMap[mapIndex] & 0x40;
@@ -2158,7 +2158,7 @@ void LilliputEngine::sub16B8F_moveCharacter(int index, Common::Point pos, int di
debugC(2, kDebugEngine, "sub16B8F_moveCharacter(%d, %d - %d, %d)", index, pos.x, pos.y, direction);
int16 diffX = pos.x >> 3;
- if (((diffX & 0xFF) == _scriptHandler->_characterTilePosX[index]) && ((pos.y >> 3) == _scriptHandler->_characterTilePosY[index])) {
+ if (((diffX & 0xFF) == _scriptHandler->_characterTilePos[index].x) && ((pos.y >> 3) == _scriptHandler->_characterTilePos[index].y)) {
_characterPositionX[index] = pos.x;
_characterPositionY[index] = pos.y;
return;
@@ -2167,7 +2167,7 @@ void LilliputEngine::sub16B8F_moveCharacter(int index, Common::Point pos, int di
if ((pos.x < 0) || (pos.x >= 512) || (pos.y < 0) || (pos.y >= 512))
return;
- int mapIndex = (_scriptHandler->_characterTilePosY[index] * 64 + _scriptHandler->_characterTilePosX[index]) * 4;
+ int mapIndex = (_scriptHandler->_characterTilePos[index].y * 64 + _scriptHandler->_characterTilePos[index].x) * 4;
assert(mapIndex < 16384);
if ((_bufferIsoMap[mapIndex + 3] & _array16C58[direction]) == 0)
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index 37b97c1..7600028 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -66,8 +66,7 @@ LilliputScript::LilliputScript(LilliputEngine *vm) : _vm(vm), _currScript(NULL)
_characterPose[i] = 0;
_characterNextSequence[i] = 16;
_characterLastSequence[i] = -1;
- _characterTilePosX[i] = 0;
- _characterTilePosY[i] = 0;
+ _characterTilePos[i] = Common::Point(0, 0);
_array122C1[i] = 0;
}
@@ -1371,11 +1370,9 @@ byte LilliputScript::OC_comparePos() {
debugC(2, kDebugScript, "OC_comparePos()");
int index = getValue1();
- int8 d1 = _characterTilePosX[index];
- int8 d2 = _characterTilePosY[index];
Common::Point var1 = getPosFromScript();
- if (var1 == Common::Point(d1, d2))
+ if (var1 == _characterTilePos[index])
return 1;
return 0;
@@ -1541,7 +1538,7 @@ byte LilliputScript::OC_compareCoords_2() {
debugC(1, kDebugScript, "OC_compareCoords_2()");
int16 index = getValue1();
- Common::Point var1 = Common::Point(_characterTilePosX[index], _characterTilePosY[index]);
+ Common::Point var1 = _characterTilePos[index];
index = _currScript->readUint16LE();
MinMax xMinMax = _vm->_rectXMinMax[index];
MinMax yMinMax = _vm->_rectYMinMax[index];
@@ -3301,7 +3298,7 @@ void LilliputScript::OC_playObjectSound() {
Common::Point var4 = Common::Point(0xFF, index & 0xFF);
int soundId = (_currScript->readUint16LE() & 0xFF);
- _vm->_soundHandler->contentFct2(soundId, _viewportPos, Common::Point(_characterTilePosX[index], _characterTilePosY[index]), var4);
+ _vm->_soundHandler->contentFct2(soundId, _viewportPos, _characterTilePos[index], var4);
}
void LilliputScript::OC_startLocationSound() {
diff --git a/engines/lilliput/script.h b/engines/lilliput/script.h
index 9f22817..2199f51 100644
--- a/engines/lilliput/script.h
+++ b/engines/lilliput/script.h
@@ -71,8 +71,7 @@ public:
byte _characterScriptEnabled[40];
int8 _interfaceHotspotStatus[20];
- int8 _characterTilePosX[40];
- int8 _characterTilePosY[40];
+ Common::Point _characterTilePos[40];
int8 _characterNextSequence[40];
int8 _characterPose[40];
byte _interfaceButtonActivationDelay[20];
More information about the Scummvm-git-logs
mailing list