LILLIPUT: Fix display string functions, some renaming

This commit is contained in:
Strangerke 2012-04-22 00:05:02 +02:00 committed by Eugene Sandulenko
parent 5d21c237f7
commit 16ec550df5
3 changed files with 14 additions and 13 deletions

View file

@ -143,7 +143,6 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd)
_byte12A09 = 0; _byte12A09 = 0;
_byte1881D = 0; _byte1881D = 0;
_byte16552 = 0; _byte16552 = 0;
_byte18AED = 0;
_rulesBuffer2PrevIndx = 0; _rulesBuffer2PrevIndx = 0;
_word16EFA = 0; _word16EFA = 0;
@ -699,8 +698,8 @@ void LilliputEngine::displayFunction17() {
displayFunction4(); displayFunction4();
} }
void LilliputEngine::displayFunction18(byte *buf, int var2, int var4) { void LilliputEngine::displayString(byte *buf, int var2, int var4) {
debugC(2, kDebugEngine, "displayFunction18(buf, %d, %d)", var2, var4); debugC(2, kDebugEngine, "displayString(buf, %d, %d)", var2, var4);
int index = var2; int index = var2;
int tmpVar4 = (var4 >> 8) + ((var4 & 0xFF) << 8); int tmpVar4 = (var4 >> 8) + ((var4 & 0xFF) << 8);
@ -974,13 +973,14 @@ void LilliputEngine::sub18A3E(byte param1) {
++_displayStringIndex; ++_displayStringIndex;
} }
void LilliputEngine::sub18AEE(int param1) { void LilliputEngine::prepareGoldAmount(int param1) {
debugC(2, kDebugEngine, "sub18AEE(%d)", param1); debugC(2, kDebugEngine, "prepareGoldAmount(%d)", param1);
static const int _array18AE3[6] = {10000, 1000, 100, 10, 1}; static const int _array18AE3[6] = {10000, 1000, 100, 10, 1};
int count; int count;
int var1 = param1; int var1 = param1;
bool hideZeros = true;
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
count = 0; count = 0;
while (var1 >= 0) { while (var1 >= 0) {
@ -988,12 +988,14 @@ void LilliputEngine::sub18AEE(int param1) {
var1 -= _array18AE3[i]; var1 -= _array18AE3[i];
} }
var1 += _array18AE3[i]; var1 += _array18AE3[i];
byte tmpVal = var1 + 0x30; --count;
byte tmpVal = count + 0x30;
if (i == 4) if (i == 4)
sub18A3E(tmpVal); sub18A3E(tmpVal);
else if ((var1 != 0) || (_byte18AED != 1)) { else if ((count != 0) || (!hideZeros)) {
_byte18AED = 0; hideZeros = false;
sub18A3E(tmpVal); sub18A3E(tmpVal);
} }
} }

View file

@ -101,7 +101,6 @@ public:
byte _byte12A09; byte _byte12A09;
byte _byte1881D; byte _byte1881D;
byte _byte16552; byte _byte16552;
byte _byte18AED;
byte _buffer1[45056]; byte _buffer1[45056];
byte _buffer2[45056]; byte _buffer2[45056];
@ -217,7 +216,7 @@ public:
void displayFunction15(); void displayFunction15();
void displayFunction16(); void displayFunction16();
void displayFunction17(); void displayFunction17();
void displayFunction18(byte *buf, int var2, int var4); void displayString(byte *buf, int var2, int var4);
void displayChar(int index, int var1); void displayChar(int index, int var1);
void sub16323(); void sub16323();
@ -229,7 +228,7 @@ public:
int sub16799(int param1, int index); int sub16799(int param1, int index);
int sub16B0C(int param1, int param2); int sub16B0C(int param1, int param2);
void sub18A3E(byte param1); void sub18A3E(byte param1);
void sub18AEE(int param1); void prepareGoldAmount(int param1);
void initGame(const LilliputGameDescription *gd); void initGame(const LilliputGameDescription *gd);
byte *loadVGA(Common::String filename, bool loadPal); byte *loadVGA(Common::String filename, bool loadPal);

View file

@ -1778,8 +1778,8 @@ void LilliputScript::sub18BE6(byte var1, int var2, int var4) {
_vm->_displayStringBuf[2] = 32; _vm->_displayStringBuf[2] = 32;
_vm->_displayStringBuf[3] = 0; _vm->_displayStringBuf[3] = 0;
_vm->sub18AEE(var1); _vm->prepareGoldAmount(var1);
_vm->displayFunction18(_vm->_displayStringBuf, var2, var4); _vm->displayString(_vm->_displayStringBuf, var2, var4);
} }
void LilliputScript::OC_displayVGAFile() { void LilliputScript::OC_displayVGAFile() {