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 class StarkEngine : public Engine {
63 public:
64  StarkEngine(OSystem *syst, const ADGameDescription *gameDesc);
65  ~StarkEngine() override;
66 
68  static Common::String formatSaveName(const char *target, int slot);
69 
71  static Common::StringArray listSaveNames(const char *target);
72 
74  static int getSaveNameSlot(const char *target, const Common::String &saveName);
75 
76  uint32 getGameFlags() const;
77 
78 protected:
79  // Engine APIs
80  Common::Error run() override;
81  bool hasFeature(EngineFeature f) const override;
82  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
83  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
84  Common::Error loadGameState(int slot) override;
85  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
86  void pauseEngineIntern(bool pause) override;
87 
88 private:
89  void mainLoop();
90  void updateDisplayScene();
91  void processEvents();
92  void onScreenChanged() const;
93  void addModsToSearchPath() const;
94  static void checkRecommendedDatafiles();
95 
96  Graphics::FrameLimiter *_frameLimiter;
97  PauseToken _gamePauseToken;
98 
99  const ADGameDescription *_gameDescription;
100 
101  // Double click handling
102  static const uint _doubleClickDelay = 500; // ms
103  uint _lastClickTime;
104 };
105 
106 } // End of namespace Stark
107 
108 #endif // STARK_H
Definition: engine.h:102
Definition: framelimiter.h:37
Definition: str.h:59
EngineFeature
Definition: engine.h:250
Definition: error.h:84
Definition: advancedDetector.h:120
Definition: ustr.h:57
Definition: console.h:27
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: stark.h:62
Definition: system.h:167
Definition: engine.h:143