From a43b0bc2dc0bbad04855adf44b948e88a7a4551e Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Mon, 16 Feb 2009 17:17:15 +0000 Subject: LOL: - more work on the user interface - fixed non interactive demo svn-id: r38374 --- engines/kyra/gui_lol.cpp | 175 +++++++++++++++++++++++++++++++++++------ engines/kyra/gui_lol.h | 2 - engines/kyra/kyra_v1.cpp | 7 +- engines/kyra/lol.cpp | 97 ++++++++++++++--------- engines/kyra/lol.h | 15 ++-- engines/kyra/scene_lol.cpp | 2 +- engines/kyra/script_tim.cpp | 25 +++--- engines/kyra/script_tim.h | 2 +- engines/kyra/sequences_lol.cpp | 3 + engines/kyra/staticres.cpp | 13 +-- 10 files changed, 255 insertions(+), 86 deletions(-) (limited to 'engines') diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index edbed6cd51..cdef2bcd30 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -500,33 +500,111 @@ void LoLEngine::gui_toggleFightButtons(bool disable) { void LoLEngine::gui_updateInput() { int inputFlag = checkInput(_activeButtons, true); - removeInputTop(); + if (_preserveEvents) + _preserveEvents = false; + else + removeInputTop(); if (inputFlag && _unkCharNum != -1 && !(inputFlag & 0x8800)) { gui_enableDefaultPlayfieldButtons(); _characters[_unkCharNum].flags &= 0xffef; gui_drawCharPortraitWithStats(_unkCharNum); - //processMouseButtonEvent(inputFlag); + gui_triggerEvent(inputFlag); _unkCharNum = -1; inputFlag = 0; } - if (inputFlag == 1) { - if (_weaponsDisabled || _availableSpells[1] == -1) - return; + switch (inputFlag) { + case 43: + case 61: + // space or enter + snd_stopSpeech(true); + break; + case 55: + if (_weaponsDisabled || _availableSpells[1] == -1) + return; - gui_highlightSelectedSpell(0); - if (_availableSpells[++_selectedSpell] == -1) - _selectedSpell = 0; - gui_highlightSelectedSpell(1); + gui_highlightSelectedSpell(0); + if (_availableSpells[++_selectedSpell] == -1) + _selectedSpell = 0; + gui_highlightSelectedSpell(1); - gui_drawAllCharPortraitsWithStats(); - } else if (inputFlag == 3) { - // TODO - //processPortraitGuiText + gui_drawAllCharPortraitsWithStats(); + break; + case 0x71a: + break; + default: + break; + } +} + +void LoLEngine::gui_triggerEvent(int eventType) { + Common::Event evt; + memset(&evt, 0, sizeof(Common::Event)); + evt.mouse.x = _mouseX; + evt.mouse.y = _mouseY; + + if (eventType == 65) { + evt.type = Common::EVENT_LBUTTONDOWN; + } else if (eventType == 66) { + evt.type = Common::EVENT_RBUTTONDOWN; } else { - snd_dialogueSpeechUpdate(1); + evt.type = Common::EVENT_KEYDOWN; + + switch (eventType) { + case 96: + evt.kbd.keycode = Common::KEYCODE_UP; + break; + case 102: + evt.kbd.keycode = Common::KEYCODE_RIGHT; + break; + case 97: + evt.kbd.keycode = Common::KEYCODE_DOWN; + break; + case 92: + evt.kbd.keycode = Common::KEYCODE_LEFT; + break; + case 91: + evt.kbd.keycode = Common::KEYCODE_HOME; + break; + case 101: + evt.kbd.keycode = Common::KEYCODE_PAGEUP; + break; + case 112: + evt.kbd.keycode = Common::KEYCODE_F1; + break; + case 113: + evt.kbd.keycode = Common::KEYCODE_F2; + break; + case 114: + evt.kbd.keycode = Common::KEYCODE_F3; + break; + case 25: + evt.kbd.keycode = Common::KEYCODE_o; + break; + case 20: + evt.kbd.keycode = Common::KEYCODE_r; + break; + case 110: + evt.kbd.keycode = Common::KEYCODE_ESCAPE; + break; + case 43: + evt.kbd.keycode = Common::KEYCODE_SPACE; + break; + case 61: + evt.kbd.keycode = Common::KEYCODE_RETURN; + break; + case 55: + evt.kbd.keycode = Common::KEYCODE_SLASH; + break; + default: + break; + } } + + removeInputTop(); + _eventList.push_back(Event(evt, true)); + _preserveEvents = true; } void LoLEngine::gui_enableDefaultPlayfieldButtons() { @@ -566,6 +644,7 @@ void LoLEngine::gui_resetButtonList() { _activeButtons = n; } + gui_notifyButtonListChanged(); _activeButtons = 0; } @@ -584,6 +663,12 @@ void LoLEngine::gui_initMagicScrollButtons() { } +void LoLEngine::gui_initMagicSubmenu(int charNum) { + gui_resetButtonList(); + _subMenuIndex = charNum; + gui_initButtonsFromList(_buttonList7); +} + void LoLEngine::gui_initButton(int index, int x) { Button *b = new Button; memset (b, 0, sizeof(Button)); @@ -620,7 +705,14 @@ void LoLEngine::gui_initButton(int index, int x) { b->data2Val2 = _buttonData[index].index; - if (index == 64) { + if (index == 15) { + // magic sub menu + b->x = _activeCharsXpos[_subMenuIndex] + 44; + b->data2Val2 = _subMenuIndex; + b->y = _buttonData[index].y; + b->width = _buttonData[index].w - 1; + b->height = _buttonData[index].h - 1; + } else if (index == 64) { // scene window button b->x = _sceneWindowButton.x; b->y = _sceneWindowButton.y; @@ -722,26 +814,65 @@ int LoLEngine::clickedAttackButton(Button *button) { } int LoLEngine::clickedMagicButton(Button *button) { - if (_characters[button->data2Val2].flags & 0x314C) + int c = button->data2Val2; + + if (_characters[c].flags & 0x314C) return 1; - if (notEnoughMagic(button->data2Val2, _availableSpells[_selectedSpell], 0)) + if (notEnoughMagic(c, _availableSpells[_selectedSpell], 0)) return 1; - _characters[button->data2Val2].flags ^= 0x10; + _characters[c].flags ^= 0x10; - gui_drawCharPortraitWithStats(button->data2Val2); - spellsub2(button->data2Val2); - _unkCharNum = button->data2Val2; + gui_drawCharPortraitWithStats(c); + gui_initMagicSubmenu(c); + _unkCharNum = c; return 1; } -int LoLEngine::clickedUnk9(Button *button) { +int LoLEngine::clickedMagicSubmenu(Button *button) { + int spellLevel = (_mouseY - 144) >> 3; + int c = button->data2Val2; + + gui_enableDefaultPlayfieldButtons(); + + if (notEnoughMagic(c, _availableSpells[_selectedSpell], spellLevel)) { + _characters[c].flags &= 0xffef; + gui_drawCharPortraitWithStats(c); + } else { + _characters[c].flags |= 4; + _characters[c].flags &= 0xffef; + /// + // TODO + /// + /*if (processSpellcast(c, _availableSpells[_selectedSpell], spellLevel)) { + initCharacterUnkSub(c, 1, 8, 1); + sub_718F(c, 2, spellLevel * spellLevel); + } else {*/ + _characters[c].flags &= 0xfffb; + gui_drawCharPortraitWithStats(c); + //} + } + + _unkCharNum = -1; return 1; } int LoLEngine::clickedScreen(Button *button) { + _characters[_unkCharNum].flags &= 0xffef; + gui_drawCharPortraitWithStats(_unkCharNum); + _unkCharNum = -1; + + if (!(button->flags2 & 0x80)) { + if (button->flags2 & 0x100) + gui_triggerEvent(65); + else + gui_triggerEvent(66); + } + + gui_enableDefaultPlayfieldButtons(); + return 1; } diff --git a/engines/kyra/gui_lol.h b/engines/kyra/gui_lol.h index e325be5678..29dc1da406 100644 --- a/engines/kyra/gui_lol.h +++ b/engines/kyra/gui_lol.h @@ -38,8 +38,6 @@ class GUI_LoL : public GUI { public: GUI_LoL(LoLEngine *vm); - void initStaticData(); - // button specific void processButton(Button *button); int processButtonList(Button *buttonList, uint16 inputFlags, int8 mouseWheel); diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 22aa30ed34..00f96d7c97 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -260,10 +260,10 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop) { } else { switch(event.kbd.keycode) { case Common::KEYCODE_SPACE: - keys = 120; + keys = 43; break; case Common::KEYCODE_RETURN: - keys = 121; + keys = 61; break; case Common::KEYCODE_UP: case Common::KEYCODE_KP8: @@ -304,6 +304,9 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop) { case Common::KEYCODE_r: keys = 20; break; + case Common::KEYCODE_SLASH: + keys = 55; + break; case Common::KEYCODE_ESCAPE: keys = 110; break; diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index ae435f4fb7..c3f41629cb 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -98,7 +98,7 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraEngine_v1(sy _spellProperties = 0; _updateFlags = 0; _selectedSpell = 0; - _updateCharNum = _updateCharV1 = _updateCharV2 = _updateCharV3 = _textColourFlag = _hideInventory = 0; + _updateCharNum = _updatePortraitSpeechAnim = _updateCharV2 = _updateCharV3 = _textColourFlag = _hideInventory = 0; _fadeText = false; _palUpdateTimer = _updatePortraitNext = 0; _lampStatusTimer = 0xffffffff; @@ -183,6 +183,7 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraEngine_v1(sy _buttonData = 0; _activeButtons = 0; + _preserveEvents = false; _buttonList1 = _buttonList2 = _buttonList3 = _buttonList4 = _buttonList5 = _buttonList6 = _buttonList7 = _buttonList8 = 0; } @@ -323,10 +324,6 @@ Common::Error LoLEngine::init() { _gui = new GUI_LoL(this); assert(_gui); - _gui->initStaticData(); - - _tim = new TIMInterpreter_LoL(this, _screen, _system); - assert(_tim); _txt = new TextDisplayer_LoL(this, _screen); @@ -472,7 +469,7 @@ Common::Error LoLEngine::go() { if (processSelection == 0) { _sound->loadSoundFile("LOREINTR"); _sound->playTrack(6); - /*int character = */chooseCharacter(); + chooseCharacter(); _sound->playTrack(1); _screen->fadeToBlack(); } @@ -480,6 +477,7 @@ Common::Error LoLEngine::go() { setupPrologueData(false); _tim = new TIMInterpreter_LoL(this, _screen, _system); + assert(_tim); if (!shouldQuit() && (processSelection == 0 || processSelection == 3)) startup(); @@ -488,7 +486,6 @@ Common::Error LoLEngine::go() { startupNew(); if (!shouldQuit() && (processSelection == 0 || processSelection == 3)) { - //_dlgAnimCallback = &TextDisplayer_LoL::portraitAnimation2; _screen->_fadeFlag = 3; _sceneUpdateRequired = true; setUnkFlags(1); @@ -787,7 +784,7 @@ void LoLEngine::update() { updateWsaAnimations(); if (_updateCharNum != -1 && _system->getMillis() > _updatePortraitNext) - updatePortraitWithStats(); + updatePortraitSpeechAnim(); if (_screen->_drawGuiFlag & 0x800 || !(_updateFlags & 4)) updateLampStatus(); @@ -915,7 +912,7 @@ void LoLEngine::loadCharFaceShapes(int charNum, int id) { _characterFaceShapes[i][charNum] = _screen->makeShapeCopy(p, i); } -void LoLEngine::updatePortraitWithStats() { +void LoLEngine::updatePortraitSpeechAnim() { int x = 0; int y = 0; bool redraw = false; @@ -951,19 +948,21 @@ void LoLEngine::updatePortraitWithStats() { if (_speechFlag) { if (snd_characterSpeaking() == 2) - _updateCharV1 = 2; + _updatePortraitSpeechAnim = 2; else - _updateCharV1 = 1; + _updatePortraitSpeechAnim = 1; } - if (--_updateCharV1) { + _updatePortraitSpeechAnim--; + + if (_updatePortraitSpeechAnim) { setCharFaceFrame(_updateCharNum, f); if (redraw) gui_drawCharPortraitWithStats(_updateCharNum); else gui_drawCharFaceShape(_updateCharNum, x, y, 0); _updatePortraitNext = _system->getMillis() + 10 * _tickLength; - } else if (_updateCharV1 == 0 && _updateCharV3 != 0) { + } else if (_updateCharV3 != 0) { faceFrameRefresh(_updateCharNum); if (redraw) { gui_drawCharPortraitWithStats(_updateCharNum); @@ -979,9 +978,9 @@ void LoLEngine::updatePortraits() { if (_updateCharNum == -1) return; - _updateCharV1 = _updateCharV3 = 1; - updatePortraitWithStats(); - _updateCharV1 = 1; + _updatePortraitSpeechAnim = _updateCharV3 = 1; + updatePortraitSpeechAnim(); + _updatePortraitSpeechAnim = 1; _updateCharNum = -1; if (!_updateCharV2) @@ -1171,7 +1170,7 @@ void LoLEngine::loadTalkFile(int index) { bool LoLEngine::snd_playCharacterSpeech(int id, int8 speaker, int) { if (!_speechFlag) - return true; + return false; if (speaker < 65) { if (_characters[speaker].flags & 1) @@ -1223,21 +1222,19 @@ bool LoLEngine::snd_playCharacterSpeech(int id, int8 speaker, int) { if (playList.empty()) return false; - do { + while (_sound->voiceIsPlaying(_activeVoiceFile)) { update(); - if (snd_characterSpeaking() == 0) - break; - } while (_sound->voiceIsPlaying()); + delay(_tickLength); + }; strcpy(_activeVoiceFile, *playList.begin()); - _sound->voicePlayFromList(playList); for (Common::List::iterator i = playList.begin(); i != playList.end(); i++) delete []*i; playList.clear(); - _tim->_dialogueComplete = 0; + _tim->_abortFlag = 0; return true; } @@ -1251,16 +1248,15 @@ int LoLEngine::snd_characterSpeaking() { return 1; } -int LoLEngine::snd_dialogueSpeechUpdate(int finish) { +void LoLEngine::snd_stopSpeech(bool setFlag) { if (!_sound->voiceIsPlaying(_activeVoiceFile)) - return -1; + return; //_dlgTimer = 0; + _sound->voiceStop(_activeVoiceFile); - if (finish) - _tim->_dialogueComplete = 1; - - return 1; + if (setFlag) + _tim->_abortFlag = 1; } void LoLEngine::snd_playSoundEffect(int track, int volume) { @@ -1355,20 +1351,47 @@ void LoLEngine::calcCoordinates(uint16 & x, uint16 & y, int block, uint16 xOffs, y = ((block & 0xffe0) << 3) | yOffs; } -bool LoLEngine::notEnoughMagic(int charNum, int spellNum, int spellLevel) { - if (_spellProperties[spellNum].mpRequired[spellLevel] > _characters[charNum].magicPointsCur) { - - return true; +bool LoLEngine::characterSays(int track, int charId, bool redraw) { + if (charId == 1) { + charId = _selectedCharacter; } else { - + if (charId < 0) { + for (int i = 0; i < 4; i++) { + if (charId != _characters[i].id || !(_characters[i].flags & 1)) + continue; + charId = i; + break; + } + } else { + charId = 0; + } + } + + bool r = snd_playCharacterSpeech(track, charId, 0); + + if (r && redraw) { + updatePortraits(); + _updateCharNum = charId; + _updateCharV2 = 0; + _updateCharV3 = 1; + _fadeText = false; + updatePortraitSpeechAnim(); } - return false; + return r ? textEnabled() : 1; } -void LoLEngine::spellsub2(int charNum) { - +bool LoLEngine::notEnoughMagic(int charNum, int spellNum, int spellLevel) { + if (_spellProperties[spellNum].mpRequired[spellLevel] > _characters[charNum].magicPointsCur) { + if (characterSays(0x4043, _characters[charNum].id, true)) + _txt->printMessage(6, getLangString(0x4043), _characters[charNum].name); + return true; + } else if (_spellProperties[spellNum + 1].unkArr[spellLevel] >= _characters[charNum].hitPointsCur) { + _txt->printMessage(2, getLangString(0x4179), _characters[charNum].name); + return true; + } + return false; } } // end of namespace Kyra diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index 39d6e04d39..5b1dfa0152 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -322,7 +322,7 @@ private: void snd_playVoiceFile(int track) {} bool snd_playCharacterSpeech(int id, int8 speaker, int); int snd_characterSpeaking(); - int snd_dialogueSpeechUpdate(int finish); + void snd_stopSpeech(bool setFlag); void snd_playSoundEffect(int track, int volume); void snd_loadSoundFile(int track); int snd_playTrack(int track); @@ -387,6 +387,7 @@ private: int _compassDefsSize; void gui_updateInput(); + void gui_triggerEvent(int eventType); void gui_enableDefaultPlayfieldButtons(); void gui_enableSequenceButtons(int x, int y, int w, int h, int enableFlags); @@ -394,11 +395,14 @@ private: void gui_initButtonsFromList(const int16 *list); void gui_initCharacterControlButtons(int index, int xOffs); void gui_initMagicScrollButtons(); + void gui_initMagicSubmenu(int charNum); void gui_initButton(int index, int x = -1); + void gui_notifyButtonListChanged() { _gui->_buttonListChanged = true; } void assignButtonCallback(Button *button, int index); Button *_activeButtons; ButtonDef _sceneWindowButton; + bool _preserveEvents; int clickedUpArrow(Button *button); int clickedDownArrow(Button *button); @@ -408,7 +412,7 @@ private: int clickedTurnRightArrow(Button *button); int clickedAttackButton(Button *button); int clickedMagicButton(Button *button); - int clickedUnk9(Button *button); + int clickedMagicSubmenu(Button *button); int clickedScreen(Button *button); int clickedPortraitLeft(Button *button); int clickedLiveMagicBarsLeft(Button *button); @@ -573,7 +577,7 @@ private: void loadCharFaceShapes(int charNum, int id); void calcCharPortraitXpos(); - void updatePortraitWithStats(); + void updatePortraitSpeechAnim(); void updatePortraits(); void initTextFading(int textType, int clearField); void charCallback4(int redraw); @@ -584,7 +588,7 @@ private: uint16 _activeCharsXpos[3]; int _updateFlags; int _updateCharNum; - int _updateCharV1; + int _updatePortraitSpeechAnim; int _updateCharV2; int _updateCharV3; int _textColourFlag; @@ -846,15 +850,16 @@ private: // misc void runLoopSub4(int a); void calcCoordinates(uint16 & x, uint16 & y, int block, uint16 xOffs, uint16 yOffs); + bool characterSays(int track, int charId, bool redraw); // spells bool notEnoughMagic(int charNum, int spellNum, int spellLevel); - void spellsub2(int charNum); int8 _availableSpells[7]; int _selectedSpell; const SpellProperty *_spellProperties; int _spellPropertiesSize; + int _subMenuIndex; // unneeded void setWalkspeed(uint8) {} diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index 529abe33a7..48c50738d6 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -938,7 +938,7 @@ void LoLEngine::notifyBlockNotPassable(int scrollFlag) { if (scrollFlag) movePartySmoothScrollBlocked(2); - snd_dialogueSpeechUpdate(1); + snd_stopSpeech(true); _txt->printMessage(0x8002, getLangString(0x403f)); snd_playSoundEffect(19, 255); } diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp index a9277150cf..94aab24bb0 100644 --- a/engines/kyra/script_tim.cpp +++ b/engines/kyra/script_tim.cpp @@ -95,7 +95,7 @@ TIMInterpreter::TIMInterpreter(KyraEngine_v1 *engine, Screen_v2 *screen_v2, OSys _drawPage2 = 8; _palDelayInc = _palDiff = _palDelayAcc = 0; - _dialogueComplete = 0; + _abortFlag = 0; } TIMInterpreter::~TIMInterpreter() { @@ -900,28 +900,32 @@ uint16 TIMInterpreter_LoL::processDialogue() { } if (_dialogueNumButtons == 0) { - int e = _vm->checkInput(0, false) & 0xCF; + int e = _vm->checkInput(0, false) & 0xFF; _vm->removeInputTop(); + _vm->gui_notifyButtonListChanged(); - if (e == 200) { - _vm->snd_dialogueSpeechUpdate(1); + if (e == 43 || e == 61) { + _vm->snd_stopSpeech(true); //_dlgTimer = 0; } if (_vm->snd_characterSpeaking() != 2) { //if (_dlgTimer < _system->getMillis()) { res = 1; - if (!_vm->shouldQuit()) + if (!_vm->shouldQuit()) { _vm->removeInputTop(); + _vm->gui_notifyButtonListChanged(); + } //} } } else { - int e = _vm->checkInput(0, false) & 0xCF; + int e = _vm->checkInput(0, false) & 0xFF; _vm->removeInputTop(); + _vm->gui_notifyButtonListChanged(); switch (e) { - case 120: - case 121: - _vm->snd_dialogueSpeechUpdate(1); + case 43: + case 61: + _vm->snd_stopSpeech(true); //_dlgTimer = 0; res = _dialogueHighlightedButton + 1; break; @@ -1057,7 +1061,7 @@ int TIMInterpreter_LoL::cmd_processDialogue(const uint16 *param) { if (!res ||!_currentTim->procParam) return 0; - _vm->snd_dialogueSpeechUpdate(0); + _vm->snd_stopSpeech(false); _currentTim->func[_currentTim->procFunc].loopIp = 0; _currentTim->dlgFunc = _currentTim->procFunc; @@ -1089,6 +1093,7 @@ int TIMInterpreter_LoL::cmd_dialogueBox(const uint16 *param) { } drawDialogueBox(cnt, tmpStr[0], tmpStr[1], tmpStr[2]); + _vm->gui_notifyButtonListChanged(); return -3; } diff --git a/engines/kyra/script_tim.h b/engines/kyra/script_tim.h index c595b8c50a..7f9d57978c 100644 --- a/engines/kyra/script_tim.h +++ b/engines/kyra/script_tim.h @@ -118,7 +118,7 @@ public: int _drawPage2; int _palDelayInc, _palDiff, _palDelayAcc; - int _dialogueComplete; + int _abortFlag; protected: virtual KyraEngine_v1 *vm(); diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp index 5ef6ae5f41..b36364d960 100644 --- a/engines/kyra/sequences_lol.cpp +++ b/engines/kyra/sequences_lol.cpp @@ -118,6 +118,7 @@ void LoLEngine::showIntro() { debugC(9, kDebugLevelMain, "LoLEngine::showIntro()"); _tim = new TIMInterpreter(this, _screen, _system); + assert(_tim); uint8 *pal = _screen->getPalette(0); memset(pal, 0, 768); @@ -182,6 +183,8 @@ int LoLEngine::chooseCharacter() { debugC(9, kDebugLevelMain, "LoLEngine::chooseCharacter()"); _tim = new TIMInterpreter(this, _screen, _system); + assert(_tim); + _tim->setLangData("LOLINTRO.DIP"); _screen->loadFont(Screen::FID_9_FNT, "FONT9P.FNT"); diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 68ffa15ad4..e5b67c572a 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -376,7 +376,6 @@ bool StaticResource::init() { { lolMusicTrackMap, kRawData, "MUSIC.MAP" }, { lolIngameGMSfxIndex, kRawData, "SFX_GM.MAP" }, { lolIngameMT32SfxIndex, kRawData, "SFX_MT32.MAP" }, - //{ lolIngameADLSfxIndex, kRawData, "SFX_ADL.MAP" }, { lolSpellProperties, lolSpellData, "SPELLS.DEF" }, { lolGameShapeMap, kRawData, "GAMESHP.MAP" }, { lolLevelShpList, kStringList, "SHPFILES.TXT" }, @@ -1057,6 +1056,9 @@ bool StaticResource::loadCompassData(const char *filename, void *&ptr, int &size bool StaticResource::loadRawDataBe16(const char *filename, void *&ptr, int &size) { Common::SeekableReadStream *file = getFile(filename); + if (!file) + return false; + size = file->size() >> 1; uint16 *r = new uint16[size]; @@ -1072,6 +1074,9 @@ bool StaticResource::loadRawDataBe16(const char *filename, void *&ptr, int &size bool StaticResource::loadButtonDefs(const char *filename, void *&ptr, int &size) { Common::SeekableReadStream *file = getFile(filename); + if (!file) + return false; + size = file->size() / 18; ButtonDef *r = new ButtonDef[size]; @@ -1756,7 +1761,7 @@ void LoLEngine::assignButtonCallback(Button *button, int index) { cb(clickedMagicButton), cb(clickedMagicButton), cb(clickedMagicButton), - cb(clickedUnk9), + cb(clickedMagicSubmenu), cb(clickedScreen), cb(clickedPortraitLeft), cb(clickedPortraitLeft), @@ -2795,10 +2800,6 @@ const int8 KyraEngine_MR::_albumWSAY[] = { // lands of lore static res -void GUI_LoL::initStaticData() { - -} - const ScreenDim Screen_LoL::_screenDimTable[] = { { 0x00, 0x00, 0x28, 0xC8, 0xC7, 0xCF, 0x00, 0x00 }, // Taken from Intro { 0x08, 0x48, 0x18, 0x38, 0xFE, 0x01, 0x00, 0x00 }, -- cgit v1.2.3