From 19e4bca41c6ecc1f4f71f04d919af75bc14f2d58 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 5 Apr 2016 21:14:34 -0400 Subject: TITANIC: Set up cursors enum with better names --- engines/titanic/core/game_object.cpp | 2 +- engines/titanic/core/link_item.cpp | 10 +++++----- engines/titanic/core/view_item.cpp | 6 +++--- engines/titanic/support/mouse_cursor.cpp | 4 ++-- engines/titanic/support/mouse_cursor.h | 30 +++++++++++++++--------------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index 510e455656..d66fa58cb4 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -47,7 +47,7 @@ CGameObject::CGameObject(): CNamedItem() { _field58 = 0; _visible = true; _field60 = 0; - _cursorId = CURSOR_1; + _cursorId = CURSOR_ARROW; _field78 = 0; _frameNumber = -1; _field90 = 0; diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp index 5ca64b1c59..285838b692 100644 --- a/engines/titanic/core/link_item.cpp +++ b/engines/titanic/core/link_item.cpp @@ -32,7 +32,7 @@ CLinkItem::CLinkItem() : CNamedItem() { _nodeNumber = -1; _viewNumber = -1; _field30 = 0; - _cursorId = CURSOR_1; + _cursorId = CURSOR_ARROW; _name = "Link"; } @@ -93,16 +93,16 @@ void CLinkItem::load(SimpleFile *file) { if (val < 2) { switch (_field30) { case 2: - _cursorId = CURSOR_2; + _cursorId = CURSOR_MOVE_LEFT; break; case 3: - _cursorId = CURSOR_3; + _cursorId = CURSOR_MOVE_RIGHT; break; case 5: - _cursorId = CURSOR_7; + _cursorId = CURSOR_MOVE_FORWARD; break; default: - _cursorId = CURSOR_4; + _cursorId = CURSOR_MOVE_FORWARD2; break; } } diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp index 47cdabbb50..c5cd77874b 100644 --- a/engines/titanic/core/view_item.cpp +++ b/engines/titanic/core/view_item.cpp @@ -204,7 +204,7 @@ bool CViewItem::handleMessage(CMouseMoveMsg &msg) { CScreenManager *screenManager = CScreenManager::_screenManagerPtr; if (handleMouseMsg(&msg, true)) { - screenManager->_mouseCursor->setCursor(CURSOR_1); + screenManager->_mouseCursor->setCursor(CURSOR_ARROW); } else { // Iterate through each link item, and if any is highlighted, // change the mouse cursor to the designated cursor for the item @@ -219,7 +219,7 @@ bool CViewItem::handleMessage(CMouseMoveMsg &msg) { } if (!handleMouseMsg(&msg, false)) - screenManager->_mouseCursor->setCursor(CURSOR_1); + screenManager->_mouseCursor->setCursor(CURSOR_ARROW); } return true; @@ -250,7 +250,7 @@ bool CViewItem::handleMouseMsg(CMouseMsg *msg, bool flag) { return false; for (int idx = (int)gameObjects.size() - 1; idx >= 0; ++idx) { - if (gameObjects[idx]->_cursorId != CURSOR_12) { + if (gameObjects[idx]->_cursorId != CURSOR_ARROW2) { CScreenManager::_screenManagerPtr->_mouseCursor->setCursor(gameObjects[idx]->_cursorId); return true; } diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp index 6db3618003..c4c57c6f07 100644 --- a/engines/titanic/support/mouse_cursor.cpp +++ b/engines/titanic/support/mouse_cursor.cpp @@ -50,9 +50,9 @@ static const int CURSOR_DATA[NUM_CURSORS][4] = { }; CMouseCursor::CMouseCursor(CScreenManager *screenManager) : - _screenManager(screenManager), _cursorId(CURSOR_15) { + _screenManager(screenManager), _cursorId(CURSOR_HOURGLASS) { loadCursorImages(); - setCursor(CURSOR_1); + setCursor(CURSOR_ARROW); } CMouseCursor::~CMouseCursor() { diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h index 507f4ecc17..28e13a82c4 100644 --- a/engines/titanic/support/mouse_cursor.h +++ b/engines/titanic/support/mouse_cursor.h @@ -31,21 +31,21 @@ namespace Titanic { #define NUM_CURSORS 15 enum CursorId { - CURSOR_1 = 1, - CURSOR_2 = 3, - CURSOR_3 = 3, - CURSOR_4 = 4, - CURSOR_5 = 5, - CURSOR_6 = 6, - CURSOR_7 = 7, - CURSOR_8 = 8, - CURSOR_9 = 9, - CURSOR_10 = 10, - CURSOR_11 = 11, - CURSOR_12 = 12, - CURSOR_13 = 13, - CURSOR_14 = 14, - CURSOR_15 = 15 + CURSOR_ARROW = 1, + CURSOR_MOVE_LEFT = 2, + CURSOR_MOVE_RIGHT = 3, + CURSOR_MOVE_FORWARD = 4, + CURSOR_MOVE_UP = 5, + CURSOR_MOVE_DOWN1 = 6, + CURSOR_MOVE_FORWARD2 = 7, + CURSOR_HAND = 8, + CURSOR_STAR = 9, + CURSOR_INVALID = 10, + CURSOR_MAGNIFIER = 11, + CURSOR_ARROW2 = 12, + CURSOR_BACKWARDS = 13, + CURSOR_DOWN = 14, + CURSOR_HOURGLASS = 15 }; class CScreenManager; -- cgit v1.2.3