Skip to content

Commit

Permalink
FULLPIPE: Fix game save/load
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Sep 19, 2016
1 parent 783d968 commit a605580
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions engines/fullpipe/stateloader.cpp
Expand Up @@ -78,8 +78,6 @@ void GameLoader::readSavegame(const char *fname) {
for (uint i = 0; i < header.encSize; i++)
data[i] -= i & 0x7f;

//Common::hexdump(data, 48);

MfcArchive *archive = new MfcArchive(new Common::MemoryReadStream(data, header.encSize));

GameVar *var = (GameVar *)archive->readClass();
Expand Down
2 changes: 0 additions & 2 deletions engines/fullpipe/statesaver.cpp
Expand Up @@ -97,8 +97,6 @@ void GameLoader::writeSavegame(Scene *sc, const char *fname) {
for (uint i = 0; i < header.encSize; i++)
stream.getData()[i] += i & 0x7f;

//Common::hexdump(stream.getData(), 48);

if (_savegameCallback)
_savegameCallback(archive, true);

Expand Down
4 changes: 3 additions & 1 deletion engines/fullpipe/utils.cpp
Expand Up @@ -475,9 +475,11 @@ void MfcArchive::writeObject(CObject *obj) {
writeUint16LE(0xffff); // New class
_objectHash[obj] = _lastIndex++;

writeUint16LE(1); // schema

switch (obj->_objtype) {
case kObjTypeGameVar:
writePascalString(lookupObjectId(kGameVar));
writePascalString(lookupObjectId(kGameVar), true); // Two byte counter
break;
default:
error("Unhandled save for object type: %d", obj->_objtype);
Expand Down

0 comments on commit a605580

Please sign in to comment.