ScummVM
lastexpress.h
Go to the documentation of this file.
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef LASTEXPRESS_LASTEXPRESS_H
24 #define LASTEXPRESS_LASTEXPRESS_H
25 
26 #include "lastexpress/debug.h"
28 
29 #include "common/random.h"
30 
31 #include "engines/engine.h"
32 
33 #include "graphics/pixelformat.h"
34 
35 struct ADGameDescription;
36 
59 namespace LastExpress {
60 
61 class Cursor;
62 class Font;
63 class GraphicsManager;
64 class Logic;
65 class Menu;
66 class ResourceManager;
67 class SceneManager;
68 class SoundManager;
69 
70 class LastExpressEngine : public Engine {
71 protected:
72  // Engine APIs
73  Common::Error run() override;
74  bool hasFeature(EngineFeature f) const override;
75 
76 public:
78  ~LastExpressEngine() override;
79 
80  // Misc
82 
83  // Game
84  Cursor *getCursor() const { return _cursor; }
85  Font *getFont() const { return _font; }
86  Logic *getGameLogic() const { return _logic; }
87  Menu *getGameMenu() const { return _menu; }
88 
89  // Managers
92  SceneManager *getSceneManager() const { return _sceneMan; }
93  SoundManager *getSoundManager() const { return _soundMan; }
94 
95  // Event handling
96  bool handleEvents();
97  void pollEvents();
98 
99  void backupEventHandlers();
100  void restoreEventHandlers();
102 
103  bool isDemo() const;
104 
105  // Frame Counter
106  // TODO: all callers could use _system->getMillis() directly without extra conversions
107  uint32 getFrameCounter() const;
108 
109 private:
112 
113  // Misc
116 
117  // Game
122 
123  // Frame counter
125 
126  // Managers
131 
132  // Event handlers
135 
138 };
139 
140 } // End of namespace LastExpress
141 
142 #endif // LASTEXPRESS_LASTEXPRESS_H
LastExpress::LastExpressEngine::_pixelFormat
Graphics::PixelFormat _pixelFormat
Definition: lastexpress.h:111
Glk::Level9::f
FILE * f
Definition: level9_main.cpp:155
LastExpress::LastExpressEngine::_resMan
ResourceManager * _resMan
Definition: lastexpress.h:128
LastExpress::LastExpressEngine::hasFeature
bool hasFeature(EngineFeature f) const override
Misc Engine.
Definition: lastexpress.cpp:312
Engine
Definition: engine.h:60
LastExpress::LastExpressEngine::getResourceManager
ResourceManager * getResourceManager() const
Definition: lastexpress.h:91
LastExpress::LastExpressEngine::_eventTickBackup
EventHandler::EventFunction * _eventTickBackup
Definition: lastexpress.h:137
LastExpress::LastExpressEngine::getSceneManager
SceneManager * getSceneManager() const
Definition: lastexpress.h:92
LastExpress::LastExpressEngine::_sceneMan
SceneManager * _sceneMan
Definition: lastexpress.h:129
pixelformat.h
LastExpress::Cursor
Definition: cursor.h:63
LastExpress::LastExpressEngine::backupEventHandlers
void backupEventHandlers()
Event Handling.
Definition: lastexpress.cpp:275
Cursor
Definition: cursor.h:28
LastExpress::LastExpressEngine::_logic
Logic * _logic
Definition: lastexpress.h:120
LastExpress::Debugger
Definition: debug.h:48
LastExpress::LastExpressEngine::_eventTick
EventHandler::EventFunction * _eventTick
Definition: lastexpress.h:134
LastExpress::LastExpressEngine::~LastExpressEngine
~LastExpressEngine() override
Definition: lastexpress.cpp:84
LastExpress::LastExpressEngine::LastExpressEngine
LastExpressEngine(OSystem *syst, const ADGameDescription *gd)
Definition: lastexpress.cpp:55
uint32
unsigned int uint32
Definition: cdtypes.h:26
LastExpress::SoundManager
Definition: sound.h:35
LastExpress::LastExpressEngine::_gameDescription
const ADGameDescription * _gameDescription
Definition: lastexpress.h:110
Common::Error
An Error instance pairs an error code with string description providing more details about the error.
Definition: error.h:77
LastExpress::LastExpressEngine::pollEvents
void pollEvents()
Definition: lastexpress.cpp:167
LastExpress::LastExpressEngine::handleEvents
bool handleEvents()
Definition: lastexpress.cpp:186
LastExpress::LastExpressEngine::_soundMan
SoundManager * _soundMan
Definition: lastexpress.h:130
LastExpress::ResourceManager
Definition: resource.h:37
eventhandler.h
LastExpress::LastExpressEngine::_font
Font * _font
Definition: lastexpress.h:119
Common::RandomSource
Simple random number generator.
Definition: random.h:36
ADGameDescription
Definition: advancedDetector.h:83
LastExpress::LastExpressEngine::getGameLogic
Logic * getGameLogic() const
Definition: lastexpress.h:86
LastExpress::LastExpressEngine::_debugger
Debugger * _debugger
Definition: lastexpress.h:114
LastExpress::LastExpressEngine::getFrameCounter
uint32 getFrameCounter() const
Definition: lastexpress.cpp:162
random.h
LastExpress::LastExpressEngine::isDemo
bool isDemo() const
Definition: detection.cpp:256
Engine::EngineFeature
EngineFeature
A feature in this context means an ability of the engine which can be either available or not.
Definition: engine.h:124
LastExpress
This is the namespace of the LastExpress engine.
Definition: animation.cpp:40
LastExpress::LastExpressEngine
Definition: lastexpress.h:70
LastExpress::LastExpressEngine::_eventMouseBackup
EventHandler::EventFunction * _eventMouseBackup
Definition: lastexpress.h:136
LastExpress::LastExpressEngine::getCursor
Cursor * getCursor() const
Definition: lastexpress.h:84
LastExpress::LastExpressEngine::restoreEventHandlers
void restoreEventHandlers()
Definition: lastexpress.cpp:283
LastExpress::LastExpressEngine::_lastFrameCount
uint32 _lastFrameCount
Definition: lastexpress.h:124
LastExpress::LastExpressEngine::_cursor
Cursor * _cursor
Definition: lastexpress.h:118
LastExpress::Logic
Definition: logic.h:44
LastExpress::Menu
Definition: menu.h:43
LastExpress::LastExpressEngine::setEventHandlers
void setEventHandlers(EventHandler::EventFunction *eventMouse, EventHandler::EventFunction *eventTick)
Definition: lastexpress.cpp:298
LastExpress::LastExpressEngine::getSoundManager
SoundManager * getSoundManager() const
Definition: lastexpress.h:93
LastExpress::GraphicsManager
Definition: graphics.h:30
Hugo::Font
Font
Definition: game.h:71
LastExpress::SceneManager
Definition: scenes.h:38
LastExpress::LastExpressEngine::_random
Common::RandomSource _random
Definition: lastexpress.h:115
GraphicsManager
Abstract class for graphics manager.
Definition: graphics.h:37
LastExpress::LastExpressEngine::getGraphicsManager
GraphicsManager * getGraphicsManager() const
Definition: lastexpress.h:90
LastExpress::LastExpressEngine::_menu
Menu * _menu
Definition: lastexpress.h:121
LastExpress::LastExpressEngine::getGameMenu
Menu * getGameMenu() const
Definition: lastexpress.h:87
OSystem
Interface for ScummVM backends.
Definition: system.h:114
engine.h
LastExpress::LastExpressEngine::run
Common::Error run() override
Init the engine and start its main loop.
Definition: lastexpress.cpp:107
debug.h
LastExpress::LastExpressEngine::getFont
Font * getFont() const
Definition: lastexpress.h:85
LastExpress::LastExpressEngine::getRandom
Common::RandomSource & getRandom()
Definition: lastexpress.h:81
LastExpress::LastExpressEngine::_eventMouse
EventHandler::EventFunction * _eventMouse
Definition: lastexpress.h:133
LastExpress::Font
Definition: font.h:49
Graphics::PixelFormat
A pixel format description.
Definition: pixelformat.h:136
LastExpress::LastExpressEngine::_graphicsMan
GraphicsManager * _graphicsMan
Definition: lastexpress.h:127
Common::Functor1
Generic functor object for unary function objects.
Definition: func.h:428