ScummVM API documentation
stark.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 STARK_H
23#define STARK_H
24
25#include "engines/engine.h"
26#include "common/events.h"
27#include "common/str-array.h"
28#include "stark/detection.h"
29
31
32namespace Common {
33class RandomSource;
34}
35
36namespace Graphics {
37class FrameLimiter;
38}
39
40namespace Stark {
41
42namespace Gfx {
43class Driver;
44}
45
46class ArchiveLoader;
47class Console;
48class DialogPlayer;
49class Diary;
50class FontProvider;
51class Global;
52class GameInterface;
53class Scene;
54class StateProvider;
55class StaticProvider;
56class ResourceProvider;
57class UserInterface;
58class Settings;
59class GameChapter;
60class GameMessage;
61
62enum STARKAction {
63 kActionNone,
64 kActionDiaryMenu,
65 kActionSaveGame,
66 kActionLoadGame,
67 kActionConversationLog,
68 kActionAprilsDiary,
69 kActionVideoReplay,
70 kActionGameSettings,
71 kActionSaveScreenshot,
72 kActionToggleSubtitles,
73 kActionQuitToMenu,
74 kActionCycleBackInventory,
75 kActionCycleForwardInventory,
76 kActionInventory,
77 kActionDisplayExits,
78 kActionExitGame,
79 kActionPause,
80 kActionInventoryScrollUp,
81 kActionInventoryScrollDown,
82 kActionDialogueScrollUp,
83 kActionDialogueScrollDown,
84 kActionPrevDialogue,
85 kActionNextDialogue,
86 kActionSelectDialogue,
87 kActionSkip
88};
89
90
91class StarkEngine : public Engine {
92public:
93 StarkEngine(OSystem *syst, const ADGameDescription *gameDesc);
94 ~StarkEngine() override;
95
97 static Common::String formatSaveName(const char *target, int slot);
98
100 static Common::StringArray listSaveNames(const char *target);
101
103 static int getSaveNameSlot(const char *target, const Common::String &saveName);
104
105 uint32 getGameFlags() const;
106
107protected:
108 // Engine APIs
109 Common::Error run() override;
110 bool hasFeature(EngineFeature f) const override;
111 bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
112 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
113 Common::Error loadGameState(int slot) override;
114 Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
115 void pauseEngineIntern(bool pause) override;
116
117private:
118 void mainLoop();
119 void updateDisplayScene();
120 void processEvents();
121 void onScreenChanged() const;
122 void addModsToSearchPath() const;
123 static void checkRecommendedDatafiles();
124
125 Graphics::FrameLimiter *_frameLimiter;
126 PauseToken _gamePauseToken;
127
128 const ADGameDescription *_gameDescription;
129
130 // Double click handling
131 static const uint _doubleClickDelay = 500; // ms
132 uint _lastClickTime;
133};
134
135} // End of namespace Stark
136
137#endif // STARK_H
Definition: error.h:81
Definition: str.h:59
Definition: ustr.h:57
Definition: engine.h:149
EngineFeature
Definition: engine.h:282
Definition: framelimiter.h:40
Definition: system.h:166
Definition: engine.h:110
Definition: stark.h:91
static int getSaveNameSlot(const char *target, const Common::String &saveName)
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
bool hasFeature(EngineFeature f) const override
Common::Error run() override
void pauseEngineIntern(bool pause) override
static Common::String formatSaveName(const char *target, int slot)
Common::Error loadGameState(int slot) override
static Common::StringArray listSaveNames(const char *target)
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: advancedDetector.h:164