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 #include "graphics/screen.h"
27 #include "bagel/detection.h"
28 #include "bagel/music.h"
29 #include "bagel/spacebar/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 
40 public:
41  bool _useOriginalSaveLoad = false;
42  SpaceBar::CBagMasterWin *_masterWin = nullptr;
43  CBofPoint g_cInitLoc; // This is the initial location for the next new pan (only option at this point)
44  bool g_bUseInitLoc = false;
45  bool g_getVilVarsFl = true;
46  MusicPlayer *_midi = nullptr;
47 
48 public:
49  BagelEngine(OSystem *syst, const ADGameDescription *gameDesc);
50  ~BagelEngine() override;
51 
52  uint32 getFeatures() const;
53 
57  Common::String getGameId() const;
58 
62  bool isSpaceBar() const {
63  return getGameId() == "spacebar";
64  }
65 
70 
74  bool isDemo() const;
75  bool isMazeODoomDemo() const;
76 
80  uint32 getRandomNumber(uint maxNum = 0x7fffffff) {
81  return _randomSource.getRandomNumber(maxNum);
82  }
83 
84  bool hasFeature(EngineFeature f) const override {
85  return
89  };
90 
94  SaveStateList listSaves() const;
95 
99  bool savesExist() const;
100 
101  virtual Graphics::Screen *getScreen() const = 0;
102 
103  void errorDialog(const char *msg) const;
104 
105  void enableKeymapper(bool enabled);
106 };
107 
108 extern BagelEngine *g_engine;
109 #define SHOULD_QUIT ::Bagel::g_engine->shouldQuit()
110 
111 inline int brand() {
112  return g_engine->getRandomNumber(RAND_MAX);
113 }
114 
115 } // End of namespace Bagel
116 
117 #endif // BAGEL_H
Definition: str.h:59
EngineFeature
Definition: engine.h:258
bool isSpaceBar() const
Definition: bagel.h:62
Definition: advancedDetector.h:164
Definition: random.h:44
SaveStateList listSaves() const
uint getRandomNumber(uint max)
Definition: screen.h:48
Engine * g_engine
Definition: engine.h:272
Definition: master_win.h:67
Common::String getGameId() const
Common::Platform getPlatform() const
Definition: bagel.h:35
Definition: afxwin.h:27
Definition: music.h:30
Definition: point.h:32
bool savesExist() const
bool isDemo() const
Definition: system.h:163
Definition: engine.h:290
bool hasFeature(EngineFeature f) const override
Definition: bagel.h:84
Definition: engine.h:144
uint32 getRandomNumber(uint maxNum=0x7fffffff)
Definition: bagel.h:80
Platform
Definition: platform.h:93