aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/lilliput/lilliput.cpp15
-rw-r--r--engines/lilliput/lilliput.h2
-rw-r--r--engines/lilliput/script.cpp20
-rw-r--r--engines/lilliput/script.h2
4 files changed, 19 insertions, 20 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 3d06b43099..7ed864aa34 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -669,7 +669,7 @@ void LilliputEngine::displayCharactersOnMap() {
restoreSurfaceUnderMousePointer();
byte *buf = (byte *)_mainSurface->getPixels();
- for (int index = _numCharacters - 1; index >=0; index--) {
+ for (int index = _numCharacters - 1; index >= 0; index--) {
if (((_rulesBuffer2_11[index] & 2) == 0) && (_scriptHandler->_array1614BPosY[index] != -1)) {
int y = (3 * _scriptHandler->_array1614BPosY[index]) + 1;
int x = (_scriptHandler->_array16123PosX[index] * 4) + 1;
@@ -1098,12 +1098,12 @@ void LilliputEngine::sub16CA0() {
}
}
-void LilliputEngine::displayFunction18(int var1, int var2, int var3, int var4) {
- debugC(2, kDebugEngineTBC, "displayFunction18(%d, %d, %d, %d)", var1, var2, var3, var4);
+void LilliputEngine::displayCharacterStatBar(int8 var1, int16 var2, int8 var3, int16 var4) {
+ debugC(2, kDebugEngineTBC, "displayCharacterStatBar(%d, %d, %d, %d)", var1, var2, var3, var4);
restoreSurfaceUnderMousePointer();
- if ((var1 & 0xFF) == 0x2D) {
+ if (var1 == 45) {
var2 += 35;
var3 -= 35;
@@ -1114,8 +1114,7 @@ void LilliputEngine::displayFunction18(int var1, int var2, int var3, int var4) {
}
byte *vgaBuf = (byte *)_mainSurface->getPixels();
- int tmpVal = (var3 >> 8) + ((var3 & 0xFF) << 8);
- int vgaIndex = var2 + tmpVal + (tmpVal >> 2);
+ int vgaIndex = var2 + (320 * var4);
if (var3 == 0)
++var3;
@@ -2248,7 +2247,7 @@ void LilliputEngine::sub12FE5() {
}
void LilliputEngine::displayHeroismIndicator() {
- debugC(2, kDebugEngineTBC, "displayHeroismIndicator()");
+ debugC(2, kDebugEngine, "displayHeroismIndicator()");
if (_scriptHandler->_savedBuffer215Ptr == NULL)
return;
@@ -2269,7 +2268,7 @@ void LilliputEngine::displayHeroismIndicator() {
_scriptHandler->_heroismLevel += var2;
- int index = _scriptHandler->_heroismBarX + _scriptHandler->_heroismBarBottomY * 320 ;
+ int index = _scriptHandler->_heroismBarX + (_scriptHandler->_heroismBarBottomY * 320);
var2 = _scriptHandler->_heroismLevel & 0xFF;
if (var2 != 0) {
diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h
index 32604d756a..3860d513c3 100644
--- a/engines/lilliput/lilliput.h
+++ b/engines/lilliput/lilliput.h
@@ -241,7 +241,7 @@ public:
void prepareGameArea();
void displayRefreshScreen();
void restoreSurfaceSpeech();
- void displayFunction18(int var1, int var2, int var3, int var4);
+ void displayCharacterStatBar(int8 var1, int16 var2, int8 var3, int16 var4);
void displayCharacter(int index, Common::Point pos, int flags);
void displayString(byte *buf, Common::Point pos);
void displayChar(int index, int var1);
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index f0970597e2..77063f826a 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -505,7 +505,7 @@ void LilliputScript::handleOpcodeType2(int curWord) {
OC_initGameAreaDisplay();
break;
case 0x57:
- OC_sub1864D();
+ OC_displayCharacterStatBar();
break;
case 0x58:
OC_initSmallAnim();
@@ -697,7 +697,7 @@ static const OpCode opCodes2[] = {
/* 0x54 */ { "OC_sub184D7", 1, kImmediateValue, kNone, kNone, kNone, kNone }, // TODO
/* 0x55 */ { "OC_displayTitleScreen", 1, kImmediateValue, kNone, kNone, kNone, kNone },
/* 0x56 */ { "OC_initGameAreaDisplay", 0, kNone, kNone, kNone, kNone, kNone },
-/* 0x57 */ { "OC_sub1864D", 6, kGetValue1, kImmediateValue, kImmediateValue, kImmediateValue, kImmediateValue},
+/* 0x57 */ { "OC_displayCharacterStatBar", 6, kGetValue1, kImmediateValue, kImmediateValue, kImmediateValue, kImmediateValue},
/* 0x58 */ { "OC_initSmallAnim", 11, kImmediateValue, kImmediateValue, kImmediateValue, kImmediateValue, kImmediateValue },
/* 0x59 */ { "OC_setCharacterHeroismBar", 4, kGetValue1, kImmediateValue, kImmediateValue, kImmediateValue, kNone },
/* 0x5a */ { "OC_sub18690", 2, kGetValue1, kgetPosFromScript, kNone, kNone, kNone }, //TODO
@@ -1943,7 +1943,7 @@ byte LilliputScript::OC_CharacterVariableAnd() {
}
byte LilliputScript::OC_IsCurrentCharacterVar0LessEqualThan() {
- debugC(1, kDebugScriptTBC, "OC_IsCurrentCharacterVar0LessEqualThan()");
+ debugC(1, kDebugScript, "OC_IsCurrentCharacterVar0LessEqualThan()");
assert(_vm->_currentCharacterVariables != NULL);
byte curByte = (_currScript->readUint16LE() & 0xFF);
@@ -3175,16 +3175,16 @@ void LilliputScript::OC_initGameAreaDisplay() {
_vm->_soundHandler->contentFct5();
}
-void LilliputScript::OC_sub1864D() {
- debugC(1, kDebugScriptTBC, "OC_sub1864D()");
+void LilliputScript::OC_displayCharacterStatBar() {
+ debugC(1, kDebugScriptTBC, "OC_displayCharacterStatBar()");
byte *tmpArr = getCharacterVariablePtr();
- int var1 = (_currScript->readUint16LE() & 0xFF);
- int var3 = ((70 * tmpArr[0]) / (_currScript->readUint16LE() & 0xFF) & 0xFF);
- int var2 = _currScript->readUint16LE();
- int var4 = _currScript->readUint16LE();
+ int8 var1 = (_currScript->readUint16LE() & 0xFF);
+ int8 var3 = (((70 * tmpArr[0]) / (_currScript->readUint16LE() & 0xFF)) & 0xFF);
+ int16 var2 = _currScript->readSint16LE();
+ int16 var4 = _currScript->readSint16LE();
- _vm->displayFunction18(var1, var2, var3, var4);
+ _vm->displayCharacterStatBar(var1, var2, var3, var4);
}
void LilliputScript::OC_initSmallAnim() {
diff --git a/engines/lilliput/script.h b/engines/lilliput/script.h
index b65751d6ca..d858fe57c7 100644
--- a/engines/lilliput/script.h
+++ b/engines/lilliput/script.h
@@ -282,7 +282,7 @@ private:
void OC_sub184D7();
void OC_displayTitleScreen();
void OC_initGameAreaDisplay();
- void OC_sub1864D();
+ void OC_displayCharacterStatBar();
void OC_initSmallAnim();
void OC_setCharacterHeroismBar();
void OC_sub18690();