aboutsummaryrefslogtreecommitdiff
path: root/engines/lilliput
diff options
context:
space:
mode:
authorStrangerke2012-05-01 00:18:26 +0200
committerEugene Sandulenko2018-03-28 17:36:57 +0200
commitca5b883ce7023dfead7ee7782c8246f6ae3a2983 (patch)
tree76cb0a7962ce9b173995e6a2fdc317eea9d83dbd /engines/lilliput
parentcf4d8322143970cc264d48cd8663e066fb33680b (diff)
downloadscummvm-rg350-ca5b883ce7023dfead7ee7782c8246f6ae3a2983.tar.gz
scummvm-rg350-ca5b883ce7023dfead7ee7782c8246f6ae3a2983.tar.bz2
scummvm-rg350-ca5b883ce7023dfead7ee7782c8246f6ae3a2983.zip
LILLIPUT: Add one core function, some renaming
Diffstat (limited to 'engines/lilliput')
-rw-r--r--engines/lilliput/lilliput.cpp28
-rw-r--r--engines/lilliput/lilliput.h2
-rw-r--r--engines/lilliput/script.cpp9
-rw-r--r--engines/lilliput/script.h2
4 files changed, 31 insertions, 10 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index aee940e2fb..39be2af0b6 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -366,7 +366,6 @@ void LilliputEngine::displayFunction1a(byte *buf, int var2, int var4) {
void LilliputEngine::displayFunction2(byte *buf, int var2, int var4) {
debugC(2, kDebugEngine, "displayFunction2(buf, %d, %d)", var2, var4);
-
int tmpVal = ((var4 & 0xFF) << 8) + (var4 >> 8);
int index2 = var2 + tmpVal + (tmpVal >> 2);
@@ -1246,9 +1245,6 @@ void LilliputEngine::renderCharacters(byte *buf, byte x, byte y) {
int displayX = _characterDisplayX[index];
int displayY = _characterDisplayY[index];
- if ((displayX == 104) && (displayY == 132))
- warning("");
-
if (index == _scriptHandler->_word1881B)
sub1546F(displayX, displayY);
@@ -1454,7 +1450,7 @@ void LilliputEngine::sub16626() {
result = 0;
break;
case 10:
- warning("result = sub_1675D");
+ result = sub1675D(index, var1);
break;
case 11:
warning("result = sub_16729");
@@ -1493,6 +1489,28 @@ int LilliputEngine::sub166DD(int index, int var1) {
return 0;
}
+int LilliputEngine::sub1675D(int index, int var1) {
+ debugC(2, kDebugEngine, "sub1675D(%d, %d)", index, var1);
+
+ int var2 = _scriptHandler->_array10A39[index];
+ int var1h = _scriptHandler->_array16123[var2];
+ int var1l = _scriptHandler->_array1614B[var2];
+ int var3 = _array109E9[index];
+
+ if ((var3 != 0xFF) && (var3 == _array10999[index])) {
+ var3 = _array10A11[index];
+ if (var3 == _array109C1[index]) {
+ _array109E9[index] = var1h;
+ _array10A11[index] = var1l;
+ }
+ }
+
+ _array10999[index] = var1h;
+ _array109C1[index] = var1l;
+
+ return sub16799(index, var1);
+}
+
void LilliputEngine::sub16EBC() {
debugC(2, kDebugEngine, "sub16EBC()");
diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h
index e26526e051..8820cb9fc1 100644
--- a/engines/lilliput/lilliput.h
+++ b/engines/lilliput/lilliput.h
@@ -291,6 +291,8 @@ public:
void sub166D8(int index);
void sub16B31(int index, int val);
void sub16B8F(int index, int x, int y, int flag);
+ int sub1675D(int index, int var1);
+
void initGame(const LilliputGameDescription *gd);
byte *loadVGA(Common::String filename, bool loadPal);
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index 5a87b6d3d1..2eb1185a1f 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -362,7 +362,7 @@ void LilliputScript::handleOpcodeType2(int curWord) {
OC_sub17E6D();
break;
case 0x28:
- OC_sub17E7E();
+ OC_changeCurrentCharacterSprite();
break;
case 0x29:
OC_sub17E99();
@@ -2408,8 +2408,8 @@ void LilliputScript::OC_sub17E6D() {
_vm->_rulesBuffer2_12[_vm->_rulesBuffer2PrevIndx] = (var1 - 2000) & 0xFF;
}
-void LilliputScript::OC_sub17E7E() {
- debugC(2, kDebugScript, "OC_sub17E7E()");
+void LilliputScript::OC_changeCurrentCharacterSprite() {
+ debugC(2, kDebugScript, "OC_changeCurrentCharacterSprite()");
int var1 = _currScript->readUint16LE();
int var2 = _currScript->readUint16LE();
@@ -2464,8 +2464,8 @@ void LilliputScript::OC_sub17EF4() {
int posTile = sub17285(_vm->_rulesBuffer2PrevIndx);
int dir = _vm->sub16B0C(posTile, var1);
_vm->_characterDirectionArray[_vm->_rulesBuffer2PrevIndx] = dir;
-
}
+
void LilliputScript::OC_sub17F08() {
debugC(1, kDebugScript, "OC_sub17F08()");
@@ -2887,6 +2887,7 @@ void LilliputScript::OC_sub183A2() {
void LilliputScript::OC_sub183C6() {
warning("OC_sub183C6");
}
+
void LilliputScript::OC_loadFile_AERIAL_GFX() {
debugC(1, kDebugScript, "OC_loadFile_AERIAL_GFX()");
diff --git a/engines/lilliput/script.h b/engines/lilliput/script.h
index b6ddafaec2..20ab849ec0 100644
--- a/engines/lilliput/script.h
+++ b/engines/lilliput/script.h
@@ -218,7 +218,7 @@ private:
void OC_sub17D1B();
void OC_sub17D23();
void OC_sub17E6D();
- void OC_sub17E7E();
+ void OC_changeCurrentCharacterSprite();
void OC_sub17E99();
void OC_sub17EC5();
void OC_sub17EF4();