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/core.h"
29 #include "tsage/resources.h"
30 #include "tsage/debugger.h"
31 #include "tsage/events.h"
32 #include "tsage/graphics.h"
33 #include "tsage/resources.h"
34 #include "tsage/detection.h"
35 
36 
37 namespace TsAGE {
38 
39 enum {
40  kRingDebugScripts = 1 << 0,
41  ktSageSound = 1 << 1,
42  ktSageCore = 1 << 2,
43  ktSageDebugGraphics = 1 << 3
44 };
45 
46 class TSageEngine : public Engine {
47 private:
48  const tSageGameDescription *_gameDescription;
49 public:
50  TSageEngine(OSystem *system, const tSageGameDescription *gameDesc);
51  ~TSageEngine() override;
52  bool hasFeature(EngineFeature f) const override;
53 
54  MemoryManager _memoryManager;
55 
56  const char *getGameId() const;
57  uint32 getGameID() const;
58  uint32 getFeatures() const;
59  Common::Language getLanguage() const;
60  Common::Path getPrimaryFilename() const;
61 
62  virtual Common::Error init();
63  Common::Error run() override;
64  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
65  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
66  Common::Error loadGameState(int slot) override;
67  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
68  void syncSoundSettings() override;
69 
70  void initialize();
71  void deinitialize();
72 };
73 
74 extern TSageEngine *g_vm;
75 
76 #define ALLOCATE_HANDLE(x) g_vm->_memoryManager.allocate(x)
77 #define ALLOCATE(x) g_vm->_memoryManager.allocate2(x)
78 #define DEALLOCATE(x) g_vm->_memoryManager.deallocate(x)
79 
80 } // End of namespace TsAGE
81 
82 #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:250
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:46
Definition: system.h:167
Definition: resources.h:108
Definition: engine.h:143
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Language
Definition: language.h:45