aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorathrxx2011-02-16 16:23:44 +0100
committerathrxx2011-02-16 16:23:44 +0100
commitd7e700f370c258a5f4786d972af3666b93b71f94 (patch)
tree5a4bf4203b9088e29ee0146715720ae46208bf08 /engines/kyra
parent68e468ee01b243e31b154a7fab42396c9b24e5f0 (diff)
downloadscummvm-rg350-d7e700f370c258a5f4786d972af3666b93b71f94.tar.gz
scummvm-rg350-d7e700f370c258a5f4786d972af3666b93b71f94.tar.bz2
scummvm-rg350-d7e700f370c258a5f4786d972af3666b93b71f94.zip
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.
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/kyra_hof.cpp5
-rw-r--r--engines/kyra/kyra_lok.cpp5
-rw-r--r--engines/kyra/kyra_mr.cpp5
-rw-r--r--engines/kyra/kyra_v1.cpp1
-rw-r--r--engines/kyra/kyra_v1.h3
-rw-r--r--engines/kyra/lol.cpp5
-rw-r--r--engines/kyra/saveload_hof.cpp2
-rw-r--r--engines/kyra/saveload_lok.cpp2
-rw-r--r--engines/kyra/saveload_lol.cpp2
-rw-r--r--engines/kyra/saveload_mr.cpp2
10 files changed, 28 insertions, 4 deletions
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp
index 5c471a8c8b..49b1d17d73 100644
--- a/engines/kyra/kyra_hof.cpp
+++ b/engines/kyra/kyra_hof.cpp
@@ -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) {
diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp
index d46fc2d502..4468a53a94 100644
--- a/engines/kyra/kyra_lok.cpp
+++ b/engines/kyra/kyra_lok.cpp
@@ -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();
diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp
index a6b99fffbf..461ed26710 100644
--- a/engines/kyra/kyra_mr.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -966,6 +966,11 @@ void KyraEngine_MR::runLoop() {
int inputFlag = checkInput(_mainButtonList, true);
removeInputTop();
+ if (_updateHandItemCursor) {
+ _updateHandItemCursor = false;
+ setHandItem(_itemInHand);
+ }
+
update();
_timer->update();
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index f5b96410e8..fec37dccc9 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -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));
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index 12b9fb5942..cf51774b0f 100644
--- a/engines/kyra/kyra_v1.h
+++ b/engines/kyra/kyra_v1.h
@@ -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
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 36bc0c99d7..63a36e3387 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -931,6 +931,11 @@ void LoLEngine::runLoop() {
checkFloatingPointerRegions();
gui_updateInput();
+ if (_updateHandItemCursor) {
+ _updateHandItemCursor = false;
+ setHandItem(_itemInHand);
+ }
+
update();
if (_sceneUpdateRequired)
diff --git a/engines/kyra/saveload_hof.cpp b/engines/kyra/saveload_hof.cpp
index ced103b7e3..7a487dcf7b 100644
--- a/engines/kyra/saveload_hof.cpp
+++ b/engines/kyra/saveload_hof.cpp
@@ -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);
diff --git a/engines/kyra/saveload_lok.cpp b/engines/kyra/saveload_lok.cpp
index 3e11d3dad3..012ff138b5 100644
--- a/engines/kyra/saveload_lok.cpp
+++ b/engines/kyra/saveload_lok.cpp
@@ -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
diff --git a/engines/kyra/saveload_lol.cpp b/engines/kyra/saveload_lol.cpp
index ee4fbf4dc1..b6c0693a16 100644
--- a/engines/kyra/saveload_lol.cpp
+++ b/engines/kyra/saveload_lol.cpp
@@ -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);
diff --git a/engines/kyra/saveload_mr.cpp b/engines/kyra/saveload_mr.cpp
index 7c583f95ee..a5e9b9e0f5 100644
--- a/engines/kyra/saveload_mr.cpp
+++ b/engines/kyra/saveload_mr.cpp
@@ -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);