aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage
diff options
context:
space:
mode:
authorStrangerke2014-03-07 14:21:09 +0100
committerStrangerke2014-03-07 14:21:46 +0100
commitdc2094f7a6e00283b6349bce9faac192c7626412 (patch)
treeadac4ca6c96264de92ecaffd6dcb91cb0addcebc /engines/tsage
parentda157fbccc7e094f16bc78e2ddadfc2ea29676f4 (diff)
downloadscummvm-rg350-dc2094f7a6e00283b6349bce9faac192c7626412.tar.gz
scummvm-rg350-dc2094f7a6e00283b6349bce9faac192c7626412.tar.bz2
scummvm-rg350-dc2094f7a6e00283b6349bce9faac192c7626412.zip
TSAGE: Rename savegame header members
Diffstat (limited to 'engines/tsage')
-rw-r--r--engines/tsage/detection.cpp16
-rw-r--r--engines/tsage/saveload.cpp40
-rw-r--r--engines/tsage/saveload.h12
3 files changed, 34 insertions, 34 deletions
diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp
index 02a21e36f8..9d61b4d182 100644
--- a/engines/tsage/detection.cpp
+++ b/engines/tsage/detection.cpp
@@ -129,10 +129,10 @@ public:
if (in) {
if (TsAGE::Saver::readSavegameHeader(in, header)) {
- saveList.push_back(SaveStateDescriptor(slot, header.saveName));
+ saveList.push_back(SaveStateDescriptor(slot, header._saveName));
- header.thumbnail->free();
- delete header.thumbnail;
+ header._thumbnail->free();
+ delete header._thumbnail;
}
delete in;
@@ -162,11 +162,11 @@ public:
delete f;
// Create the return descriptor
- SaveStateDescriptor desc(slot, header.saveName);
- desc.setThumbnail(header.thumbnail);
- desc.setSaveDate(header.saveYear, header.saveMonth, header.saveDay);
- desc.setSaveTime(header.saveHour, header.saveMinutes);
- desc.setPlayTime(header.totalFrames * GAME_FRAME_TIME);
+ SaveStateDescriptor desc(slot, header._saveName);
+ desc.setThumbnail(header._thumbnail);
+ desc.setSaveDate(header._saveYear, header._saveMonth, header._saveDay);
+ desc.setSaveTime(header._saveHour, header._saveMinutes);
+ desc.setPlayTime(header._totalFrames * GAME_FRAME_TIME);
return desc;
}
diff --git a/engines/tsage/saveload.cpp b/engines/tsage/saveload.cpp
index fe71c03973..9954b929b2 100644
--- a/engines/tsage/saveload.cpp
+++ b/engines/tsage/saveload.cpp
@@ -141,8 +141,8 @@ Common::Error Saver::save(int slot, const Common::String &saveName) {
// Write out the savegame header
tSageSavegameHeader header;
- header.saveName = saveName;
- header.version = TSAGE_SAVEGAME_VERSION;
+ header._saveName = saveName;
+ header._version = TSAGE_SAVEGAME_VERSION;
writeSavegameHeader(saveFile, header);
// Save out objects that need to come at the start of the savegame
@@ -190,11 +190,11 @@ Common::Error Saver::restore(int slot) {
// Read in the savegame header
tSageSavegameHeader header;
readSavegameHeader(saveFile, header);
- if (header.thumbnail)
- header.thumbnail->free();
- delete header.thumbnail;
+ if (header._thumbnail)
+ header._thumbnail->free();
+ delete header._thumbnail;
- serializer.setSaveVersion(header.version);
+ serializer.setSaveVersion(header._version);
// Load in data for objects that need to come at the start of the savegame
for (Common::List<SaveListener *>::iterator i = _listeners.begin(); i != _listeners.end(); ++i) {
@@ -242,34 +242,34 @@ const char *SAVEGAME_STR = "SCUMMVM_TSAGE";
bool Saver::readSavegameHeader(Common::InSaveFile *in, tSageSavegameHeader &header) {
char saveIdentBuffer[SAVEGAME_STR_SIZE + 1];
- header.thumbnail = NULL;
+ header._thumbnail = NULL;
// Validate the header Id
in->read(saveIdentBuffer, SAVEGAME_STR_SIZE + 1);
if (strncmp(saveIdentBuffer, SAVEGAME_STR, SAVEGAME_STR_SIZE))
return false;
- header.version = in->readByte();
- if (header.version > TSAGE_SAVEGAME_VERSION)
+ header._version = in->readByte();
+ if (header._version > TSAGE_SAVEGAME_VERSION)
return false;
// Read in the string
- header.saveName.clear();
+ header._saveName.clear();
char ch;
- while ((ch = (char)in->readByte()) != '\0') header.saveName += ch;
+ while ((ch = (char)in->readByte()) != '\0') header._saveName += ch;
// Get the thumbnail
- header.thumbnail = Graphics::loadThumbnail(*in);
- if (!header.thumbnail)
+ header._thumbnail = Graphics::loadThumbnail(*in);
+ if (!header._thumbnail)
return false;
// Read in save date/time
- header.saveYear = in->readSint16LE();
- header.saveMonth = in->readSint16LE();
- header.saveDay = in->readSint16LE();
- header.saveHour = in->readSint16LE();
- header.saveMinutes = in->readSint16LE();
- header.totalFrames = in->readUint32LE();
+ header._saveYear = in->readSint16LE();
+ header._saveMonth = in->readSint16LE();
+ header._saveDay = in->readSint16LE();
+ header._saveHour = in->readSint16LE();
+ header._saveMinutes = in->readSint16LE();
+ header._totalFrames = in->readUint32LE();
return true;
}
@@ -281,7 +281,7 @@ void Saver::writeSavegameHeader(Common::OutSaveFile *out, tSageSavegameHeader &h
out->writeByte(TSAGE_SAVEGAME_VERSION);
// Write savegame name
- out->write(header.saveName.c_str(), header.saveName.size() + 1);
+ out->write(header._saveName.c_str(), header._saveName.size() + 1);
// Get the active palette
uint8 thumbPalette[256 * 3];
diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h
index a6ad71699e..be5ff51ffb 100644
--- a/engines/tsage/saveload.h
+++ b/engines/tsage/saveload.h
@@ -38,12 +38,12 @@ typedef void (*SaveNotifierFn)(bool postFlag);
class SavedObject;
struct tSageSavegameHeader {
- uint8 version;
- Common::String saveName;
- Graphics::Surface *thumbnail;
- int saveYear, saveMonth, saveDay;
- int saveHour, saveMinutes;
- int totalFrames;
+ uint8 _version;
+ Common::String _saveName;
+ Graphics::Surface *_thumbnail;
+ int _saveYear, _saveMonth, _saveDay;
+ int _saveHour, _saveMinutes;
+ int _totalFrames;
};
/*--------------------------------------------------------------------------*/