[Scummvm-cvs-logs] SF.net SVN: scummvm: [30582] scummvm/trunk/engines/lure
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Sun Jan 20 04:38:16 CET 2008
Revision: 30582
http://scummvm.svn.sourceforge.net/scummvm/?rev=30582&view=rev
Author: dreammaster
Date: 2008-01-19 19:38:16 -0800 (Sat, 19 Jan 2008)
Log Message:
-----------
Fixed bug with saving of cached actor schedules and added saving of talk data flags
Modified Paths:
--------------
scummvm/trunk/engines/lure/luredefs.h
scummvm/trunk/engines/lure/res.cpp
scummvm/trunk/engines/lure/res_struct.cpp
scummvm/trunk/engines/lure/res_struct.h
Modified: scummvm/trunk/engines/lure/luredefs.h
===================================================================
--- scummvm/trunk/engines/lure/luredefs.h 2008-01-19 22:24:52 UTC (rev 30581)
+++ scummvm/trunk/engines/lure/luredefs.h 2008-01-20 03:38:16 UTC (rev 30582)
@@ -36,7 +36,7 @@
#define LURE_DAT_MAJOR 1
#define LURE_DAT_MINOR 29
#define LURE_MIN_SAVEGAME_MINOR 25
-#define LURE_SAVEGAME_MINOR 31
+#define LURE_SAVEGAME_MINOR 32
#define LURE_DEBUG 1
Modified: scummvm/trunk/engines/lure/res.cpp
===================================================================
--- scummvm/trunk/engines/lure/res.cpp 2008-01-19 22:24:52 UTC (rev 30581)
+++ scummvm/trunk/engines/lure/res.cpp 2008-01-20 03:38:16 UTC (rev 30582)
@@ -731,15 +731,16 @@
stream->writeUint16LE(_talkingCharacter);
// Save sublist data
+ _hotspotSchedules.saveToStream(stream);
_hotspotData.saveToStream(stream);
_activeHotspots.saveToStream(stream);
- _hotspotSchedules.saveToStream(stream);
_fieldList.saveToStream(stream);
_randomActions.saveToStream(stream);
_barmanLists.saveToStream(stream);
_exitJoins.saveToStream(stream);
_roomData.saveToStream(stream);
_delayList.saveToStream(stream);
+ _talkData.saveToStream(stream);
}
void Resources::loadFromStream(Common::ReadStream *stream) {
@@ -755,17 +756,16 @@
_talkState = TALK_NONE;
_activeTalkData = NULL;
- debugC(ERROR_DETAILED, kLureDebugScripts, "Loading hotspot data");
- _hotspotData.loadFromStream(stream);
- debugC(ERROR_DETAILED, kLureDebugScripts, "Loading active hotspots");
- _activeHotspots.loadFromStream(stream);
-
_hotspotSchedules.clear();
if (saveVersion >= 31) {
_hotspotSchedules.loadFromStream(stream);
debugC(ERROR_DETAILED, kLureDebugScripts, "Loading hotspot schedules");
}
+ debugC(ERROR_DETAILED, kLureDebugScripts, "Loading hotspot data");
+ _hotspotData.loadFromStream(stream);
+ debugC(ERROR_DETAILED, kLureDebugScripts, "Loading active hotspots");
+ _activeHotspots.loadFromStream(stream);
debugC(ERROR_DETAILED, kLureDebugScripts, "Loading fields");
_fieldList.loadFromStream(stream);
debugC(ERROR_DETAILED, kLureDebugScripts, "Loading random actions");
@@ -778,6 +778,12 @@
_roomData.loadFromStream(stream);
debugC(ERROR_DETAILED, kLureDebugScripts, "Loading delay list");
_delayList.loadFromStream(stream);
+
+ if (saveVersion >= 32) {
+ debugC(ERROR_DETAILED, kLureDebugScripts, "Loading talk data");
+ _talkData.loadFromStream(stream);
+ }
+
debugC(ERROR_DETAILED, kLureDebugScripts, "Finished loading");
}
Modified: scummvm/trunk/engines/lure/res_struct.cpp
===================================================================
--- scummvm/trunk/engines/lure/res_struct.cpp 2008-01-19 22:24:52 UTC (rev 30581)
+++ scummvm/trunk/engines/lure/res_struct.cpp 2008-01-20 03:38:16 UTC (rev 30582)
@@ -692,6 +692,34 @@
return *i;
}
+// The following class acts as a container for all the NPC conversations
+
+void TalkDataList::saveToStream(WriteStream *stream) {
+ TalkDataList::iterator i;
+ for (i = begin(); i != end(); ++i) {
+ TalkData *rec = *i;
+ TalkEntryList::iterator i;
+
+ for (i = rec->entries.begin(); i != rec->entries.end(); ++i) {
+ TalkEntryData *entry = *i;
+ stream->writeUint16LE(entry->descId);
+ }
+ }
+}
+
+void TalkDataList::loadFromStream(ReadStream *stream) {
+ TalkDataList::iterator i;
+ for (i = begin(); i != end(); ++i) {
+ TalkData *rec = *i;
+ TalkEntryList::iterator i;
+
+ for (i = rec->entries.begin(); i != rec->entries.end(); ++i) {
+ TalkEntryData *entry = *i;
+ entry->descId = stream->readUint16LE();
+ }
+ }
+}
+
// The following class handles a set of coordinates a character should walk to
// if they're to exit a room to a designated secondary room
Modified: scummvm/trunk/engines/lure/res_struct.h
===================================================================
--- scummvm/trunk/engines/lure/res_struct.h 2008-01-19 22:24:52 UTC (rev 30581)
+++ scummvm/trunk/engines/lure/res_struct.h 2008-01-20 03:38:16 UTC (rev 30582)
@@ -589,7 +589,11 @@
TalkEntryData *getResponse(int index);
};
-typedef ManagedList<TalkData *> TalkDataList;
+class TalkDataList: public ManagedList<TalkData *> {
+public:
+ void saveToStream(WriteStream *stream);
+ void loadFromStream(ReadStream *stream);
+};
struct RoomExitCoordinateData {
int16 x;
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