aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMarisa-Chan2013-11-20 11:45:52 +0000
committerMarisa-Chan2013-11-20 11:45:52 +0000
commitf877410feef2e0030dd6c0664d615cc86118ca29 (patch)
tree69bde4e3aa6c151be55311106298a0ce7688522d /engines
parentff541a0d021796d0c42d627dc4dcfe91c1335487 (diff)
downloadscummvm-rg350-f877410feef2e0030dd6c0664d615cc86118ca29.tar.gz
scummvm-rg350-f877410feef2e0030dd6c0664d615cc86118ca29.tar.bz2
scummvm-rg350-f877410feef2e0030dd6c0664d615cc86118ca29.zip
ZVISION: Add new ChangeCursor method for load items icons.
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/cursor_manager.cpp17
-rw-r--r--engines/zvision/cursor_manager.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/engines/zvision/cursor_manager.cpp b/engines/zvision/cursor_manager.cpp
index 385e4dcc9c..de229a38d8 100644
--- a/engines/zvision/cursor_manager.cpp
+++ b/engines/zvision/cursor_manager.cpp
@@ -116,6 +116,23 @@ void CursorManager::changeCursor(const Common::String &cursorName, bool pushed)
warning("No cursor found for identifier %s", cursorName.c_str());
}
+void CursorManager::changeCursor(int id, bool active, bool pushed) {
+ Common::String file;
+ if (_engine->getGameId() == GID_NEMESIS) {
+ file = Common::String::format("%2.2d%s%c.zcr", id, active ? "act" : "idle", pushed ? 'b' : 'a');
+ } else if (_engine->getGameId() == GID_GRANDINQUISITOR) {
+ file = Common::String::format("g0b%cc%2.2x1.zcr", active ? (pushed ? 'd' : 'c') : (pushed ? 'b' : 'a') , id);
+ } else
+ return;
+
+ if (_currentCursor.equals(file))
+ return;
+
+ _currentCursor = file;
+
+ changeCursor(ZorkCursor(file));
+}
+
void CursorManager::changeCursor(const ZorkCursor &cursor) {
CursorMan.replaceCursor(cursor.getSurface(), cursor.getWidth(), cursor.getHeight(), cursor.getHotspotX(), cursor.getHotspotY(), cursor.getKeyColor(), false, _pixelFormat);
}
diff --git a/engines/zvision/cursor_manager.h b/engines/zvision/cursor_manager.h
index 0173bf810c..ac79b259fa 100644
--- a/engines/zvision/cursor_manager.h
+++ b/engines/zvision/cursor_manager.h
@@ -81,6 +81,8 @@ public:
* @param pushed Should the cursor be pushed (true) or not pushed (false) (Another way to say it: down or up)
*/
void changeCursor(const Common::String &cursorName, bool pushed);
+
+ void changeCursor(int id, bool active, bool pushed);
/**
* Change the cursor to a certain push state. If the cursor is already in the specified push state, nothing will happen.
*