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
37namespace 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
46struct ChewyGameDescription;
47class EventsManager;
48class Globals;
49class Sound;
50class VideoPlayer;
51
52class ChewyEngine : public Engine {
53private:
54 bool _canLoad = false;
55 bool _canSave = false;
56
57protected:
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 void pauseEngineIntern(bool pause) override;
70public:
71 const ChewyGameDescription *_gameDescription;
73 EventsManager *_events = nullptr;
74 Globals *_globals = nullptr;
75 Sound *_sound = nullptr;
76 VideoPlayer *_video = nullptr;
77 Graphics::Screen *_screen = nullptr;
78 bool _showWalkAreas = false;
79
80public:
81 ChewyEngine(OSystem *syst, const ChewyGameDescription *gameDesc);
82 ~ChewyEngine() override;
83
84 uint32 getFeatures() const;
85 Common::Language getLanguage() const;
86
87 bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override {
88 return _canLoad;
89 }
90 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override {
91 return _canSave;
92 }
93 void setCanLoadSave(bool canLoadSave) {
94 _canLoad = canLoadSave;
95 _canSave = canLoadSave;
96 }
97
98 void syncSoundSettings() override;
99
104
108 Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave) override;
109
110 SaveStateList listSaves();
111
115 void showGmm(bool isInGame);
116
117 uint getRandomNumber(uint max) {
118 return _rnd.getRandomNumber(max);
119 }
120};
121
122extern ChewyEngine *g_engine;
123extern Graphics::Screen *g_screen;
124
125} // End of namespace Chewy
126
127#endif
Definition: chewy.h:52
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: chewy.h:87
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: chewy.h:90
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave) override
Common::Error loadGameStream(Common::SeekableReadStream *stream) override
void syncSoundSettings() override
void pauseEngineIntern(bool pause) override
void showGmm(bool isInGame)
bool hasFeature(EngineFeature f) const override
Common::Error run() override
Definition: events.h:37
Definition: globals.h:52
Definition: sound.h:35
Definition: video_player.h:29
Definition: error.h:81
Definition: random.h:44
uint getRandomNumber(uint max)
Definition: stream.h:745
Definition: ustr.h:57
Definition: stream.h:77
Definition: engine.h:149
EngineFeature
Definition: engine.h:282
Definition: screen.h:47
Definition: system.h:166
Language
Definition: language.h:45
Engine * g_engine
Definition: detection.h:27