22 #ifndef ASYLUM_ASYLUM_H 23 #define ASYLUM_ASYLUM_H 25 #include "common/file.h" 26 #include "common/language.h" 27 #include "common/random.h" 28 #include "common/rect.h" 29 #include "common/scummsys.h" 30 #include "common/serializer.h" 31 #include "common/system.h" 33 #include "engines/advancedDetector.h" 34 #include "engines/engine.h" 36 #include "asylum/resources/data.h" 38 #include "asylum/detection.h" 39 #include "asylum/eventhandler.h" 40 #include "asylum/shared.h" 59 class ResourceManager;
70 extern const char *
const engineKeyMapId;
71 extern const char *
const resviewerKeyMapId;
92 bool startGame(ResourcePackId sceneId, StartGameType type);
134 uint32 lastScreenUpdate;
137 Cursor *cursor() {
return _cursor; }
138 Encounter *encounter() {
return _encounter; }
139 Menu *menu() {
return _menu; }
141 Savegame *savegame() {
return _savegame; }
142 Scene *scene() {
return _scene; }
143 Screen *screen() {
return _screen; }
145 Special *special() {
return _special; }
146 Speech *speech() {
return _speech; }
147 Sound *sound() {
return _sound; }
148 Text *text() {
return _text; }
152 Puzzles *puzzles() {
return _puzzles; }
155 void setGameFlag(GameFlag flag);
156 void clearGameFlag(GameFlag flag);
157 void toggleGameFlag(GameFlag flag);
158 bool isGameFlagSet(GameFlag flag)
const;
159 bool isGameFlagNotSet(GameFlag flag)
const;
160 bool areGameFlagsSet(uint from, uint to)
const;
161 void resetFlags() { memset(_gameFlags, 0,
sizeof(_gameFlags)); }
164 uint getRandom(uint max) {
return max ? _rnd->
getRandomNumber(max - 1) : 0; }
167 bool rectContains(
const int16 (*rectPtr)[4],
const Common::Point &p)
const;
171 void checkAchievements();
185 void notify(AsylumEventType type, int32 param1 = 0, int32 param2 = 0);
195 bool checkGameVersion(
const char *version) {
return !strcmp(_gameDescription->
extra, version); }
200 bool isMenuVisible() {
return _handler == (
EventHandler *)_menu; }
238 uint32 _gameFlags[130];
242 void updateMouseCursor();
243 void processDelayedEvents();
252 Scene *_previousScene;
253 ResourcePackId _delayedSceneIndex;
254 int32 _delayedVideoIndex;
259 #endif // ASYLUM_ASYLUM_H
void notify(AsylumEventType type, int32 param1=0, int32 param2=0)
Definition: encounters.h:84
bool canSaveAutosaveCurrently() override
virtual bool hasFeature(EngineFeature f) const override
EngineFeature
Definition: engine.h:253
static String format(MSVC_PRINTF const char *fmt,...) GCC_PRINTF(1
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
virtual Common::Error run() override
const char * extra
Definition: advancedDetector.h:180
Definition: advancedDetector.h:163
void setTick(uint32 offset)
Definition: asylum.h:123
virtual uint32 getMillis(bool skipRecord=false)=0
uint getRandomNumber(uint max)
Definition: atari-screen.h:60
OSystem * _system
Definition: engine.h:149
MetaEngine * getMetaEngine() const
Definition: engine.h:529
Definition: serializer.h:79
Definition: savegame.h:37
Common::Error loadGameState(int slot) override
Common::Language language
Definition: advancedDetector.h:193
void switchEventHandler(EventHandler *handler)
Definition: atari-cursor.h:38
uint32 screenUpdateCount
Definition: asylum.h:133
Definition: eventhandler.h:61
Definition: serializer.h:308
const Common::String _targetName
Definition: engine.h:181
static bool exists(const Path &filename)
uint32 getTick()
Definition: asylum.h:116
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
void updateReverseStereo()
void switchScene(ResourcePackId sceneId)
Definition: asylum.h:109
int getAutosaveSlot() const override
Definition: asylum.h:204
bool startGame(ResourcePackId sceneId, StartGameType type)
Language
Definition: language.h:45