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