ScummVM API documentation
chamber.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 CHAMBER_H
23#define CHAMBER_H
24#define RUNCOMMAND_RESTART 1337
25
26#include "common/random.h"
27#include "common/serializer.h"
28#include "common/rendermode.h"
29#include "common/platform.h"
30#include "engines/engine.h"
31#include "chamber/renderer.h"
32
34
35namespace Audio {
36class SoundHandle;
37class PCSpeaker;
38}
39
40namespace Chamber {
41
42enum CHAMBERActions {
43 kActionNone,
44 kActionInteract,
45 kActionQuit,
46 kActionYes,
47 kActionNo,
48};
49
50class ChamberEngine : public Engine {
51public:
52 // We need random numbers
54
55 ChamberEngine(OSystem *syst, const ADGameDescription *desc);
57
58 Common::Language getLanguage() const;
59 Common::Platform getPlatform() const;
60
61 Common::Error run() override;
62 Common::Error init();
63 Common::Error execute();
64 bool hasFeature(EngineFeature f) const override;
65 bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override { return true; }
66 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override { return true; }
68 Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
69 void syncGameStream(Common::Serializer &s);
70
71 byte readKeyboardChar();
72
73 void initSound();
74 void deinitSound();
75
76 int getX(int original_x);
77 int getY(int original_y);
78
79public:
80 bool _shouldQuit;
81 bool _shouldRestart;
82 bool _prioritycommand_1;
83 bool _prioritycommand_2;
84
85 Common::RenderMode _videoMode;
86 Common::RenderMode _renderMode;
87
88 byte *_pxiData;
89
90 uint16 _screenW;
91 uint16 _screenH;
93 uint16 _line_offset;
95 uint8 _screenPPB;
96 uint16 _screenBPL;
98 uint8 _fontWidth;
99
100
101 Audio::PCSpeaker *_speaker;
102
103 Renderer *_renderer = nullptr;
104
105private:
106 const ADGameDescription *_gameDescription;
107};
108
109void init(void);
110
111extern ChamberEngine *g_vm;
112
113// Amiga shares the EGA planar 16-colour pipeline; graphics code branches on this
114inline bool isEgaLikeRenderer() {
115 return g_vm->_videoMode == Common::kRenderEGA ||
116 g_vm->_videoMode == Common::kRenderAmiga;
117}
118
119} // End of namespace Chamber
120
121#endif
Definition: pcspk.h:36
Definition: chamber.h:50
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: chamber.h:66
Common::Error loadGameStream(Common::SeekableReadStream *stream) override
uint8 _fontWidth
Font height.
Definition: chamber.h:98
uint16 _screenBPL
Bytes per line.
Definition: chamber.h:96
uint16 _line_offset2
Memory offset of blanks.
Definition: chamber.h:94
uint16 _screenH
Screen Height.
Definition: chamber.h:91
Common::Error run() override
uint8 _screenBits
Bits per pixel.
Definition: chamber.h:92
uint16 _line_offset
Memory offset of blanks.
Definition: chamber.h:93
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: chamber.h:65
uint8 _fontHeight
Font height.
Definition: chamber.h:97
uint16 _screenW
Screen Width.
Definition: chamber.h:90
bool hasFeature(EngineFeature f) const override
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave=false) override
uint8 _screenPPB
Pixels per byte.
Definition: chamber.h:95
Definition: renderer.h:29
Definition: error.h:81
Definition: random.h:44
Definition: stream.h:745
Definition: serializer.h:80
Definition: ustr.h:57
Definition: stream.h:77
Definition: engine.h:155
EngineFeature
Definition: engine.h:293
Definition: system.h:166
Language
Definition: language.h:45
Platform
Definition: platform.h:93
RenderMode
Definition: rendermode.h:48
Definition: system.h:39
Definition: advancedDetector.h:164