diff options
author | Nicola Mettifogo | 2007-09-19 08:40:12 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-09-19 08:40:12 +0000 |
commit | 258901bab96f0050385a9912c8ea0fe2a41b2d6f (patch) | |
tree | a3ae8675b679c9f3b58ac8d97c79369502ea23c1 /engines/scumm/saveload.cpp | |
parent | a89694c0d61a75a960f5bec6c498659c988401cc (diff) | |
download | scummvm-rg350-258901bab96f0050385a9912c8ea0fe2a41b2d6f.tar.gz scummvm-rg350-258901bab96f0050385a9912c8ea0fe2a41b2d6f.tar.bz2 scummvm-rg350-258901bab96f0050385a9912c8ea0fe2a41b2d6f.zip |
Merged common/stdafx.h into common/scummsys.h. All referencing files have been updated.
svn-id: r28966
Diffstat (limited to 'engines/scumm/saveload.cpp')
-rw-r--r-- | engines/scumm/saveload.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index bc18af8426..2aa64ff409 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -23,7 +23,7 @@ * */ -#include "common/stdafx.h" + #include "common/config-manager.h" #include "common/savefile.h" @@ -59,10 +59,10 @@ struct SaveInfoSection { uint32 type; uint32 version; uint32 size; - + uint32 timeTValue; // Obsolete since version 2, but kept for compatibility uint32 playtime; - + uint32 date; uint16 time; }; @@ -152,7 +152,7 @@ bool ScummEngine::loadState(int slot, bool compat) { // we see a version that is higher than anything we'd expect... if (hdr.ver > 0xFFFFFF) hdr.ver = SWAP_BYTES_32(hdr.ver); - + // Reject save games which are too old or too new. Note that // We do not really support V7 games, but still accept them here // to work around a bug from the stone age (see below for more @@ -385,23 +385,23 @@ void ScummEngine::makeSavegameName(char *out, int slot, bool temporary) { void ScummEngine::listSavegames(bool *marks, int num) { assert(marks); - + char prefix[256]; char slot[2]; int slotNum; Common::StringList filenames; - + makeSavegameName(prefix, 99, false); prefix[strlen(prefix)-2] = '*'; prefix[strlen(prefix)-1] = 0; memset(marks, false, num * sizeof(bool)); //assume no savegames for this title filenames = _saveFileMan->listSavefiles(prefix); - + for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); file++){ //Obtain the last 2 digits of the filename, since they correspond to the save slot slot[0] = file->c_str()[file->size()-2]; slot[1] = file->c_str()[file->size()-1]; - + slotNum = atoi(slot); if (slotNum >= 0 && slotNum < num) marks[slotNum] = true; //mark this slot as valid @@ -509,8 +509,8 @@ bool ScummEngine::loadInfosFromSlot(int slot, InfoStuff *stuff) { delete in; return false; } - - delete in; + + delete in; return true; } @@ -540,11 +540,11 @@ bool ScummEngine::loadInfos(Common::InSaveFile *file, InfoStuff *stuff) { // For header version 1, we load the data in with our old method if (section.version == 1) { time_t tmp = section.timeTValue; - tm *curTime = localtime(&tmp); + tm *curTime = localtime(&tmp); stuff->date = (curTime->tm_mday & 0xFF) << 24 | ((curTime->tm_mon + 1) & 0xFF) << 16 | (curTime->tm_year + 1900) & 0xFFFF; stuff->time = (curTime->tm_hour & 0xFF) << 8 | (curTime->tm_min) & 0xFF; } - + if (section.version >= 2) { section.date = file->readUint32BE(); section.time = file->readUint16BE(); @@ -552,7 +552,7 @@ bool ScummEngine::loadInfos(Common::InSaveFile *file, InfoStuff *stuff) { stuff->date = section.date; stuff->time = section.time; } - + stuff->playtime = section.playtime; // Skip over the remaining (unsupported) data @@ -572,9 +572,9 @@ void ScummEngine::saveInfos(Common::OutSaveFile* file) { // still save old format for older versions section.timeTValue = time(0); section.playtime = _system->getMillis() / 1000 - _engineStartTime; - + time_t curTime_ = time(0); - tm *curTime = localtime(&curTime_); + tm *curTime = localtime(&curTime_); section.date = (curTime->tm_mday & 0xFF) << 24 | ((curTime->tm_mon + 1) & 0xFF) << 16 | (curTime->tm_year + 1900) & 0xFFFF; section.time = (curTime->tm_hour & 0xFF) << 8 | (curTime->tm_min) & 0xFF; |