diff options
author | Strangerke | 2012-04-22 00:05:02 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-03-28 17:36:57 +0200 |
commit | 16ec550df57d3bb1bc661ec46872b31ca5239adb (patch) | |
tree | 125c8bb72a5c75bbb1f6f03e99ffc309351945aa /engines | |
parent | 5d21c237f70d1cdba3d3b7f978e2542088b89489 (diff) | |
download | scummvm-rg350-16ec550df57d3bb1bc661ec46872b31ca5239adb.tar.gz scummvm-rg350-16ec550df57d3bb1bc661ec46872b31ca5239adb.tar.bz2 scummvm-rg350-16ec550df57d3bb1bc661ec46872b31ca5239adb.zip |
LILLIPUT: Fix display string functions, some renaming
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lilliput/lilliput.cpp | 18 | ||||
-rw-r--r-- | engines/lilliput/lilliput.h | 5 | ||||
-rw-r--r-- | engines/lilliput/script.cpp | 4 |
3 files changed, 14 insertions, 13 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp index 6730f5bf3f..caf83019f0 100644 --- a/engines/lilliput/lilliput.cpp +++ b/engines/lilliput/lilliput.cpp @@ -143,7 +143,6 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd) _byte12A09 = 0; _byte1881D = 0; _byte16552 = 0; - _byte18AED = 0; _rulesBuffer2PrevIndx = 0; _word16EFA = 0; @@ -699,8 +698,8 @@ void LilliputEngine::displayFunction17() { displayFunction4(); } -void LilliputEngine::displayFunction18(byte *buf, int var2, int var4) { - debugC(2, kDebugEngine, "displayFunction18(buf, %d, %d)", var2, var4); +void LilliputEngine::displayString(byte *buf, int var2, int var4) { + debugC(2, kDebugEngine, "displayString(buf, %d, %d)", var2, var4); int index = var2; int tmpVar4 = (var4 >> 8) + ((var4 & 0xFF) << 8); @@ -974,13 +973,14 @@ void LilliputEngine::sub18A3E(byte param1) { ++_displayStringIndex; } -void LilliputEngine::sub18AEE(int param1) { - debugC(2, kDebugEngine, "sub18AEE(%d)", param1); +void LilliputEngine::prepareGoldAmount(int param1) { + debugC(2, kDebugEngine, "prepareGoldAmount(%d)", param1); static const int _array18AE3[6] = {10000, 1000, 100, 10, 1}; int count; int var1 = param1; + bool hideZeros = true; for (int i = 0; i < 5; i++) { count = 0; while (var1 >= 0) { @@ -988,12 +988,14 @@ void LilliputEngine::sub18AEE(int param1) { var1 -= _array18AE3[i]; } var1 += _array18AE3[i]; - byte tmpVal = var1 + 0x30; + --count; + + byte tmpVal = count + 0x30; if (i == 4) sub18A3E(tmpVal); - else if ((var1 != 0) || (_byte18AED != 1)) { - _byte18AED = 0; + else if ((count != 0) || (!hideZeros)) { + hideZeros = false; sub18A3E(tmpVal); } } diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h index d4d5dfcadf..a0c9eec33b 100644 --- a/engines/lilliput/lilliput.h +++ b/engines/lilliput/lilliput.h @@ -101,7 +101,6 @@ public: byte _byte12A09; byte _byte1881D; byte _byte16552; - byte _byte18AED; byte _buffer1[45056]; byte _buffer2[45056]; @@ -217,7 +216,7 @@ public: void displayFunction15(); void displayFunction16(); 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 sub16323(); @@ -229,7 +228,7 @@ public: int sub16799(int param1, int index); int sub16B0C(int param1, int param2); void sub18A3E(byte param1); - void sub18AEE(int param1); + void prepareGoldAmount(int param1); 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 ca7e389170..d99b8e7932 100644 --- a/engines/lilliput/script.cpp +++ b/engines/lilliput/script.cpp @@ -1778,8 +1778,8 @@ void LilliputScript::sub18BE6(byte var1, int var2, int var4) { _vm->_displayStringBuf[2] = 32; _vm->_displayStringBuf[3] = 0; - _vm->sub18AEE(var1); - _vm->displayFunction18(_vm->_displayStringBuf, var2, var4); + _vm->prepareGoldAmount(var1); + _vm->displayString(_vm->_displayStringBuf, var2, var4); } void LilliputScript::OC_displayVGAFile() { |