2010-10-18 19:17:38 +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.
|
2014-02-18 01:34:21 +00:00
|
|
|
*
|
2010-10-18 19:17:38 +00:00
|
|
|
* 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.
|
2014-02-18 01:34:21 +00:00
|
|
|
*
|
2010-10-18 19:17:38 +00:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-05-17 16:20:01 +00:00
|
|
|
#ifndef LASTEXPRESS_LASTEXPRESS_H
|
|
|
|
#define LASTEXPRESS_LASTEXPRESS_H
|
2010-10-18 19:17:38 +00:00
|
|
|
|
|
|
|
#include "lastexpress/debug.h"
|
|
|
|
#include "lastexpress/eventhandler.h"
|
|
|
|
|
|
|
|
#include "common/random.h"
|
|
|
|
|
|
|
|
#include "engines/engine.h"
|
|
|
|
|
|
|
|
#include "graphics/pixelformat.h"
|
|
|
|
|
2011-06-10 18:19:18 +00:00
|
|
|
struct ADGameDescription;
|
|
|
|
|
2010-10-18 19:17:38 +00:00
|
|
|
/**
|
|
|
|
* This is the namespace of the LastExpress engine.
|
|
|
|
*
|
|
|
|
* Status of this engine:
|
2010-10-22 22:06:59 +00:00
|
|
|
* The game is playable but still very buggy and missing crucial functionality:
|
2010-10-18 19:17:38 +00:00
|
|
|
* - Resources: classes for the resource formats used by the game are mostly
|
|
|
|
* complete (subtitles integration/cursor transparency are missing)
|
|
|
|
* - Display: basic graphic manager functionality is implemented (transitions
|
|
|
|
* and dirty rects handling are missing)
|
2010-10-22 22:06:59 +00:00
|
|
|
* - Menu/Navigation: menu is done and navigation/hotspot handling are also
|
|
|
|
* mostly implemented (with remaining bugs)
|
|
|
|
* - Logic: all the hardcoded AI logic has been implemented, as well as the
|
|
|
|
* shared entity code for drawing/handling of entities.
|
|
|
|
* - Sound: most of the sound queue functionality is still missing
|
|
|
|
* - Savegame: almost all the savegame code is still missing.
|
2010-10-18 19:17:38 +00:00
|
|
|
*
|
|
|
|
* Maintainers:
|
2010-10-22 22:06:59 +00:00
|
|
|
* littleboy, jvprat, clone2727
|
2010-10-18 19:17:38 +00:00
|
|
|
*
|
|
|
|
* Supported games:
|
2010-10-22 22:06:59 +00:00
|
|
|
* - The Last Express
|
2010-10-18 19:17:38 +00:00
|
|
|
*/
|
|
|
|
namespace LastExpress {
|
|
|
|
|
|
|
|
class Cursor;
|
|
|
|
class Font;
|
|
|
|
class GraphicsManager;
|
|
|
|
class Logic;
|
|
|
|
class Menu;
|
|
|
|
class ResourceManager;
|
|
|
|
class SceneManager;
|
|
|
|
class SoundManager;
|
|
|
|
|
|
|
|
class LastExpressEngine : public Engine {
|
|
|
|
protected:
|
|
|
|
// Engine APIs
|
2020-02-05 14:42:31 +00:00
|
|
|
Common::Error run() override;
|
2020-02-09 11:05:30 +00:00
|
|
|
bool hasFeature(EngineFeature f) const override;
|
2010-10-18 19:17:38 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
LastExpressEngine(OSystem *syst, const ADGameDescription *gd);
|
2020-02-09 11:05:30 +00:00
|
|
|
~LastExpressEngine() override;
|
2010-10-18 19:17:38 +00:00
|
|
|
|
|
|
|
// Misc
|
2018-10-17 21:56:28 +00:00
|
|
|
Common::RandomSource& getRandom() {return _random; }
|
2010-10-18 19:17:38 +00:00
|
|
|
|
|
|
|
// Game
|
|
|
|
Cursor *getCursor() const { return _cursor; }
|
|
|
|
Font *getFont() const { return _font; }
|
|
|
|
Logic *getGameLogic() const { return _logic; }
|
|
|
|
Menu *getGameMenu() const { return _menu; }
|
|
|
|
|
|
|
|
// Managers
|
|
|
|
GraphicsManager *getGraphicsManager() const { return _graphicsMan; }
|
|
|
|
ResourceManager *getResourceManager() const { return _resMan; }
|
|
|
|
SceneManager *getSceneManager() const { return _sceneMan; }
|
|
|
|
SoundManager *getSoundManager() const { return _soundMan; }
|
|
|
|
|
|
|
|
// Event handling
|
|
|
|
bool handleEvents();
|
|
|
|
void pollEvents();
|
|
|
|
|
|
|
|
void backupEventHandlers();
|
|
|
|
void restoreEventHandlers();
|
|
|
|
void setEventHandlers(EventHandler::EventFunction *eventMouse, EventHandler::EventFunction *eventTick);
|
|
|
|
|
2011-06-10 18:19:18 +00:00
|
|
|
bool isDemo() const;
|
2010-10-18 19:17:38 +00:00
|
|
|
|
|
|
|
// Frame Counter
|
2018-10-15 22:03:55 +00:00
|
|
|
// TODO: all callers could use _system->getMillis() directly without extra conversions
|
|
|
|
uint32 getFrameCounter() const;
|
2010-10-18 19:17:38 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
const ADGameDescription *_gameDescription;
|
|
|
|
Graphics::PixelFormat _pixelFormat;
|
|
|
|
|
|
|
|
// Misc
|
|
|
|
Debugger *_debugger;
|
|
|
|
Common::RandomSource _random;
|
|
|
|
|
|
|
|
// Game
|
|
|
|
Cursor *_cursor;
|
|
|
|
Font *_font;
|
|
|
|
Logic *_logic;
|
|
|
|
Menu *_menu;
|
|
|
|
|
|
|
|
// Frame counter
|
|
|
|
uint32 _lastFrameCount;
|
|
|
|
|
|
|
|
// Managers
|
|
|
|
GraphicsManager *_graphicsMan;
|
|
|
|
ResourceManager *_resMan;
|
|
|
|
SceneManager *_sceneMan;
|
|
|
|
SoundManager *_soundMan;
|
|
|
|
|
|
|
|
// Event handlers
|
2010-11-11 14:19:44 +00:00
|
|
|
EventHandler::EventFunction *_eventMouse;
|
|
|
|
EventHandler::EventFunction *_eventTick;
|
2010-10-18 19:17:38 +00:00
|
|
|
|
2010-11-11 14:19:44 +00:00
|
|
|
EventHandler::EventFunction *_eventMouseBackup;
|
|
|
|
EventHandler::EventFunction *_eventTickBackup;
|
2010-10-18 19:17:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace LastExpress
|
|
|
|
|
2016-05-17 16:20:01 +00:00
|
|
|
#endif // LASTEXPRESS_LASTEXPRESS_H
|