diff options
Diffstat (limited to 'engines/fullpipe/gameloader.cpp')
-rw-r--r-- | engines/fullpipe/gameloader.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index d9f7327a6b..c8b01939dd 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -21,6 +21,7 @@ */ #include "fullpipe/fullpipe.h" +#include "graphics/thumbnail.h" #include "fullpipe/gameloader.h" #include "fullpipe/scene.h" @@ -501,6 +502,14 @@ void GameLoader::updateSystems(int counterdiff) { } } +void GameLoader::readSavegame(const char *fname) { + warning("STUB: readSavegame(%s)", fname); +} + +void GameLoader::writeSavegame(Scene *sc, const char *fname) { + warning("STUB: writeSavegame(sc, %s)", fname); +} + Sc2::Sc2() { _sceneId = 0; _field_2 = 0; @@ -593,6 +602,42 @@ bool PreloadItems::load(MfcArchive &file) { return true; } +const char *getSavegameFile(int saveGameIdx) { + static char buffer[20]; + sprintf(buffer, "fullpipe.s%02d", saveGameIdx); + return buffer; +} + +bool readSavegameHeader(Common::InSaveFile *in, FullpipeSavegameHeader &header) { + char saveIdentBuffer[6]; + header.thumbnail = NULL; + + // Validate the header Id + in->read(saveIdentBuffer, 6); + if (strcmp(saveIdentBuffer, "SVMCR")) + return false; + + header.version = in->readByte(); + if (header.version != FULLPIPE_SAVEGAME_VERSION) + return false; + + // Read in the string + header.saveName.clear(); + char ch; + while ((ch = (char)in->readByte()) != '\0') header.saveName += ch; + + // Get the thumbnail + header.thumbnail = Graphics::loadThumbnail(*in); + if (!header.thumbnail) + return false; + + return true; +} + +void GameLoader::restoreDefPicAniInfos() { + warning("STUB: restoreDefPicAniInfos()"); +} + GameVar *FullpipeEngine::getGameLoaderGameVar() { if (_gameLoader) return _gameLoader->_gameVar; |