ScummVM API documentation
bagel.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 BAGEL_H
23 #define BAGEL_H
24 
25 #include "common/random.h"
26 
27 #include "bagel/detection.h"
28 #include "bagel/music.h"
29 #include "bagel/baglib/master_win.h"
30 
31 namespace Bagel {
32 
33 struct BagelGameDescription;
34 
35 class BagelEngine : public Engine {
36 private:
37  const ADGameDescription *_gameDescription;
38  Common::RandomSource _randomSource;
39  StBagelSave _saveData;
40 
41  bool canSaveLoadFromWindow() const;
42 
43 public:
44  Graphics::Screen *_screen = nullptr;
45  MusicPlayer *_midi = nullptr;
46  bool _useOriginalSaveLoad = false;
47  CBagMasterWin *_masterWin = nullptr;
48  CBofPoint g_cInitLoc; // This is the initial location for the next new pan (only option at this point)
49  bool g_bUseInitLoc = false;
50  bool g_getVilVarsFl = true;
51 
52 public:
53  BagelEngine(OSystem *syst, const ADGameDescription *gameDesc);
54  ~BagelEngine() override;
55 
56  uint32 getFeatures() const;
57 
61  Common::String getGameId() const;
62 
67 
71  bool isDemo() const;
72 
76  uint32 getRandomNumber(uint maxNum = 0x7fffffff) {
77  return _randomSource.getRandomNumber(maxNum);
78  }
79 
80  bool hasFeature(EngineFeature f) const override {
81  return
85  };
86 
87  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
88  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
89 
93  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
94  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave,
95  StBagelSave &saveData);
96 
100  Common::Error loadGameState(int slot) override;
101 
105  Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
106 
111 
115  SaveStateList listSaves() const;
116 
120  bool savesExist() const;
121 
125  void pauseEngineIntern(bool pause) override;
126 
127  void errorDialog(const char *msg) const;
128 
129  void enableKeymapper(bool enabled);
130 };
131 
132 extern BagelEngine *g_engine;
133 #define SHOULD_QUIT ::Bagel::g_engine->shouldQuit()
134 
135 } // End of namespace Bagel
136 
137 #endif // BAGEL_H
Definition: str.h:59
EngineFeature
Definition: engine.h:250
Definition: stream.h:77
Definition: error.h:84
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: advancedDetector.h:163
Definition: random.h:44
SaveStateList listSaves() const
Definition: master_win.h:66
Common::Error loadGameStream(Common::SeekableReadStream *stream) override
uint getRandomNumber(uint max)
Definition: stream.h:745
Definition: screen.h:48
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
Engine * g_engine
Definition: engine.h:264
Common::String getGameId() const
void pauseEngineIntern(bool pause) override
Common::Error loadGameState(int slot) override
Definition: ustr.h:57
Common::Platform getPlatform() const
Definition: bagel.h:35
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: bagel.h:31
Definition: music.h:30
Definition: point.h:34
bool savesExist() const
Definition: save_game_file.h:103
bool isDemo() const
Definition: system.h:161
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave=false) override
Definition: engine.h:282
bool hasFeature(EngineFeature f) const override
Definition: bagel.h:80
Definition: engine.h:143
uint32 getRandomNumber(uint maxNum=0x7fffffff)
Definition: bagel.h:76
Platform
Definition: platform.h:46