mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-27 20:28:27 +00:00
Store game title in savefile. Lets us not guess which game save is made for
as it is not possible to tell that by md5. Bumbed savegame version. svn-id: r19113
This commit is contained in:
parent
68c5fe52c2
commit
1529b1ad0a
@ -39,7 +39,7 @@
|
||||
#include "saga/scene.h"
|
||||
#include "saga/script.h"
|
||||
|
||||
#define CURRENT_SAGA_VER 4
|
||||
#define CURRENT_SAGA_VER 5
|
||||
|
||||
namespace Saga {
|
||||
|
||||
@ -158,8 +158,10 @@ void SagaEngine::fillSaveList() {
|
||||
}
|
||||
|
||||
|
||||
#define TITLESIZE 80
|
||||
void SagaEngine::save(const char *fileName, const char *saveName) {
|
||||
Common::OutSaveFile *out;
|
||||
char title[TITLESIZE];
|
||||
|
||||
if (!(out = _saveFileMan->openForSaving(fileName))) {
|
||||
return;
|
||||
@ -172,6 +174,11 @@ void SagaEngine::save(const char *fileName, const char *saveName) {
|
||||
|
||||
out->write(&_saveHeader, sizeof(_saveHeader));
|
||||
|
||||
// Original game title
|
||||
memset(title, 0, TITLESIZE);
|
||||
strncpy(title, getGameDescription()->title, TITLESIZE);
|
||||
out->write(title, TITLESIZE);
|
||||
|
||||
// Surrounding scene
|
||||
out->writeSint32LE(_scene->getOutsetSceneNumber());
|
||||
|
||||
@ -203,6 +210,7 @@ void SagaEngine::load(const char *fileName) {
|
||||
int commonBufferSize;
|
||||
int sceneNumber, insetSceneNumber;
|
||||
int mapx, mapy;
|
||||
char title[TITLESIZE];
|
||||
|
||||
if (!(in = _saveFileMan->openForLoading(fileName))) {
|
||||
return;
|
||||
@ -220,6 +228,11 @@ void SagaEngine::load(const char *fileName) {
|
||||
error("SagaEngine::load wrong format");
|
||||
}
|
||||
|
||||
if (_saveHeader.version > 4) {
|
||||
in->read(title, TITLESIZE);
|
||||
debug(2, "Save is for: %s", title);
|
||||
}
|
||||
|
||||
// Surrounding scene
|
||||
sceneNumber = in->readSint32LE();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user