2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
2004-04-12 21:40:49 +00:00
|
|
|
*
|
2007-05-30 21:56:52 +00:00
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2004-04-12 21:40:49 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2008-01-05 12:45:14 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2004-04-12 21:40:49 +00:00
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2004-04-12 21:40:49 +00:00
|
|
|
*
|
2006-02-11 12:44:16 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2004-04-12 21:40:49 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2004-05-01 09:07:31 +00:00
|
|
|
// Game detection, general game parameters
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-08-02 16:20:35 +00:00
|
|
|
#include "saga/saga.h"
|
2004-12-22 19:34:41 +00:00
|
|
|
|
2008-02-02 00:54:52 +00:00
|
|
|
#include "base/plugins.h"
|
|
|
|
|
2005-10-14 04:28:20 +00:00
|
|
|
#include "common/config-manager.h"
|
2006-10-02 22:21:57 +00:00
|
|
|
#include "common/advancedDetector.h"
|
2008-10-06 12:48:52 +00:00
|
|
|
#include "common/system.h"
|
2008-11-10 14:11:30 +00:00
|
|
|
#include "graphics/thumbnail.h"
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2008-11-03 18:32:16 +00:00
|
|
|
#include "saga/animation.h"
|
2007-04-27 23:11:12 +00:00
|
|
|
#include "saga/displayinfo.h"
|
2008-11-03 18:32:16 +00:00
|
|
|
#include "saga/events.h"
|
2008-12-22 14:13:15 +00:00
|
|
|
#include "saga/resource.h"
|
2004-08-06 01:39:17 +00:00
|
|
|
#include "saga/interface.h"
|
2004-08-11 23:42:02 +00:00
|
|
|
#include "saga/scene.h"
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2006-03-09 14:33:07 +00:00
|
|
|
namespace Saga {
|
2007-01-21 20:24:38 +00:00
|
|
|
struct SAGAGameDescription {
|
|
|
|
Common::ADGameDescription desc;
|
|
|
|
|
|
|
|
int gameId;
|
|
|
|
uint32 features;
|
|
|
|
int startSceneNumber;
|
|
|
|
const GameResourceDescription *resourceDescription;
|
|
|
|
int fontsCount;
|
|
|
|
const GameFontDescription *fontDescriptions;
|
|
|
|
const GameSoundInfo *voiceInfo;
|
|
|
|
const GameSoundInfo *sfxInfo;
|
|
|
|
const GamePatchDescription *patchDescriptions;
|
|
|
|
};
|
|
|
|
|
2008-12-29 17:30:29 +00:00
|
|
|
bool SagaEngine::isBigEndian() const { return isMacResources() && getGameId() == GID_ITE; }
|
2008-06-04 17:20:25 +00:00
|
|
|
bool SagaEngine::isMacResources() const { return (getPlatform() == Common::kPlatformMacintosh); }
|
2007-01-21 20:24:38 +00:00
|
|
|
const GameResourceDescription *SagaEngine::getResourceDescription() { return _gameDescription->resourceDescription; }
|
|
|
|
const GameSoundInfo *SagaEngine::getVoiceInfo() const { return _gameDescription->voiceInfo; }
|
|
|
|
const GameSoundInfo *SagaEngine::getSfxInfo() const { return _gameDescription->sfxInfo; }
|
2008-01-27 19:47:41 +00:00
|
|
|
const GameSoundInfo *SagaEngine::getMusicInfo() const {
|
2007-08-26 15:57:30 +00:00
|
|
|
static GameSoundInfo musicInfo;
|
|
|
|
musicInfo.resourceType = kSoundPCM;
|
|
|
|
musicInfo.sampleBits = 16;
|
|
|
|
musicInfo.isSigned = true;
|
|
|
|
|
2008-01-27 19:47:41 +00:00
|
|
|
return &musicInfo;
|
2007-08-26 15:57:30 +00:00
|
|
|
}
|
2007-01-21 20:24:38 +00:00
|
|
|
|
|
|
|
const GameFontDescription *SagaEngine::getFontDescription(int index) {
|
|
|
|
assert(index < _gameDescription->fontsCount);
|
|
|
|
return &_gameDescription->fontDescriptions[index];
|
|
|
|
}
|
|
|
|
int SagaEngine::getFontsCount() const { return _gameDescription->fontsCount; }
|
|
|
|
|
|
|
|
int SagaEngine::getGameId() const { return _gameDescription->gameId; }
|
2007-07-13 16:37:37 +00:00
|
|
|
|
|
|
|
uint32 SagaEngine::getFeatures() const {
|
|
|
|
uint32 result = _gameDescription->features;
|
|
|
|
|
|
|
|
if (_gf_wyrmkeep)
|
|
|
|
result |= GF_WYRMKEEP;
|
|
|
|
|
|
|
|
if (_gf_compressed_sounds)
|
|
|
|
result |= GF_COMPRESSED_SOUNDS;
|
|
|
|
|
2008-01-27 19:47:41 +00:00
|
|
|
return result;
|
2007-07-13 16:37:37 +00:00
|
|
|
}
|
|
|
|
|
2007-01-21 20:24:38 +00:00
|
|
|
Common::Language SagaEngine::getLanguage() const { return _gameDescription->desc.language; }
|
|
|
|
Common::Platform SagaEngine::getPlatform() const { return _gameDescription->desc.platform; }
|
|
|
|
int SagaEngine::getGameNumber() const { return _gameNumber; }
|
|
|
|
int SagaEngine::getStartSceneNumber() const { return _gameDescription->startSceneNumber; }
|
|
|
|
|
|
|
|
const GamePatchDescription *SagaEngine::getPatchDescriptions() const { return _gameDescription->patchDescriptions; }
|
|
|
|
const Common::ADGameFileDescription *SagaEngine::getFilesDescriptions() const { return _gameDescription->desc.filesDescriptions; }
|
|
|
|
|
2006-03-09 14:33:07 +00:00
|
|
|
}
|
|
|
|
|
2007-01-24 23:13:00 +00:00
|
|
|
static const PlainGameDescriptor sagaGames[] = {
|
2007-01-29 23:25:51 +00:00
|
|
|
{"saga", "SAGA Engine game"},
|
2006-03-09 14:33:07 +00:00
|
|
|
{"ite", "Inherit the Earth: Quest for the Orb"},
|
|
|
|
{"ihnm", "I Have No Mouth and I Must Scream"},
|
2008-12-21 22:52:44 +00:00
|
|
|
{"dino", "Dinotopia"},
|
|
|
|
{"fta2", "Faery Tale Adventure II: Halls of the Dead"},
|
2006-03-09 14:33:07 +00:00
|
|
|
{0, 0}
|
|
|
|
};
|
|
|
|
|
2007-01-29 23:25:51 +00:00
|
|
|
static const Common::ADObsoleteGameID obsoleteGameIDsTable[] = {
|
|
|
|
{"ite", "saga", Common::kPlatformUnknown},
|
|
|
|
{"ihnm", "saga", Common::kPlatformUnknown},
|
2008-12-21 22:52:44 +00:00
|
|
|
{"dino", "saga", Common::kPlatformUnknown},
|
|
|
|
{"fta2", "saga", Common::kPlatformUnknown},
|
2007-01-29 23:25:51 +00:00
|
|
|
{0, 0, Common::kPlatformUnknown}
|
|
|
|
};
|
|
|
|
|
2007-04-27 22:39:31 +00:00
|
|
|
#include "saga/detection_tables.h"
|
2006-08-26 11:33:15 +00:00
|
|
|
|
2007-01-24 23:13:00 +00:00
|
|
|
static const Common::ADParams detectionParams = {
|
|
|
|
// Pointer to ADGameDescription or its superset structure
|
|
|
|
(const byte *)Saga::gameDescriptions,
|
|
|
|
// Size of that superset structure
|
|
|
|
sizeof(Saga::SAGAGameDescription),
|
|
|
|
// Number of bytes to compute MD5 sum for
|
|
|
|
5000,
|
|
|
|
// List of all engine targets
|
|
|
|
sagaGames,
|
|
|
|
// Structure for autoupgrading obsolete targets
|
2007-01-29 23:25:51 +00:00
|
|
|
obsoleteGameIDsTable,
|
2007-01-28 07:31:26 +00:00
|
|
|
// Name of single gameid (optional)
|
|
|
|
"saga",
|
2007-02-04 03:10:27 +00:00
|
|
|
// List of files for file-based fallback detection (optional)
|
|
|
|
0,
|
2007-01-28 07:31:26 +00:00
|
|
|
// Flags
|
2008-04-05 22:29:08 +00:00
|
|
|
0
|
2007-01-24 23:13:00 +00:00
|
|
|
};
|
|
|
|
|
2008-02-02 11:52:04 +00:00
|
|
|
class SagaMetaEngine : public Common::AdvancedMetaEngine {
|
2008-02-02 02:35:13 +00:00
|
|
|
public:
|
2008-02-02 11:52:04 +00:00
|
|
|
SagaMetaEngine() : Common::AdvancedMetaEngine(detectionParams) {}
|
2008-02-02 02:35:13 +00:00
|
|
|
|
|
|
|
virtual const char *getName() const {
|
2009-01-02 18:20:15 +00:00
|
|
|
return "Saga engine ["
|
|
|
|
|
|
|
|
#if defined(ENABLE_IHNM) && defined(ENABLE_SAGA2)
|
|
|
|
"all games"
|
|
|
|
#else
|
|
|
|
"ITE"
|
|
|
|
|
|
|
|
#if defined(ENABLE_IHNM)
|
|
|
|
", IHNM"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(ENABLE_SAGA2)
|
|
|
|
", SAGA2 games"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
"]";
|
|
|
|
|
|
|
|
;
|
2008-02-02 02:35:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual const char *getCopyright() const {
|
|
|
|
return "Inherit the Earth (C) Wyrmkeep Entertainment";
|
|
|
|
}
|
|
|
|
|
2008-08-15 18:15:14 +00:00
|
|
|
virtual bool hasFeature(MetaEngineFeature f) const;
|
2008-03-14 17:31:04 +00:00
|
|
|
virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
|
2008-07-29 02:12:07 +00:00
|
|
|
virtual SaveStateList listSaves(const char *target) const;
|
2008-11-09 16:13:34 +00:00
|
|
|
virtual int getMaximumSaveSlot() const;
|
2008-09-11 19:47:45 +00:00
|
|
|
virtual void removeSaveState(const char *target, int slot) const;
|
2008-11-10 14:11:30 +00:00
|
|
|
SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
|
2008-02-02 02:35:13 +00:00
|
|
|
};
|
|
|
|
|
2008-08-15 18:15:14 +00:00
|
|
|
bool SagaMetaEngine::hasFeature(MetaEngineFeature f) const {
|
|
|
|
return
|
|
|
|
(f == kSupportsListSaves) ||
|
2008-10-26 16:42:08 +00:00
|
|
|
(f == kSupportsLoadingDuringStartup) ||
|
2008-11-10 14:11:30 +00:00
|
|
|
(f == kSupportsDeleteSave) ||
|
|
|
|
(f == kSavesSupportMetaInfo) ||
|
|
|
|
(f == kSavesSupportThumbnail) ||
|
|
|
|
(f == kSavesSupportCreationDate);
|
2008-11-04 16:11:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Saga::SagaEngine::hasFeature(EngineFeature f) const {
|
|
|
|
return
|
|
|
|
(f == kSupportsRTL) ||
|
2008-11-03 18:32:16 +00:00
|
|
|
(f == kSupportsLoadingDuringRuntime) ||
|
|
|
|
(f == kSupportsSavingDuringRuntime);
|
2008-08-15 18:15:14 +00:00
|
|
|
}
|
|
|
|
|
2008-03-14 17:31:04 +00:00
|
|
|
bool SagaMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
|
|
|
|
const Saga::SAGAGameDescription *gd = (const Saga::SAGAGameDescription *)desc;
|
2007-11-03 21:06:58 +00:00
|
|
|
if (gd) {
|
|
|
|
*engine = new Saga::SagaEngine(syst, gd);
|
|
|
|
}
|
|
|
|
return gd != 0;
|
|
|
|
}
|
|
|
|
|
2008-07-29 02:12:07 +00:00
|
|
|
SaveStateList SagaMetaEngine::listSaves(const char *target) const {
|
|
|
|
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
|
|
|
Common::StringList filenames;
|
|
|
|
char saveDesc[SAVE_TITLE_SIZE];
|
|
|
|
Common::String pattern = target;
|
|
|
|
pattern += ".s??";
|
|
|
|
|
|
|
|
filenames = saveFileMan->listSavefiles(pattern.c_str());
|
|
|
|
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
|
|
|
|
|
|
|
SaveStateList saveList;
|
2008-11-07 19:43:01 +00:00
|
|
|
int slotNum = 0;
|
2008-07-29 02:12:07 +00:00
|
|
|
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
|
2008-11-07 19:43:01 +00:00
|
|
|
slotNum = atoi(file->c_str() + file->size() - 2);
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-07-29 02:12:07 +00:00
|
|
|
if (slotNum >= 0 && slotNum <= 99) {
|
|
|
|
Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str());
|
|
|
|
if (in) {
|
|
|
|
for (int i = 0; i < 3; i++)
|
|
|
|
in->readUint32BE();
|
|
|
|
in->read(saveDesc, SAVE_TITLE_SIZE);
|
2008-11-05 15:41:12 +00:00
|
|
|
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
|
2008-07-29 02:12:07 +00:00
|
|
|
delete in;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return saveList;
|
|
|
|
}
|
|
|
|
|
2008-11-09 16:13:34 +00:00
|
|
|
int SagaMetaEngine::getMaximumSaveSlot() const { return 99; }
|
|
|
|
|
2008-09-11 19:47:45 +00:00
|
|
|
void SagaMetaEngine::removeSaveState(const char *target, int slot) const {
|
|
|
|
char extension[6];
|
|
|
|
snprintf(extension, sizeof(extension), ".s%02d", slot);
|
|
|
|
|
|
|
|
Common::String filename = target;
|
|
|
|
filename += extension;
|
|
|
|
|
|
|
|
g_system->getSavefileManager()->removeSavefile(filename.c_str());
|
|
|
|
}
|
|
|
|
|
2008-11-10 14:11:30 +00:00
|
|
|
SaveStateDescriptor SagaMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
|
|
|
|
static char fileName[MAX_FILE_NAME];
|
|
|
|
sprintf(fileName, "%s.s%02d", target, slot);
|
|
|
|
char title[TITLESIZE];
|
|
|
|
|
|
|
|
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(fileName);
|
|
|
|
|
|
|
|
if (in) {
|
|
|
|
uint32 type = in->readUint32BE();
|
|
|
|
in->readUint32LE(); // size
|
|
|
|
uint32 version = in->readUint32LE();
|
|
|
|
char name[SAVE_TITLE_SIZE];
|
|
|
|
in->read(name, sizeof(name));
|
|
|
|
|
|
|
|
SaveStateDescriptor desc(slot, name);
|
|
|
|
|
|
|
|
// Some older saves were not written in an endian safe fashion.
|
|
|
|
// We try to detect this here by checking for extremly high version values.
|
|
|
|
// If found, we retry with the data swapped.
|
|
|
|
if (version > 0xFFFFFF) {
|
|
|
|
warning("This savegame is not endian safe, retrying with the data swapped");
|
|
|
|
version = SWAP_BYTES_32(version);
|
|
|
|
}
|
|
|
|
|
|
|
|
debug(2, "Save version: %x", version);
|
|
|
|
|
|
|
|
if (version < 4)
|
|
|
|
warning("This savegame is not endian-safe. There may be problems");
|
|
|
|
|
|
|
|
if (type != MKID_BE('SAGA')) {
|
|
|
|
error("SagaEngine::load wrong save game format");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (version > 4) {
|
|
|
|
in->read(title, TITLESIZE);
|
|
|
|
debug(0, "Save is for: %s", title);
|
|
|
|
}
|
|
|
|
|
|
|
|
desc.setDeletableFlag(true);
|
|
|
|
desc.setWriteProtectedFlag(false);
|
|
|
|
|
|
|
|
if (version >= 6) {
|
2008-11-10 18:51:51 +00:00
|
|
|
Graphics::Surface *thumbnail = new Graphics::Surface();
|
2008-11-10 14:11:30 +00:00
|
|
|
assert(thumbnail);
|
|
|
|
if (!Graphics::loadThumbnail(*in, *thumbnail)) {
|
|
|
|
delete thumbnail;
|
|
|
|
thumbnail = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
desc.setThumbnail(thumbnail);
|
|
|
|
|
|
|
|
uint32 saveDate = in->readUint32BE();
|
|
|
|
uint16 saveTime = in->readUint16BE();
|
|
|
|
|
|
|
|
int day = (saveDate >> 24) & 0xFF;
|
|
|
|
int month = (saveDate >> 16) & 0xFF;
|
|
|
|
int year = saveDate & 0xFFFF;
|
|
|
|
|
|
|
|
desc.setSaveDate(year, month, day);
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-11-10 14:11:30 +00:00
|
|
|
int hour = (saveTime >> 8) & 0xFF;
|
|
|
|
int minutes = saveTime & 0xFF;
|
|
|
|
|
|
|
|
desc.setSaveTime(hour, minutes);
|
|
|
|
|
|
|
|
// TODO: played time
|
|
|
|
}
|
|
|
|
|
|
|
|
delete in;
|
|
|
|
|
|
|
|
return desc;
|
|
|
|
}
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-11-10 14:11:30 +00:00
|
|
|
return SaveStateDescriptor();
|
|
|
|
}
|
|
|
|
|
2008-05-06 03:00:26 +00:00
|
|
|
#if PLUGIN_ENABLED_DYNAMIC(SAGA)
|
|
|
|
REGISTER_PLUGIN_DYNAMIC(SAGA, PLUGIN_TYPE_ENGINE, SagaMetaEngine);
|
|
|
|
#else
|
|
|
|
REGISTER_PLUGIN_STATIC(SAGA, PLUGIN_TYPE_ENGINE, SagaMetaEngine);
|
|
|
|
#endif
|
2006-03-09 14:33:07 +00:00
|
|
|
|
2004-04-12 21:40:49 +00:00
|
|
|
namespace Saga {
|
2006-10-02 22:21:57 +00:00
|
|
|
|
2006-11-12 03:23:29 +00:00
|
|
|
bool SagaEngine::initGame() {
|
2008-12-22 14:36:58 +00:00
|
|
|
_displayClip.right = getDisplayInfo().width;
|
|
|
|
_displayClip.bottom = getDisplayInfo().height;
|
2006-12-19 13:50:34 +00:00
|
|
|
|
|
|
|
return _resource->createContexts();
|
2006-11-12 03:23:29 +00:00
|
|
|
}
|
2006-10-02 22:21:57 +00:00
|
|
|
|
2007-04-27 23:11:12 +00:00
|
|
|
const GameDisplayInfo &SagaEngine::getDisplayInfo() {
|
2008-12-21 22:52:44 +00:00
|
|
|
switch (_gameDescription->gameId) {
|
|
|
|
case GID_ITE:
|
|
|
|
return ITE_DisplayInfo;
|
2009-01-02 16:52:38 +00:00
|
|
|
#ifdef ENABLE_IHNM
|
2008-12-21 22:52:44 +00:00
|
|
|
case GID_IHNM:
|
|
|
|
return IHNM_DisplayInfo;
|
2009-01-02 16:52:38 +00:00
|
|
|
#endif
|
2009-01-02 19:10:51 +00:00
|
|
|
#ifdef ENABLE_SAGA2
|
2008-12-21 22:52:44 +00:00
|
|
|
case GID_DINO:
|
2009-01-02 16:52:38 +00:00
|
|
|
return FTA2_DisplayInfo; // TODO
|
2008-12-21 22:52:44 +00:00
|
|
|
case GID_FTA2:
|
|
|
|
return FTA2_DisplayInfo;
|
2009-01-02 19:10:51 +00:00
|
|
|
#endif
|
2008-12-21 22:52:44 +00:00
|
|
|
default:
|
|
|
|
error("getDisplayInfo: Unknown game ID");
|
2009-01-02 16:52:38 +00:00
|
|
|
return ITE_DisplayInfo; // unreachable
|
2008-12-21 22:52:44 +00:00
|
|
|
}
|
2007-04-27 23:11:12 +00:00
|
|
|
}
|
|
|
|
|
2008-11-06 17:05:54 +00:00
|
|
|
Common::Error SagaEngine::loadGameState(int slot) {
|
2008-11-03 18:32:16 +00:00
|
|
|
// Init the current chapter to 8 (character selection) for IHNM
|
2008-12-21 15:59:05 +00:00
|
|
|
if (getGameId() == GID_IHNM)
|
2008-11-03 18:32:16 +00:00
|
|
|
_scene->changeScene(-2, 0, kTransitionFade, 8);
|
|
|
|
|
|
|
|
// First scene sets up palette
|
|
|
|
_scene->changeScene(getStartSceneNumber(), 0, kTransitionNoFade);
|
|
|
|
_events->handleEvents(0); // Process immediate events
|
|
|
|
|
2008-12-21 15:59:05 +00:00
|
|
|
if (getGameId() == GID_ITE)
|
2008-11-03 18:32:16 +00:00
|
|
|
_interface->setMode(kPanelMain);
|
|
|
|
else
|
|
|
|
_interface->setMode(kPanelChapterSelection);
|
|
|
|
|
|
|
|
load(calcSaveFileName((uint)slot));
|
|
|
|
syncSoundSettings();
|
|
|
|
|
2008-11-06 17:05:54 +00:00
|
|
|
return Common::kNoError; // TODO: return success/failure
|
2008-11-03 18:32:16 +00:00
|
|
|
}
|
|
|
|
|
2008-11-07 19:43:01 +00:00
|
|
|
Common::Error SagaEngine::saveGameState(int slot, const char *desc) {
|
|
|
|
save(calcSaveFileName((uint)slot), desc);
|
|
|
|
return Common::kNoError; // TODO: return success/failure
|
|
|
|
}
|
|
|
|
|
2009-01-01 15:06:43 +00:00
|
|
|
bool SagaEngine::canLoadGameStateCurrently() {
|
2008-11-10 18:51:51 +00:00
|
|
|
return !_scene->isInIntro();
|
|
|
|
}
|
|
|
|
|
2009-01-01 15:06:43 +00:00
|
|
|
bool SagaEngine::canSaveGameStateCurrently() {
|
|
|
|
return !_scene->isInIntro() &&
|
2008-11-10 18:51:51 +00:00
|
|
|
(_interface->getMode() == kPanelMain || _interface->getMode() == kPanelChapterSelection);
|
|
|
|
}
|
|
|
|
|
2004-04-12 21:40:49 +00:00
|
|
|
} // End of namespace Saga
|