2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* 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.
|
2006-02-11 12:54:56 +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
|
2006-02-11 12:54:56 +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
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2006-07-23 15:32:14 +00:00
|
|
|
#ifndef LURE_H
|
|
|
|
#define LURE_H
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2006-09-23 00:42:35 +00:00
|
|
|
#include "engines/engine.h"
|
2006-02-11 12:54:56 +00:00
|
|
|
#include "common/rect.h"
|
|
|
|
#include "sound/mixer.h"
|
|
|
|
#include "common/file.h"
|
2008-07-25 19:41:17 +00:00
|
|
|
#include "common/savefile.h"
|
2009-08-24 23:04:25 +00:00
|
|
|
#include "common/util.h"
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
#include "lure/disk.h"
|
|
|
|
#include "lure/res.h"
|
|
|
|
#include "lure/screen.h"
|
|
|
|
#include "lure/events.h"
|
|
|
|
#include "lure/menu.h"
|
|
|
|
#include "lure/strings.h"
|
|
|
|
#include "lure/room.h"
|
2007-06-22 12:36:04 +00:00
|
|
|
#include "lure/fights.h"
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2009-11-24 22:10:14 +00:00
|
|
|
/**
|
|
|
|
* This is the namespace of the Lure engine.
|
|
|
|
*
|
|
|
|
* Status of this engine: ???
|
|
|
|
*
|
|
|
|
* Supported games:
|
|
|
|
* - ???
|
|
|
|
*/
|
2006-02-11 12:54:56 +00:00
|
|
|
namespace Lure {
|
|
|
|
|
2009-08-24 23:04:25 +00:00
|
|
|
#define RandomNumberGen LureEngine::getReference().rnd()
|
|
|
|
|
2010-01-05 08:24:27 +00:00
|
|
|
enum LureLanguage {
|
|
|
|
LANG_IT_ITA = 10,
|
|
|
|
LANG_FR_FRA = 6,
|
|
|
|
LANG_DE_DEU = 7,
|
|
|
|
LANG_ES_ESP = 17,
|
|
|
|
LANG_EN_ANY = 3,
|
|
|
|
LANG_UNKNOWN = -1
|
|
|
|
};
|
|
|
|
|
2007-12-06 12:10:41 +00:00
|
|
|
struct LureGameDescription;
|
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
class LureEngine : public Engine {
|
|
|
|
private:
|
2008-02-14 22:52:57 +00:00
|
|
|
bool _initialised;
|
2008-07-25 19:41:17 +00:00
|
|
|
int _gameToLoad;
|
2007-12-02 08:32:21 +00:00
|
|
|
uint8 _saveVersion;
|
2006-02-11 12:54:56 +00:00
|
|
|
Disk *_disk;
|
|
|
|
Resources *_resources;
|
|
|
|
Screen *_screen;
|
|
|
|
Mouse *_mouse;
|
|
|
|
Events *_events;
|
|
|
|
Menu *_menu;
|
|
|
|
StringData *_strings;
|
|
|
|
Room *_room;
|
2007-06-22 12:36:04 +00:00
|
|
|
FightsManager *_fights;
|
2009-08-24 23:04:25 +00:00
|
|
|
Common::RandomSource _rnd;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2006-10-02 12:48:56 +00:00
|
|
|
const char *generateSaveName(int slotNumber);
|
2007-12-06 12:10:41 +00:00
|
|
|
|
|
|
|
const LureGameDescription *_gameDescription;
|
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
public:
|
2007-12-06 12:10:41 +00:00
|
|
|
LureEngine(OSystem *system, const LureGameDescription *gameDesc);
|
2006-02-11 12:54:56 +00:00
|
|
|
~LureEngine();
|
2006-10-02 12:48:56 +00:00
|
|
|
static LureEngine &getReference();
|
2009-01-31 12:15:21 +00:00
|
|
|
bool _saveLoadAllowed;
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2008-11-04 16:11:40 +00:00
|
|
|
// Engine APIs
|
2009-03-01 04:30:55 +00:00
|
|
|
Common::Error init();
|
|
|
|
Common::Error go();
|
|
|
|
virtual Common::Error run() {
|
|
|
|
Common::Error err;
|
|
|
|
err = init();
|
|
|
|
if (err != Common::kNoError)
|
|
|
|
return err;
|
|
|
|
return go();
|
|
|
|
}
|
2008-11-04 16:11:40 +00:00
|
|
|
virtual bool hasFeature(EngineFeature f) const;
|
2008-06-30 22:41:55 +00:00
|
|
|
virtual void syncSoundSettings();
|
2008-11-04 16:11:40 +00:00
|
|
|
virtual void pauseEngineIntern(bool pause);
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
Disk &disk() { return *_disk; }
|
2006-10-02 12:48:56 +00:00
|
|
|
|
2009-08-24 23:04:25 +00:00
|
|
|
Common::RandomSource &rnd() { return _rnd; }
|
2008-07-25 19:41:17 +00:00
|
|
|
int gameToLoad() { return _gameToLoad; }
|
2006-10-02 12:48:56 +00:00
|
|
|
bool loadGame(uint8 slotNumber);
|
|
|
|
bool saveGame(uint8 slotNumber, Common::String &caption);
|
|
|
|
Common::String *detectSave(int slotNumber);
|
2007-12-02 08:32:21 +00:00
|
|
|
uint8 saveVersion() { return _saveVersion; }
|
2009-07-03 10:40:49 +00:00
|
|
|
void GUIError(const char *msg, ...) GCC_PRINTF(2, 3);
|
2007-12-06 12:10:41 +00:00
|
|
|
|
|
|
|
uint32 getFeatures() const;
|
2010-01-05 08:24:27 +00:00
|
|
|
LureLanguage getLureLanguage() const;
|
2007-12-06 12:10:41 +00:00
|
|
|
Common::Language getLanguage() const;
|
|
|
|
Common::Platform getPlatform() const;
|
2009-01-26 06:53:23 +00:00
|
|
|
virtual GUI::Debugger *getDebugger();
|
2007-12-31 05:55:20 +00:00
|
|
|
bool isEGA() const { return (getFeatures() & GF_EGA) != 0; }
|
2009-01-31 12:15:21 +00:00
|
|
|
|
2009-05-24 15:17:42 +00:00
|
|
|
virtual Common::Error loadGameState(int slot) {
|
2009-01-31 12:15:21 +00:00
|
|
|
return loadGame(slot) ? Common::kReadingFailed : Common::kNoError;
|
|
|
|
}
|
|
|
|
virtual Common::Error saveGameState(int slot, const char *desc) {
|
|
|
|
String s(desc);
|
|
|
|
return saveGame(slot, s) ? Common::kReadingFailed : Common::kNoError;
|
|
|
|
}
|
2009-05-24 15:17:42 +00:00
|
|
|
virtual bool canLoadGameStateCurrently() {
|
2009-01-31 12:15:21 +00:00
|
|
|
return _saveLoadAllowed && !Fights.isFighting();
|
|
|
|
}
|
2009-05-24 15:17:42 +00:00
|
|
|
virtual bool canSaveGameStateCurrently() {
|
2009-01-31 12:15:21 +00:00
|
|
|
return _saveLoadAllowed && !Fights.isFighting();
|
|
|
|
}
|
2006-02-11 12:54:56 +00:00
|
|
|
};
|
2008-07-25 19:41:17 +00:00
|
|
|
Common::String getSaveName(Common::InSaveFile *in);
|
2006-02-11 12:54:56 +00:00
|
|
|
} // End of namespace Lure
|
|
|
|
|
|
|
|
#endif
|