KYRA/LOL: fixed hand item cursor bug

This fixes a bug when loading savegames with different active hand items via GMM. The mouse cursor was not set to the active hand item in these cases.
This commit is contained in:
athrxx 2011-02-16 16:23:44 +01:00
parent 68e468ee01
commit d7e700f370
10 changed files with 28 additions and 4 deletions

View File

@ -504,6 +504,11 @@ void KyraEngine_HoF::runLoop() {
int inputFlag = checkInput(_buttonList, true);
removeInputTop();
if (_updateHandItemCursor) {
_updateHandItemCursor = false;
setHandItem(_itemInHand);
}
update();
if (inputFlag == 198 || inputFlag == 199) {

View File

@ -819,6 +819,11 @@ void KyraEngine_LoK::updateMousePointer(bool forceUpdate) {
newY = 4;
}
if (_updateHandItemCursor) {
_updateHandItemCursor = false;
setHandItem(_itemInHand);
}
if ((newMouseState && _mouseState != newMouseState) || (newMouseState && forceUpdate)) {
_mouseState = newMouseState;
_screen->hideMouse();

View File

@ -966,6 +966,11 @@ void KyraEngine_MR::runLoop() {
int inputFlag = checkInput(_mainButtonList, true);
removeInputTop();
if (_updateHandItemCursor) {
_updateHandItemCursor = false;
setHandItem(_itemInHand);
}
update();
_timer->update();

View File

@ -65,6 +65,7 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags)
_gameToLoad = -1;
_mouseState = -1;
_updateHandItemCursor = false;
_deathHandler = -1;
memset(_flagsTable, 0, sizeof(_flagsTable));

View File

@ -343,6 +343,9 @@ protected:
virtual void setHandItem(Item item) = 0;
virtual void removeHandItem() = 0;
void setDelayedCursorUpdate() { _updateHandItemCursor = true; }
bool _updateHandItemCursor;
// game flags
uint8 _flagsTable[100]; // TODO: check this value

View File

@ -931,6 +931,11 @@ void LoLEngine::runLoop() {
checkFloatingPointerRegions();
gui_updateInput();
if (_updateHandItemCursor) {
_updateHandItemCursor = false;
setHandItem(_itemInHand);
}
update();
if (_sceneUpdateRequired)

View File

@ -311,7 +311,7 @@ Common::Error KyraEngine_HoF::loadGameState(int slot) {
_mainCharacter.facing = 4;
enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1);
setHandItem(_itemInHand);
setDelayedCursorUpdate();
if (_lastMusicCommand >= 0 && !_unkSceneScreenFlag1)
snd_playWanderScoreViaMap(_lastMusicCommand, 1);

View File

@ -176,7 +176,7 @@ Common::Error KyraEngine_LoK::loadGameState(int slot) {
_screen->copyRegion(8, 8, 8, 8, 304, 212, 10, 0);
}
setHandItem(_itemInHand);
setDelayedCursorUpdate();
// Will-O-Wisp uses a different shape size than Brandon's usual
// shape, thus we need to setup the correct size depending on

View File

@ -263,7 +263,7 @@ Common::Error LoLEngine::loadGameState(int slot) {
int t = _credits;
_credits = 0;
giveCredits(t, 0);
setHandItem(_itemInHand);
setDelayedCursorUpdate();
loadLevel(_currentLevel);
gui_drawPlayField();
timerSpecialCharacterUpdate(0);

View File

@ -308,7 +308,7 @@ Common::Error KyraEngine_MR::loadGameState(int slot) {
_goodConsciencePosition = false;
enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1);
setHandItem(_itemInHand);
setDelayedCursorUpdate();
if (_lastMusicCommand >= 0 && !_unkSceneScreenFlag1)
snd_playWanderScoreViaMap(_lastMusicCommand, 1);