diff options
author | Alyssa Milburn | 2012-08-28 15:39:00 +0200 |
---|---|---|
committer | Alyssa Milburn | 2012-08-28 15:54:12 +0200 |
commit | 31801137b5c6908edd76f357b3f29b07e9e3be84 (patch) | |
tree | 33e973717545ae27da6ba4996d0d8fe1bcd437b3 /engines/kyra | |
parent | 35fd91793b34b72624a89f2a76f45bc8e59020d2 (diff) | |
parent | 6ab8db638e4a1d547ee67db067b5d6c3d6c940a4 (diff) | |
download | scummvm-rg350-31801137b5c6908edd76f357b3f29b07e9e3be84.tar.gz scummvm-rg350-31801137b5c6908edd76f357b3f29b07e9e3be84.tar.bz2 scummvm-rg350-31801137b5c6908edd76f357b3f29b07e9e3be84.zip |
Merge remote-tracking branch 'origin/master' into tony
Conflicts:
common/coroutines.cpp
common/coroutines.h
devtools/create_project/msbuild.cpp
devtools/create_project/visualstudio.cpp
Diffstat (limited to 'engines/kyra')
40 files changed, 123 insertions, 289 deletions
diff --git a/engines/kyra/animator_hof.cpp b/engines/kyra/animator_hof.cpp index 5a2378f4d0..59112504d6 100644 --- a/engines/kyra/animator_hof.cpp +++ b/engines/kyra/animator_hof.cpp @@ -104,9 +104,7 @@ void KyraEngine_HoF::refreshAnimObjects(int force) { if (height + y > 143) height -= height + y - 144; - _screen->hideMouse(); _screen->copyRegion(x, y, x, y, width, height, 2, 0, Screen::CR_NO_P_CHECK); - _screen->showMouse(); curObject->needRefresh = false; } diff --git a/engines/kyra/animator_mr.cpp b/engines/kyra/animator_mr.cpp index 29fa3aba80..83e774e2fc 100644 --- a/engines/kyra/animator_mr.cpp +++ b/engines/kyra/animator_mr.cpp @@ -175,9 +175,7 @@ void KyraEngine_MR::refreshAnimObjects(int force) { height -= height + y - (maxY + 1); if (height > 0) { - _screen->hideMouse(); _screen->copyRegion(x, y, x, y, width, height, 2, 0, Screen::CR_NO_P_CHECK); - _screen->showMouse(); } curObject->needRefresh = false; @@ -209,9 +207,7 @@ void KyraEngine_MR::updateItemAnimations() { nextFrame = true; _screen->drawShape(2, getShapePtr(422 + i), 9, 0, 0, 0); _screen->drawShape(2, getShapePtr(shpIdx), 9, 0, 0, 0); - _screen->hideMouse(); _screen->copyRegion(9, 0, _inventoryX[i], _inventoryY[i], 24, 20, 2, 0, Screen::CR_NO_P_CHECK); - _screen->showMouse(); } } } diff --git a/engines/kyra/detection_tables.h b/engines/kyra/detection_tables.h index 884fca659b..e2162f20e2 100644 --- a/engines/kyra/detection_tables.h +++ b/engines/kyra/detection_tables.h @@ -159,7 +159,7 @@ const KYRAGameDescription adGameDescs[] = { }, KYRA1_FLOPPY_FLAGS }, - { + { // russian fan translation { "kyra1", "Extracted", @@ -1329,6 +1329,22 @@ const KYRAGameDescription adGameDescs[] = { LOL_FLOPPY_CMP_FLAGS }, + { // French floppy version 1.20, bug #3552534 "KYRA: LOL Floppy FR version unknown" + { + "lol", + 0, + { + { "WESTWOOD.1", 0, "43857e24d1fc6731f3b13d9ed6db8c3a", -1 }, + { 0, 0, 0, 0 } + }, + Common::FR_FRA, + Common::kPlatformPC, + ADGF_NO_FLAGS, + GUIO8(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GAMEOPTION_LOL_SCROLLING, GAMEOPTION_LOL_CURSORS) + }, + LOL_FLOPPY_CMP_FLAGS + }, + { { "lol", @@ -1397,6 +1413,23 @@ const KYRAGameDescription adGameDescs[] = { LOL_FLOPPY_FLAGS }, + { // French floppy version 1.23, bug #3552534 "KYRA: LOL Floppy FR version unknown" + { + "lol", + "Extracted", + { + { "GENERAL.PAK", 0, "f4fd14f244bd7c7fa08d026fafe44cc5", -1 }, + { "CHAPTER7.PAK", 0, "733e33c8444c93843dac3b683c283eaa", -1 }, + { 0, 0, 0, 0 } + }, + Common::FR_FRA, + Common::kPlatformPC, + ADGF_NO_FLAGS, + GUIO8(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GAMEOPTION_LOL_SCROLLING, GAMEOPTION_LOL_CURSORS) + }, + LOL_FLOPPY_FLAGS + }, + // Russian fan translation { { diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp index a63f123258..fadb1066e0 100644 --- a/engines/kyra/eobcommon.cpp +++ b/engines/kyra/eobcommon.cpp @@ -770,7 +770,7 @@ void EoBCoreEngine::releaseItemsAndDecorationsShapes() { if (_spellShapes) { for (int i = 0; i < 4; i++) { if (_spellShapes[i]) - delete [] _spellShapes[i]; + delete[] _spellShapes[i]; } delete[] _spellShapes; } @@ -820,7 +820,7 @@ void EoBCoreEngine::releaseItemsAndDecorationsShapes() { if (_firebeamShapes[i]) delete[] _firebeamShapes[i]; } - delete []_firebeamShapes; + delete[] _firebeamShapes; } delete[] _redSplatShape; diff --git a/engines/kyra/eobcommon.h b/engines/kyra/eobcommon.h index 050fe2b794..f60e755dd7 100644 --- a/engines/kyra/eobcommon.h +++ b/engines/kyra/eobcommon.h @@ -263,7 +263,7 @@ protected: // Main Menu, Intro, Finale virtual int mainMenu() = 0; - virtual void seq_xdeath() {}; + virtual void seq_xdeath() {} virtual void seq_playFinale() = 0; bool _playFinale; @@ -921,8 +921,8 @@ protected: void usePotion(int charIndex, int weaponSlot); void useWand(int charIndex, int weaponSlot); - virtual void turnUndeadAuto() {}; - virtual void turnUndeadAutoHit() {}; + virtual void turnUndeadAuto() {} + virtual void turnUndeadAutoHit() {} void castSpell(int spell, int weaponSlot); void removeCharacterEffect(int spell, int charIndex, int showWarning); diff --git a/engines/kyra/gui_hof.cpp b/engines/kyra/gui_hof.cpp index c1bfee066f..36fbb0b40a 100644 --- a/engines/kyra/gui_hof.cpp +++ b/engines/kyra/gui_hof.cpp @@ -121,14 +121,12 @@ int KyraEngine_HoF::buttonInventory(Button *button) { if (_itemInHand == kItemNone) { if (item == kItemNone) return 0; - _screen->hideMouse(); clearInventorySlot(inventorySlot, 0); snd_playSoundEffect(0x0B); setMouseCursor(item); int string = (_lang == 1) ? getItemCommandStringPickUp(item) : 7; updateCommandLineEx(item+54, string, 0xD6); _itemInHand = (int16)item; - _screen->showMouse(); _mainCharacter.inventory[inventorySlot] = kItemNone; } else { if (_mainCharacter.inventory[inventorySlot] != kItemNone) { @@ -137,23 +135,19 @@ int KyraEngine_HoF::buttonInventory(Button *button) { item = _mainCharacter.inventory[inventorySlot]; snd_playSoundEffect(0x0B); - _screen->hideMouse(); clearInventorySlot(inventorySlot, 0); drawInventoryShape(0, _itemInHand, inventorySlot); setMouseCursor(item); int string = (_lang == 1) ? getItemCommandStringPickUp(item) : 7; updateCommandLineEx(item+54, string, 0xD6); - _screen->showMouse(); _mainCharacter.inventory[inventorySlot] = _itemInHand; setHandItem(item); } else { snd_playSoundEffect(0x0C); - _screen->hideMouse(); drawInventoryShape(0, _itemInHand, inventorySlot); _screen->setMouseCursor(0, 0, getShapePtr(0)); int string = (_lang == 1) ? getItemCommandStringInv(_itemInHand) : 8; updateCommandLineEx(_itemInHand+54, string, 0xD6); - _screen->showMouse(); _mainCharacter.inventory[inventorySlot] = _itemInHand; _itemInHand = kItemNone; } @@ -172,9 +166,7 @@ int KyraEngine_HoF::scrollInventory(Button *button) { memcpy(src+5, dst, sizeof(Item)*5); memcpy(dst, dst+5, sizeof(Item)*5); memcpy(dst+5, temp, sizeof(Item)*5); - _screen->hideMouse(); _screen->copyRegion(0x46, 0x90, 0x46, 0x90, 0x71, 0x2E, 0, 2); - _screen->showMouse(); redrawInventory(2); scrollInventoryWheel(); return 0; @@ -199,9 +191,7 @@ int KyraEngine_HoF::findFreeVisibleInventorySlot() { void KyraEngine_HoF::removeSlotFromInventory(int slot) { _mainCharacter.inventory[slot] = kItemNone; if (slot < 10) { - _screen->hideMouse(); clearInventorySlot(slot, 0); - _screen->showMouse(); } } @@ -223,15 +213,12 @@ bool KyraEngine_HoF::checkInventoryItemExchange(Item handItem, int slot) { snd_playSoundEffect(0x68); _mainCharacter.inventory[slot] = newItem; - _screen->hideMouse(); clearInventorySlot(slot, 0); drawInventoryShape(0, newItem, slot); if (removeItem) removeHandItem(); - _screen->showMouse(); - if (_lang != 1) updateCommandLineEx(newItem+54, 0x2E, 0xD6); @@ -243,12 +230,10 @@ bool KyraEngine_HoF::checkInventoryItemExchange(Item handItem, int slot) { void KyraEngine_HoF::drawInventoryShape(int page, Item item, int slot) { _screen->drawShape(page, getShapePtr(item+64), _inventoryX[slot], _inventoryY[slot], 0, 0); - _screen->updateScreen(); } void KyraEngine_HoF::clearInventorySlot(int slot, int page) { _screen->drawShape(page, getShapePtr(240+slot), _inventoryX[slot], _inventoryY[slot], 0, 0); - _screen->updateScreen(); } void KyraEngine_HoF::redrawInventory(int page) { @@ -256,7 +241,6 @@ void KyraEngine_HoF::redrawInventory(int page) { _screen->_curPage = page; const Item *inventory = _mainCharacter.inventory; - _screen->hideMouse(); for (int i = 0; i < 10; ++i) { clearInventorySlot(i, page); if (inventory[i] != kItemNone) { @@ -264,7 +248,6 @@ void KyraEngine_HoF::redrawInventory(int page) { drawInventoryShape(page, inventory[i], i); } } - _screen->showMouse(); _screen->updateScreen(); _screen->_curPage = pageBackUp; @@ -277,17 +260,13 @@ void KyraEngine_HoF::scrollInventoryWheel() { memcpy(_screenBuffer, _screen->getCPagePtr(2), 64000); uint8 overlay[0x100]; _screen->generateOverlay(_screen->getPalette(0), overlay, 0, 50); - _screen->hideMouse(); _screen->copyRegion(0x46, 0x90, 0x46, 0x79, 0x71, 0x17, 0, 2, Screen::CR_NO_P_CHECK); - _screen->showMouse(); snd_playSoundEffect(0x25); bool breakFlag = false; for (int i = 0; i <= 6 && !breakFlag; ++i) { if (movie.opened()) { - _screen->hideMouse(); movie.displayFrame(i % frames, 0, 0, 0, 0, 0, 0); - _screen->showMouse(); _screen->updateScreen(); } @@ -355,9 +334,7 @@ int KyraEngine_HoF::bookButton(Button *button) { _bookNewPage = _bookCurPage; if (_screenBuffer) { - _screen->hideMouse(); memcpy(_screenBuffer, _screen->getCPagePtr(0), 64000); - _screen->showMouse(); } _screen->copyPalette(2, 0); @@ -382,9 +359,7 @@ int KyraEngine_HoF::bookButton(Button *button) { restorePage3(); if (_screenBuffer) { - _screen->hideMouse(); _screen->copyBlockToPage(0, 0, 0, 320, 200, _screenBuffer); - _screen->showMouse(); } setHandItem(_itemInHand); @@ -471,7 +446,6 @@ void KyraEngine_HoF::showBookPage() { int rightPageY = _bookPageYOffset[_bookCurPage+1]; - _screen->hideMouse(); if (leftPage) { bookDecodeText(leftPage); bookPrintText(2, leftPage, 20, leftPageY+20, 0x31); @@ -483,7 +457,6 @@ void KyraEngine_HoF::showBookPage() { bookPrintText(2, rightPage, 176, rightPageY+20, 0x31); delete[] rightPage; } - _screen->showMouse(); } void KyraEngine_HoF::bookLoop() { @@ -517,10 +490,8 @@ void KyraEngine_HoF::bookLoop() { loadBookBkgd(); showBookPage(); snd_playSoundEffect(0x64); - _screen->hideMouse(); _screen->copyRegion(0, 0, 0, 0, 0x140, 0xC8, 2, 0, Screen::CR_NO_P_CHECK); _screen->updateScreen(); - _screen->showMouse(); } _system->delayMillis(10); } @@ -550,9 +521,7 @@ void KyraEngine_HoF::bookPrintText(int dstPage, const uint8 *str, int x, int y, Screen::FontId oldFont = _screen->setFont(_flags.lang == Common::JA_JPN ? Screen::FID_SJIS_FNT : Screen::FID_BOOKFONT_FNT); _screen->_charWidth = -2; - _screen->hideMouse(); _screen->printText((const char *)str, x, y, color, (_flags.lang == Common::JA_JPN) ? 0xf6 : 0); - _screen->showMouse(); _screen->_charWidth = 0; _screen->setFont(oldFont); @@ -679,9 +648,7 @@ int GUI_HoF::optionsButton(Button *button) { _restartGame = false; _reloadTemporarySave = false; - _screen->hideMouse(); updateButton(&_vm->_inventoryButtons[0]); - _screen->showMouse(); if (!_screen->isMouseVisible() && button) return 0; @@ -690,9 +657,7 @@ int GUI_HoF::optionsButton(Button *button) { if (_vm->_mouseState < -1) { _vm->_mouseState = -1; - _screen->hideMouse(); _screen->setMouseCursor(1, 1, _vm->getShapePtr(0)); - _screen->showMouse(); return 0; } diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp index b4e5148b64..8e18ff910d 100644 --- a/engines/kyra/gui_lok.cpp +++ b/engines/kyra/gui_lok.cpp @@ -48,19 +48,16 @@ int KyraEngine_LoK::buttonInventoryCallback(Button *caller) { snd_playSoundEffect(0x36); return 0; } else { - _screen->hideMouse(); _screen->fillRect(_itemPosX[itemOffset], _itemPosY[itemOffset], _itemPosX[itemOffset] + 15, _itemPosY[itemOffset] + 15, _flags.platform == Common::kPlatformAmiga ? 19 : 12); snd_playSoundEffect(0x35); setMouseItem(inventoryItem); updateSentenceCommand(_itemList[getItemListIndex(inventoryItem)], _takenList[0], 179); _itemInHand = inventoryItem; - _screen->showMouse(); _currentCharacter->inventoryItems[itemOffset] = kItemNone; } } else { if (inventoryItem != kItemNone) { snd_playSoundEffect(0x35); - _screen->hideMouse(); _screen->fillRect(_itemPosX[itemOffset], _itemPosY[itemOffset], _itemPosX[itemOffset] + 15, _itemPosY[itemOffset] + 15, _flags.platform == Common::kPlatformAmiga ? 19 : 12); _screen->drawShape(0, _shapes[216 + _itemInHand], _itemPosX[itemOffset], _itemPosY[itemOffset], 0, 0); setMouseItem(inventoryItem); @@ -69,16 +66,13 @@ int KyraEngine_LoK::buttonInventoryCallback(Button *caller) { updateSentenceCommand(_itemList[getItemListIndex(inventoryItem)], _takenList[0], 179); else updateSentenceCommand(_itemList[getItemListIndex(inventoryItem)], _takenList[1], 179); - _screen->showMouse(); _currentCharacter->inventoryItems[itemOffset] = _itemInHand; _itemInHand = inventoryItem; } else { snd_playSoundEffect(0x32); - _screen->hideMouse(); _screen->drawShape(0, _shapes[216 + _itemInHand], _itemPosX[itemOffset], _itemPosY[itemOffset], 0, 0); _screen->setMouseCursor(1, 1, _shapes[0]); updateSentenceCommand(_itemList[getItemListIndex(_itemInHand)], _placedList[0], 179); - _screen->showMouse(); _currentCharacter->inventoryItems[itemOffset] = _itemInHand; _itemInHand = kItemNone; } diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp index e88b7fdffb..37526f9a5f 100644 --- a/engines/kyra/gui_mr.cpp +++ b/engines/kyra/gui_mr.cpp @@ -104,7 +104,6 @@ int KyraEngine_MR::callbackButton3(Button *button) { void KyraEngine_MR::showMessage(const char *string, uint8 c0, uint8 c1) { _shownMessage = string; - _screen->hideMouse(); restoreCommandLine(); _restoreCommandLine = false; @@ -118,8 +117,6 @@ void KyraEngine_MR::showMessage(const char *string, uint8 c0, uint8 c1) { _screen->updateScreen(); setCommandLineRestoreTimer(7); } - - _screen->showMouse(); } void KyraEngine_MR::showMessageFromCCode(int string, uint8 c0, int) { @@ -330,10 +327,8 @@ void KyraEngine_MR::drawMalcolmsMoodText() { _screen->_curPage = 2; } - _screen->hideMouse(); _screen->drawShape(_screen->_curPage, getShapePtr(432), 244, 189, 0, 0); _text->printText(string, x, y+1, 0xFF, 0xF0, 0x00); - _screen->showMouse(); _screen->_curPage = pageBackUp; } @@ -441,7 +436,6 @@ void KyraEngine_MR::redrawInventory(int page) { int pageBackUp = _screen->_curPage; _screen->_curPage = page; - _screen->hideMouse(); for (int i = 0; i < 10; ++i) { clearInventorySlot(i, page); @@ -451,7 +445,6 @@ void KyraEngine_MR::redrawInventory(int page) { } } - _screen->showMouse(); _screen->_curPage = pageBackUp; if (page == 0 || page == 1) @@ -489,14 +482,12 @@ int KyraEngine_MR::buttonInventory(Button *button) { if (slotItem == kItemNone) return 0; - _screen->hideMouse(); clearInventorySlot(slot, 0); snd_playSoundEffect(0x0B, 0xC8); setMouseCursor(slotItem); updateItemCommand(slotItem, (_lang == 1) ? getItemCommandStringPickUp(slotItem) : 0, 0xFF); _itemInHand = slotItem; _mainCharacter.inventory[slot] = kItemNone; - _screen->showMouse(); } else if (_itemInHand == 27) { if (_chatText) return 0; @@ -508,21 +499,17 @@ int KyraEngine_MR::buttonInventory(Button *button) { snd_playSoundEffect(0x0B, 0xC8); - _screen->hideMouse(); clearInventorySlot(slot, 0); drawInventorySlot(0, _itemInHand, slot); setMouseCursor(slotItem); updateItemCommand(slotItem, (_lang == 1) ? getItemCommandStringPickUp(slotItem) : 0, 0xFF); _mainCharacter.inventory[slot] = _itemInHand; _itemInHand = slotItem; - _screen->showMouse(); } else { snd_playSoundEffect(0x0C, 0xC8); - _screen->hideMouse(); drawInventorySlot(0, _itemInHand, slot); _screen->setMouseCursor(0, 0, getShapePtr(0)); updateItemCommand(_itemInHand, (_lang == 1) ? getItemCommandStringInv(_itemInHand) : 2, 0xFF); - _screen->showMouse(); _mainCharacter.inventory[slot] = _itemInHand; _itemInHand = kItemNone; } @@ -624,22 +611,18 @@ int KyraEngine_MR::buttonShowScore(Button *button) { int KyraEngine_MR::buttonJesterStaff(Button *button) { makeCharFacingMouse(); if (_itemInHand == 27) { - _screen->hideMouse(); removeHandItem(); snd_playSoundEffect(0x0C, 0xC8); drawJestersStaff(1, 0); updateItemCommand(27, 2, 0xFF); setGameFlag(0x97); - _screen->showMouse(); } else if (_itemInHand == kItemNone) { if (queryGameFlag(0x97)) { - _screen->hideMouse(); snd_playSoundEffect(0x0B, 0xC8); setHandItem(27); drawJestersStaff(0, 0); updateItemCommand(27, 0, 0xFF); resetGameFlag(0x97); - _screen->showMouse(); } else { if (queryGameFlag(0x2F)) objectChat((const char *)getTableEntry(_cCodeFile, 20), 0, 204, 20); @@ -1108,9 +1091,7 @@ int GUI_MR::redrawButtonCallback(Button *button) { if (!_displayMenu) return 0; - _screen->hideMouse(); _screen->drawBox(button->x + 1, button->y + 1, button->x + button->width - 1, button->y + button->height - 1, 0xD0); - _screen->showMouse(); return 0; } @@ -1119,9 +1100,7 @@ int GUI_MR::redrawShadedButtonCallback(Button *button) { if (!_displayMenu) return 0; - _screen->hideMouse(); _screen->drawShadedBox(button->x, button->y, button->x + button->width, button->y + button->height, 0xD1, 0xCF); - _screen->showMouse(); return 0; } @@ -1162,9 +1141,7 @@ int GUI_MR::quitGame(Button *caller) { int GUI_MR::optionsButton(Button *button) { PauseTimer pause(*_vm->_timer); - _screen->hideMouse(); updateButton(&_vm->_mainButtonData[0]); - _screen->showMouse(); if (!_vm->_inventoryState && button && !_vm->_menuDirectlyToLoad) return 0; @@ -1179,9 +1156,7 @@ int GUI_MR::optionsButton(Button *button) { if (_vm->_mouseState < -1) { _vm->_mouseState = -1; - _screen->hideMouse(); _screen->setMouseCursor(1, 1, _vm->getShapePtr(0)); - _screen->showMouse(); return 0; } diff --git a/engines/kyra/gui_v1.cpp b/engines/kyra/gui_v1.cpp index f3459ddfe3..cec6562dd9 100644 --- a/engines/kyra/gui_v1.cpp +++ b/engines/kyra/gui_v1.cpp @@ -70,8 +70,6 @@ void GUI_v1::initMenuLayout(Menu &menu) { void GUI_v1::initMenu(Menu &menu) { _menuButtonList = 0; - _screen->hideMouse(); - int textX; int textY; @@ -192,7 +190,6 @@ void GUI_v1::initMenu(Menu &menu) { updateMenuButton(scrollDownButton); } - _screen->showMouse(); _screen->updateScreen(); } @@ -309,10 +306,8 @@ void GUI_v1::updateMenuButton(Button *button) { if (!_displayMenu) return; - _screen->hideMouse(); updateButton(button); _screen->updateScreen(); - _screen->showMouse(); } void GUI_v1::updateButton(Button *button) { @@ -340,12 +335,10 @@ int GUI_v1::redrawButtonCallback(Button *button) { if (!_displayMenu) return 0; - _screen->hideMouse(); if (_vm->gameFlags().platform == Common::kPlatformAmiga) _screen->drawBox(button->x + 1, button->y + 1, button->x + button->width - 1, button->y + button->height - 1, 17); else _screen->drawBox(button->x + 1, button->y + 1, button->x + button->width - 1, button->y + button->height - 1, 0xF8); - _screen->showMouse(); return 0; } @@ -354,12 +347,10 @@ int GUI_v1::redrawShadedButtonCallback(Button *button) { if (!_displayMenu) return 0; - _screen->hideMouse(); if (_vm->gameFlags().platform == Common::kPlatformAmiga) _screen->drawShadedBox(button->x, button->y, button->x + button->width, button->y + button->height, 31, 18); else _screen->drawShadedBox(button->x, button->y, button->x + button->width, button->y + button->height, 0xF9, 0xFA); - _screen->showMouse(); return 0; } diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index 65f8bd45e5..1df4149d2e 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -105,15 +105,11 @@ void GUI_v2::processButton(Button *button) { switch (val1 - 1) { case 0: - _screen->hideMouse(); _screen->drawShape(_screen->_curPage, dataPtr, x, y, button->dimTableIndex, 0x10); - _screen->showMouse(); break; case 1: - _screen->hideMouse(); _screen->printText((const char *)dataPtr, x, y, val2, val3); - _screen->showMouse(); break; case 3: @@ -122,22 +118,16 @@ void GUI_v2::processButton(Button *button) { break; case 4: - _screen->hideMouse(); _screen->drawBox(x, y, x2, y2, val2); - _screen->showMouse(); break; case 5: - _screen->hideMouse(); _screen->fillRect(x, y, x2, y2, val2, -1, true); - _screen->showMouse(); break; default: break; } - - _screen->updateScreen(); } int GUI_v2::processButtonList(Button *buttonList, uint16 inputFlag, int8 mouseWheel) { diff --git a/engines/kyra/items_hof.cpp b/engines/kyra/items_hof.cpp index 711e1b8f7c..ef2c50c0c5 100644 --- a/engines/kyra/items_hof.cpp +++ b/engines/kyra/items_hof.cpp @@ -300,8 +300,6 @@ void KyraEngine_HoF::itemDropDown(int startX, int startY, int dstX, int dstY, in } void KyraEngine_HoF::exchangeMouseItem(int itemPos) { - _screen->hideMouse(); - deleteItemAnimEntry(itemPos); int itemId = _itemList[itemPos].id; @@ -317,7 +315,6 @@ void KyraEngine_HoF::exchangeMouseItem(int itemPos) { str2 = getItemCommandStringPickUp(itemId); updateCommandLineEx(itemId + 54, str2, 0xD6); - _screen->showMouse(); runSceneScript6(); } @@ -331,7 +328,6 @@ bool KyraEngine_HoF::pickUpItem(int x, int y) { if (_itemInHand >= 0) { exchangeMouseItem(itemPos); } else { - _screen->hideMouse(); deleteItemAnimEntry(itemPos); int itemId = _itemList[itemPos].id; _itemList[itemPos].id = kItemNone; @@ -344,7 +340,6 @@ bool KyraEngine_HoF::pickUpItem(int x, int y) { updateCommandLineEx(itemId + 54, str2, 0xD6); _itemInHand = itemId; - _screen->showMouse(); runSceneScript6(); } diff --git a/engines/kyra/items_lok.cpp b/engines/kyra/items_lok.cpp index 2937038463..b92cd616c1 100644 --- a/engines/kyra/items_lok.cpp +++ b/engines/kyra/items_lok.cpp @@ -163,17 +163,13 @@ void KyraEngine_LoK::placeItemInGenericMapScene(int item, int index) { } void KyraEngine_LoK::setHandItem(Item item) { - _screen->hideMouse(); setMouseItem(item); _itemInHand = item; - _screen->showMouse(); } void KyraEngine_LoK::removeHandItem() { - _screen->hideMouse(); _screen->setMouseCursor(1, 1, _shapes[0]); _itemInHand = kItemNone; - _screen->showMouse(); } void KyraEngine_LoK::setMouseItem(Item item) { @@ -415,7 +411,6 @@ int KyraEngine_LoK::processItemDrop(uint16 sceneId, uint8 item, int x, int y, in } void KyraEngine_LoK::exchangeItemWithMouseItem(uint16 sceneId, int itemIndex) { - _screen->hideMouse(); _animator->animRemoveGameItem(itemIndex); assert(sceneId < _roomTableSize); Room *currentRoom = &_roomTable[sceneId]; @@ -432,7 +427,6 @@ void KyraEngine_LoK::exchangeItemWithMouseItem(uint16 sceneId, int itemIndex) { updateSentenceCommand(_itemList[getItemListIndex(_itemInHand)], _takenList[0], 179); else updateSentenceCommand(_itemList[getItemListIndex(_itemInHand)], _takenList[1], 179); - _screen->showMouse(); clickEventHandler2(); } @@ -720,9 +714,7 @@ void KyraEngine_LoK::magicOutMouseItem(int animIndex, int itemPos) { _itemInHand = kItemNone; } else { _characterList[0].inventoryItems[itemPos] = kItemNone; - _screen->hideMouse(); _screen->fillRect(_itemPosX[itemPos], _itemPosY[itemPos], _itemPosX[itemPos] + 15, _itemPosY[itemPos] + 15, _flags.platform == Common::kPlatformAmiga ? 19 : 12, 0); - _screen->showMouse(); } _screen->showMouse(); @@ -793,9 +785,7 @@ void KyraEngine_LoK::magicInMouseItem(int animIndex, int item, int itemPos) { _itemInHand = item; } else { _characterList[0].inventoryItems[itemPos] = item; - _screen->hideMouse(); _screen->drawShape(0, _shapes[216 + item], _itemPosX[itemPos], _itemPosY[itemPos], 0, 0); - _screen->showMouse(); } _screen->showMouse(); _screen->_curPage = videoPageBackUp; @@ -846,9 +836,7 @@ void KyraEngine_LoK::updatePlayerItemsForScene() { ++_itemInHand; if (_itemInHand > 33) _itemInHand = 33; - _screen->hideMouse(); _screen->setMouseCursor(8, 15, _shapes[216 + _itemInHand]); - _screen->showMouse(); } bool redraw = false; @@ -864,9 +852,7 @@ void KyraEngine_LoK::updatePlayerItemsForScene() { } if (redraw) { - _screen->hideMouse(); redrawInventory(0); - _screen->showMouse(); } if (_itemInHand == 33) @@ -884,7 +870,6 @@ void KyraEngine_LoK::updatePlayerItemsForScene() { void KyraEngine_LoK::redrawInventory(int page) { int videoPageBackUp = _screen->_curPage; _screen->_curPage = page; - _screen->hideMouse(); for (int i = 0; i < 10; ++i) { _screen->fillRect(_itemPosX[i], _itemPosY[i], _itemPosX[i] + 15, _itemPosY[i] + 15, _flags.platform == Common::kPlatformAmiga ? 19 : 12, page); @@ -893,7 +878,6 @@ void KyraEngine_LoK::redrawInventory(int page) { _screen->drawShape(page, _shapes[216 + item], _itemPosX[i], _itemPosY[i], 0, 0); } } - _screen->showMouse(); _screen->_curPage = videoPageBackUp; _screen->updateScreen(); } diff --git a/engines/kyra/items_lol.cpp b/engines/kyra/items_lol.cpp index ea2acaf64d..409b53f6f0 100644 --- a/engines/kyra/items_lol.cpp +++ b/engines/kyra/items_lol.cpp @@ -441,20 +441,20 @@ bool LoLEngine::launchObject(int objectType, Item item, int startX, int startY, return true; } -void LoLEngine::endObjectFlight(FlyingObject *t, int x, int y, int collisionObject) { +void LoLEngine::endObjectFlight(FlyingObject *t, int x, int y, int collisionType) { int cx = x; int cy = y; uint16 block = calcBlockIndex(t->x, t->y); removeAssignedObjectFromBlock(&_levelBlockProperties[block], t->item); removeDrawObjectFromBlock(&_levelBlockProperties[block], t->item); - if (collisionObject == 1) { + if (collisionType == 1) { cx = t->x; cy = t->y; } if (t->objectType == 0 || t->objectType == 1) { - objectFlightProcessHits(t, cx, cy, collisionObject); + objectFlightProcessHits(t, cx, cy, collisionType); t->x = (cx & 0xffc0) | 0x40; t->y = (cy & 0xffc0) | 0x40; t->flyingHeight = 0; @@ -488,27 +488,23 @@ void LoLEngine::updateObjectFlightPosition(FlyingObject *t) { } } -void LoLEngine::objectFlightProcessHits(FlyingObject *t, int x, int y, int objectOnNextBlock) { - uint16 r = 0; - - if (objectOnNextBlock == 1) { +void LoLEngine::objectFlightProcessHits(FlyingObject *t, int x, int y, int collisionType) { + if (collisionType == 1) { runLevelScriptCustom(calcNewBlockPosition(_itemsInPlay[t->item].block, t->direction >> 1), 0x8000, -1, t->item, 0, 0); - } else if (objectOnNextBlock == 2) { + } else if (collisionType == 2) { if (_itemProperties[_itemsInPlay[t->item].itemPropertyIndex].flags & 0x4000) { - int o = _levelBlockProperties[_itemsInPlay[t->item].block].assignedObjects; - while (o & 0x8000) { - LoLObject *i = findObject(o); - o = i->nextAssignedObject; - runItemScript(t->attackerId, t->item, 0x8000, o, 0); + uint16 obj = _levelBlockProperties[_itemsInPlay[t->item].block].assignedObjects; + while (obj & 0x8000) { + runItemScript(t->attackerId, t->item, 0x8000, obj, 0); + obj = findObject(obj)->nextAssignedObject; } } else { - r = getNearestMonsterFromPos(x, y); - runItemScript(t->attackerId, t->item, 0x8000, r, 0); + runItemScript(t->attackerId, t->item, 0x8000, getNearestMonsterFromPos(x, y), 0); } - } else if (objectOnNextBlock == 4) { + } else if (collisionType == 4) { _partyAwake = true; if (_itemProperties[_itemsInPlay[t->item].itemPropertyIndex].flags & 0x4000) { for (int i = 0; i < 4; i++) { @@ -516,8 +512,7 @@ void LoLEngine::objectFlightProcessHits(FlyingObject *t, int x, int y, int objec runItemScript(t->attackerId, t->item, 0x8000, i, 0); } } else { - r = getNearestPartyMemberFromPos(x, y); - runItemScript(t->attackerId, t->item, 0x8000, r, 0); + runItemScript(t->attackerId, t->item, 0x8000, getNearestPartyMemberFromPos(x, y), 0); } } } @@ -543,9 +538,9 @@ void LoLEngine::updateFlyingObject(FlyingObject *t) { middle of a block (or making the monsters align to the middle before casting them) wouldn't help here (and wouldn't be faithful to the original either). */ - int objectOnNextBlock = checkBlockBeforeObjectPlacement(x, y, /*_itemProperties[_itemsInPlay[t->item].itemPropertyIndex].flags & 0x4000 ? 256 :*/ 63, t->flags, t->wallFlags); - if (objectOnNextBlock) { - endObjectFlight(t, x, y, objectOnNextBlock); + int collisionType = checkBlockBeforeObjectPlacement(x, y, /*_itemProperties[_itemsInPlay[t->item].itemPropertyIndex].flags & 0x4000 ? 256 :*/ 63, t->flags, t->wallFlags); + if (collisionType) { + endObjectFlight(t, x, y, collisionType); } else { if (--t->distance) { processObjectFlight(t, x, y); @@ -567,16 +562,16 @@ void LoLEngine::assignItemToBlock(uint16 *assignedBlockObjects, int id) { *assignedBlockObjects = id; } -int LoLEngine::checkDrawObjectSpace(int itemX, int itemY, int partyX, int partyY) { - int a = itemX - partyX; - if (a < 0) - a = -a; +int LoLEngine::checkDrawObjectSpace(int x1, int y1, int x2, int y2) { + int dx = x1 - x2; + if (dx < 0) + dx = -dx; - int b = itemY - partyY; - if (b < 0) - b = -b; + int dy = y1 - y2; + if (dy < 0) + dy = -dy; - return a + b; + return dx + dy; } int LoLEngine::checkSceneForItems(uint16 *blockDrawObjects, int color) { diff --git a/engines/kyra/items_mr.cpp b/engines/kyra/items_mr.cpp index c731627026..029f676538 100644 --- a/engines/kyra/items_mr.cpp +++ b/engines/kyra/items_mr.cpp @@ -319,7 +319,6 @@ void KyraEngine_MR::exchangeMouseItem(int itemPos, int runScript) { return; } - _screen->hideMouse(); deleteItemAnimEntry(itemPos); Item itemId = _itemList[itemPos].id; @@ -335,7 +334,6 @@ void KyraEngine_MR::exchangeMouseItem(int itemPos, int runScript) { str2 = getItemCommandStringPickUp(itemId); updateItemCommand(itemId, str2, 0xFF); - _screen->showMouse(); if (runScript) runSceneScript6(); @@ -350,7 +348,6 @@ bool KyraEngine_MR::pickUpItem(int x, int y, int runScript) { if (_itemInHand >= 0) { exchangeMouseItem(itemPos, runScript); } else { - _screen->hideMouse(); deleteItemAnimEntry(itemPos); Item itemId = _itemList[itemPos].id; _itemList[itemPos].id = kItemNone; @@ -363,7 +360,6 @@ bool KyraEngine_MR::pickUpItem(int x, int y, int runScript) { updateItemCommand(itemId, itemString, 0xFF); _itemInHand = itemId; - _screen->showMouse(); if (runScript) runSceneScript6(); @@ -401,7 +397,6 @@ bool KyraEngine_MR::itemListMagic(Item handItem, int itemSlot) { assert(animObjIndex != -1); - _screen->hideMouse(); snd_playSoundEffect(0x93, 0xC8); for (int i = 109; i <= 141; ++i) { _animObjects[animObjIndex].shapeIndex1 = i+248; @@ -411,7 +406,6 @@ bool KyraEngine_MR::itemListMagic(Item handItem, int itemSlot) { deleteItemAnimEntry(itemSlot); _itemList[itemSlot].id = kItemNone; - _screen->showMouse(); return true; } @@ -440,7 +434,6 @@ bool KyraEngine_MR::itemListMagic(Item handItem, int itemSlot) { _itemList[itemSlot].id = (int8)resItem; - _screen->hideMouse(); deleteItemAnimEntry(itemSlot); addItemToAnimList(itemSlot); @@ -448,7 +441,6 @@ bool KyraEngine_MR::itemListMagic(Item handItem, int itemSlot) { removeHandItem(); else if (newItem != 0xFF) setHandItem(newItem); - _screen->showMouse(); if (_lang != 1) updateItemCommand(resItem, 3, 0xFF); @@ -500,7 +492,6 @@ bool KyraEngine_MR::itemInventoryMagic(Item handItem, int invSlot) { _mainCharacter.inventory[invSlot] = (int8)resItem; - _screen->hideMouse(); clearInventorySlot(invSlot, 0); drawInventorySlot(0, resItem, invSlot); @@ -508,7 +499,6 @@ bool KyraEngine_MR::itemInventoryMagic(Item handItem, int invSlot) { removeHandItem(); else if (newItem != 0xFF) setHandItem(newItem); - _screen->showMouse(); if (_lang != 1) updateItemCommand(resItem, 3, 0xFF); diff --git a/engines/kyra/items_v2.cpp b/engines/kyra/items_v2.cpp index c191c2e62b..2145a2c2f0 100644 --- a/engines/kyra/items_v2.cpp +++ b/engines/kyra/items_v2.cpp @@ -82,26 +82,19 @@ void KyraEngine_v2::resetItem(int index) { } void KyraEngine_v2::setHandItem(Item item) { - Screen *scr = screen(); - scr->hideMouse(); - if (item == kItemNone) { removeHandItem(); } else { setMouseCursor(item); _itemInHand = item; } - - scr->showMouse(); } void KyraEngine_v2::removeHandItem() { Screen *scr = screen(); - scr->hideMouse(); scr->setMouseCursor(0, 0, getShapePtr(0)); _itemInHand = kItemNone; _mouseState = kItemNone; - scr->showMouse(); } } // end of namesapce Kyra diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index 0ba173d9d0..7fbecb7f53 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -419,8 +419,6 @@ void KyraEngine_HoF::startup() { _screen->loadPalette("PALETTE.COL", _screen->getPalette(0)); _screen->loadBitmap("_PLAYFLD.CPS", 3, 3, 0); _screen->copyPage(3, 0); - _screen->showMouse(); - _screen->hideMouse(); clearAnimObjects(); @@ -784,20 +782,16 @@ void KyraEngine_HoF::updateMouse() { if (type != 0 && _mouseState != type && _screen->isMouseVisible()) { _mouseState = type; - _screen->hideMouse(); _screen->setMouseCursor(xOffset, yOffset, getShapePtr(shapeIndex)); - _screen->showMouse(); } if (type == 0 && _mouseState != _itemInHand && _screen->isMouseVisible()) { if ((mouse.y > 145) || (mouse.x > 6 && mouse.x < 312 && mouse.y > 6 && mouse.y < 135)) { _mouseState = _itemInHand; - _screen->hideMouse(); if (_itemInHand == kItemNone) _screen->setMouseCursor(0, 0, getShapePtr(0)); else _screen->setMouseCursor(8, 15, getShapePtr(_itemInHand+64)); - _screen->showMouse(); } } } @@ -914,7 +908,6 @@ void KyraEngine_HoF::showMessageFromCCode(int id, int16 palIndex, int) { void KyraEngine_HoF::showMessage(const char *string, int16 palIndex) { _shownMessage = string; - _screen->hideMouse(); _screen->fillRect(0, 190, 319, 199, 0xCF); if (string) { @@ -932,7 +925,6 @@ void KyraEngine_HoF::showMessage(const char *string, int16 palIndex) { } _fadeMessagePalette = false; - _screen->showMouse(); } void KyraEngine_HoF::showChapterMessage(int id, int16 palIndex) { @@ -1116,9 +1108,7 @@ int KyraEngine_HoF::getDrawLayer(int x, int y) { void KyraEngine_HoF::backUpPage0() { if (_screenBuffer) { - _screen->hideMouse(); memcpy(_screenBuffer, _screen->getCPagePtr(0), 64000); - _screen->showMouse(); } } diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index ece4a0daba..27bc2ad22a 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -454,10 +454,8 @@ void KyraEngine_LoK::mainLoop() { if (_deathHandler != -1) { snd_playWanderScoreViaMap(0, 1); snd_playSoundEffect(49); - _screen->hideMouse(); _screen->setMouseCursor(1, 1, _shapes[0]); removeHandItem(); - _screen->showMouse(); _gui->buttonMenuCallback(0); _deathHandler = -1; } @@ -706,7 +704,6 @@ int KyraEngine_LoK::processInputHelper(int xpos, int ypos) { uint8 item = findItemAtPos(xpos, ypos); if (item != 0xFF) { if (_itemInHand == kItemNone) { - _screen->hideMouse(); _animator->animRemoveGameItem(item); snd_playSoundEffect(53); assert(_currentCharacter->sceneId < _roomTableSize); @@ -717,7 +714,6 @@ int KyraEngine_LoK::processInputHelper(int xpos, int ypos) { assert(_itemList && _takenList); updateSentenceCommand(_itemList[getItemListIndex(item2)], _takenList[0], 179); _itemInHand = item2; - _screen->showMouse(); clickEventHandler2(); return 1; } else { @@ -834,21 +830,17 @@ void KyraEngine_LoK::updateMousePointer(bool forceUpdate) { if ((newMouseState && _mouseState != newMouseState) || (newMouseState && forceUpdate)) { _mouseState = newMouseState; - _screen->hideMouse(); _screen->setMouseCursor(newX, newY, _shapes[shape]); - _screen->showMouse(); } if (!newMouseState) { if (_mouseState != _itemInHand || forceUpdate) { if (mouse.y > 158 || (mouse.x >= 12 && mouse.x < 308 && mouse.y < 136 && mouse.y >= 12) || forceUpdate) { _mouseState = _itemInHand; - _screen->hideMouse(); if (_itemInHand == kItemNone) _screen->setMouseCursor(1, 1, _shapes[0]); else _screen->setMouseCursor(8, 15, _shapes[216 + _itemInHand]); - _screen->showMouse(); } } } diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index 39ed0d038a..448e4ef70d 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -1298,7 +1298,6 @@ bool KyraEngine_MR::updateScore(int scoreId, int strId) { setNextIdleAnimTimer(); _scoreFlagTable[scoreIndex] |= (1 << scoreBit); - _screen->hideMouse(); strcpy(_stringBuffer, (const char *)getTableEntry(_scoreFile, strId)); strcat(_stringBuffer, ": "); @@ -1308,7 +1307,6 @@ bool KyraEngine_MR::updateScore(int scoreId, int strId) { if (count > 0) scoreIncrease(count, _stringBuffer); - _screen->showMouse(); setNextIdleAnimTimer(); return true; } diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 75b568a00a..848fb18b6a 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -198,8 +198,6 @@ void KyraEngine_v2::moveCharacter(int facing, int x, int y) { y &= ~1; _mainCharacter.facing = facing; - Screen *scr = screen(); - scr->hideMouse(); switch (facing) { case 0: while (_mainCharacter.y1 > y) @@ -224,7 +222,6 @@ void KyraEngine_v2::moveCharacter(int facing, int x, int y) { default: break; } - scr->showMouse(); } void KyraEngine_v2::updateCharPosWithUpdate() { diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 38e9d33259..d3028c5e2d 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -1436,7 +1436,7 @@ void LoLEngine::increaseExperience(int charNum, int skill, uint32 points) { bool loop = true; while (loop) { - if (_characters[charNum].experiencePts[skill] <= _expRequirements[_characters[charNum].skillLevels[skill]]) + if (_characters[charNum].experiencePts[skill] < _expRequirements[_characters[charNum].skillLevels[skill]]) break; _characters[charNum].skillLevels[skill]++; @@ -2894,11 +2894,11 @@ int LoLEngine::processMagicVaelansCube() { uint8 s = _levelBlockProperties[bl].walls[_currentDirection ^ 2]; uint8 flg = _wllWallFlags[s]; - int v = (s == 47 && (_currentLevel == 17 || _currentLevel == 24)) ? 1 : 0; - if ((_wllVmpMap[s] == 1 || _wllVmpMap[s] == 2) && (flg & 1) && (_currentLevel == 22)) { + int res = (s == 47 && (_currentLevel == 17 || _currentLevel == 24)) ? 1 : 0; + if ((_wllVmpMap[s] == 1 || _wllVmpMap[s] == 2) && (!(flg & 1)) && (_currentLevel != 22)) { memset(_levelBlockProperties[bl].walls, 0, 4); gui_drawScene(0); - v = 1; + res = 1; } uint16 o = _levelBlockProperties[bl].assignedObjects; @@ -2906,7 +2906,7 @@ int LoLEngine::processMagicVaelansCube() { LoLMonster *m = &_monsters[o & 0x7fff]; if (m->properties->flags & 0x1000) { inflictDamage(o, 100, 0xffff, 0, 0x80); - v = 1; + res = 1; } o = m->nextAssignedObject; } @@ -2922,7 +2922,7 @@ int LoLEngine::processMagicVaelansCube() { delete[] tmpPal1; delete[] tmpPal2; - return v; + return res; } int LoLEngine::processMagicGuardian(int charNum) { diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index dbd461267f..dcd13804b3 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -1047,14 +1047,14 @@ private: void setItemPosition(Item item, uint16 x, uint16 y, int flyingHeight, int moveable); void removeLevelItem(Item item, int block); bool launchObject(int objectType, Item item, int startX, int startY, int flyingHeight, int direction, int, int attackerId, int c); - void endObjectFlight(FlyingObject *t, int x, int y, int collisionObject); + void endObjectFlight(FlyingObject *t, int x, int y, int collisionType); void processObjectFlight(FlyingObject *t, int x, int y); void updateObjectFlightPosition(FlyingObject *t); - void objectFlightProcessHits(FlyingObject *t, int x, int y, int objectOnNextBlock); + void objectFlightProcessHits(FlyingObject *t, int x, int y, int collisionType); void updateFlyingObject(FlyingObject *t); void assignItemToBlock(uint16 *assignedBlockObjects, int id); - int checkDrawObjectSpace(int itemX, int itemY, int partyX, int partyY); + int checkDrawObjectSpace(int x1, int y1, int x2, int y2); int checkSceneForItems(uint16 *blockDrawObjects, int color); uint8 _moneyColumnHeight[5]; @@ -1095,7 +1095,7 @@ private: void monsterDropItems(LoLMonster *monster); void giveItemToMonster(LoLMonster *monster, Item item); int checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 objectWidth, uint16 testFlag, uint16 wallFlag); - int checkBlockForWallsAndSufficientSpace(int block, int x, int y, int objectWidth, int testFlag, int wallFlag); + int testBlockPassability(int block, int x, int y, int objectWidth, int testFlag, int wallFlag); int calcMonsterSkillLevel(int id, int a); int checkBlockOccupiedByParty(int x, int y, int testFlag); const uint16 *getCharacterOrMonsterStats(int id); @@ -1122,7 +1122,7 @@ private: int checkForPossibleDistanceAttack(uint16 monsterBlock, int direction, int distance, uint16 curBlock); int walkMonsterCheckDest(int x, int y, LoLMonster *monster, int unk); void getNextStepCoords(int16 monsterX, int16 monsterY, int &newX, int &newY, uint16 direction); - void rearrangeAttackingMonster(LoLMonster *monster); + void alignMonsterToParty(LoLMonster *monster); void moveStrayingMonster(LoLMonster *monster); void killMonster(LoLMonster *monster); diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 711fe15348..04d805737f 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -141,7 +141,7 @@ bool Screen::init() { if (!font) error("Could not load any SJIS font, neither the original nor ScummVM's 'SJIS.FNT'"); - _fonts[FID_SJIS_FNT] = new SJISFont(this, font, _sjisInvisibleColor, _use16ColorMode, !_use16ColorMode); + _fonts[FID_SJIS_FNT] = new SJISFont(font, _sjisInvisibleColor, _use16ColorMode, !_use16ColorMode); } } @@ -1128,8 +1128,6 @@ void Screen::drawBox(int x1, int y1, int x2, int y2, int color) { void Screen::drawShadedBox(int x1, int y1, int x2, int y2, int color1, int color2) { assert(x1 >= 0 && y1 >= 0); - hideMouse(); - fillRect(x1, y1, x2, y1 + 1, color1); fillRect(x2 - 1, y1, x2, y2, color1); @@ -1137,8 +1135,6 @@ void Screen::drawShadedBox(int x1, int y1, int x2, int y2, int color1, int color drawClippedLine(x1 + 1, y1 + 1, x1 + 1, y2 - 1, color2); drawClippedLine(x1, y2 - 1, x2 - 1, y2 - 1, color2); drawClippedLine(x1, y2, x2, y2, color2); - - showMouse(); } void Screen::drawClippedLine(int x1, int y1, int x2, int y2, int color) { @@ -3599,8 +3595,8 @@ void AMIGAFont::unload() { memset(_chars, 0, sizeof(_chars)); } -SJISFont::SJISFont(Screen *s, Graphics::FontSJIS *font, const uint8 invisColor, bool is16Color, bool outlineSize) - : _colorMap(0), _font(font), _invisColor(invisColor), _is16Color(is16Color), _screen(s) { +SJISFont::SJISFont(Graphics::FontSJIS *font, const uint8 invisColor, bool is16Color, bool outlineSize) + : _colorMap(0), _font(font), _invisColor(invisColor), _is16Color(is16Color) { assert(_font); _font->setDrawingMode(outlineSize ? Graphics::FontSJIS::kOutlineMode : Graphics::FontSJIS::kDefaultMode); diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index b064c72bb0..60bfeb3241 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -213,7 +213,7 @@ private: */ class SJISFont : public Font { public: - SJISFont(Screen *s, Graphics::FontSJIS *font, const uint8 invisColor, bool is16Color, bool outlineSize); + SJISFont(Graphics::FontSJIS *font, const uint8 invisColor, bool is16Color, bool outlineSize); ~SJISFont() { unload(); } bool usesOverlay() const { return true; } @@ -233,7 +233,6 @@ private: const uint8 _invisColor; const bool _is16Color; - const Screen *_screen; int _sjisWidth, _asciiWidth; int _fontHeight; }; diff --git a/engines/kyra/screen_eob.cpp b/engines/kyra/screen_eob.cpp index e06ca42c40..ae75c111b4 100644 --- a/engines/kyra/screen_eob.cpp +++ b/engines/kyra/screen_eob.cpp @@ -607,7 +607,7 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco srcLineStart += SCREEN_W; src = srcLineStart; } - delete [] colorMap; + delete[] colorMap; } return shp; diff --git a/engines/kyra/screen_lok.cpp b/engines/kyra/screen_lok.cpp index f32a898dd9..f028f93294 100644 --- a/engines/kyra/screen_lok.cpp +++ b/engines/kyra/screen_lok.cpp @@ -190,7 +190,6 @@ void Screen_LoK::copyBackgroundBlock(int x, int page, int flag) { _curPage = page; int curX = x; - hideMouse(); copyRegionToBuffer(_curPage, 8, 8, 8, height, ptr2); for (int i = 0; i < 19; ++i) { int tempX = curX + 1; @@ -208,7 +207,6 @@ void Screen_LoK::copyBackgroundBlock(int x, int page, int flag) { curX = curX % 38; } } - showMouse(); _curPage = oldVideoPage; } diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp index 08b232f400..3726b1f4b9 100644 --- a/engines/kyra/screen_lol.cpp +++ b/engines/kyra/screen_lol.cpp @@ -31,7 +31,7 @@ namespace Kyra { -Screen_LoL::Screen_LoL(LoLEngine *vm, OSystem *system) : Screen_v2(vm, system, vm->gameFlags().use16ColorMode ? _screenDimTable16C : _screenDimTable256C, _screenDimTableCount), _vm(vm) { +Screen_LoL::Screen_LoL(LoLEngine *vm, OSystem *system) : Screen_v2(vm, system, vm->gameFlags().use16ColorMode ? _screenDimTable16C : _screenDimTable256C, _screenDimTableCount) { _paletteOverlay1 = new uint8[0x100]; _paletteOverlay2 = new uint8[0x100]; _grayOverlay = new uint8[0x100]; diff --git a/engines/kyra/screen_lol.h b/engines/kyra/screen_lol.h index 3bba9f8b70..09496705bb 100644 --- a/engines/kyra/screen_lol.h +++ b/engines/kyra/screen_lol.h @@ -89,8 +89,6 @@ public: static void convertPC98Gfx(uint8 *data, int w, int h, int pitch); private: - LoLEngine *_vm; - static const ScreenDim _screenDimTable256C[]; static const ScreenDim _screenDimTable16C[]; static const int _screenDimTableCount; diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp index b80b8105a1..fca83ae632 100644 --- a/engines/kyra/script_hof.cpp +++ b/engines/kyra/script_hof.cpp @@ -325,7 +325,6 @@ int KyraEngine_HoF::o2_drawShape(EMCState *script) { if (modeFlag) { _screen->drawShape(2, shp, x, y, 2, dsFlag ? 1 : 0); } else { - _screen->hideMouse(); restorePage3(); _screen->drawShape(2, shp, x, y, 2, dsFlag ? 1 : 0); memcpy(_gamePlayBuffer, _screen->getCPagePtr(3), 46080); @@ -334,7 +333,6 @@ int KyraEngine_HoF::o2_drawShape(EMCState *script) { flagAnimObjsForRefresh(); flagAnimObjsSpecialRefresh(); refreshAnimObjectsIfNeed(); - _screen->showMouse(); } return 0; @@ -492,7 +490,6 @@ int KyraEngine_HoF::o2_drawSceneShape(EMCState *script) { int y = stackPos(2); int flag = (stackPos(3) != 0) ? 1 : 0; - _screen->hideMouse(); restorePage3(); _screen->drawShape(2, _sceneShapeTable[shape], x, y, 2, flag); @@ -504,7 +501,6 @@ int KyraEngine_HoF::o2_drawSceneShape(EMCState *script) { flagAnimObjsSpecialRefresh(); flagAnimObjsForRefresh(); refreshAnimObjectsIfNeed(); - _screen->showMouse(); return 0; } diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp index 8342bccab6..db9e01cabb 100644 --- a/engines/kyra/script_lok.cpp +++ b/engines/kyra/script_lok.cpp @@ -157,7 +157,6 @@ int KyraEngine_LoK::o1_dropItemInScene(EMCState *script) { int KyraEngine_LoK::o1_drawAnimShapeIntoScene(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_drawAnimShapeIntoScene(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); - _screen->hideMouse(); _animator->restoreAllObjectBackgrounds(); int shape = stackPos(0); int xpos = stackPos(1); @@ -169,7 +168,6 @@ int KyraEngine_LoK::o1_drawAnimShapeIntoScene(EMCState *script) { _animator->preserveAnyChangedBackgrounds(); _animator->flagAllObjectsForRefresh(); _animator->updateAllObjectShapes(); - _screen->showMouse(); return 0; } @@ -1298,7 +1296,6 @@ int KyraEngine_LoK::o1_drawItemShapeIntoScene(EMCState *script) { if (onlyHidPage) { _screen->drawShape(2, _shapes[216 + item], x, y, 0, flags); } else { - _screen->hideMouse(); _animator->restoreAllObjectBackgrounds(); _screen->drawShape(2, _shapes[216 + item], x, y, 0, flags); _screen->drawShape(0, _shapes[216 + item], x, y, 0, flags); @@ -1306,7 +1303,6 @@ int KyraEngine_LoK::o1_drawItemShapeIntoScene(EMCState *script) { _animator->preserveAnyChangedBackgrounds(); _animator->flagAllObjectsForRefresh(); _animator->updateAllObjectShapes(); - _screen->showMouse(); } return 0; } diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index c5d1d49030..9c0fe21ad4 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -958,10 +958,9 @@ int LoLEngine::olol_loadMonsterProperties(EMCState *script) { l->hitPoints = stackPos(26); l->speedTotalWaitTicks = 1; l->flags = stackPos(27); - l->unk5 = stackPos(28); - // FIXME??? + // This is what the original does here (setting the value first to stackPos(28) and then to stackPos(29): + //l->unk5 = stackPos(28); l->unk5 = stackPos(29); - // l->numDistAttacks = stackPos(30); l->numDistWeapons = stackPos(31); diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp index afe11aba02..22d0bc4e95 100644 --- a/engines/kyra/script_mr.cpp +++ b/engines/kyra/script_mr.cpp @@ -150,9 +150,7 @@ int KyraEngine_MR::o3_addItemToInventory(EMCState *script) { if (slot >= 0) { _mainCharacter.inventory[slot] = stackPos(0); if (_inventoryState) { - _screen->hideMouse(); redrawInventory(0); - _screen->showMouse(); } } return slot; @@ -330,7 +328,6 @@ int KyraEngine_MR::o3_drawSceneShape(EMCState *script) { int shape = stackPos(0); int flag = (stackPos(1) != 0) ? 1 : 0; - _screen->hideMouse(); restorePage3(); const int x = _sceneShapeDescs[shape].drawX; @@ -344,7 +341,6 @@ int KyraEngine_MR::o3_drawSceneShape(EMCState *script) { flagAnimObjsForRefresh(); refreshAnimObjectsIfNeed(); - _screen->showMouse(); return 0; } diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp index dd49d6faaa..e63d0a7d8f 100644 --- a/engines/kyra/sequences_lok.cpp +++ b/engines/kyra/sequences_lok.cpp @@ -838,9 +838,7 @@ void KyraEngine_LoK::seq_fillFlaskWithWater(int item, int type) { if (newItem == -1) return; - _screen->hideMouse(); setMouseItem(newItem); - _screen->showMouse(); _itemInHand = newItem; assert(_fullFlask); diff --git a/engines/kyra/sound_intern.h b/engines/kyra/sound_intern.h index 427bef66e2..827a487685 100644 --- a/engines/kyra/sound_intern.h +++ b/engines/kyra/sound_intern.h @@ -130,7 +130,6 @@ private: void fadeOutSoundEffects(); int _lastTrack; - Audio::AudioStream *_currentSFX; Audio::SoundHandle _sfxHandle; uint8 *_musicTrackData; diff --git a/engines/kyra/sound_midi.cpp b/engines/kyra/sound_midi.cpp index 0004395f6f..70cc304192 100644 --- a/engines/kyra/sound_midi.cpp +++ b/engines/kyra/sound_midi.cpp @@ -475,8 +475,8 @@ SoundMidiPC::SoundMidiPC(KyraEngine_v1 *vm, Audio::Mixer *mixer, MidiDriver *dri ::GUI::MessageDialog dialog(_("You appear to be using a General MIDI device,\n" "but your game only supports Roland MT32 MIDI.\n" "We try to map the Roland MT32 instruments to\n" - "General MIDI ones. After all it might happen\n" - "that a few tracks will not be correctly played.")); + "General MIDI ones. It is still possible that\n" + "some tracks sound incorrect.")); dialog.runModal(); } } diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 2f996de1ac..4b25db33f2 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -34,7 +34,7 @@ namespace Kyra { SoundTowns::SoundTowns(KyraEngine_v1 *vm, Audio::Mixer *mixer) - : Sound(vm, mixer), _lastTrack(-1), _currentSFX(0), _musicTrackData(0), _sfxFileData(0), _cdaPlaying(0), + : Sound(vm, mixer), _lastTrack(-1), _musicTrackData(0), _sfxFileData(0), _cdaPlaying(0), _sfxFileIndex((uint)-1), _musicFadeTable(0), _sfxWDTable(0), _sfxBTTable(0), _sfxChannel(0x46) { _driver = new TownsEuphonyDriver(_mixer); diff --git a/engines/kyra/sprites_lol.cpp b/engines/kyra/sprites_lol.cpp index a07abd4580..f4bae113c5 100644 --- a/engines/kyra/sprites_lol.cpp +++ b/engines/kyra/sprites_lol.cpp @@ -355,7 +355,7 @@ int LoLEngine::checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 object int yOffs = 0; int flag = 0; - int r = checkBlockForWallsAndSufficientSpace(calcBlockIndex(x, y), x, y, objectWidth, testFlag, wallFlag); + int r = testBlockPassability(calcBlockIndex(x, y), x, y, objectWidth, testFlag, wallFlag); if (r) return r; @@ -369,7 +369,7 @@ int LoLEngine::checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 object _objectLastDirection = 2; x2 = x + objectWidth; - r = checkBlockForWallsAndSufficientSpace(calcBlockIndex(x2, y), x, y, objectWidth, testFlag, wallFlag); + r = testBlockPassability(calcBlockIndex(x2, y), x, y, objectWidth, testFlag, wallFlag); if (r) return r; @@ -385,7 +385,7 @@ int LoLEngine::checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 object _objectLastDirection = 6; x2 = x - objectWidth; - r = checkBlockForWallsAndSufficientSpace(calcBlockIndex(x2, y), x, y, objectWidth, testFlag, wallFlag); + r = testBlockPassability(calcBlockIndex(x2, y), x, y, objectWidth, testFlag, wallFlag); if (r) return r; @@ -403,7 +403,7 @@ int LoLEngine::checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 object _objectLastDirection = 4; y2 = y + objectWidth; - r = checkBlockForWallsAndSufficientSpace(calcBlockIndex(x, y2), x, y, objectWidth, testFlag, wallFlag); + r = testBlockPassability(calcBlockIndex(x, y2), x, y, objectWidth, testFlag, wallFlag); if (r) return r; @@ -420,7 +420,7 @@ int LoLEngine::checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 object _objectLastDirection = 0; y2 = y - objectWidth; - r = checkBlockForWallsAndSufficientSpace(calcBlockIndex(x, y2), x, y, objectWidth, testFlag, wallFlag); + r = testBlockPassability(calcBlockIndex(x, y2), x, y, objectWidth, testFlag, wallFlag); if (r) return r; @@ -436,7 +436,7 @@ int LoLEngine::checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 object if (!flag) return 0; - r = checkBlockForWallsAndSufficientSpace(calcBlockIndex(x2, y2), x, y, objectWidth, testFlag, wallFlag); + r = testBlockPassability(calcBlockIndex(x2, y2), x, y, objectWidth, testFlag, wallFlag); if (r) return r; @@ -447,7 +447,7 @@ int LoLEngine::checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 object return 0; } -int LoLEngine::checkBlockForWallsAndSufficientSpace(int block, int x, int y, int objectWidth, int testFlag, int wallFlag) { +int LoLEngine::testBlockPassability(int block, int x, int y, int objectWidth, int testFlag, int wallFlag) { if (block == _currentBlock) testFlag &= 0xfffe; @@ -461,9 +461,9 @@ int LoLEngine::checkBlockForWallsAndSufficientSpace(int block, int x, int y, int if (!(testFlag & 2)) return 0; - uint16 b = _levelBlockProperties[block].assignedObjects; - while (b & 0x8000) { - LoLMonster *monster = &_monsters[b & 0x7fff]; + uint16 obj = _levelBlockProperties[block].assignedObjects; + while (obj & 0x8000) { + LoLMonster *monster = &_monsters[obj & 0x7fff]; if (monster->mode < 13) { int r = checkDrawObjectSpace(x, y, monster->x, monster->y); @@ -471,7 +471,7 @@ int LoLEngine::checkBlockForWallsAndSufficientSpace(int block, int x, int y, int return 2; } - b = findObject(b)->nextAssignedObject; + obj = findObject(obj)->nextAssignedObject; } return 0; @@ -1105,7 +1105,7 @@ void LoLEngine::updateMonster(LoLMonster *monster) { if ((monster->fightCurTick <= 0) || (checkDrawObjectSpace(_partyPosX, _partyPosY, monster->x, monster->y) > 256) || (monster->flags & 8)) setMonsterMode(monster, 7); else - rearrangeAttackingMonster(monster); + alignMonsterToParty(monster); break; case 6: @@ -1428,26 +1428,26 @@ int LoLEngine::walkMonsterCheckDest(int x, int y, LoLMonster *monster, int unk) uint8 m = monster->mode; monster->mode = 15; - int res = checkBlockBeforeObjectPlacement(x, y, monster->properties->maxWidth, 7, monster->properties->flags & 0x1000 ? 32 : unk); + int objType = checkBlockBeforeObjectPlacement(x, y, monster->properties->maxWidth, 7, monster->properties->flags & 0x1000 ? 32 : unk); monster->mode = m; - return res; + return objType; } void LoLEngine::getNextStepCoords(int16 srcX, int16 srcY, int &newX, int &newY, uint16 direction) { - static const int8 shiftTableX[] = { 0, 32, 32, 32, 0, -32, -32, -32 }; - static const int8 shiftTableY[] = { -32, -32, 0, 32, 32, 32, 0, -32 }; + static const int8 stepAdjustX[] = { 0, 32, 32, 32, 0, -32, -32, -32 }; + static const int8 stepAdjustY[] = { -32, -32, 0, 32, 32, 32, 0, -32 }; - newX = (srcX + shiftTableX[direction]) & 0x1fff; - newY = (srcY + shiftTableY[direction]) & 0x1fff; + newX = (srcX + stepAdjustX[direction]) & 0x1fff; + newY = (srcY + stepAdjustY[direction]) & 0x1fff; } -void LoLEngine::rearrangeAttackingMonster(LoLMonster *monster) { - int t = (monster->direction >> 1); +void LoLEngine::alignMonsterToParty(LoLMonster *monster) { + uint8 mdir = monster->direction >> 1; uint16 mx = monster->x; uint16 my = monster->y; - uint16 *c = (t & 1) ? &my : &mx; - bool centered = (*c & 0x7f) == 0; + uint16 *pos = (mdir & 1) ? &my : &mx; + bool centered = (*pos & 0x7f) == 0; bool posFlag = true; if (monster->properties->maxWidth <= 63) { @@ -1464,11 +1464,13 @@ void LoLEngine::rearrangeAttackingMonster(LoLMonster *monster) { r = true; } else { for (int i = 0; i < 3; i++) { - t = (t + 1) & 3; - id = _levelBlockProperties[calcNewBlockPosition(monster->block, t)].assignedObjects; + mdir = (mdir + 1) & 3; + id = _levelBlockProperties[calcNewBlockPosition(monster->block, mdir)].assignedObjects; id = (id & 0x8000) ? (id & 0x7fff) : 0xffff; - if (id != 0xffff) + if (id != 0xffff) { r = true; + break; + } } } } @@ -1484,15 +1486,15 @@ void LoLEngine::rearrangeAttackingMonster(LoLMonster *monster) { return; if (posFlag) { - if (*c & 0x80) - *c -= 32; + if (*pos & 0x80) + *pos -= 32; else - *c += 32; + *pos += 32; } else { - if (*c & 0x80) - *c += 32; + if (*pos & 0x80) + *pos += 32; else - *c -= 32; + *pos -= 32; } if (walkMonsterCheckDest(mx, my, monster, 4)) @@ -1502,8 +1504,10 @@ void LoLEngine::rearrangeAttackingMonster(LoLMonster *monster) { int fy = _partyPosY; calcSpriteRelPosition(mx, my, fx, fy, monster->direction >> 1); - t = (fx < 0) ? -fx : fx; - if (fy > 160 || t > 80) + if (fx < 0) + fx = -fx; + + if (fy > 160 || fx > 80) return; placeMonster(monster, mx, my); diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 423b827092..00dc4f9e13 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -38,7 +38,7 @@ namespace Kyra { -#define RESFILE_VERSION 82 +#define RESFILE_VERSION 83 namespace { bool checkKyraDat(Common::SeekableReadStream *file) { diff --git a/engines/kyra/text_hof.cpp b/engines/kyra/text_hof.cpp index 4a52d7d740..06067d6693 100644 --- a/engines/kyra/text_hof.cpp +++ b/engines/kyra/text_hof.cpp @@ -42,9 +42,7 @@ void TextDisplayer_HoF::restoreTalkTextMessageBkgd(int srcPage, int dstPage) { void TextDisplayer_HoF::restoreScreen() { _vm->restorePage3(); _vm->drawAnimObjects(); - _screen->hideMouse(); _screen->copyRegion(_talkCoords.x, _talkMessageY, _talkCoords.x, _talkMessageY, _talkCoords.w, _talkMessageH, 2, 0, Screen::CR_NO_P_CHECK); - _screen->showMouse(); _vm->flagAnimObjsForRefresh(); _vm->refreshAnimObjects(0); } @@ -58,8 +56,6 @@ void TextDisplayer_HoF::printCustomCharacterText(const char *text, int x, int y, int x1 = 0, x2 = 0; calcWidestLineBounds(x1, x2, w, x); - _screen->hideMouse(); - _talkCoords.x = x1; _talkCoords.w = w+2; _talkCoords.y = y; @@ -78,7 +74,6 @@ void TextDisplayer_HoF::printCustomCharacterText(const char *text, int x, int y, } _screen->_curPage = curPageBackUp; - _screen->showMouse(); } char *TextDisplayer_HoF::preprocessString(const char *str) { @@ -248,8 +243,6 @@ void KyraEngine_HoF::objectChatInit(const char *str, int object, int vocHigh, in restorePage3(); _text->backupTalkTextMessageBkgd(2, 2); - _screen->hideMouse(); - _chatTextEnabled = textEnabled(); if (_chatTextEnabled) { objectChatPrintText(str, object); @@ -264,8 +257,6 @@ void KyraEngine_HoF::objectChatInit(const char *str, int object, int vocHigh, in } else { _chatVocHigh = _chatVocLow = -1; } - - _screen->showMouse(); } void KyraEngine_HoF::objectChatPrintText(const char *str, int object) { diff --git a/engines/kyra/text_lok.cpp b/engines/kyra/text_lok.cpp index 62bdf18816..a557940868 100644 --- a/engines/kyra/text_lok.cpp +++ b/engines/kyra/text_lok.cpp @@ -296,10 +296,8 @@ void KyraEngine_LoK::characterSays(int vocFile, const char *chatStr, int8 charNu _animator->restoreAllObjectBackgrounds(); _screen->copyRegion(12, _text->_talkMessageY, 12, 136, 296, _text->_talkMessageH, 2, 2); - _screen->hideMouse(); _text->printCharacterText(processedString, charNum, _characterList[charNum].x1); - _screen->showMouse(); } if (chatDuration == -2) @@ -317,10 +315,8 @@ void KyraEngine_LoK::characterSays(int vocFile, const char *chatStr, int8 charNu _screen->copyRegion(12, 136, 12, _text->_talkMessageY, 296, _text->_talkMessageH, 2, 2); _animator->preserveAllBackgrounds(); _animator->prepDrawAllObjects(); - _screen->hideMouse(); _screen->copyRegion(12, _text->_talkMessageY, 12, _text->_talkMessageY, 296, _text->_talkMessageH, 2, 0); - _screen->showMouse(); _animator->flagAllObjectsForRefresh(); _animator->copyChangedObjectsForward(0); } @@ -332,7 +328,6 @@ void KyraEngine_LoK::characterSays(int vocFile, const char *chatStr, int8 charNu } void KyraEngine_LoK::drawSentenceCommand(const char *sentence, int color) { - _screen->hideMouse(); _screen->fillRect(8, 143, 311, 152, _flags.platform == Common::kPlatformAmiga ? 19 : 12); if (_flags.platform == Common::kPlatformAmiga) { @@ -354,7 +349,6 @@ void KyraEngine_LoK::drawSentenceCommand(const char *sentence, int color) { } _text->printText(sentence, 8, 143, 0xFF, _flags.platform == Common::kPlatformAmiga ? 19 : 12, 0); - _screen->showMouse(); setTextFadeTimerCountdown(15); _fadeText = false; } diff --git a/engines/kyra/text_mr.cpp b/engines/kyra/text_mr.cpp index b680e9c6f9..10b0880f29 100644 --- a/engines/kyra/text_mr.cpp +++ b/engines/kyra/text_mr.cpp @@ -145,9 +145,7 @@ void TextDisplayer_MR::printText(const char *str, int x, int y, uint8 c0, uint8 void TextDisplayer_MR::restoreScreen() { _vm->restorePage3(); _vm->drawAnimObjects(); - _screen->hideMouse(); _screen->copyRegion(_talkCoords.x, _talkMessageY, _talkCoords.x, _talkMessageY, _talkCoords.w, _talkMessageH, 2, 0, Screen::CR_NO_P_CHECK); - _screen->showMouse(); _vm->flagAnimObjsForRefresh(); _vm->refreshAnimObjects(0); } @@ -261,8 +259,6 @@ void KyraEngine_MR::objectChatInit(const char *str, int object, int vocHigh, int restorePage3(); - _screen->hideMouse(); - _chatTextEnabled = textEnabled(); if (_chatTextEnabled) { objectChatPrintText(str, object); @@ -277,8 +273,6 @@ void KyraEngine_MR::objectChatInit(const char *str, int object, int vocHigh, int } else { _chatVocHigh = _chatVocLow = -1; } - - _screen->showMouse(); } void KyraEngine_MR::objectChatPrintText(const char *str, int object) { |