ScummVM API documentation
chewy.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 CHEWY_CHEWY_H
23 #define CHEWY_CHEWY_H
24 
25 // FIXME
26 #define AIL
27 #define ENGLISCH
28 
29 #include "common/scummsys.h"
30 #include "common/error.h"
31 #include "common/memstream.h"
32 #include "common/random.h"
33 #include "engines/engine.h"
34 #include "engines/savestate.h"
35 #include "graphics/screen.h"
36 
37 namespace Chewy {
38 
39 #define SCREEN_WIDTH 320
40 #define SCREEN_HEIGHT 200
41 
42 #define SHOULD_QUIT g_engine->shouldQuit()
43 #define SHOULD_QUIT_RETURN if (g_engine->shouldQuit()) return
44 #define SHOULD_QUIT_RETURN0 if (g_engine->shouldQuit()) return 0
45 
46 struct ChewyGameDescription;
47 class EventsManager;
48 class Globals;
49 class Sound;
50 class VideoPlayer;
51 
52 class ChewyEngine : public Engine {
53 private:
54  bool _canLoad = false;
55  bool _canSave = false;
56 
57 protected:
58  // Engine APIs
59  Common::Error run() override;
60 
64  bool hasFeature(EngineFeature f) const override;
65 
66  void initialize();
67  void shutdown() {}
68 
69 public:
70  const ChewyGameDescription *_gameDescription;
72  EventsManager *_events = nullptr;
73  Globals *_globals = nullptr;
74  Sound *_sound = nullptr;
75  VideoPlayer *_video = nullptr;
76  Graphics::Screen *_screen = nullptr;
77  bool _showWalkAreas = false;
78 
79 public:
80  ChewyEngine(OSystem *syst, const ChewyGameDescription *gameDesc);
81  ~ChewyEngine() override;
82 
83  uint32 getFeatures() const;
84  Common::Language getLanguage() const;
85 
86  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override {
87  return _canLoad;
88  }
89  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override {
90  return _canSave;
91  }
92  void setCanLoadSave(bool canLoadSave) {
93  _canLoad = canLoadSave;
94  _canSave = canLoadSave;
95  }
96 
97  void syncSoundSettings() override;
98 
103 
107  Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave) override;
108 
109  SaveStateList listSaves();
110 
114  void showGmm(bool isInGame);
115 
116  uint getRandomNumber(uint max) {
117  return _rnd.getRandomNumber(max);
118  }
119 
120  void playVideo(uint num);
121 };
122 
123 extern ChewyEngine *g_engine;
124 extern Graphics::Screen *g_screen;
125 
126 } // End of namespace Chewy
127 
128 #endif
Common::Error run() override
EngineFeature
Definition: engine.h:253
Definition: stream.h:77
Definition: error.h:84
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave) override
void showGmm(bool isInGame)
Definition: random.h:44
Definition: detection.h:27
Definition: video_player.h:29
void syncSoundSettings() override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: chewy.h:86
uint getRandomNumber(uint max)
Definition: stream.h:745
Definition: screen.h:48
Engine * g_engine
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: chewy.h:89
Common::Error loadGameStream(Common::SeekableReadStream *stream) override
Definition: ustr.h:57
Definition: chewy.h:52
Definition: sound.h:35
Definition: globals.h:52
Definition: ani_dat.h:25
Definition: system.h:161
bool hasFeature(EngineFeature f) const override
Definition: events.h:38
Definition: engine.h:144
Language
Definition: language.h:45