diff options
author | Johannes Schickel | 2008-03-09 15:24:47 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-03-09 15:24:47 +0000 |
commit | d2bbfbcc35a1ab8cc3be52dba690a07cbabdf632 (patch) | |
tree | d81928a37ca17b3a240a8fbb2d54c4572353947b | |
parent | 05f68b17d4a60ece9e2eed14746eab5b29a3e688 (diff) | |
download | scummvm-rg350-d2bbfbcc35a1ab8cc3be52dba690a07cbabdf632.tar.gz scummvm-rg350-d2bbfbcc35a1ab8cc3be52dba690a07cbabdf632.tar.bz2 scummvm-rg350-d2bbfbcc35a1ab8cc3be52dba690a07cbabdf632.zip |
- fixed little glitch when putting items in cauldron
- implemented listing of items in cauldron
svn-id: r31088
-rw-r--r-- | engines/kyra/gui_v2.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 46 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.h | 1 |
3 files changed, 49 insertions, 2 deletions
diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index c05987e482..1f997564b7 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -1018,7 +1018,7 @@ int KyraEngine_v2::cauldronButton(Button *button) { return 0; } - if (!_screen->isMouseVisible() || _handItemSet < 0) + if (!_screen->isMouseVisible() || _handItemSet < -1) return 0; if (queryGameFlag(0xE4)) { @@ -1036,7 +1036,7 @@ int KyraEngine_v2::cauldronButton(Button *button) { } if (_itemInHand == -1) { - //sub_33AAE(); + listItemsInCauldron(); return 0; } diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 83bc93c2c4..e9aa61de11 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -1848,6 +1848,7 @@ void KyraEngine_v2::cauldronItemAnim(int item) { mouseY -= 2; uint32 waitEnd = _system->getMillis() + _tickLength; _system->warpMouse(mouseX, mouseY); + _system->updateScreen(); delayUntil(waitEnd); } @@ -1858,6 +1859,7 @@ void KyraEngine_v2::cauldronItemAnim(int item) { mouseX -= 2; uint32 waitEnd = _system->getMillis() + _tickLength; _system->warpMouse(mouseX, mouseY); + _system->updateScreen(); delayUntil(waitEnd); } @@ -1997,6 +1999,50 @@ bool KyraEngine_v2::addToCauldronStateTable(int data, int idx) { return false; } +void KyraEngine_v2::listItemsInCauldron() { + int itemsInCauldron = 0; + for (int i = 0; i < 25; ++i) { + if (_cauldronTable[i] != -1) + ++itemsInCauldron; + else + break; + } + + if (!itemsInCauldron) { + if (!_cauldronState) + objectChat(getTableString(0xF4, _cCodeBuffer, 1), 0, 0x83, 0xF4); + else + objectChat(getTableString(0xF3, _cCodeBuffer, 1), 0, 0x83, 0xF3); + } else { + objectChat(getTableString(0xF7, _cCodeBuffer, 1), 0, 0x83, 0xF7); + + char buffer[80]; + for (int i = 0; i < itemsInCauldron-1; ++i) { + char *str = buffer; + strcpy(str, getTableString(_cauldronTable[i]+54, _cCodeBuffer, 1)); + if (_lang == 1) { + if (*str == 37) + str += 2; + } + strcpy((char*)_unkBuf500Bytes, "..."); + strcat((char*)_unkBuf500Bytes, str); + strcat((char*)_unkBuf500Bytes, "..."); + objectChat((const char*)_unkBuf500Bytes, 0, 0x83, _cauldronTable[i]+54); + } + + char *str = buffer; + strcpy(str, getTableString(_cauldronTable[itemsInCauldron-1]+54, _cCodeBuffer, 1)); + if (_lang == 1) { + if (*str == 37) + str += 2; + } + strcpy((char*)_unkBuf500Bytes, "..."); + strcat((char*)_unkBuf500Bytes, str); + strcat((char*)_unkBuf500Bytes, "."); + objectChat((const char*)_unkBuf500Bytes, 0, 0x83, _cauldronTable[itemsInCauldron-1]+54); + } +} + #pragma mark - void KyraEngine_v2::registerDefaultSettings() { diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index ac0604ac31..6db213c1b5 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -665,6 +665,7 @@ protected: void cauldronItemAnim(int item); void cauldronRndPaletteFade(); bool updateCauldron(); + void listItemsInCauldron(); // localization void loadCCodeBuffer(const char *file); |