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 
30 struct ADGameDescription;
31 
32 namespace Common {
33 class RandomSource;
34 }
35 
36 namespace Graphics {
37 class FrameLimiter;
38 }
39 
40 namespace Stark {
41 
42 namespace Gfx {
43 class Driver;
44 }
45 
46 class ArchiveLoader;
47 class Console;
48 class DialogPlayer;
49 class Diary;
50 class FontProvider;
51 class Global;
52 class GameInterface;
53 class Scene;
54 class StateProvider;
55 class StaticProvider;
56 class ResourceProvider;
57 class UserInterface;
58 class Settings;
59 class GameChapter;
60 class GameMessage;
61 
62 enum 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 
91 class StarkEngine : public Engine {
92 public:
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 
107 protected:
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 
117 private:
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: engine.h:103
Definition: framelimiter.h:37
Definition: str.h:59
EngineFeature
Definition: engine.h:253
Definition: error.h:84
Definition: advancedDetector.h:163
Definition: ustr.h:57
Definition: console.h:27
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: stark.h:91
Definition: system.h:161
Definition: engine.h:144