[Scummvm-cvs-logs] scummvm master -> 84db0f60b02414b2f223da190f2797cd9381df8d
athrxx
athrxx at scummvm.org
Wed Feb 16 16:33:05 CET 2011
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
d7e700f370 KYRA/LOL: fixed hand item cursor bug
e23696d900 KYRA/LOL: add comments for last commit
84db0f60b0 Merge branch 'master' of https://github.com/scummvm/scummvm
Commit: d7e700f370c258a5f4786d972af3666b93b71f94
https://github.com/scummvm/scummvm/commit/d7e700f370c258a5f4786d972af3666b93b71f94
Author: athrxx (athrxx at scummvm.org)
Date: 2011-02-16T07:23:44-08:00
Commit Message:
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.
Changed paths:
engines/kyra/kyra_hof.cpp
engines/kyra/kyra_lok.cpp
engines/kyra/kyra_mr.cpp
engines/kyra/kyra_v1.cpp
engines/kyra/kyra_v1.h
engines/kyra/lol.cpp
engines/kyra/saveload_hof.cpp
engines/kyra/saveload_lok.cpp
engines/kyra/saveload_lol.cpp
engines/kyra/saveload_mr.cpp
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp
index 5c471a8..49b1d17 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 d46fc2d..4468a53 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 a6b99ff..461ed26 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 f5b9641..fec37dc 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 12b9fb5..cf51774 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 36bc0c9..63a36e3 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 ced103b..7a487dc 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 3e11d3d..012ff13 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 ee4fbf4..b6c0693 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 7c583f9..a5e9b9e 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);
Commit: e23696d90077bbda05421a72ee3290bb00e52b22
https://github.com/scummvm/scummvm/commit/e23696d90077bbda05421a72ee3290bb00e52b22
Author: athrxx (athrxx at scummvm.org)
Date: 2011-02-16T07:31:22-08:00
Commit Message:
KYRA/LOL: add comments for last commit
Changed paths:
engines/kyra/kyra_hof.cpp
engines/kyra/kyra_lok.cpp
engines/kyra/kyra_mr.cpp
engines/kyra/lol.cpp
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp
index 49b1d17..990e55b 100644
--- a/engines/kyra/kyra_hof.cpp
+++ b/engines/kyra/kyra_hof.cpp
@@ -505,6 +505,9 @@ void KyraEngine_HoF::runLoop() {
removeInputTop();
if (_updateHandItemCursor) {
+ // This works around an issue which would occur when setHandItem(_itemInHand)
+ // was called from inside loadGameState(). When loading via GMM the
+ // mouse cursor would not be set correctly.
_updateHandItemCursor = false;
setHandItem(_itemInHand);
}
diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp
index 4468a53..7526216 100644
--- a/engines/kyra/kyra_lok.cpp
+++ b/engines/kyra/kyra_lok.cpp
@@ -820,6 +820,9 @@ void KyraEngine_LoK::updateMousePointer(bool forceUpdate) {
}
if (_updateHandItemCursor) {
+ // This works around an issue which would occur when setHandItem(_itemInHand)
+ // was called from inside loadGameState(). When loading via GMM the
+ // mouse cursor would not be set correctly.
_updateHandItemCursor = false;
setHandItem(_itemInHand);
}
diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp
index 461ed26..b863ef5 100644
--- a/engines/kyra/kyra_mr.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -967,6 +967,9 @@ void KyraEngine_MR::runLoop() {
removeInputTop();
if (_updateHandItemCursor) {
+ // This works around an issue which would occur when setHandItem(_itemInHand)
+ // was called from inside loadGameState(). When loading via GMM the
+ // mouse cursor would not be set correctly.
_updateHandItemCursor = false;
setHandItem(_itemInHand);
}
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 63a36e3..7003d8c 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -932,6 +932,9 @@ void LoLEngine::runLoop() {
gui_updateInput();
if (_updateHandItemCursor) {
+ // This works around an issue which would occur when setHandItem(_itemInHand)
+ // was called from inside loadGameState(). When loading via GMM the
+ // mouse cursor would not be set correctly.
_updateHandItemCursor = false;
setHandItem(_itemInHand);
}
Commit: 84db0f60b02414b2f223da190f2797cd9381df8d
https://github.com/scummvm/scummvm/commit/84db0f60b02414b2f223da190f2797cd9381df8d
Author: athrxx (athrxx at scummvm.org)
Date: 2011-02-16T07:32:26-08:00
Commit Message:
Merge branch 'master' of https://github.com/scummvm/scummvm
Changed paths:
engines/parallaction/graphics.cpp
More information about the Scummvm-git-logs
mailing list