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
35namespace TsAGE {
36
37enum 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
66enum {
67 kRingDebugScripts = 1 << 0,
68 ktSageSound = 1 << 1,
69 ktSageCore = 1 << 2,
70 ktSageDebugGraphics = 1 << 3
71};
72
73class TSageEngine : public Engine {
74private:
75 const tSageGameDescription *_gameDescription;
76public:
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 void pauseEngineIntern(bool pause) override;
97
98 void initialize();
99 void deinitialize();
100};
101
102extern TSageEngine *g_vm;
103
104#define ALLOCATE_HANDLE(x) g_vm->_memoryManager.allocate(x)
105#define ALLOCATE(x) g_vm->_memoryManager.allocate2(x)
106#define DEALLOCATE(x) g_vm->_memoryManager.deallocate(x)
107
108} // End of namespace TsAGE
109
110#endif
Definition: error.h:81
Definition: path.h:52
Definition: str.h:59
Definition: ustr.h:57
Definition: engine.h:149
EngineFeature
Definition: engine.h:282
Definition: system.h:166
Definition: resources.h:108
Definition: tsage.h:73
void syncSoundSettings() override
void pauseEngineIntern(bool pause) override
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
Common::Error run() override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Common::Error loadGameState(int slot) override
bool hasFeature(EngineFeature f) const override
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Language
Definition: language.h:45
Definition: detection.h:46