[Scummvm-cvs-logs] SF.net SVN: scummvm: [22577] scummvm/trunk/engines/lure/room.cpp
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Tue May 23 05:38:01 CEST 2006
Revision: 22577
Author: dreammaster
Date: 2006-05-23 05:36:57 -0700 (Tue, 23 May 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=22577&view=rev
Log Message:
-----------
Added some extra safety checks. Also contains some started work on redesigning the display of the current action
Modified Paths:
--------------
scummvm/trunk/engines/lure/room.cpp
Modified: scummvm/trunk/engines/lure/room.cpp
===================================================================
--- scummvm/trunk/engines/lure/room.cpp 2006-05-23 12:24:50 UTC (rev 22576)
+++ scummvm/trunk/engines/lure/room.cpp 2006-05-23 12:36:57 UTC (rev 22577)
@@ -83,6 +83,8 @@
_showInfo = false;
_isExit = false;
_destRoomNumber = 0;
+ _cursorState = CS_NONE;
+
//****DEBUG****
memset(tempLayer, 0, DECODED_PATHS_WIDTH * DECODED_PATHS_HEIGHT * 2);
}
@@ -356,6 +358,7 @@
// Handle first layer (layer 3)
for (i = hotspots.begin(); i != hotspots.end(); ++i) {
Hotspot &h = *i.operator*();
+
if ((h.roomNumber() == _roomNumber) && h.isActiveAnimation() && (h.layer() == 3)) {
flagCoveredCells(h);
addAnimation(h);
@@ -382,6 +385,7 @@
}
for (iTemp = tempList.begin(); iTemp != tempList.end(); ++iTemp) {
Hotspot &h = *iTemp.operator*();
+
flagCoveredCells(h);
addAnimation(h);
addLayers(h);
@@ -390,6 +394,7 @@
// Handle third layer (layer 2)
for (i = hotspots.begin(); i != hotspots.end(); ++i) {
Hotspot &h = *i.operator*();
+
if ((h.roomNumber() == _roomNumber) && h.isActiveAnimation() && (h.layer() == 2)) {
flagCoveredCells(h);
addAnimation(h);
@@ -424,14 +429,20 @@
s.writeString(0, 0, _hotspotName, false, DIALOG_TEXT_COLOUR);
} else {
char buffer[MAX_DESC_SIZE];
- strcpy(buffer, res.getCurrentActionStr());
+ const char *actionStr = res.getCurrentActionStr();
+ strcpy(buffer, actionStr);
if (action != STATUS) {
strcat(buffer, " ");
- if (usedId != 0xffff) {
- uint16 nameId = res.getHotspot(usedId)->nameId;
- strings.getString(nameId, buffer + strlen(buffer), NULL, NULL);
+ if ((usedId != 0xffff) && (usedId != 0)) {
+ HotspotData *usedHotspot = res.getHotspot(usedId);
+
+ if (usedHotspot != NULL)
+ strings.getString(usedHotspot->nameId, buffer + strlen(buffer), NULL, NULL);
+ else
+ strcat(buffer, "???");
+
if (action == GIVE) strcat(buffer, " to ");
else strcat(buffer, " on ");
}
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