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 
33 struct ADGameDescription;
34 
35 namespace Audio {
36 class SoundHandle;
37 class PCSpeaker;
38 }
39 
40 namespace Chamber {
41 
42 enum CHAMBERActions {
43  kActionNone,
44  kActionInteract,
45  kActionQuit,
46  kActionYes,
47  kActionNo,
48 };
49 
50 class ChamberEngine : public Engine {
51 public:
52  // We need random numbers
54 
55  ChamberEngine(OSystem *syst, const ADGameDescription *desc);
56  ~ChamberEngine();
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; }
67  Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
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 
79 public:
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;
92  uint8 _screenBits;
93  uint16 _line_offset;
94  uint16 _line_offset2;
95  uint8 _screenPPB;
96  uint16 _screenBPL;
97  uint8 _fontHeight;
98  uint8 _fontWidth;
99 
100 
101  Audio::PCSpeaker *_speaker;
102 
103  Renderer *_renderer = nullptr;
104 
105 private:
106  const ADGameDescription *_gameDescription;
107 };
108 
109 void init(void);
110 
111 extern ChamberEngine *g_vm;
112 
113 // Amiga shares the EGA planar 16-colour pipeline; graphics code branches on this
114 inline 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
uint8 _screenPPB
Pixels per byte.
Definition: chamber.h:95
EngineFeature
Definition: engine.h:282
Definition: stream.h:77
Definition: error.h:81
Definition: advancedDetector.h:164
uint8 _fontWidth
Font height.
Definition: chamber.h:98
Definition: random.h:44
uint16 _screenW
Screen Width.
Definition: chamber.h:90
RenderMode
Definition: rendermode.h:48
Definition: chamber.h:50
Definition: renderer.h:29
Definition: stream.h:745
Definition: serializer.h:80
uint16 _line_offset2
Memory offset of blanks.
Definition: chamber.h:94
Definition: amiga.h:27
Definition: ustr.h:57
uint8 _fontHeight
Font height.
Definition: chamber.h:97
uint16 _line_offset
Memory offset of blanks.
Definition: chamber.h:93
uint16 _screenBPL
Bytes per line.
Definition: chamber.h:96
uint8 _screenBits
Bits per pixel.
Definition: chamber.h:92
uint16 _screenH
Screen Height.
Definition: chamber.h:91
Definition: system.h:166
Definition: engine.h:149
Definition: pcspk.h:36
Definition: system.h:39
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: chamber.h:66
Platform
Definition: platform.h:93
Language
Definition: language.h:45
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: chamber.h:65