LILLIPUT: More renaming
This commit is contained in:
parent
e1f6fe2226
commit
aedc95231d
4 changed files with 52 additions and 48 deletions
|
@ -472,8 +472,8 @@ void LilliputEngine::displayInterfaceHotspots() {
|
|||
displayMousePointer();
|
||||
}
|
||||
|
||||
void LilliputEngine::displayFunction9() {
|
||||
debugC(2, kDebugEngineTBC, "displayFunction9()");
|
||||
void LilliputEngine::displayLandscape() {
|
||||
debugC(2, kDebugEngine, "displayLandscape()");
|
||||
|
||||
memcpy(_buffer2_45k, _buffer3_45k, 45056);
|
||||
|
||||
|
@ -484,12 +484,11 @@ void LilliputEngine::displayFunction9() {
|
|||
for (int i = 0; i < 8; i++) {
|
||||
for (int j = 0; j < 8 ; j++) {
|
||||
var2 = (j << 8) + i;
|
||||
displayFunction13(_buffer2_45k, _bufferIsoMap[var1 + index], var2, 0);
|
||||
displayIsometricBlock(_buffer2_45k, _bufferIsoMap[var1 + index], var2, 0);
|
||||
index += 4;
|
||||
}
|
||||
index += 224;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Display dialog bubble
|
||||
|
@ -595,7 +594,7 @@ void LilliputEngine::displayFunction12() {
|
|||
displayFunction6();
|
||||
displayFunction7();
|
||||
displayInterfaceHotspots();
|
||||
displayFunction9();
|
||||
displayLandscape();
|
||||
displayFunction15();
|
||||
displayFunction14();
|
||||
|
||||
|
@ -603,9 +602,9 @@ void LilliputEngine::displayFunction12() {
|
|||
free(tmpBuf);
|
||||
}
|
||||
|
||||
void LilliputEngine::displayFunction13(byte *buf, int var1, int var2, int var3) {
|
||||
debugC(1, kDebugEngineTBC, "displayFunction13(buf, %d, %d, %d)", var1, var2, var3);
|
||||
|
||||
void LilliputEngine::displayIsometricBlock(byte *buf, int var1, int var2, int var3) {
|
||||
debugC(1, kDebugEngine, "displayIsometricBlock(buf, %d, %d, %d)", var1, var2, var3);
|
||||
|
||||
byte tmpByte1 = ((7 + (var2 >> 8) - (var2 & 0xFF)) << 4) & 0xFF;
|
||||
byte tmpByte2 = ((4 + (var2 >> 8) + (var2 & 0xFF) - (var3 >> 7) ) << 3) & 0xFF;
|
||||
|
||||
|
@ -768,7 +767,7 @@ void LilliputEngine::displayFunction15() {
|
|||
int var1 = map[1];
|
||||
if (_rulesChunk9[var1] != 128)
|
||||
var1 += _scriptHandler->_byte12A04;
|
||||
displayFunction13(_buffer1_45k, var1, tmpVal, 1 << 8);
|
||||
displayIsometricBlock(_buffer1_45k, var1, tmpVal, 1 << 8);
|
||||
}
|
||||
renderCharacters(map, Common::Point(j, i));
|
||||
|
||||
|
@ -776,7 +775,7 @@ void LilliputEngine::displayFunction15() {
|
|||
int var1 = map[2];
|
||||
if (_rulesChunk9[var1] != 128)
|
||||
var1 += _scriptHandler->_byte12A04;
|
||||
displayFunction13(_buffer1_45k, var1, tmpVal, 2 << 8);
|
||||
displayIsometricBlock(_buffer1_45k, var1, tmpVal, 2 << 8);
|
||||
}
|
||||
map += 4;
|
||||
}
|
||||
|
@ -1242,7 +1241,7 @@ void LilliputEngine::viewportScrollTo(Common::Point goalPos) {
|
|||
_scriptHandler->_viewportPos.x += dx;
|
||||
_scriptHandler->_viewportPos.y += dy;
|
||||
|
||||
displayFunction9();
|
||||
displayLandscape();
|
||||
displayFunction15();
|
||||
displayFunction14();
|
||||
|
||||
|
@ -1271,17 +1270,16 @@ void LilliputEngine::renderCharacters(byte *buf, Common::Point pos) {
|
|||
}
|
||||
|
||||
int index = _charactersToDisplay[_currentDisplayCharacter];
|
||||
int displayX = _characterDisplayX[index];
|
||||
int displayY = _characterDisplayY[index];
|
||||
Common::Point characterPos = Common::Point(_characterDisplayX[index], _characterDisplayY[index]);
|
||||
|
||||
if (index == _scriptHandler->_word1881B)
|
||||
sub1546F(displayX, displayY);
|
||||
sub1546F(characterPos);
|
||||
|
||||
if (_byte16552 != 1) {
|
||||
int flag = _characterDirectionArray[index];
|
||||
int frame = _characterFrameArray[index];
|
||||
byte flag = _characterDirectionArray[index];
|
||||
int16 frame = _characterFrameArray[index];
|
||||
|
||||
if (frame != 0xFFFF) {
|
||||
if (frame != -1) {
|
||||
frame += _scriptHandler->_array10AB1[index];
|
||||
if ((flag & 1) == 1)
|
||||
frame += _spriteSizeArray[index];
|
||||
|
@ -1292,7 +1290,7 @@ void LilliputEngine::renderCharacters(byte *buf, Common::Point pos) {
|
|||
frame = -frame;
|
||||
}
|
||||
|
||||
displayCharacter(frame, Common::Point(displayX, displayY), flag);
|
||||
displayCharacter(frame, characterPos, flag);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1302,11 +1300,11 @@ void LilliputEngine::renderCharacters(byte *buf, Common::Point pos) {
|
|||
renderCharacters(buf, pos);
|
||||
}
|
||||
|
||||
void LilliputEngine::sub1546F(byte displayX, byte displayY) {
|
||||
debugC(2, kDebugEngineTBC, "sub1546F(%d, %d)", displayX, displayY);
|
||||
void LilliputEngine::sub1546F(Common::Point displayPos) {
|
||||
debugC(2, kDebugEngineTBC, "sub1546F(%d, %d)", displayPos.x, displayPos.y);
|
||||
|
||||
int orgX = displayX + 8;
|
||||
int orgY = displayY;
|
||||
int orgX = displayPos.x + 8;
|
||||
int orgY = displayPos.y;
|
||||
int var2 = 0;
|
||||
|
||||
int x = orgX;
|
||||
|
@ -1539,7 +1537,7 @@ byte LilliputEngine::sub16A76(int indexb, int indexs) {
|
|||
if (var2 == -1)
|
||||
return 1;
|
||||
|
||||
int _word16A74 = var2; // useless?
|
||||
// int _word16A74 = var2; // useless?
|
||||
|
||||
var1h = _word16937Pos.x;
|
||||
var1l = _word16937Pos.y;
|
||||
|
|
|
@ -155,7 +155,7 @@ public:
|
|||
int16 _characterPositionX[40];
|
||||
int16 _characterPositionY[40];
|
||||
char _characterPositionAltitude[40];
|
||||
int _characterFrameArray[40];
|
||||
int16 _characterFrameArray[40];
|
||||
byte _rulesBuffer2_5[40];
|
||||
byte _rulesBuffer2_6[40];
|
||||
byte _rulesBuffer2_7[40];
|
||||
|
@ -228,11 +228,11 @@ public:
|
|||
void displayFunction6();
|
||||
void displayFunction7();
|
||||
void displayInterfaceHotspots();
|
||||
void displayFunction9();
|
||||
void displayLandscape();
|
||||
void displayFunction10();
|
||||
void displayFunction11(byte *buf);
|
||||
void displayFunction12();
|
||||
void displayFunction13(byte *buf, int var1, int var2, int var3);
|
||||
void displayIsometricBlock(byte *buf, int var1, int var2, int var3);
|
||||
void displayFunction14();
|
||||
void displayFunction15();
|
||||
void displayFunction16();
|
||||
|
@ -287,7 +287,7 @@ public:
|
|||
int sub13240(Common::Point mousePos, int var3, int var4);
|
||||
void sub131B2(Common::Point pos, bool &forceReturnFl);
|
||||
void sub131FC(Common::Point pos);
|
||||
void sub1546F(byte displayX, byte displayY);
|
||||
void sub1546F(Common::Point displayPos);
|
||||
void sub15498(byte x, byte y, int var2);
|
||||
void sub15A4C(int &vgaIndex, byte *srcBuf, int &bufIndex);
|
||||
void sub15F31(bool &forceReturnFl);
|
||||
|
|
|
@ -98,7 +98,7 @@ byte LilliputScript::handleOpcodeType1(int curWord) {
|
|||
return OC_sub1740A();
|
||||
break;
|
||||
case 0x3:
|
||||
return OC_sub17434();
|
||||
return OC_compareCharacterId();
|
||||
break;
|
||||
case 0x4:
|
||||
return OC_sub17468();
|
||||
|
@ -563,7 +563,7 @@ static const OpCode opCodes1[] = {
|
|||
{ "OC_checkCharacterGoalPos", 1, kgetPosFromScript, kNone, kNone, kNone, kNone },
|
||||
{ "OC_comparePos", 2, kGetValue1, kgetPosFromScript, kNone, kNone, kNone },
|
||||
{ "OC_sub1740A", 1, kImmediateValue, kNone, kNone, kNone, kNone },
|
||||
{ "OC_sub17434", 4, kGetValue1, kImmediateValue, kCompareOperation, kImmediateValue, kNone },
|
||||
{ "OC_compareCharacterId", 4, kGetValue1, kImmediateValue, kCompareOperation, kImmediateValue, kNone },
|
||||
{ "OC_sub17468", 2, kCompareOperation, kImmediateValue, kNone, kNone, kNone },
|
||||
{ "OC_getRandom", 1, kImmediateValue, kNone, kNone, kNone, kNone },
|
||||
{ "OC_for", 2, kImmediateValue, kImmediateValue, kNone, kNone, kNone },
|
||||
|
@ -965,18 +965,25 @@ void LilliputScript::sub185ED(byte index, byte subIndex) {
|
|||
_vm->display16x16IndexedBuf(_vm->_bufferIdeogram, _vm->_arr18560[index]._field5[subIndex], _vm->_arr18560[index]._field1);
|
||||
}
|
||||
|
||||
byte LilliputScript::compareValues(byte var1, int oper, int var2) {
|
||||
debugC(2, kDebugScriptTBC, "compareValues(%d, %c, %d)", var1, oper & 0xFF, var2);
|
||||
byte LilliputScript::compareValues(int var1, int oper, int var2) {
|
||||
debugC(2, kDebugScript, "compareValues(%d, %c, %d)", var1, oper & 0xFF, var2);
|
||||
|
||||
switch (oper & 0xFF) {
|
||||
case '<':
|
||||
return (var1 < var2);
|
||||
if (var1 < var2)
|
||||
return 1;
|
||||
break;
|
||||
case '>':
|
||||
return (var1 > var2);
|
||||
if (var1 > var2)
|
||||
return 1;
|
||||
break;
|
||||
default:
|
||||
return (var1 == var2);
|
||||
if (var1 == var2)
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void LilliputScript::computeOperation(byte *bufPtr, int oper, int var3) {
|
||||
|
@ -1274,7 +1281,7 @@ void LilliputScript::sub18B3C(int var) {
|
|||
}
|
||||
|
||||
int16 LilliputScript::getValue1() {
|
||||
debugC(2, kDebugScriptTBC, "getValue1()");
|
||||
debugC(2, kDebugScript, "getValue1()");
|
||||
|
||||
int16 curWord = _currScript->readUint16LE();
|
||||
if (curWord < 1000)
|
||||
|
@ -1366,7 +1373,7 @@ void LilliputScript::sub130B6() {
|
|||
}
|
||||
|
||||
byte *LilliputScript::getCharacterVariablePtr() {
|
||||
debugC(2, kDebugScriptTBC, "getCharacterVariablePtr()");
|
||||
debugC(2, kDebugScript, "getCharacterVariablePtr()");
|
||||
|
||||
int8 tmpVal = (int8) (getValue1() & 0xFF);
|
||||
int index = tmpVal * 32;
|
||||
|
@ -1420,9 +1427,8 @@ byte LilliputScript::OC_sub1740A() {
|
|||
}
|
||||
}
|
||||
|
||||
// Compare field0 with value -> character id?
|
||||
byte LilliputScript::OC_sub17434() {
|
||||
debugC(1, kDebugScriptTBC, "OC_sub17434()");
|
||||
byte LilliputScript::OC_compareCharacterId() {
|
||||
debugC(1, kDebugScript, "OC_compareCharacterId()");
|
||||
|
||||
byte *tmpArr = getCharacterVariablePtr();
|
||||
byte var1 = tmpArr[0];
|
||||
|
@ -2410,7 +2416,7 @@ void LilliputScript::OC_sub17C0E() {
|
|||
|
||||
if (b2 == 0) {
|
||||
_byte12A09 = 1;
|
||||
_vm->displayFunction9();
|
||||
_vm->displayLandscape();
|
||||
_byte12A09 = 0;
|
||||
}
|
||||
}
|
||||
|
@ -2802,7 +2808,7 @@ void LilliputScript::OC_sub1810A() {
|
|||
_viewportCharacterTarget = 0xFFFF;
|
||||
_viewportPos = getPosFromScript();
|
||||
|
||||
_vm->displayFunction9();
|
||||
_vm->displayLandscape();
|
||||
_vm->displayFunction15();
|
||||
}
|
||||
|
||||
|
@ -2933,15 +2939,15 @@ void LilliputScript::OC_PaletteFadeIn() {
|
|||
}
|
||||
|
||||
void LilliputScript::OC_loadAndDisplayCUBESx_GFX() {
|
||||
debugC(1, kDebugScriptTBC, "OC_loadAndDisplayCUBESx_GFX()");
|
||||
debugC(1, kDebugScript, "OC_loadAndDisplayCUBESx_GFX()");
|
||||
|
||||
int curWord = _currScript->readUint16LE();
|
||||
int curWord = (_currScript->readUint16LE() & 0xFF);
|
||||
assert((curWord >= 0) && (curWord <= 9));
|
||||
Common::String fileName = Common::String::format("CUBES%d.GFX", curWord);
|
||||
_byte10806 = curWord + 0x30;
|
||||
_byte10806 = curWord + 0x30; // Useless?
|
||||
|
||||
_vm->_bufferCubegfx = _vm->loadVGA(fileName, 61440, false);
|
||||
_vm->displayFunction9();
|
||||
_vm->displayLandscape();
|
||||
_vm->displayFunction15();
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
char _array16123PosX[40];
|
||||
char _array1614BPosY[40];
|
||||
byte _array12811[40];
|
||||
byte _array10AB1[40];
|
||||
char _array10AB1[40];
|
||||
byte _array122FD[20];
|
||||
byte _array122C1[40];
|
||||
byte _array10A39[40];
|
||||
|
@ -146,14 +146,14 @@ private:
|
|||
Common::Point getPosFromScript();
|
||||
|
||||
byte *getCharacterVariablePtr();
|
||||
byte compareValues(byte var1, int oper, int var2);
|
||||
byte compareValues(int var1, int oper, int var2);
|
||||
void computeOperation(byte *bufPtr, int oper, int var2);
|
||||
|
||||
//Opcodes Type 1
|
||||
byte OC_checkCharacterGoalPos();
|
||||
byte OC_comparePos();
|
||||
byte OC_sub1740A();
|
||||
byte OC_sub17434();
|
||||
byte OC_compareCharacterId();
|
||||
byte OC_sub17468();
|
||||
byte OC_getRandom();
|
||||
byte OC_for();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue