From 804c821ab1079a7ab426d08773b08d50e382ffb3 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 2 Dec 2007 04:49:33 +0000 Subject: Enhanced savegames to store any active dialog when the game was saved svn-id: r29689 --- engines/lure/res.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'engines/lure/res.cpp') diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp index 0b926c5454..67a71a840f 100644 --- a/engines/lure/res.cpp +++ b/engines/lure/res.cpp @@ -596,6 +596,10 @@ Hotspot *Resources::addHotspot(uint16 hotspotId) { Hotspot *hotspot = new Hotspot(hData); _activeHotspots.push_back(hotspot); + if (hotspotId < FIRST_NONCHARACTER_ID) + // Default characters to facing upwards until they start moving + hotspot->setDirection(UP); + return hotspot; } @@ -677,6 +681,10 @@ void Resources::setTalkData(uint16 offset) { } void Resources::saveToStream(Common::WriteStream *stream) { + // Save basic fields + stream->writeUint16LE(_talkingCharacter); + + // Save sublist data _hotspotData.saveToStream(stream); _activeHotspots.saveToStream(stream); _fieldList.saveToStream(stream); @@ -688,6 +696,9 @@ void Resources::saveToStream(Common::WriteStream *stream) { } void Resources::loadFromStream(Common::ReadStream *stream) { + debugC(ERROR_DETAILED, kLureDebugScripts, "Loading resource data"); + _talkingCharacter = stream->readUint16LE(); + debugC(ERROR_DETAILED, kLureDebugScripts, "Loading hotspot data"); _hotspotData.loadFromStream(stream); debugC(ERROR_DETAILED, kLureDebugScripts, "Loading active hotspots"); -- cgit v1.2.3