aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2018-03-28 07:19:56 +0200
committerEugene Sandulenko2018-03-28 17:36:57 +0200
commit74ce6af22e6916179f426a180a69cc0031ac8e05 (patch)
treef679d329e8c97d9253a8ff154b4325ce3c29cbf3
parent96f35b1740138739189358f4cbbca4690ae55ab4 (diff)
downloadscummvm-rg350-74ce6af22e6916179f426a180a69cc0031ac8e05.tar.gz
scummvm-rg350-74ce6af22e6916179f426a180a69cc0031ac8e05.tar.bz2
scummvm-rg350-74ce6af22e6916179f426a180a69cc0031ac8e05.zip
LILLIPUT: more renaming and refactoring
-rw-r--r--engines/lilliput/lilliput.cpp32
-rw-r--r--engines/lilliput/lilliput.h12
-rw-r--r--engines/lilliput/script.cpp131
-rw-r--r--engines/lilliput/script.h20
4 files changed, 97 insertions, 98 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 598452f807..a37f02db8c 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -186,7 +186,7 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd)
_characterRelativePositionY[i] = -1;
_characterDisplayX[i] = 0;
_characterDisplayY[i] = 0;
- _array12299[i] = -1;
+ _characterMagicPuffFrame[i] = -1;
_characterSubTargetPosX[i] = -1;
_characterSubTargetPosY[i] = -1;
_stingArray[i] = 0;
@@ -202,10 +202,10 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd)
_spriteSizeArray[i] = 20;
_characterDirectionArray[i] = 0;
_rulesBuffer2_10[i] = 0;
- _rulesBuffer2_11[i] = 0;
+ _characterTypes[i] = 0;
_characterBehaviour[i] = 0;
- _rulesBuffer2_13_posX[i] = 0;
- _rulesBuffer2_14_posY[i] = 0;
+ _characterHomePosX[i] = 0;
+ _characterHomePosY[i] = 0;
_array1289F[i] = -1;
}
@@ -281,8 +281,8 @@ void LilliputEngine::newInt8() {
--_byte12A05;
else {
_byte12A05 = 10;
- if (_sound_byte16F06 != 0)
- --_sound_byte16F06;
+ if (_int8Timer != 0)
+ --_int8Timer;
_animationTick ^= 1;
if (!_refreshScreenFlag)
@@ -605,7 +605,7 @@ void LilliputEngine::displayCharactersOnMap() {
byte *buf = (byte *)_mainSurface->getPixels();
for (int index = _numCharacters - 1; index >= 0; index--) {
- if (((_rulesBuffer2_11[index] & 2) == 0) && (_scriptHandler->_characterTilePosY[index] != -1)) {
+ if (((_characterTypes[index] & 2) == 0) && (_scriptHandler->_characterTilePosY[index] != -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;
@@ -953,7 +953,7 @@ void LilliputEngine::sub16CA0() {
debugC(2, kDebugEngine, "sub16CA0()");
for (int index = _numCharacters - 1; index >= 0; index--) {
- if (_rulesBuffer2_11[index] & 1)
+ if (_characterTypes[index] & 1)
continue;
int c1 = _scriptHandler->_characterTilePosX[index];
@@ -968,7 +968,7 @@ void LilliputEngine::sub16CA0() {
if ((index != index2) &&
(_characterCarried[index] != index2) &&
(_characterCarried[index2] != index) &&
- (_rulesBuffer2_11[index2] & 2) == 0) {
+ (_characterTypes[index2] & 2) == 0) {
int d1 = _scriptHandler->_characterTilePosX[index2];
int d2 = _scriptHandler->_characterTilePosY[index2];
@@ -981,7 +981,7 @@ void LilliputEngine::sub16CA0() {
if ((c1 == d1) && (c2 == d2)) {
byte16C9F = 4;
- } else if ((_rulesBuffer2_11[index] & 4) != 0) {
+ } else if ((_characterTypes[index] & 4) != 0) {
byte16C9F = 0;
} else {
switch (_characterDirectionArray[index]) {
@@ -1256,9 +1256,9 @@ void LilliputEngine::renderCharacters(byte *buf, Common::Point pos) {
if ((flag & 1) == 1)
frame += _spriteSizeArray[index];
- if (_array12299[index] != -1) {
- frame = _array12299[index] + 82;
- --_array12299[index];
+ if (_characterMagicPuffFrame[index] != -1) {
+ frame = _characterMagicPuffFrame[index] + 82;
+ --_characterMagicPuffFrame[index];
frame = -frame;
}
@@ -2526,10 +2526,10 @@ void LilliputEngine::loadRules() {
_spriteSizeArray[j] = f.readByte();
_characterDirectionArray[j] = f.readByte();
_rulesBuffer2_10[j] = f.readByte();
- _rulesBuffer2_11[j] = f.readByte();
+ _characterTypes[j] = f.readByte();
_characterBehaviour[j] = f.readByte();
- _rulesBuffer2_13_posX[j] = f.readByte();
- _rulesBuffer2_14_posY[j] = f.readByte();
+ _characterHomePosX[j] = f.readByte();
+ _characterHomePosY[j] = f.readByte();
for (int k = 0; k < 32; k++)
_characterVariables[(j * 32) + k] = f.readByte();
diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h
index 6c30fe8c57..17a2da13f1 100644
--- a/engines/lilliput/lilliput.h
+++ b/engines/lilliput/lilliput.h
@@ -106,11 +106,11 @@ public:
int _smallAnimsFrameIndex;
byte _handleOpcodeReturnCode;
- byte _byte184F4;
+ byte _keyDelay;
byte _lastAnimationTick;
byte _animationTick;
Common::Point _nextDisplayCharacterPos;
- byte _sound_byte16F06;
+ byte _int8Timer;
Common::Event _lastKeyPressed;
Common::EventType _lastEventType;
byte _keyboard_nextIndex;
@@ -177,10 +177,10 @@ public:
byte _spriteSizeArray[40];
byte _characterDirectionArray[40];
byte _rulesBuffer2_10[40];
- byte _rulesBuffer2_11[40];
+ byte _characterTypes[40];
byte _characterBehaviour[40];
- byte _rulesBuffer2_13_posX[40];
- byte _rulesBuffer2_14_posY[40];
+ byte _characterHomePosX[40];
+ byte _characterHomePosY[40];
byte _characterVariables[1400 + 3120];
byte *_currentCharacterAttributes;
byte _poseArray[40 * 32];
@@ -216,7 +216,7 @@ public:
int16 _characterRelativePositionY[40];
int16 _characterDisplayX[40];
int16 _characterDisplayY[40];
- int8 _array12299[40];
+ int8 _characterMagicPuffFrame[40];
int16 _characterSubTargetPosX[40];
int16 _characterSubTargetPosY[40];
byte _stingArray[40];
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index b93000d6f8..03d5f3f992 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -30,7 +30,7 @@
namespace Lilliput {
LilliputScript::LilliputScript(LilliputEngine *vm) : _vm(vm), _currScript(NULL) {
- _byte10806 = 0;
+ _cubeSet = 0;
_lastRandomValue = 0;
_scriptForVal = 0;
_byte1881A = 0;
@@ -398,10 +398,10 @@ void LilliputScript::handleOpcodeType2(int curWord) {
OC_setCharacterScriptEnabled();
break;
case 0x33:
- OC_setCurrentCharacterVar2();
+ OC_setCurrentCharacterAttr2();
break;
case 0x34:
- OC_SetCurrentCharacterVar2ToZero();
+ OC_clearCurrentCharacterAttr2();
break;
case 0x35:
OC_setCharacterProperties();
@@ -410,7 +410,7 @@ void LilliputScript::handleOpcodeType2(int curWord) {
OC_sub1805D();
break;
case 0x37:
- OC_sub18074();
+ OC_setNewPose();
break;
case 0x38:
OC_setCurrentCharacterDirection();
@@ -437,7 +437,7 @@ void LilliputScript::handleOpcodeType2(int curWord) {
OC_sub18213();
break;
case 0x40:
- OC_sub18252();
+ OC_magicPuffEntrance();
break;
case 0x41:
OC_sub18260();
@@ -452,10 +452,10 @@ void LilliputScript::handleOpcodeType2(int curWord) {
OC_PaletteFadeIn();
break;
case 0x45:
- OC_loadAndDisplayCUBESx_GFX();
+ OC_loadAndDisplayCubesGfx();
break;
case 0x46:
- OC_setCurrentCharacterVar3();
+ OC_setCurrentCharacterAttr3();
break;
case 0x47:
OC_setArray122C1();
@@ -515,13 +515,13 @@ void LilliputScript::handleOpcodeType2(int curWord) {
OC_setCharacterHeroismBar();
break;
case 0x5A:
- OC_sub18690();
+ OC_setCharacterHome();
break;
case 0x5B:
OC_setViewPortCharacterTarget();
break;
case 0x5C:
- OC_sub186A1();
+ OC_showObject();
break;
case 0x5D:
OC_sub186E5_snd();
@@ -530,7 +530,7 @@ void LilliputScript::handleOpcodeType2(int curWord) {
OC_sub1870A_snd();
break;
case 0x5F:
- OC_sub18725_snd();
+ OC_stopSound();
break;
case 0x60:
OC_sub18733_snd();
@@ -662,11 +662,11 @@ static const OpCode opCodes2[] = {
/* 0x30 */ { "OC_setCurrentCharacterAttr6", 1, kGetValue1, kNone, kNone, kNone, kNone },
/* 0x31 */ { "OC_setCurrentCharacterPose", 1, kImmediateValue, kNone, kNone, kNone, kNone },
/* 0x32 */ { "OC_setCharacterScriptEnabled", 1, kGetValue1, kNone, kNone, kNone, kNone },
-/* 0x33 */ { "OC_setCurrentCharacterVar2", 1, kImmediateValue, kNone, kNone, kNone, kNone },
-/* 0x34 */ { "OC_setCurrentCharacterVar2ToZero", 0, kNone, kNone, kNone, kNone, kNone },
+/* 0x33 */ { "OC_setCurrentCharacterAttr2", 1, kImmediateValue, kNone, kNone, kNone, kNone },
+/* 0x34 */ { "OC_ClearCurrentCharacterAttr2", 0, kNone, kNone, kNone, kNone, kNone },
/* 0x35 */ { "OC_setCharacterProperties", 5, kGetValue1, kImmediateValue, kImmediateValue, kImmediateValue, kImmediateValue },
/* 0x36 */ { "OC_sub1805D", 5, kGetValue1, kImmediateValue, kImmediateValue, kImmediateValue, kImmediateValue },
-/* 0x37 */ { "OC_sub18074", 2, kImmediateValue, kImmediateValue, kNone, kNone, kNone },
+/* 0x37 */ { "OC_setNewPose", 2, kImmediateValue, kImmediateValue, kNone, kNone, kNone },
/* 0x38 */ { "OC_setCurrentCharacterDirection", 1, kImmediateValue, kNone, kNone, kNone, kNone },
/* 0x39 */ { "OC_setInterfaceHotspot", 2, kImmediateValue, kImmediateValue, kNone, kNone, kNone },
/* 0x3a */ { "OC_scrollViewPort", 1, kImmediateValue, kNone, kNone, kNone, kNone },
@@ -675,13 +675,13 @@ static const OpCode opCodes2[] = {
/* 0x3d */ { "OC_sub1817F", 2, kImmediateValue, kImmediateValue, kNone, kNone, kNone },
/* 0x3e */ { "OC_sub181BB", 4, kImmediateValue, kImmediateValue, kImmediateValue, kImmediateValue, kNone },
/* 0x3f */ { "OC_sub18213", 1, kImmediateValue, kNone, kNone, kNone, kNone },
-/* 0x40 */ { "OC_sub18252", 1, kGetValue1, kNone, kNone, kNone, kNone },
+/* 0x40 */ { "OC_magicPuffEntrance", 1, kGetValue1, kNone, kNone, kNone, kNone },
/* 0x41 */ { "OC_sub18260", 2, kGetValue1, kgetPosFromScript, kNone, kNone, kNone }, // TODO
/* 0x42 */ { "OC_characterVariableAddOrRemoveFlag", 4, kGetValue1, kImmediateValue, kImmediateValue, kImmediateValue, kNone },
/* 0x43 */ { "OC_paletteFadeOut", 0, kNone, kNone, kNone, kNone, kNone },
/* 0x44 */ { "OC_paletteFadeIn", 0, kNone, kNone, kNone, kNone, kNone },
-/* 0x45 */ { "OC_loadAndDisplayCUBESx_GFX", 1, kImmediateValue, kNone, kNone, kNone, kNone },
-/* 0x46 */ { "OC_setCurrentCharacterVar3", 1, kImmediateValue, kNone, kNone, kNone, kNone },
+/* 0x45 */ { "OC_loadAndDisplayCubesGfx", 1, kImmediateValue, kNone, kNone, kNone, kNone },
+/* 0x46 */ { "OC_setCurrentCharacterAttr3", 1, kImmediateValue, kNone, kNone, kNone, kNone },
/* 0x47 */ { "OC_setArray122C1", 1, kImmediateValue, kNone, kNone, kNone, kNone },
/* 0x48 */ { "OC_sub18367", 0, kNone, kNone, kNone, kNone, kNone },
/* 0x49 */ { "OC_enableCharacterScript", 2, kGetValue1, kImmediateValue, kNone, kNone, kNone },
@@ -701,12 +701,12 @@ static const OpCode opCodes2[] = {
/* 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
+/* 0x5a */ { "OC_setCharacterHome", 2, kGetValue1, kgetPosFromScript, kNone, kNone, kNone }, //TODO
/* 0x5b */ { "OC_setViewPortCharacterTarget", 1, kGetValue1, kNone, kNone, kNone, kNone },
-/* 0x5c */ { "OC_sub186A1", 3, kGetValue1, kImmediateValue, kImmediateValue, kNone, kNone }, //TODO
+/* 0x5c */ { "OC_showObject", 3, kGetValue1, kImmediateValue, kImmediateValue, kNone, kNone }, //TODO
/* 0x5d */ { "OC_sub186E5_snd", 2, kGetValue1, kImmediateValue, kNone, kNone, kNone },
/* 0x5e */ { "OC_sub1870A_snd", 2, kgetPosFromScript, kImmediateValue, kNone, kNone, kNone },
-/* 0x5f */ { "OC_sub18725_snd", 1, kGetValue1, kNone, kNone, kNone, kNone },
+/* 0x5f */ { "OC_stopSound", 1, kGetValue1, kNone, kNone, kNone, kNone },
/* 0x60 */ { "OC_sub18733_snd", 1, kGetValue1, kNone, kNone, kNone, kNone },
/* 0x61 */ { "OC_sub1873F_snd", 1, kgetPosFromScript, kNone, kNone, kNone, kNone },
/* 0x62 */ { "OC_sub18746_snd", 1, kImmediateValue, kNone, kNone, kNone, kNone },
@@ -1298,11 +1298,11 @@ Common::Point LilliputScript::getPosFromScript() {
switch(tmpVal) {
case 0xFF:
assert((_vm->_currentScriptCharacter >= 0) && (_vm->_currentScriptCharacter < 40));
- return Common::Point(_vm->_rulesBuffer2_13_posX[_vm->_currentScriptCharacter], _vm->_rulesBuffer2_14_posY[_vm->_currentScriptCharacter]);
+ return Common::Point(_vm->_characterHomePosX[_vm->_currentScriptCharacter], _vm->_characterHomePosY[_vm->_currentScriptCharacter]);
case 0xFE: {
int8 index = curWord & 0xFF;
assert((index >= 0) && (index < 40));
- return Common::Point(_vm->_rulesBuffer2_13_posX[index], _vm->_rulesBuffer2_14_posY[index]);
+ return Common::Point(_vm->_characterHomePosX[index], _vm->_characterHomePosY[index]);
}
case 0xFD:
return _vm->_currentScriptCharacterPos;
@@ -2722,16 +2722,16 @@ void LilliputScript::OC_setCharacterScriptEnabled() {
_characterScriptEnabled[index] = 1;
}
-void LilliputScript::OC_setCurrentCharacterVar2() {
- debugC(1, kDebugScript, "OC_setCurrentCharacterVar2()");
+void LilliputScript::OC_setCurrentCharacterAttr2() {
+ debugC(1, kDebugScript, "OC_setCurrentCharacterAttr2()");
int curWord = _currScript->readUint16LE();
assert(_vm->_currentCharacterAttributes != NULL);
_vm->_currentCharacterAttributes[2] = curWord & 0xFF;
}
-void LilliputScript::OC_SetCurrentCharacterVar2ToZero() {
- debugC(1, kDebugScript, "OC_SetCurrentCharacterVar2ToZero()");
+void LilliputScript::OC_clearCurrentCharacterAttr2() {
+ debugC(1, kDebugScript, "OC_clearCurrentCharacterAttr2()");
assert(_vm->_currentCharacterAttributes != NULL);
_vm->_currentCharacterAttributes[2] = 0;
@@ -2762,8 +2762,8 @@ void LilliputScript::OC_sub1805D() {
_array129A5[i] = _currScript->readUint16LE() & 0xFF;
}
-void LilliputScript::OC_sub18074() {
- debugC(1, kDebugScriptTBC, "OC_sub18074()");
+void LilliputScript::OC_setNewPose() {
+ debugC(1, kDebugScriptTBC, "OC_setNewPose()");
int var2 = _currScript->readUint16LE();
byte var1 = (_currScript->readUint16LE() & 0xFF);
@@ -2910,13 +2910,13 @@ void LilliputScript::OC_sub18213() {
enableCharacterScript(_vm->_currentScriptCharacter, maxItem, _vm->_currentCharacterAttributes);
}
-void LilliputScript::OC_sub18252() {
- debugC(1, kDebugScript, "OC_sub18252()");
+void LilliputScript::OC_magicPuffEntrance() {
+ debugC(1, kDebugScript, "OC_magicPuffEntrance()");
int16 index = getValue1();
assert((index >0) && (index < 40));
- _vm->_array12299[index] = 4;
+ _vm->_characterMagicPuffFrame[index] = 4;
}
void LilliputScript::OC_sub18260() {
@@ -2982,21 +2982,21 @@ void LilliputScript::OC_PaletteFadeIn() {
_vm->_refreshScreenFlag = false;
}
-void LilliputScript::OC_loadAndDisplayCUBESx_GFX() {
- debugC(1, kDebugScript, "OC_loadAndDisplayCUBESx_GFX()");
+void LilliputScript::OC_loadAndDisplayCubesGfx() {
+ debugC(1, kDebugScript, "OC_loadAndDisplayCubesGfx()");
- int curWord = (_currScript->readUint16LE() & 0xFF);
- assert((curWord >= 0) && (curWord <= 9));
- Common::String fileName = Common::String::format("CUBES%d.GFX", curWord);
- _byte10806 = curWord + 0x30; // Useless?
+ int setNumb = (_currScript->readUint16LE() & 0xFF);
+ assert((setNumb >= 0) && (setNumb <= 9));
+ Common::String fileName = Common::String::format("CUBES%d.GFX", setNumb);
+ _cubeSet = setNumb; // Useless in this variant, keep for the moment for Rome
_vm->_bufferCubegfx = _vm->loadVGA(fileName, 61440, false);
_vm->displayLandscape();
_vm->prepareGameArea();
}
-void LilliputScript::OC_setCurrentCharacterVar3() {
- debugC(1, kDebugScript, "OC_setCurrentCharacterVar3()");
+void LilliputScript::OC_setCurrentCharacterAttr3() {
+ debugC(1, kDebugScript, "OC_setCurrentCharacterAttr3()");
byte var1 = _currScript->readUint16LE() & 0xFF;
assert(_vm->_currentCharacterAttributes != NULL);
@@ -3116,31 +3116,30 @@ void LilliputScript::OC_startSpeechIfSoundOff() {
void LilliputScript::OC_sub1844A() {
debugC(1, kDebugScriptTBC, "OC_sub1844A()");
- int var1 = getValue1();
+ int characterIndex = getValue1();
int var2 = _currScript->readUint16LE();
- _vm->_rulesBuffer2_11[var1] = (var2 & 0xFF);
+ _vm->_characterTypes[characterIndex] = (var2 & 0xFF);
for (int i = 0; i < 40; i++) {
- _interactions[40 * var1 + i] = 0;
- _interactions[var1 + 40 * i] = 0;
+ _interactions[40 * characterIndex + i] = 0;
+ _interactions[characterIndex + 40 * i] = 0;
}
}
void LilliputScript::OC_displayNumericCharacterVariable() {
debugC(1, kDebugScript, "OC_displayNumericCharacterVariable()");
- byte *buf215Ptr = getCharacterAttributesPtr();
- byte tmpVal = buf215Ptr[0];
- int curWord = _currScript->readUint16LE();
- assert(curWord != 0);
- int displayVal = tmpVal / (curWord & 0xFF);
+ byte *charAttrArr = getCharacterAttributesPtr();
+ byte attr = charAttrArr[0];
+ int divisor = _currScript->readUint16LE();
+ assert(divisor != 0);
+ int displayVal = attr / (divisor & 0xFF);
int posX = _currScript->readSint16LE();
int posY = _currScript->readSint16LE();
- if (!_vm->_displayMap) {
+ if (!_vm->_displayMap)
displayNumber(displayVal, Common::Point(posX, posY));
- }
}
void LilliputScript::displayNumber(byte var1, Common::Point pos) {
@@ -3179,8 +3178,8 @@ void LilliputScript::OC_startSpeechWithoutSpeeker() {
void LilliputScript::OC_displayTitleScreen() {
debugC(1, kDebugScript, "OC_displayTitleScreen()");
- _vm->_byte184F4 = (_currScript->readUint16LE() & 0xFF);
- _vm->_sound_byte16F06 = _vm->_byte184F4;
+ _vm->_keyDelay = (_currScript->readUint16LE() & 0xFF);
+ _vm->_int8Timer = _vm->_keyDelay;
_vm->_keyboard_resetKeyboardBuffer();
@@ -3202,7 +3201,7 @@ void LilliputScript::OC_displayTitleScreen() {
if (_vm->_mouseButton == 1)
break;
- if ((_vm->_byte184F4 != 0) && (_vm->_sound_byte16F06 == 0))
+ if ((_vm->_keyDelay != 0) && (_vm->_int8Timer == 0))
break;
_vm->_system->delayMillis(1);
@@ -3260,13 +3259,13 @@ void LilliputScript::OC_setCharacterHeroismBar() {
_heroismBarBottomY = _currScript->readUint16LE();
}
-void LilliputScript::OC_sub18690() {
- debugC(1, kDebugScriptTBC, "OC_sub18690()");
+void LilliputScript::OC_setCharacterHome() {
+ debugC(1, kDebugScriptTBC, "OC_setCharacterHome()");
int index = getValue1();
Common::Point pos = getPosFromScript();
- _vm->_rulesBuffer2_13_posX[index] = pos.x;
- _vm->_rulesBuffer2_14_posY[index] = pos.y;
+ _vm->_characterHomePosX[index] = pos.x;
+ _vm->_characterHomePosY[index] = pos.y;
}
void LilliputScript::OC_setViewPortCharacterTarget() {
@@ -3275,8 +3274,8 @@ void LilliputScript::OC_setViewPortCharacterTarget() {
_viewportCharacterTarget = getValue1();
}
-void LilliputScript::OC_sub186A1() {
- debugC(1, kDebugScriptTBC, "OC_sub186A1()");
+void LilliputScript::OC_showObject() {
+ debugC(1, kDebugScriptTBC, "OC_showObject()");
int var1 = getValue1();
int posX = _currScript->readUint16LE();
@@ -3288,9 +3287,9 @@ void LilliputScript::OC_sub186A1() {
int frame = _vm->_characterFrameArray[var1];
byte* buf = _vm->_bufferMen;
- if (frame > 0xF0) {
+ if (frame > 240) {
buf = _vm->_bufferMen2;
- frame -= 0xF0;
+ frame -= 240;
}
_vm->display16x16IndexedBuf(buf, frame, pos);
@@ -3302,9 +3301,9 @@ void LilliputScript::OC_sub186E5_snd() {
assert(index < 40);
Common::Point var4 = Common::Point(0xFF, index & 0xFF);
- int var1 = (_currScript->readUint16LE() & 0xFF);
+ int soundId = (_currScript->readUint16LE() & 0xFF);
- _vm->_soundHandler->contentFct2(var1, _viewportPos, Common::Point(_characterTilePosX[index], _characterTilePosY[index]), var4);
+ _vm->_soundHandler->contentFct2(soundId, _viewportPos, Common::Point(_characterTilePosX[index], _characterTilePosY[index]), var4);
}
void LilliputScript::OC_sub1870A_snd() {
@@ -3318,12 +3317,12 @@ void LilliputScript::OC_sub1870A_snd() {
_vm->_soundHandler->contentFct2(var1, var2, var3, var4);
}
-void LilliputScript::OC_sub18725_snd() {
- debugC(1, kDebugScript, "OC_sub18725_snd()");
+void LilliputScript::OC_stopSound() {
+ debugC(1, kDebugScript, "OC_stopSound()");
- Common::Point var4 = Common::Point(-1, getValue1() & 0xFF);
+ Common::Point var4 = Common::Point(-1, getValue1() & 0xFF); // should be split in 2 parameters
- _vm->_soundHandler->contentFct3(var4);
+ _vm->_soundHandler->contentFct3(var4); // Stop Sound
}
void LilliputScript::OC_sub18733_snd() {
diff --git a/engines/lilliput/script.h b/engines/lilliput/script.h
index 5ec3ba8c4c..e9810ccb58 100644
--- a/engines/lilliput/script.h
+++ b/engines/lilliput/script.h
@@ -108,7 +108,7 @@ private:
Common::Stack<ScriptStream *> _scriptStack;
byte _byte16F05_ScriptHandler;
- byte _byte10806;
+ byte _cubeSet;
byte _lastRandomValue;
byte _scriptForVal;
byte _byte1881A;
@@ -255,11 +255,11 @@ private:
void OC_setCurrentCharacterAttr6();
void OC_setCurrentCharacterPose();
void OC_setCharacterScriptEnabled();
- void OC_setCurrentCharacterVar2();
- void OC_SetCurrentCharacterVar2ToZero();
+ void OC_setCurrentCharacterAttr2();
+ void OC_clearCurrentCharacterAttr2();
void OC_setCharacterProperties();
void OC_sub1805D();
- void OC_sub18074();
+ void OC_setNewPose();
void OC_setCurrentCharacterDirection();
void OC_setInterfaceHotspot();
void OC_scrollViewPort();
@@ -269,13 +269,13 @@ private:
void sub1818B(Common::Point point);
void OC_sub181BB();
void OC_sub18213();
- void OC_sub18252();
+ void OC_magicPuffEntrance();
void OC_sub18260();
void OC_CharacterVariableAddOrRemoveFlag();
void OC_PaletteFadeOut();
void OC_PaletteFadeIn();
- void OC_loadAndDisplayCUBESx_GFX();
- void OC_setCurrentCharacterVar3();
+ void OC_loadAndDisplayCubesGfx();
+ void OC_setCurrentCharacterAttr3();
void OC_setArray122C1();
void OC_sub18367();
void OC_enableCharacterScript();
@@ -295,12 +295,12 @@ private:
void OC_displayCharacterStatBar();
void OC_initSmallAnim();
void OC_setCharacterHeroismBar();
- void OC_sub18690();
+ void OC_setCharacterHome();
void OC_setViewPortCharacterTarget();
- void OC_sub186A1();
+ void OC_showObject();
void OC_sub186E5_snd();
void OC_sub1870A_snd();
- void OC_sub18725_snd();
+ void OC_stopSound();
void OC_sub18733_snd();
void OC_sub1873F_snd();
void OC_sub18746_snd();