ScummVM API documentation
tsage.h
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 modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (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, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef TSAGE_TSAGE_H
23 #define TSAGE_TSAGE_H
24 
25 #include "engines/engine.h"
26 #include "gui/debugger.h"
27 
28 #include "tsage/resources.h"
29 #include "tsage/debugger.h"
30 #include "tsage/events.h"
31 #include "tsage/resources.h"
32 #include "tsage/detection.h"
33 
34 
35 namespace TsAGE {
36 
37 enum TSAGEAction {
38  kActionNone,
39  kActionEscape,
40  kActionReturn,
41  kActionHelp,
42  kActionSoundOptions,
43  kActionQuitGame,
44  kActionRestartGame,
45  kActionSaveGame,
46  kActionRestoreGame,
47  kActionCredits,
48  kActionPauseGame,
49  kActionWalk,
50  kActionLook,
51  kActionUse,
52  kActionTalk,
53  kActionMoveUpCrawlNorth,
54  kActionMoveDownCrawlSouth,
55  kActionMoveLeftCrawlWest,
56  kActionMoveRightCrawlEast,
57  kActionIncreaseSpeed,
58  kActionDecreaseSpeed,
59  kActionMinimumSpeed,
60  kActionMaximumSpeed,
61  kActionLowSpeed,
62  kActionMediumSpeed,
63  kActionDrawCards
64 };
65 
66 enum {
67  kRingDebugScripts = 1 << 0,
68  ktSageSound = 1 << 1,
69  ktSageCore = 1 << 2,
70  ktSageDebugGraphics = 1 << 3
71 };
72 
73 class TSageEngine : public Engine {
74 private:
75  const tSageGameDescription *_gameDescription;
76 public:
77  TSageEngine(OSystem *system, const tSageGameDescription *gameDesc);
78  ~TSageEngine() override;
79  bool hasFeature(EngineFeature f) const override;
80 
81  MemoryManager _memoryManager;
82 
83  const char *getGameId() const;
84  uint32 getGameID() const;
85  uint32 getFeatures() const;
86  Common::Language getLanguage() const;
87  Common::Path getPrimaryFilename() const;
88 
89  virtual Common::Error init();
90  Common::Error run() override;
91  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
92  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
93  Common::Error loadGameState(int slot) override;
94  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
95  void syncSoundSettings() override;
96 
97  void initialize();
98  void deinitialize();
99 };
100 
101 extern TSageEngine *g_vm;
102 
103 #define ALLOCATE_HANDLE(x) g_vm->_memoryManager.allocate(x)
104 #define ALLOCATE(x) g_vm->_memoryManager.allocate2(x)
105 #define DEALLOCATE(x) g_vm->_memoryManager.deallocate(x)
106 
107 } // End of namespace TsAGE
108 
109 #endif
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
Definition: str.h:59
EngineFeature
Definition: engine.h:253
Common::Error run() override
Definition: error.h:84
Definition: detection.h:44
bool hasFeature(EngineFeature f) const override
Definition: path.h:52
Common::Error loadGameState(int slot) override
Definition: ustr.h:57
void syncSoundSettings() override
Definition: blueforce_dialogs.h:30
Definition: tsage.h:73
Definition: system.h:161
Definition: resources.h:108
Definition: engine.h:144
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Language
Definition: language.h:45