ScummVM API documentation
spacebar.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_SPACEBAR_H
23 #define BAGEL_SPACEBAR_H
24 
25 #include "bagel/bagel.h"
26 #include "bagel/spacebar/baglib/bagel.h"
27 #include "bagel/spacebar/bibble_window.h"
28 
29 namespace Bagel {
30 namespace SpaceBar {
31 
32 class SpaceBarEngine : public BagelEngine, public CBagel {
33 private:
34  StBagelSave _saveData;
35 
36  ErrorCode InitializeSoundSystem(uint16 nChannels = 1, uint32 nFreq = 11025, uint16 nBitsPerSample = 8);
37  ErrorCode ShutDownSoundSystem();
38 
39  bool canSaveLoadFromWindow(bool save) const;
40 
41 protected:
42  // Engine APIs
43  Common::Error run() override;
44 
45  ErrorCode initialize() override;
46  ErrorCode shutdown() override;
47 
51  void pauseEngineIntern(bool pause) override;
52 
53 public:
54  CBetArea g_cBetAreas[BIBBLE_NUM_BET_AREAS];
55  const CBofRect viewPortRect = CBofRect(80, 10, 559, 369);
56  CBofRect viewRect;
57  Graphics::Screen *_screen = nullptr;
58 
59 public:
60  SpaceBarEngine(OSystem *syst, const ADGameDescription *gameDesc);
61  ~SpaceBarEngine() override;
62  void initializePath(const Common::FSNode &gamePath) override;
63 
64  Graphics::Screen *getScreen() const override {
65  return _screen;
66  }
67 
68  bool shouldQuit() const override {
69  return BagelEngine::shouldQuit();
70  }
71 
72  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
73  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
74 
78  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
79  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave,
80  SpaceBar::StBagelSave &saveData);
81 
85  Common::Error loadGameState(int slot) override;
86 
90  Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
91 
96 };
97 
98 extern SpaceBarEngine *g_engine;
99 
100 } // namespace SpaceBar
101 } // namespace Bagel
102 
103 #endif
void pauseEngineIntern(bool pause) override
Definition: str.h:59
Common::Error loadGameStream(Common::SeekableReadStream *stream) override
ErrorCode initialize() override
Definition: stream.h:77
Definition: error.h:81
Definition: bagel.h:72
Definition: advancedDetector.h:164
Common::Error run() override
Definition: bibble_window.h:58
Definition: stream.h:745
Definition: screen.h:48
Definition: rect.h:35
Engine * g_engine
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
Definition: spacebar.h:32
Common::Error loadGameState(int slot) override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: ustr.h:57
static bool shouldQuit()
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave=false) override
Definition: bagel.h:35
Definition: fs.h:69
Definition: afxwin.h:27
Definition: save_game_file.h:104
ErrorCode shutdown() override
Definition: system.h:163
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
void initializePath(const Common::FSNode &gamePath) override