[Scummvm-cvs-logs] SF.net SVN: scummvm:[39428] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Mar 15 21:30:57 CET 2009


Revision: 39428
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39428&view=rev
Author:   fingolfin
Date:     2009-03-15 20:30:57 +0000 (Sun, 15 Mar 2009)

Log Message:
-----------
Moved Tinsel::Serializer to Common::Serializer, so that I can use it in the SCI engine

Modified Paths:
--------------
    scummvm/trunk/common/stream.h
    scummvm/trunk/engines/tinsel/actors.cpp
    scummvm/trunk/engines/tinsel/dialogs.cpp
    scummvm/trunk/engines/tinsel/dialogs.h
    scummvm/trunk/engines/tinsel/pcode.cpp
    scummvm/trunk/engines/tinsel/pcode.h
    scummvm/trunk/engines/tinsel/polygons.cpp
    scummvm/trunk/engines/tinsel/saveload.cpp
    scummvm/trunk/engines/tinsel/timers.cpp
    scummvm/trunk/engines/tinsel/timers.h
    scummvm/trunk/engines/tinsel/tinsel.cpp

Added Paths:
-----------
    scummvm/trunk/common/serializer.h

Removed Paths:
-------------
    scummvm/trunk/engines/tinsel/serializer.h

Copied: scummvm/trunk/common/serializer.h (from rev 39426, scummvm/trunk/engines/tinsel/serializer.h)
===================================================================
--- scummvm/trunk/common/serializer.h	                        (rev 0)
+++ scummvm/trunk/common/serializer.h	2009-03-15 20:30:57 UTC (rev 39428)
@@ -0,0 +1,160 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef COMMON_SERIALIZER_H
+#define COMMON_SERIALIZER_H
+
+#include "common/stream.h"
+#include "common/str.h"
+
+namespace Common {
+
+
+#define SYNC_AS(SUFFIX,TYPE,SIZE) \
+	template <class T> \
+	void syncAs ## SUFFIX(T &val) { \
+		if (_loadStream) \
+			val = static_cast<T>(_loadStream->read ## SUFFIX()); \
+		else { \
+			TYPE tmp = val; \
+			_saveStream->write ## SUFFIX(tmp); \
+		} \
+		_bytesSynced += SIZE; \
+	}
+
+
+// TODO: Write comment for this
+// TODO: Inspired by the SCUMM engine -- move to common/ code and use in more engines?
+class Serializer {
+public:
+	Serializer(Common::SeekableReadStream *in, Common::WriteStream *out)
+		: _loadStream(in), _saveStream(out), _bytesSynced(0) {
+		assert(in || out);
+	}
+
+	bool isSaving() { return (_saveStream != 0); }
+	bool isLoading() { return (_loadStream != 0); }
+
+	uint bytesSynced() const { return _bytesSynced; }
+
+	void syncBytes(byte *buf, uint32 size) {
+		if (_loadStream)
+			_loadStream->read(buf, size);
+		else
+			_saveStream->write(buf, size);
+		_bytesSynced += size;
+	}
+
+	/**
+	 * Sync a C-string, by treating it as a zero-terminated byte sequence.
+	 */
+	void syncString(Common::String &str) {
+		if (_loadStream) {
+			char c;
+			str.clear();
+			while ((c = _loadStream->readByte())) {
+				str += c;
+				_bytesSynced++;
+			}
+			_bytesSynced++;
+		} else {
+			_saveStream->writeString(str);
+			_saveStream->writeByte(0);
+			_bytesSynced += str.size() + 1;
+		}
+	}
+
+	void skip(uint32 size) {
+		_bytesSynced += size;
+		if (_loadStream)
+			_loadStream->skip(size);
+		else {
+			while (size--)
+				_saveStream->writeByte(0);
+		}
+	}
+
+	SYNC_AS(Byte, byte, 1)
+
+	SYNC_AS(Uint16LE, uint16, 2)
+	SYNC_AS(Uint16BE, uint16, 2)
+	SYNC_AS(Sint16LE, int16, 2)
+	SYNC_AS(Sint16BE, int16, 2)
+
+	SYNC_AS(Uint32LE, uint32, 4)
+	SYNC_AS(Uint32BE, uint32, 4)
+	SYNC_AS(Sint32LE, int32, 4)
+	SYNC_AS(Sint32BE, int32, 4)
+
+protected:
+	Common::SeekableReadStream *_loadStream;
+	Common::WriteStream *_saveStream;
+
+	uint _bytesSynced;
+};
+
+#undef SYNC_AS
+
+// TODO: Make a subclass "VersionedSerializer", which makes it easy to support
+//       multiple versions of a savegame format (again inspired by SCUMM).
+/*
+class VersionedSerializer : public Serializer {
+public:
+	// "version" is the version of the savegame we are loading/creating
+	VersionedSerializer(Common::SeekableReadStream *in, Common::OutSaveFile *out, int version)
+		: Serializer(in, out), _version(version) {
+		assert(in || out);
+	}
+
+	void syncBytes(byte *buf, uint16 size, int minVersion = 0, int maxVersion = INF) {
+		if (_version < minVersion || _version > maxVersion)
+			return;	// Do nothing if too old or too new
+		if (_loadStream) {
+			_loadStream->read(buf, size);
+		} else {
+			_saveStream->write(buf, size);
+		}
+	}
+	...
+
+};
+
+*/
+
+// Mixin class / interface
+// TODO Maybe call it ISerializable or SerializableMixin ?
+// TODO: Taken from SCUMM engine -- move to common/ code?
+class Serializable {
+public:
+	virtual ~Serializable() {}
+
+	// Maybe rename this method to "syncWithSerializer" or "syncUsingSerializer" ?
+	virtual void saveLoadWithSerializer(Serializer &ser) = 0;
+};
+
+
+} // end of namespace Common
+
+#endif


Property changes on: scummvm/trunk/common/serializer.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: scummvm/trunk/common/stream.h
===================================================================
--- scummvm/trunk/common/stream.h	2009-03-15 20:22:46 UTC (rev 39427)
+++ scummvm/trunk/common/stream.h	2009-03-15 20:30:57 UTC (rev 39428)
@@ -154,6 +154,10 @@
 		writeUint32BE((uint32)value);
 	}
 
+	/**
+	 * Write the given string to the stream.
+	 * This writes str.size() characters, but no terminating zero byte.
+	 */
 	void writeString(const String &str);
 };
 

Modified: scummvm/trunk/engines/tinsel/actors.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/actors.cpp	2009-03-15 20:22:46 UTC (rev 39427)
+++ scummvm/trunk/engines/tinsel/actors.cpp	2009-03-15 20:30:57 UTC (rev 39428)
@@ -39,7 +39,7 @@
 #include "tinsel/polygons.h"
 #include "tinsel/rince.h"
 #include "tinsel/sched.h"
-#include "tinsel/serializer.h"
+#include "common/serializer.h"
 #include "tinsel/sysvar.h"
 #include "tinsel/tinsel.h"
 #include "tinsel/token.h"
@@ -1417,7 +1417,7 @@
 }
 
 
-void syncAllActorsAlive(Serializer &s) {
+void syncAllActorsAlive(Common::Serializer &s) {
 	for (int i = 0; i < MAX_SAVED_ALIVES; i++) {
 		s.syncAsByte(actorInfo[i].bAlive);
 		s.syncAsByte(actorInfo[i].tagged);

Modified: scummvm/trunk/engines/tinsel/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/dialogs.cpp	2009-03-15 20:22:46 UTC (rev 39427)
+++ scummvm/trunk/engines/tinsel/dialogs.cpp	2009-03-15 20:30:57 UTC (rev 39428)
@@ -50,7 +50,7 @@
 #include "tinsel/polygons.h"
 #include "tinsel/savescn.h"
 #include "tinsel/sched.h"
-#include "tinsel/serializer.h"
+#include "common/serializer.h"
 #include "tinsel/sound.h"
 #include "tinsel/strres.h"
 #include "tinsel/sysvar.h"
@@ -5475,7 +5475,7 @@
 /**
  * (Un)serialize the inventory data for save/restore game.
  */
-void syncInvInfo(Serializer &s) {
+void syncInvInfo(Common::Serializer &s) {
 	for (int i = 0; i < NUM_INV; i++) {
 		s.syncAsSint32LE(InvD[i].MinHicons);
 		s.syncAsSint32LE(InvD[i].MinVicons);

Modified: scummvm/trunk/engines/tinsel/dialogs.h
===================================================================
--- scummvm/trunk/engines/tinsel/dialogs.h	2009-03-15 20:22:46 UTC (rev 39427)
+++ scummvm/trunk/engines/tinsel/dialogs.h	2009-03-15 20:30:57 UTC (rev 39428)
@@ -31,10 +31,12 @@
 #include "tinsel/dw.h"
 #include "tinsel/events.h"	// for PLR_EVENT, PLR_EVENT
 
+namespace Common {
+	class Serializer;
+}
+
 namespace Tinsel {
 
-class Serializer;
-
 enum {
 	INV_OPEN	= -1,	// DW1 only
 	INV_CONV	= 0,
@@ -146,7 +148,7 @@
 
 void KillInventory(void);
 
-void syncInvInfo(Serializer &s);
+void syncInvInfo(Common::Serializer &s);
 
 int InvGetLimit(int invno);
 void InvSetLimit(int invno, int n);

Modified: scummvm/trunk/engines/tinsel/pcode.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/pcode.cpp	2009-03-15 20:22:46 UTC (rev 39427)
+++ scummvm/trunk/engines/tinsel/pcode.cpp	2009-03-15 20:30:57 UTC (rev 39428)
@@ -31,7 +31,7 @@
 #include "tinsel/dialogs.h"	// for inventory id's
 #include "tinsel/pcode.h"	// opcodes etc.
 #include "tinsel/scn.h"	// FindChunk()
-#include "tinsel/serializer.h"
+#include "common/serializer.h"
 #include "tinsel/timers.h"
 #include "tinsel/tinlib.h"	// Library routines
 #include "tinsel/tinsel.h"
@@ -356,7 +356,7 @@
 /**
  * (Un)serialize the global data for save/restore game.
  */
-void syncGlobInfo(Serializer &s) {
+void syncGlobInfo(Common::Serializer &s) {
 	for (int i = 0; i < numGlobals; i++) {
 		s.syncAsSint32LE(pGlobals[i]);
 	}
@@ -365,7 +365,7 @@
 /**
  * (Un)serialize an interpreter context for save/restore game.
  */
-void INT_CONTEXT::syncWithSerializer(Serializer &s) {
+void INT_CONTEXT::syncWithSerializer(Common::Serializer &s) {
 	if (s.isLoading()) {
 		// Null out the pointer fields
 		pProc = NULL;

Modified: scummvm/trunk/engines/tinsel/pcode.h
===================================================================
--- scummvm/trunk/engines/tinsel/pcode.h	2009-03-15 20:22:46 UTC (rev 39427)
+++ scummvm/trunk/engines/tinsel/pcode.h	2009-03-15 20:30:57 UTC (rev 39428)
@@ -30,10 +30,13 @@
 #include "tinsel/events.h"	// for TINSEL_EVENT
 #include "tinsel/sched.h"	// for PROCESS
 
+namespace Common {
+	class Serializer;
+}
+
 namespace Tinsel {
 
 // forward declaration
-class Serializer;
 struct INV_OBJECT;
 
 enum RESUME_STATE {
@@ -79,7 +82,7 @@
 	RESCODE resumeCode;
 	RESUME_STATE resumeState;
 
-	void syncWithSerializer(Serializer &s);
+	void syncWithSerializer(Common::Serializer &s);
 };
 typedef INT_CONTEXT *PINT_CONTEXT;
 

Modified: scummvm/trunk/engines/tinsel/polygons.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/polygons.cpp	2009-03-15 20:22:46 UTC (rev 39427)
+++ scummvm/trunk/engines/tinsel/polygons.cpp	2009-03-15 20:30:57 UTC (rev 39428)
@@ -30,7 +30,7 @@
 #include "tinsel/polygons.h"
 #include "tinsel/rince.h"
 #include "tinsel/sched.h"
-#include "tinsel/serializer.h"
+#include "common/serializer.h"
 #include "tinsel/tinsel.h"
 #include "tinsel/token.h"
 
@@ -1198,7 +1198,7 @@
 /**
  * (Un)serialize the dead tag and exit data for save/restore game.
  */
-void syncPolyInfo(Serializer &s) {
+void syncPolyInfo(Common::Serializer &s) {
 	int i;
 
 	for (i = 0; i < MAX_SCENES; i++) {

Modified: scummvm/trunk/engines/tinsel/saveload.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/saveload.cpp	2009-03-15 20:22:46 UTC (rev 39427)
+++ scummvm/trunk/engines/tinsel/saveload.cpp	2009-03-15 20:30:57 UTC (rev 39428)
@@ -30,11 +30,11 @@
 #include "tinsel/dw.h"
 #include "tinsel/rince.h"
 #include "tinsel/savescn.h"
-#include "tinsel/serializer.h"
 #include "tinsel/timers.h"
 #include "tinsel/tinlib.h"
 #include "tinsel/tinsel.h"
 
+#include "common/serializer.h"
 #include "common/savefile.h"
 
 namespace Tinsel {
@@ -73,16 +73,16 @@
 //----------------- EXTERN FUNCTIONS --------------------
 
 // in DOS_DW.C
-extern void syncSCdata(Serializer &s);
+extern void syncSCdata(Common::Serializer &s);
 
 // in DOS_MAIN.C
 //char HardDriveLetter(void);
 
 // in PCODE.C
-extern void syncGlobInfo(Serializer &s);
+extern void syncGlobInfo(Common::Serializer &s);
 
 // in POLYGONS.C
-extern void syncPolyInfo(Serializer &s);
+extern void syncPolyInfo(Common::Serializer &s);
 
 //----------------- LOCAL DEFINES --------------------
 
@@ -120,7 +120,7 @@
 
 void setNeedLoad() { NeedLoad = true; }
 
-static void syncTime(Serializer &s, struct tm &t) {
+static void syncTime(Common::Serializer &s, struct tm &t) {
 	s.syncAsUint16LE(t.tm_year);
 	s.syncAsByte(t.tm_mon);
 	s.syncAsByte(t.tm_mday);
@@ -134,7 +134,7 @@
 	}
 }
 
-static bool syncSaveGameHeader(Serializer &s, SaveGameHeader &hdr) {
+static bool syncSaveGameHeader(Common::Serializer &s, SaveGameHeader &hdr) {
 	s.syncAsUint32LE(hdr.id);
 	s.syncAsUint32LE(hdr.size);
 	s.syncAsUint32LE(hdr.ver);
@@ -153,7 +153,7 @@
 	return true;
 }
 
-static void syncSavedMover(Serializer &s, SAVED_MOVER &sm) {
+static void syncSavedMover(Common::Serializer &s, SAVED_MOVER &sm) {
 	SCNHANDLE *pList[3] = { (SCNHANDLE *)&sm.walkReels,
 		(SCNHANDLE *)&sm.standReels, (SCNHANDLE *)&sm.talkReels };
 
@@ -178,7 +178,7 @@
 	}
 }
 
-static void syncSavedActor(Serializer &s, SAVED_ACTOR &sa) {
+static void syncSavedActor(Common::Serializer &s, SAVED_ACTOR &sa) {
 	s.syncAsUint16LE(sa.actorID);
 	s.syncAsUint16LE(sa.zFactor);
 	s.syncAsUint32LE(sa.bAlive);
@@ -188,33 +188,33 @@
 	s.syncAsUint16LE(sa.presPlayY);
 }
 
-extern void syncAllActorsAlive(Serializer &s);
+extern void syncAllActorsAlive(Common::Serializer &s);
 
-static void syncNoScrollB(Serializer &s, NOSCROLLB &ns) {
+static void syncNoScrollB(Common::Serializer &s, NOSCROLLB &ns) {
 	s.syncAsSint32LE(ns.ln);
 	s.syncAsSint32LE(ns.c1);
 	s.syncAsSint32LE(ns.c2);
 }
 
-static void syncZPosition(Serializer &s, Z_POSITIONS &zp) {
+static void syncZPosition(Common::Serializer &s, Z_POSITIONS &zp) {
 	s.syncAsSint16LE(zp.actor);
 	s.syncAsSint16LE(zp.column);
 	s.syncAsSint32LE(zp.z);
 }
 
-static void syncPolyVolatile(Serializer &s, POLY_VOLATILE &p) {
+static void syncPolyVolatile(Common::Serializer &s, POLY_VOLATILE &p) {
 	s.syncAsByte(p.bDead);
 	s.syncAsSint16LE(p.xoff);
 	s.syncAsSint16LE(p.yoff);
 }
 
-static void syncSoundReel(Serializer &s, SOUNDREELS &sr) {
+static void syncSoundReel(Common::Serializer &s, SOUNDREELS &sr) {
 	s.syncAsUint32LE(sr.hFilm);
 	s.syncAsSint32LE(sr.column);
 	s.syncAsSint32LE(sr.actorCol);
 }
 
-static void syncSavedData(Serializer &s, SAVED_DATA &sd) {
+static void syncSavedData(Common::Serializer &s, SAVED_DATA &sd) {
 	s.syncAsUint32LE(sd.SavedSceneHandle);
 	s.syncAsUint32LE(sd.SavedBgroundHandle);
 	for (int i = 0; i < MAX_MOVERS; ++i)
@@ -324,7 +324,7 @@
 		}
 
 		// Try to load save game header
-		Serializer s(f, 0);
+		Common::Serializer s(f, 0);
 		SaveGameHeader hdr;
 		bool validHeader = syncSaveGameHeader(s, hdr);
 		delete f;
@@ -379,7 +379,7 @@
 		return NULL;
 }
 
-static void DoSync(Serializer &s) {
+static void DoSync(Common::Serializer &s) {
 	int	sg = 0;
 
 	if (TinselV2) {
@@ -433,7 +433,7 @@
 		return false;
 	}
 
-	Serializer s(f, 0);
+	Common::Serializer s(f, 0);
 	SaveGameHeader hdr;
 	if (!syncSaveGameHeader(s, hdr)) {
 		delete f;	// Invalid header, or savegame too new -> skip it
@@ -474,7 +474,7 @@
 	if (f == NULL)
 		return;
 
-	Serializer s(0, f);
+	Common::Serializer s(0, f);
 
 	// Write out a savegame header
 	SaveGameHeader hdr;

Deleted: scummvm/trunk/engines/tinsel/serializer.h
===================================================================
--- scummvm/trunk/engines/tinsel/serializer.h	2009-03-15 20:22:46 UTC (rev 39427)
+++ scummvm/trunk/engines/tinsel/serializer.h	2009-03-15 20:30:57 UTC (rev 39428)
@@ -1,141 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- * Handles timers.
- */
-
-#ifndef TINSEL_SERIALIZER_H
-#define TINSEL_SERIALIZER_H
-
-#include "common/scummsys.h"
-#include "common/savefile.h"
-
-
-namespace Tinsel {
-
-
-#define SYNC_AS(SUFFIX,TYPE,SIZE) \
-	template <class T> \
-	void syncAs ## SUFFIX(T &val) { \
-		if (_loadStream) \
-			val = static_cast<T>(_loadStream->read ## SUFFIX()); \
-		else { \
-			TYPE tmp = val; \
-			_saveStream->write ## SUFFIX(tmp); \
-		} \
-		_bytesSynced += SIZE; \
-	}
-
-
-// TODO: Write comment for this
-// TODO: Inspired by the SCUMM engine -- move to common/ code and use in more engines?
-class Serializer {
-public:
-	Serializer(Common::SeekableReadStream *in, Common::OutSaveFile *out)
-		: _loadStream(in), _saveStream(out), _bytesSynced(0) {
-		assert(in || out);
-	}
-
-	bool isSaving() { return (_saveStream != 0); }
-	bool isLoading() { return (_loadStream != 0); }
-
-	uint bytesSynced() const { return _bytesSynced; }
-
-	void syncBytes(byte *buf, uint32 size) {
-		if (_loadStream)
-			_loadStream->read(buf, size);
-		else
-			_saveStream->write(buf, size);
-		_bytesSynced += size;
-	}
-
-	void skip(uint32 size) {
-		if (_loadStream)
-			_loadStream->skip(size);
-		else {
-			while (size--)
-				_saveStream->writeByte(0);
-		}
-		_bytesSynced += size;
-	}
-
-	SYNC_AS(Byte, byte, 1)
-
-	SYNC_AS(Uint16LE, uint16, 2)
-	SYNC_AS(Uint16BE, uint16, 2)
-	SYNC_AS(Sint16LE, int16, 2)
-	SYNC_AS(Sint16BE, int16, 2)
-
-	SYNC_AS(Uint32LE, uint32, 4)
-	SYNC_AS(Uint32BE, uint32, 4)
-	SYNC_AS(Sint32LE, int32, 4)
-	SYNC_AS(Sint32BE, int32, 4)
-
-protected:
-	Common::SeekableReadStream *_loadStream;
-	Common::OutSaveFile *_saveStream;
-
-	uint _bytesSynced;
-};
-
-#undef SYNC_AS
-
-// TODO: Make a subclass "VersionedSerializer", which makes it easy to support
-//       multiple versions of a savegame format (again inspired by SCUMM).
-/*
-class VersionedSerializer : public Serializer {
-public:
-	// "version" is the version of the savegame we are loading/creating
-	VersionedSerializer(Common::SeekableReadStream *in, Common::OutSaveFile *out, int version)
-		: Serializer(in, out), _version(version) {
-		assert(in || out);
-	}
-
-	void syncBytes(byte *buf, uint16 size, int minVersion = 0, int maxVersion = INF) {
-		if (_version < minVersion || _version > maxVersion)
-			return;	// Do nothing if too old or too new
-		if (_loadStream) {
-			_loadStream->read(buf, size);
-		} else {
-			_saveStream->write(buf, size);
-		}
-	}
-	...
-
-};
-
-*/
-
-// Mixin class / interface
-// TODO Maybe call it ISerializable or SerializableMixin ?
-// TODO: Taken from SCUMM engine -- move to common/ code?
-class Serializable {
-public:
-	virtual ~Serializable() {}
-	virtual void saveLoadWithSerializer(Serializer *ser) = 0;
-};
-
-
-} // end of namespace Tinsel
-
-#endif

Modified: scummvm/trunk/engines/tinsel/timers.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/timers.cpp	2009-03-15 20:22:46 UTC (rev 39427)
+++ scummvm/trunk/engines/tinsel/timers.cpp	2009-03-15 20:30:57 UTC (rev 39428)
@@ -30,7 +30,7 @@
 
 #include "tinsel/timers.h"
 #include "tinsel/dw.h"
-#include "tinsel/serializer.h"
+#include "common/serializer.h"
 
 #include "common/system.h"
 
@@ -81,7 +81,7 @@
 /**
  * (Un)serialize the timer data for save/restore game.
  */
-void syncTimerInfo(Serializer &s) {
+void syncTimerInfo(Common::Serializer &s) {
 	for (int i = 0; i < MAX_TIMERS; i++) {
 		s.syncAsSint32LE(timers[i].tno);
 		s.syncAsSint32LE(timers[i].ticks);

Modified: scummvm/trunk/engines/tinsel/timers.h
===================================================================
--- scummvm/trunk/engines/tinsel/timers.h	2009-03-15 20:22:46 UTC (rev 39427)
+++ scummvm/trunk/engines/tinsel/timers.h	2009-03-15 20:30:57 UTC (rev 39428)
@@ -30,17 +30,19 @@
 #include "common/scummsys.h"
 #include "tinsel/dw.h"
 
+namespace Common {
+	class Serializer;
+}
+
 namespace Tinsel {
 
-class Serializer;
-
 #define ONE_SECOND 24
 
 uint32 DwGetCurrentTime(void);
 
 void RebootTimers(void);
 
-void syncTimerInfo(Serializer &s);
+void syncTimerInfo(Common::Serializer &s);
 
 void FettleTimers(void);
 

Modified: scummvm/trunk/engines/tinsel/tinsel.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.cpp	2009-03-15 20:22:46 UTC (rev 39427)
+++ scummvm/trunk/engines/tinsel/tinsel.cpp	2009-03-15 20:30:57 UTC (rev 39428)
@@ -30,6 +30,7 @@
 #include "common/file.h"
 #include "common/savefile.h"
 #include "common/config-manager.h"
+#include "common/serializer.h"
 #include "common/stream.h"
 
 #include "graphics/cursorman.h"
@@ -60,7 +61,6 @@
 #include "tinsel/polygons.h"
 #include "tinsel/savescn.h"
 #include "tinsel/scn.h"
-#include "tinsel/serializer.h"
 #include "tinsel/sound.h"
 #include "tinsel/strres.h"
 #include "tinsel/sysvar.h"
@@ -614,7 +614,7 @@
 	bCuttingScene = false;
 }
 
-void syncSCdata(Serializer &s) {
+void syncSCdata(Common::Serializer &s) {
 	s.syncAsUint32LE(HookScene.scene);
 	s.syncAsSint32LE(HookScene.entry);
 	s.syncAsSint32LE(HookScene.trans);


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