aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2011-11-23 17:55:15 +1100
committerPaul Gilbert2011-11-23 17:55:15 +1100
commitafc92983bea4c060917a2388e89d405df388d522 (patch)
treeee228dbf3c1a53892ab75296aa76d3b913b77b4a
parentf5e945c7d1276be68881ffdd395a91dd6a2266f1 (diff)
downloadscummvm-rg350-afc92983bea4c060917a2388e89d405df388d522.tar.gz
scummvm-rg350-afc92983bea4c060917a2388e89d405df388d522.tar.bz2
scummvm-rg350-afc92983bea4c060917a2388e89d405df388d522.zip
TSAGE: Bugfixes for R2RW SceneExit class
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp35
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.h6
2 files changed, 23 insertions, 18 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index 6a390df611..2946c9464f 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -937,7 +937,7 @@ void SceneArea::process(Event &event) {
R2_GLOBALS._events.setCursor(_cursorNum);
}
_insideArea = true;
- } else if ((event.mousePos.y < 171) && _insideArea && (_cursorNum != cursor) &&
+ } else if ((event.mousePos.y < 171) && _insideArea && (_cursorNum == cursor) &&
(_savedCursorNum != CURSOR_NONE)) {
// Cursor moved outside bounded area
R2_GLOBALS._events.setCursor(_savedCursorNum);
@@ -980,21 +980,26 @@ void SceneExit::process(Event &event) {
if (!R2_GLOBALS._insetUp) {
SceneArea::process(event);
- if (_enabled && (event.eventType == EVENT_BUTTON_DOWN)) {
- if (!_bounds.contains(event.mousePos))
- _moving = 0;
- else if (!R2_GLOBALS._player._canWalk) {
- _moving = 0;
- changeScene();
- event.handled = true;
- } else {
- Common::Point dest((_destPos.x == -1) ? event.mousePos.x : _destPos.x,
- (_destPos.y == -1) ? event.mousePos.y : _destPos.y);
- ADD_PLAYER_MOVER(dest.x, dest.y);
-
- _moving = true;
- event.handled = true;
+ if (_enabled) {
+ if (event.eventType == EVENT_BUTTON_DOWN) {
+ if (!_bounds.contains(event.mousePos))
+ _moving = false;
+ else if (!R2_GLOBALS._player._canWalk) {
+ _moving = false;
+ changeScene();
+ event.handled = true;
+ } else {
+ Common::Point dest((_destPos.x == -1) ? event.mousePos.x : _destPos.x,
+ (_destPos.y == -1) ? event.mousePos.y : _destPos.y);
+ ADD_PLAYER_MOVER(dest.x, dest.y);
+
+ _moving = true;
+ event.handled = true;
+ }
}
+
+ if (_moving && (_bounds.contains(R2_GLOBALS._player._position) || (R2_GLOBALS._player._position == _destPos)))
+ changeScene();
}
}
}
diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h
index 152e6f8518..9eaa1b0cd1 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.h
+++ b/engines/tsage/ringworld2/ringworld2_logic.h
@@ -66,9 +66,9 @@ public:
Common::Point _destPos;
public:
SceneExit();
- void setDetails(const Rect &bounds, CursorType cursor, int sceneNumber);
- void setDest(const Common::Point &p) { _destPos = p; }
- void changeScene();
+ virtual void setDetails(const Rect &bounds, CursorType cursor, int sceneNumber);
+ virtual void setDest(const Common::Point &p) { _destPos = p; }
+ virtual void changeScene();
virtual void synchronize(Serializer &s);
virtual void process(Event &event);