[Scummvm-cvs-logs] SF.net SVN: scummvm: [22208] scummvm/trunk/engines/lure

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sat Apr 29 04:21:01 CEST 2006


Revision: 22208
Author:   dreammaster
Date:     2006-04-29 04:19:55 -0700 (Sat, 29 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22208&view=rev

Log Message:
-----------
Added proper action display after selection along with showing the camera cursor

Modified Paths:
--------------
    scummvm/trunk/engines/lure/room.cpp
    scummvm/trunk/engines/lure/room.h
Modified: scummvm/trunk/engines/lure/room.cpp
===================================================================
--- scummvm/trunk/engines/lure/room.cpp	2006-04-29 11:18:08 UTC (rev 22207)
+++ scummvm/trunk/engines/lure/room.cpp	2006-04-29 11:19:55 UTC (rev 22208)
@@ -83,6 +83,8 @@
 	_showInfo = false;
 	_isExit = false;
 	_destRoomNumber = 0;
+//****DEBUG****
+	memset(tempLayer, 0, DECODED_PATHS_WIDTH * DECODED_PATHS_HEIGHT * 2);
 }
 
 Room::~Room() {
@@ -194,18 +196,19 @@
 		_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 @@
 		} 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, " ");
+
+				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);
 			}
-
-			strcat(buffer, _hotspotName);
 			s.writeString(0, 0, buffer, false, DIALOG_WHITE_COLOUR);
 		}
 	}
@@ -449,9 +455,9 @@
 				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 @@
 	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();

Modified: scummvm/trunk/engines/lure/room.h
===================================================================
--- scummvm/trunk/engines/lure/room.h	2006-04-29 11:18:08 UTC (rev 22207)
+++ scummvm/trunk/engines/lure/room.h	2006-04-29 11:19:55 UTC (rev 22208)
@@ -51,6 +51,8 @@
 	}
 };
 
+enum CursorState {CS_NONE, CS_ACTION, CS_SEQUENCE, CS_TALKING, CS_UNKNOWN};
+
 class Room {
 private:
 	RoomData *_roomData;
@@ -69,6 +71,7 @@
 	bool _cells[NUM_HORIZ_RECTS*NUM_VERT_RECTS];
 	TalkDialog *_talkDialog;
 	int16 _talkDialogX, _talkDialogY;
+	CursorState _cursorState;
 
 	void checkRoomHotspots();
 	uint8 checkRoomExits();
@@ -98,8 +101,10 @@
 	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();
 };
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list