aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2011-05-11 20:28:30 +1000
committerPaul Gilbert2011-05-11 20:28:30 +1000
commit2b112a9c587c82af3b5df3b63e6eaa51401e6c37 (patch)
treed4c031855d7d00a9d75ba7f04386f00e5b1bbe84 /engines
parente448ad0f5dbaa0a5ad5e82bfbccda32df25956dd (diff)
downloadscummvm-rg350-2b112a9c587c82af3b5df3b63e6eaa51401e6c37.tar.gz
scummvm-rg350-2b112a9c587c82af3b5df3b63e6eaa51401e6c37.tar.bz2
scummvm-rg350-2b112a9c587c82af3b5df3b63e6eaa51401e6c37.zip
TSAGE: Rework parts of the cursor code to better match the original
This also fixes the problem with the cursor appearing in cutscenes when you press any key
Diffstat (limited to 'engines')
-rw-r--r--engines/tsage/dialogs.cpp5
-rw-r--r--engines/tsage/events.cpp30
-rw-r--r--engines/tsage/events.h1
-rw-r--r--engines/tsage/ringworld_logic.cpp3
-rw-r--r--engines/tsage/ringworld_scenes2.cpp2
5 files changed, 18 insertions, 23 deletions
diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp
index f8e35f74f9..4eb35d9d44 100644
--- a/engines/tsage/dialogs.cpp
+++ b/engines/tsage/dialogs.cpp
@@ -73,12 +73,11 @@ MessageDialog::MessageDialog(const Common::String &message, const Common::String
int MessageDialog::show(const Common::String &message, const Common::String &btn1Message, const Common::String &btn2Message) {
// Ensure that the cursor is the arrow
- _globals->_events.pushCursor(CURSOR_ARROW);
- _globals->_events.showCursor();
+ _globals->_events.setCursor(CURSOR_ARROW);
int result = show2(message, btn1Message, btn2Message);
- _globals->_events.popCursor();
+ _globals->_events.setCursorFromFlag();
return result;
}
diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp
index e51c5da479..cc2e3f0933 100644
--- a/engines/tsage/events.cpp
+++ b/engines/tsage/events.cpp
@@ -38,7 +38,7 @@ namespace tSage {
EventsClass::EventsClass() {
_currentCursor = CURSOR_NONE;
- hideCursor();
+ _lastCursor = CURSOR_NONE;
_frameNumber = 0;
_priorFrameTime = 0;
_prevDelayFrame = 0;
@@ -140,17 +140,11 @@ bool EventsClass::getEvent(Event &evt, int eventMask) {
* @cursorType Specified cursor number
*/
void EventsClass::setCursor(CursorType cursorType) {
- _globals->clearFlag(122);
-
- if ((_currentCursor == cursorType) && CursorMan.isVisible())
+ if (cursorType == _lastCursor)
return;
- if (cursorType == CURSOR_NONE) {
- if (CursorMan.isVisible())
- CursorMan.showMouse(false);
- return;
- }
-
+ _lastCursor = cursorType;
+ _globals->clearFlag(122);
CursorMan.showMouse(true);
const byte *cursor;
@@ -158,8 +152,8 @@ void EventsClass::setCursor(CursorType cursorType) {
uint size;
switch (cursorType) {
- case OBJECT_STUNNER:
- // Stunner cursor
+ case CURSOR_NONE:
+ // No cursor
cursor = _resourceManager->getSubResource(4, 1, 6, &size);
_globals->setFlag(122);
break;
@@ -215,8 +209,8 @@ void EventsClass::pushCursor(CursorType cursorType) {
uint size;
switch (cursorType) {
- case CURSOR_CROSSHAIRS:
- // Crosshairs cursor
+ case CURSOR_NONE:
+ // No cursor
cursor = _resourceManager->getSubResource(4, 1, 6, &size);
break;
@@ -273,19 +267,19 @@ void EventsClass::setCursor(Graphics::Surface &cursor, int transColor, const Com
}
void EventsClass::setCursorFromFlag() {
- setCursor(_globals->getFlag(122) ? CURSOR_CROSSHAIRS : _currentCursor);
+ setCursor(isCursorVisible() ? _currentCursor : CURSOR_NONE);
}
void EventsClass::showCursor() {
- CursorMan.showMouse(true);
+ setCursor(_currentCursor);
}
void EventsClass::hideCursor() {
- CursorMan.showMouse(false);
+ setCursor(CURSOR_NONE);
}
bool EventsClass::isCursorVisible() const {
- return CursorMan.isVisible();
+ return !_globals->getFlag(122);
}
/**
diff --git a/engines/tsage/events.h b/engines/tsage/events.h
index d2dbd9e058..2e6f19a151 100644
--- a/engines/tsage/events.h
+++ b/engines/tsage/events.h
@@ -80,6 +80,7 @@ public:
Common::Point _mousePos;
CursorType _currentCursor;
+ CursorType _lastCursor;
void setCursor(CursorType cursorType);
void pushCursor(CursorType cursorType);
diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp
index d334e0ce1f..b4f2ed4909 100644
--- a/engines/tsage/ringworld_logic.cpp
+++ b/engines/tsage/ringworld_logic.cpp
@@ -1328,10 +1328,9 @@ void RingworldGame::handleSaveLoad(bool saveFlag, int &saveSlot, Common::String
}
void RingworldGame::start() {
- // Set some default flags and cursor
+ // Set some default flags
_globals->setFlag(12);
_globals->setFlag(34);
- _globals->_events.setCursor(CURSOR_WALK);
// Set the screen to scroll in response to the player moving off-screen
_globals->_scrollFollower = &_globals->_player;
diff --git a/engines/tsage/ringworld_scenes2.cpp b/engines/tsage/ringworld_scenes2.cpp
index 6a8db81adf..c3edbf9fa7 100644
--- a/engines/tsage/ringworld_scenes2.cpp
+++ b/engines/tsage/ringworld_scenes2.cpp
@@ -113,6 +113,8 @@ void Scene1000::Action3::signal() {
setDelay(240);
break;
case 5: {
+ _globals->_player.enableControl();
+
const char *SEEN_INTRO = "seen_intro";
if (!ConfMan.hasKey(SEEN_INTRO) || !ConfMan.getBool(SEEN_INTRO)) {
// First time being played, so show the introduction