From 946d0582dcd24ceeb4245c1709b65f2de4ee480a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 29 Apr 2006 11:19:55 +0000 Subject: Added proper action display after selection along with showing the camera cursor svn-id: r22208 --- engines/lure/room.cpp | 43 ++++++++++++++++++++++++++++++------------- engines/lure/room.h | 5 +++++ 2 files changed, 35 insertions(+), 13 deletions(-) (limited to 'engines') diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp index dcedde6583..4452acad71 100644 --- a/engines/lure/room.cpp +++ b/engines/lure/room.cpp @@ -83,6 +83,8 @@ Room::Room(): _screen(Screen::getReference()) { _showInfo = false; _isExit = false; _destRoomNumber = 0; +//****DEBUG**** + memset(tempLayer, 0, DECODED_PATHS_WIDTH * DECODED_PATHS_HEIGHT * 2); } Room::~Room() { @@ -194,18 +196,19 @@ void Room::checkRoomHotspots() { _hotspotId = 0; _hotspotNameId = 0; _hotspot = NULL; + _destRoomNumber = 0; } else { _hotspotNameId = entry->nameId; _hotspot = entry; _hotspotId = entry->hotspotId; _isExit = false; - _destRoomNumber = 0; } } uint8 Room::checkRoomExits() { Mouse &m = Mouse::getReference(); Resources &res = Resources::getReference(); + _destRoomNumber = 0; RoomExitHotspotList &exits = _roomData->exitHotspots; if (exits.empty()) return CURSOR_ARROW; @@ -422,16 +425,19 @@ void Room::update() { } else { char buffer[MAX_DESC_SIZE]; strcpy(buffer, res.getCurrentActionStr()); - strcat(buffer, " "); - if (usedId != 0xffff) { - uint16 nameId = res.getHotspot(usedId)->nameId; - strings.getString(nameId, buffer + strlen(buffer), NULL, NULL); - if (action == GIVE) strcat(buffer, " to "); - else strcat(buffer, " on "); - } + if (action != STATUS) { + strcat(buffer, " "); - strcat(buffer, _hotspotName); + if (usedId != 0xffff) { + uint16 nameId = res.getHotspot(usedId)->nameId; + strings.getString(nameId, buffer + strlen(buffer), NULL, NULL); + if (action == GIVE) strcat(buffer, " to "); + else strcat(buffer, " on "); + } + + strcat(buffer, _hotspotName); + } s.writeString(0, 0, buffer, false, DIALOG_WHITE_COLOUR); } } @@ -449,9 +455,9 @@ void Room::update() { uint16 v = tempLayer[(yctr + 1) * DECODED_PATHS_WIDTH + xctr + 1]; if ((v != 0) && (v < 100)) { sprintf(buffer, "%d", v % 10); - s.writeString(xctr * 8, yctr * 8 + 8, buffer, true); - } else if (v == 0xffff) { -// } else if (_roomData->paths.isOccupied(xctr, yctr)) { +// s.writeString(xctr * 8, yctr * 8 + 8, buffer, true); +// } else if (v == 0xffff) { + } else if (_roomData->paths.isOccupied(xctr, yctr)) { s.fillRect(Rect(xctr * 8, yctr * 8 + 8, xctr * 8 + 7, yctr * 8 + 15), 255); } } @@ -507,20 +513,31 @@ void Room::checkCursor() { uint16 oldHotspotId = _hotspotId; uint16 currentCursor = mouse.getCursorNum(); uint16 newCursor = currentCursor; + CurrentAction playerAction = res.getActiveHotspot(PLAYER_ID)->currentActions().action(); - if ((currentCursor >= CURSOR_TIME_START) && (currentCursor <= CURSOR_TIME_END)) { + if ((currentCursor >= CURSOR_TIME_START) && (currentCursor <= CURSOR_TIME_END) && + ((playerAction == START_WALKING) || (playerAction == PROCESSING_PATH))) { + // Animate the clock when processing the player path ++newCursor; if (newCursor == CURSOR_CROSS) newCursor = CURSOR_TIME_START; } else if (checkInTalkDialog()) { newCursor = CURSOR_TALK; } else if (res.getTalkData()) { newCursor = CURSOR_ARROW; + } else if (_cursorState == CS_UNKNOWN) { + newCursor = CURSOR_CAMERA; + } else if (_cursorState == CS_TALKING) { + newCursor = CURSOR_ARROW; } else if (mouse.y() < MENUBAR_Y_SIZE) { // If viewing a room remotely, then don't change to the menu cursor uint16 oldRoomNumber = res.fieldList().getField(OLD_ROOM_NUMBER); if (oldRoomNumber != 0) return; newCursor = CURSOR_MENUBAR; + } else if (_cursorState != CS_NONE) { + // Currently in a special mode +// checkRoomHotspots(); + newCursor = CURSOR_CAMERA; } else { // Check for a highlighted hotspot checkRoomHotspots(); diff --git a/engines/lure/room.h b/engines/lure/room.h index 7387bf0972..d8011d0300 100644 --- a/engines/lure/room.h +++ b/engines/lure/room.h @@ -51,6 +51,8 @@ public: } }; +enum CursorState {CS_NONE, CS_ACTION, CS_SEQUENCE, CS_TALKING, CS_UNKNOWN}; + class Room { private: RoomData *_roomData; @@ -69,6 +71,7 @@ private: bool _cells[NUM_HORIZ_RECTS*NUM_VERT_RECTS]; TalkDialog *_talkDialog; int16 _talkDialogX, _talkDialogY; + CursorState _cursorState; void checkRoomHotspots(); uint8 checkRoomExits(); @@ -98,8 +101,10 @@ public: HotspotData &hotspot() { return *_hotspot; } uint16 descId() { return _descId; } bool showInfo() { return _showInfo; } + CursorState cursorState() { return _cursorState; } void setShowInfo(bool value) { _showInfo = value; } void setTalkDialog(uint16 characterId, uint16 descId); + void setCursorState(CursorState state) { _cursorState = state; } bool checkInTalkDialog(); }; -- cgit v1.2.3