COMMON: Move VER macro for serializer into common code

This commit is contained in:
Colin Snover 2017-11-29 12:05:59 -06:00 committed by Eugene Sandulenko
parent 9916b26383
commit 2e061d95c5
18 changed files with 2 additions and 76 deletions

View file

@ -28,6 +28,7 @@
namespace Common { namespace Common {
#define VER(x) Common::Serializer::Version(x)
#define SYNC_AS(SUFFIX,TYPE,SIZE) \ #define SYNC_AS(SUFFIX,TYPE,SIZE) \
template<typename T> \ template<typename T> \

View file

@ -61,12 +61,6 @@
namespace Sci { namespace Sci {
#define VER(x) Common::Serializer::Version(x)
#pragma mark -
// These are serialization functions for various objects. // These are serialization functions for various objects.
void syncWithSerializer(Common::Serializer &s, Common::Serializable &obj) { void syncWithSerializer(Common::Serializer &s, Common::Serializable &obj) {

View file

@ -31,7 +31,6 @@
#include "scumm/he/intern_he.h" #include "scumm/he/intern_he.h"
#include "scumm/object.h" #include "scumm/object.h"
#include "scumm/resource.h" #include "scumm/resource.h"
#include "scumm/saveload.h"
#include "scumm/scumm_v7.h" #include "scumm/scumm_v7.h"
#include "scumm/scumm_v0.h" #include "scumm/scumm_v0.h"
#include "scumm/he/sound_he.h" #include "scumm/he/sound_he.h"

View file

@ -26,7 +26,6 @@
#include "common/scummsys.h" #include "common/scummsys.h"
#include "common/serializer.h" #include "common/serializer.h"
#include "scumm/saveload.h"
#include "scumm/scumm.h" #include "scumm/scumm.h"

View file

@ -28,7 +28,6 @@
#include "graphics/sjis.h" #include "graphics/sjis.h"
#include "scumm/scumm.h" #include "scumm/scumm.h"
#include "scumm/gfx.h" #include "scumm/gfx.h"
#include "scumm/saveload.h"
namespace Scumm { namespace Scumm {

View file

@ -31,7 +31,6 @@
#include "scumm/he/intern_he.h" #include "scumm/he/intern_he.h"
#include "scumm/object.h" #include "scumm/object.h"
#include "scumm/he/resource_he.h" #include "scumm/he/resource_he.h"
#include "scumm/saveload.h"
#include "scumm/scumm.h" #include "scumm/scumm.h"
#include "scumm/scumm_v2.h" #include "scumm/scumm_v2.h"
#include "scumm/scumm_v5.h" #include "scumm/scumm_v5.h"

View file

@ -24,7 +24,6 @@
#include "scumm/he/intern_he.h" #include "scumm/he/intern_he.h"
#include "scumm/resource.h" #include "scumm/resource.h"
#include "scumm/saveload.h"
#include "scumm/scumm.h" #include "scumm/scumm.h"
#include "scumm/he/sprite_he.h" #include "scumm/he/sprite_he.h"
#include "scumm/usage_bits.h" #include "scumm/usage_bits.h"

View file

@ -32,7 +32,6 @@
#include "scumm/imuse/imuse_internal.h" #include "scumm/imuse/imuse_internal.h"
#include "scumm/imuse/instrument.h" #include "scumm/imuse/instrument.h"
#include "scumm/resource.h" #include "scumm/resource.h"
#include "scumm/saveload.h"
#include "scumm/scumm.h" #include "scumm/scumm.h"
namespace Scumm { namespace Scumm {

View file

@ -27,7 +27,6 @@
#include "common/serializer.h" #include "common/serializer.h"
#include "scumm/imuse/imuse.h" #include "scumm/imuse/imuse.h"
#include "scumm/imuse/instrument.h" #include "scumm/imuse/instrument.h"
#include "scumm/saveload.h"
#include "audio/mididrv.h" #include "audio/mididrv.h"
class MidiParser; class MidiParser;

View file

@ -26,7 +26,6 @@
#include "common/textconsole.h" #include "common/textconsole.h"
#include "common/util.h" #include "common/util.h"
#include "scumm/imuse/imuse_internal.h" #include "scumm/imuse/imuse_internal.h"
#include "scumm/saveload.h"
#include "scumm/scumm.h" #include "scumm/scumm.h"
namespace Scumm { namespace Scumm {

View file

@ -26,7 +26,6 @@
#include "engines/engine.h" #include "engines/engine.h"
#include "scumm/imuse/imuse_internal.h" #include "scumm/imuse/imuse_internal.h"
#include "scumm/saveload.h"
#include "scumm/scumm.h" #include "scumm/scumm.h"
#include "audio/midiparser.h" #include "audio/midiparser.h"

View file

@ -21,7 +21,6 @@
*/ */
#include "scumm/scumm.h" #include "scumm/scumm.h"
#include "scumm/saveload.h"
#include "scumm/imuse/instrument.h" #include "scumm/imuse/instrument.h"
#include "audio/mididrv.h" #include "audio/mididrv.h"

View file

@ -24,7 +24,6 @@
#include "common/timer.h" #include "common/timer.h"
#include "scumm/actor.h" #include "scumm/actor.h"
#include "scumm/saveload.h"
#include "scumm/scumm_v7.h" #include "scumm/scumm_v7.h"
#include "scumm/sound.h" #include "scumm/sound.h"
#include "scumm/imuse_digi/dimuse.h" #include "scumm/imuse_digi/dimuse.h"

View file

@ -24,7 +24,6 @@
#include "scumm/imuse/imuse.h" #include "scumm/imuse/imuse.h"
#include "scumm/scumm.h" #include "scumm/scumm.h"
#include "scumm/resource.h" #include "scumm/resource.h"
#include "scumm/saveload.h"
#include "audio/fmopl.h" #include "audio/fmopl.h"
#include "audio/mixer.h" #include "audio/mixer.h"

View file

@ -27,7 +27,6 @@
#include "common/util.h" #include "common/util.h"
#include "common/mutex.h" #include "common/mutex.h"
#include "scumm/music.h" #include "scumm/music.h"
#include "scumm/saveload.h"
#include "audio/audiostream.h" #include "audio/audiostream.h"
#include "audio/mixer.h" #include "audio/mixer.h"

View file

@ -35,7 +35,6 @@
#include "scumm/he/intern_he.h" #include "scumm/he/intern_he.h"
#include "scumm/object.h" #include "scumm/object.h"
#include "scumm/resource.h" #include "scumm/resource.h"
#include "scumm/saveload.h"
#include "scumm/scumm_v0.h" #include "scumm/scumm_v0.h"
#include "scumm/scumm_v7.h" #include "scumm/scumm_v7.h"
#include "scumm/sound.h" #include "scumm/sound.h"
@ -69,6 +68,7 @@ struct SaveInfoSection {
#define SaveInfoSectionSize (4+4+4 + 4+4 + 4+2) #define SaveInfoSectionSize (4+4+4 + 4+4 + 4+2)
#define CURRENT_VER 98
#define INFOSECTION_VERSION 2 #define INFOSECTION_VERSION 2
#pragma mark - #pragma mark -

View file

@ -1,55 +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.
*
*/
#ifndef SCUMM_SAVELOAD_H
#define SCUMM_SAVELOAD_H
#include "common/scummsys.h"
#include "common/serializer.h"
namespace Scumm {
/**
* The current savegame format version.
* Our save/load system uses an elaborate scheme to allow us to modify the
* savegame while keeping full backward compatibility, in the sense that newer
* ScummVM versions always are able to load old savegames.
* In order to achieve that, we store a version in the savegame files, and whenever
* the savegame layout is modified, the version is incremented.
*
* This roughly works by marking each savegame entry with a range of versions
* for which it is valid; the save/load code iterates over all entries, but
* only saves/loads those which are valid for the version of the savegame
* which is being loaded/saved currently.
*/
#define CURRENT_VER 98
/**
* An auxillary macro, used to specify savegame versions. We use this instead
* of just writing the raw version, because this way they stand out more to
* the reading eye, making it a bit easier to navigate through the code.
*/
#define VER(x) Common::Serializer::Version(x)
} // End of namespace Scumm
#endif

View file

@ -28,7 +28,6 @@
#include "common/str.h" #include "common/str.h"
#include "audio/mididrv.h" #include "audio/mididrv.h"
#include "backends/audiocd/audiocd.h" #include "backends/audiocd/audiocd.h"
#include "scumm/saveload.h"
namespace Audio { namespace Audio {
class Mixer; class Mixer;