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
31namespace Bagel {
32
33struct BagelGameDescription;
34
35class BagelEngine : public Engine {
36private:
37 const ADGameDescription *_gameDescription;
38
39protected:
40 Common::RandomSource _randomSource;
41
42public:
43 bool _useOriginalSaveLoad = false;
44 SpaceBar::CBagMasterWin *_masterWin = nullptr;
45 CBofPoint g_cInitLoc; // This is the initial location for the next new pan (only option at this point)
46 bool g_bUseInitLoc = false;
47 bool g_getVilVarsFl = true;
48 MusicPlayer *_midi = nullptr;
49
50public:
51 BagelEngine(OSystem *syst, const ADGameDescription *gameDesc);
52 ~BagelEngine() override;
53
54 uint32 getFeatures() const;
55
60
64 bool isSpaceBar() const {
65 return getGameId() == "spacebar";
66 }
67
72
76 bool isDemo() const;
77 bool isMazeODoomDemo() const;
78
82 uint32 getRandomNumber(uint maxNum = 0x7fffffff);
83
84 bool hasFeature(EngineFeature f) const override {
85 return
89 };
90
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
108extern BagelEngine *g_engine;
109#define SHOULD_QUIT ::Bagel::g_engine->shouldQuit()
110
111inline int brand() {
112 return g_engine->getRandomNumber(RAND_MAX);
113}
114
115} // End of namespace Bagel
116
117#endif // BAGEL_H
Definition: bagel.h:35
Common::Platform getPlatform() const
bool savesExist() const
bool isSpaceBar() const
Definition: bagel.h:64
uint32 getRandomNumber(uint maxNum=0x7fffffff)
bool isDemo() const
bool hasFeature(EngineFeature f) const override
Definition: bagel.h:84
SaveStateList listSaves() const
Common::String getGameId() const
Definition: point.h:32
Definition: music.h:30
Definition: master_win.h:67
Definition: random.h:44
Definition: str.h:59
Definition: engine.h:149
EngineFeature
Definition: engine.h:282
@ kSupportsReturnToLauncher
Definition: engine.h:296
@ kSupportsSavingDuringRuntime
Definition: engine.h:314
@ kSupportsLoadingDuringRuntime
Definition: engine.h:305
Definition: screen.h:47
Definition: system.h:166
Platform
Definition: platform.h:93
Engine * g_engine
Definition: advancedDetector.h:164