2016-02-06 01:39:42 +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.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TITANIC_TITANIC_H
|
|
|
|
#define TITANIC_TITANIC_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
2016-03-17 23:58:59 +00:00
|
|
|
#include "common/random.h"
|
2016-05-16 11:40:10 +00:00
|
|
|
#include "common/str-array.h"
|
2016-02-06 01:39:42 +00:00
|
|
|
#include "common/system.h"
|
|
|
|
#include "common/serializer.h"
|
|
|
|
#include "engines/advancedDetector.h"
|
|
|
|
#include "engines/engine.h"
|
2016-03-22 01:51:29 +00:00
|
|
|
#include "graphics/screen.h"
|
2016-03-18 02:29:16 +00:00
|
|
|
#include "titanic/debugger.h"
|
2016-03-19 00:04:54 +00:00
|
|
|
#include "titanic/events.h"
|
2016-04-03 20:16:35 +00:00
|
|
|
#include "titanic/support/files_manager.h"
|
2016-04-02 00:37:44 +00:00
|
|
|
#include "titanic/main_game_window.h"
|
2016-05-12 01:17:28 +00:00
|
|
|
#include "titanic/support/exe_resources.h"
|
2016-07-03 21:43:37 +00:00
|
|
|
#include "titanic/support/movie_manager.h"
|
2016-04-03 20:16:35 +00:00
|
|
|
#include "titanic/support/screen_manager.h"
|
|
|
|
#include "titanic/support/string.h"
|
2016-05-08 18:37:18 +00:00
|
|
|
#include "titanic/true_talk/tt_script_base.h"
|
2016-02-06 01:39:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the namespace of the Titanic engine.
|
|
|
|
*
|
|
|
|
* Status of this engine: In Development
|
|
|
|
*
|
|
|
|
* Games using this engine:
|
|
|
|
* - Starship Titanic
|
|
|
|
*/
|
|
|
|
namespace Titanic {
|
|
|
|
|
|
|
|
enum TitanicDebugChannels {
|
|
|
|
kDebugCore = 1 << 0,
|
|
|
|
kDebugScripts = 1 << 1,
|
|
|
|
kDebugGraphics = 1 << 2,
|
|
|
|
kDebugSound = 1 << 3
|
|
|
|
};
|
|
|
|
|
|
|
|
#define TITANIC_SAVEGAME_VERSION 1
|
|
|
|
|
2016-03-13 19:30:12 +00:00
|
|
|
#define SCREEN_WIDTH 640
|
|
|
|
#define SCREEN_HEIGHT 480
|
|
|
|
|
2016-02-08 04:25:34 +00:00
|
|
|
#define ERROR_BASIC 1
|
|
|
|
#define ERROR_INTERMEDIATE 2
|
|
|
|
#define ERROR_DETAILED 3
|
|
|
|
|
2016-04-02 01:58:39 +00:00
|
|
|
#define TOTAL_ITEMS 46
|
2016-05-01 23:09:21 +00:00
|
|
|
#define TOTAL_ROOMS 34
|
2016-04-02 01:58:39 +00:00
|
|
|
|
2016-07-22 23:20:05 +00:00
|
|
|
#define MAX_SAVES 99
|
|
|
|
|
2016-02-06 01:39:42 +00:00
|
|
|
struct TitanicGameDescription;
|
2016-02-07 21:22:16 +00:00
|
|
|
class TitanicEngine;
|
2016-02-06 01:39:42 +00:00
|
|
|
|
|
|
|
class TitanicEngine : public Engine {
|
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* Handles basic initialization
|
|
|
|
*/
|
|
|
|
void initialize();
|
2016-02-28 17:46:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles game deinitialization
|
|
|
|
*/
|
|
|
|
void deinitialize();
|
2016-04-02 00:37:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets up the item names, short, and long descriptions
|
|
|
|
*/
|
|
|
|
void setItemNames();
|
2016-05-01 23:09:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets up the list of room names
|
|
|
|
*/
|
|
|
|
void setRoomNames();
|
2016-02-06 01:39:42 +00:00
|
|
|
protected:
|
|
|
|
const TitanicGameDescription *_gameDescription;
|
|
|
|
int _loadSaveSlot;
|
|
|
|
|
|
|
|
// Engine APIs
|
2016-03-16 03:49:18 +00:00
|
|
|
virtual void initializePath(const Common::FSNode &gamePath);
|
2016-02-06 01:39:42 +00:00
|
|
|
virtual Common::Error run();
|
|
|
|
virtual bool hasFeature(EngineFeature f) const;
|
2016-02-06 03:11:02 +00:00
|
|
|
public:
|
2016-03-18 02:29:16 +00:00
|
|
|
Debugger *_debugger;
|
2016-03-19 00:04:54 +00:00
|
|
|
Events *_events;
|
2016-05-10 01:03:21 +00:00
|
|
|
CFilesManager *_filesManager;
|
2016-07-03 21:43:37 +00:00
|
|
|
CMovieManager _movieManager;
|
2016-03-22 01:51:29 +00:00
|
|
|
Graphics::Screen *_screen;
|
2016-02-06 03:11:02 +00:00
|
|
|
OSScreenManager *_screenManager;
|
|
|
|
CMainGameWindow *_window;
|
2016-03-17 23:58:59 +00:00
|
|
|
Common::RandomSource _randomSource;
|
2016-05-08 18:37:18 +00:00
|
|
|
CScriptHandler *_scriptHandler;
|
2016-05-14 04:12:47 +00:00
|
|
|
TTscriptBase *_script;
|
2016-05-30 14:18:50 +00:00
|
|
|
CTrueTalkManager *_trueTalkManager;
|
2016-05-12 01:17:28 +00:00
|
|
|
CExeResources _exeResources;
|
2016-05-16 11:40:10 +00:00
|
|
|
StringArray _itemNames;
|
|
|
|
StringArray _itemDescriptions;
|
2016-04-02 01:58:39 +00:00
|
|
|
CString _itemObjects[TOTAL_ITEMS];
|
2016-05-16 11:40:10 +00:00
|
|
|
StringArray _itemIds;
|
|
|
|
StringArray _roomNames;
|
2016-02-06 01:39:42 +00:00
|
|
|
public:
|
|
|
|
TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
|
|
|
|
virtual ~TitanicEngine();
|
|
|
|
|
2016-06-26 03:07:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if a savegame can be loaded
|
|
|
|
*/
|
|
|
|
virtual bool canLoadGameStateCurrently();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the game can be saved
|
|
|
|
*/
|
|
|
|
virtual bool canSaveGameStateCurrently();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called by the GMM to load a savegame
|
|
|
|
*/
|
|
|
|
virtual Common::Error loadGameState(int slot);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called by the GMM to save the game
|
|
|
|
*/
|
|
|
|
virtual Common::Error saveGameState(int slot, const Common::String &desc);
|
|
|
|
|
2016-02-06 01:39:42 +00:00
|
|
|
uint32 getFeatures() const;
|
|
|
|
bool isDemo() const;
|
|
|
|
Common::Language getLanguage() const;
|
2016-04-10 14:20:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a random number
|
|
|
|
*/
|
|
|
|
uint getRandomNumber(uint max) { return _randomSource.getRandomNumber(max); }
|
2016-06-26 03:07:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Support method that generates a savegame name
|
|
|
|
* @param slot Slot number
|
|
|
|
*/
|
|
|
|
CString generateSaveName(int slot);
|
2016-07-22 23:20:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks whether a savegame exists for the given slot,
|
|
|
|
* and if it exists, returns it's description
|
|
|
|
*/
|
|
|
|
CString getSavegameName(int slot);
|
2016-02-06 01:39:42 +00:00
|
|
|
};
|
|
|
|
|
2016-03-15 03:09:57 +00:00
|
|
|
extern TitanicEngine *g_vm;
|
|
|
|
|
2016-02-06 01:39:42 +00:00
|
|
|
} // End of namespace Titanic
|
|
|
|
|
|
|
|
#endif /* TITANIC_TITANIC_H */
|