diff options
author | Florian Kagerer | 2009-06-19 17:03:28 +0000 |
---|---|---|
committer | Florian Kagerer | 2009-06-19 17:03:28 +0000 |
commit | ec7d86404c672f62368bdddaba1f4258960141de (patch) | |
tree | 8b5848dcbfa9a819e205288d8bd48e7a7670f36f | |
parent | 91b5d1befb4532f291e7d5f125b439790bafd1fd (diff) | |
download | scummvm-rg350-ec7d86404c672f62368bdddaba1f4258960141de.tar.gz scummvm-rg350-ec7d86404c672f62368bdddaba1f4258960141de.tar.bz2 scummvm-rg350-ec7d86404c672f62368bdddaba1f4258960141de.zip |
LOL: - implemented bezel cup opcode
- implemented font conversion for certain language specific characters in load game dialogue (only german atm)
svn-id: r41677
-rw-r--r-- | engines/kyra/gui_lol.cpp | 12 | ||||
-rw-r--r-- | engines/kyra/lol.cpp | 49 | ||||
-rw-r--r-- | engines/kyra/lol.h | 7 | ||||
-rw-r--r-- | engines/kyra/script_lol.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/staticres.cpp | 7 |
5 files changed, 81 insertions, 2 deletions
diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index fbcd4f0572..0465c5c6c6 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -2239,6 +2239,8 @@ int GUI_LoL::runMenu(Menu &menu) { if (_currentMenu == &_loadMenu || _currentMenu == &_saveMenu) { updateSaveList(true); Common::sort(_saveSlots.begin(), _saveSlots.end(), Common::Greater<int>()); + + setupSavegameNames(*_currentMenu, 4); } @@ -2359,6 +2361,16 @@ void GUI_LoL::setupSavegameNames(Menu &menu, int num) { if ((in = _vm->openSaveForReading(_vm->getSavegameFilename(_saveSlots[i + _savegameOffset]), header)) != 0) { strncpy(s, header.description.c_str(), 80); s[79] = 0; + + for (uint32 ii = 0; ii < strlen(s); ii++) { + for (int iii = 0; iii < _vm->_fontConversionTableGermanSize; iii += 2) { + if (s[ii] == _vm->_fontConversionTableGerman[iii]) { + s[ii] = _vm->_fontConversionTableGerman[iii + 1]; + break; + } + } + } + menu.item[i].itemString = s; s += (strlen(s) + 1); menu.item[i].saveSlot = _saveSlots[i + _savegameOffset]; diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 20ca169cb5..965379498c 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -2783,6 +2783,55 @@ void LoLEngine::callbackProcessMagicLightning(WSAMovie_v2 *mov, int x, int y) { delete[] tpal; } +void LoLEngine::drinkBezelCup(int numUses, int charNum) { + int cp = _screen->setCurPage(2); + snd_playSoundEffect(73, -1); + + WSAMovie_v2 *mov = new WSAMovie_v2(this); + mov->open("bezel.wsa", 0, 0); + if (!mov->opened()) + error("Bezel: Unable to load bezel.wsa"); + + int x = _activeCharsXpos[charNum] - 11; + int y = 124; + int w = mov->width(); + int h = mov->height(); + + _screen->copyRegion(x, y, 0, 0, w, h, 0, 2, Screen::CR_NO_P_CHECK); + + static const uint8 bezelAnimData[] = { 0, 26, 20, 27, 61, 55, 62, 92, 86, 93, 131, 125 }; + int frm = bezelAnimData[numUses * 3]; + int hpDiff = _characters[charNum].hitPointsMax - _characters[charNum].hitPointsCur; + uint16 step = 0; + + do { + step = (step & 0xff) + (hpDiff * 256) / (bezelAnimData[numUses * 3 + 2]); + increaseCharacterHitpoints(charNum, step / 256, true); + gui_drawCharPortraitWithStats(charNum); + + uint32 etime = _system->getMillis() + 4 * _tickLength; + + _screen->copyRegion(0, 0, x, y, w, h, 2, 2, Screen::CR_NO_P_CHECK); + mov->displayFrame(frm, 2, x, y, 0x5000, _trueLightTable1, _trueLightTable2); + _screen->copyRegion(x, y, x, y, w, h, 2, 0, Screen::CR_NO_P_CHECK); + _screen->updateScreen(); + + delayUntil(etime); + } while (++frm < bezelAnimData[numUses * 3 + 1]); + + _characters[charNum].hitPointsCur = _characters[charNum].hitPointsMax; + _screen->copyRegion(0, 0, x, y, w, h, 2, 2, Screen::CR_NO_P_CHECK); + removeCharacterEffects(&_characters[charNum], 4, 4); + gui_drawCharPortraitWithStats(charNum); + _screen->copyRegion(x, y, x, y, w, h, 2, 0, Screen::CR_NO_P_CHECK); + _screen->updateScreen(); + + mov->close(); + delete mov; + + _screen->setCurPage(cp); +} + void LoLEngine::addSpellToScroll(int spell, int charNum) { bool assigned = false; int slot = 0; diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index f2a6727289..b393ce2680 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -777,6 +777,7 @@ private: int olol_assignSpecialGuiShape(EMCState *script); int olol_findInventoryItem(EMCState *script); int olol_restoreFadePalette(EMCState *script); + int olol_drinkBezelCup(EMCState *script); int olol_changeItemTypeOrFlag(EMCState *script); int olol_placeInventoryItemInHand(EMCState *script); int olol_castSpell(EMCState *script); @@ -851,6 +852,8 @@ private: void decodeSjis(const char *src, char *dst); static const char * const _languageExt[]; + static const char _fontConversionTableGerman[]; + static const int _fontConversionTableGermanSize; // graphics void setupScreenDims(); @@ -905,7 +908,7 @@ private: void setCharacterMagicOrHitPoints(int charNum, int type, int points, int mode); void increaseExperience(int charNum, int skill, uint32 points); - void increaseCharacterHitpoints(int charNum, int points, bool unk); + void increaseCharacterHitpoints(int charNum, int points, bool ignoreDeath); LoLCharacter *_characters; uint16 _activeCharsXpos[3]; @@ -1348,6 +1351,8 @@ private: void callbackProcessMagicSwarm(WSAMovie_v2 *mov, int x, int y); void callbackProcessMagicLightning(WSAMovie_v2 *mov, int x, int y); + void drinkBezelCup(int a, int charNum); + void addSpellToScroll(int spell, int charNum); void transferSpellToScollAnimation(int charNum, int spell, int slot); diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index 474a0eec86..52792fb85c 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -1994,6 +1994,12 @@ int LoLEngine::olol_findInventoryItem(EMCState *script) { return -1; } +int LoLEngine::olol_drinkBezelCup(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_drinkBezelCup(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); + drinkBezelCup(3 - stackPos(0), stackPos(1)); + return 1; +} + int LoLEngine::olol_restoreFadePalette(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_restoreFadePalette(%p)", (const void *)script); memcpy(_screen->_currentPalette, _screen->getPalette(1), 384); @@ -2852,7 +2858,7 @@ void LoLEngine::setupOpcodeTable() { // 0xA8 OpcodeUnImpl(); OpcodeUnImpl(); - OpcodeUnImpl(); + Opcode(olol_drinkBezelCup); Opcode(olol_changeItemTypeOrFlag); // 0xAC diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 382d167d83..7b518f727f 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -3296,6 +3296,13 @@ const int LoLEngine::_outroMonsterScaleTableY[] = { 0x100, 0x100, 0x100, 0x100, 0x100, 0x100, 0x100, 0x100 }; +const char LoLEngine::_fontConversionTableGerman[] = { + 'Ä', 0x8e, 'ä', 0x84, 'Ö', 0x99, 'ö', + 0x94, 'Ü', 0x9a, 'ü', 0x81, 'ß', 0xe1 +}; + +const int LoLEngine::_fontConversionTableGermanSize = ARRAYSIZE(LoLEngine::_fontConversionTableGerman); + #endif // ENABLE_LOL } // End of namespace Kyra |