ScummVM API documentation
room.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 ACCESS_ROOM_H
23#define ACCESS_ROOM_H
24
25#include "common/scummsys.h"
26#include "common/array.h"
27#include "common/rect.h"
28#include "access/data.h"
29#include "access/detection.h"
30
31#define TILE_WIDTH 16
32#define TILE_HEIGHT 16
33
34namespace Access {
35
36class Plotter {
37public:
40 int _blockIn;
41 int _delta;
42public:
43 Plotter();
44
45 void load(Common::SeekableReadStream *stream, int wallCount, int blockCount);
46};
47
48class JetFrame {
49public:
50 int _wallCode;
51 int _wallCodeOld;
52 int _wallCode1;
53 int _wallCode1Old;
54
55 JetFrame() {
56 _wallCode = _wallCodeOld = 0;
57 _wallCode1 = _wallCode1Old = 0;
58 }
59};
60
61enum Function { FN_NONE = 0, FN_CLEAR1 = 1, FN_CLEAR2 = 2, FN_RELOAD = 3, FN_BREAK = 4, FN_5 = 5 };
62
63// room flags for Noctropolis
64enum RoomFlag {
65 kRoomFlagStiletto = 2,
66 kRoomFlagTopView = 4,
67 kRoomFlagNoPlayer = 0x80,
68};
69
70
71class Room : public Manager {
72private:
74 int _matrixSize;
75
76private:
77 void roomLoop();
78
79 void cmdExitContinuance();
80 void roomLoopContinuance();
81
82 void commandOff();
83
84 void swapOrg();
85 int calcLR(int yp);
86 int calcUD(int xp);
87
88 void takePicture();
89
93 void cycleCommand(int incr);
94
95 bool checkCode(int v1, int v2);
96
97protected:
98 void loadRoomData(const byte *roomData);
99
104
109
110 int checkBoxes();
111 int checkBoxes2(const Common::Point &pt, int start, int count);
112 void checkBoxes3();
113
114 virtual int validateBox(int boxId);
115
119 void executeCommand(int commandId);
120
121 void clearCamera();
122
123 virtual void roomInit();
124
125 virtual void reloadRoom() = 0;
126
127 virtual void reloadRoom1() = 0;
128
129 virtual void setupRoom();
130
131 virtual void doCommands();
132
133 virtual void mainAreaLClick() = 0;
134
135 virtual void mainAreaRClick() {};
136
137 virtual void walkCursor();
138
139public:
140 int _rMouse[10][2];
141 byte _palIntensity;
142 uint16 *_playField;
143 Plotter _plotter;
144 byte *_tile;
145 Function _function;
146 int _roomFlag;
147 int _playFieldWidth;
148 int _playFieldHeight;
149 int _selectCommand;
150 bool _conFlag; // not the same as script->_continuenceFlag which is used in Noctropolis
151
152public:
153
154 Room(AccessEngine *vm);
155
156 virtual ~Room();
157
158 void doRoom();
159
160 void loadRoom(int roomNumber);
161
162 virtual void roomMenu() = 0;
163
167 virtual void clearRoom();
168
173
177 void buildColumn(int playX, int screenX);
178
182 void buildRow(int playY, int screenY);
183
184 virtual void init4Quads() = 0;
185
186 void setWallCodes();
187
188 bool codeWalls();
189
193 void handleCommand(int commandId);
194
195 void loadPlayField(const FileIdent &file);
196
197 int checkBoxes1(const Common::Point &pt);
198};
199
200class RoomInfo {
201public:
203 Common::String _soundFilename;
204 int _priority;
205 };
206public:
207 byte _roomFlag;
208 int _estIndex;
209 byte _palIntensity;
210 FileIdent _musicFile;
211 int _scaleH1;
212 int _scaleH2;
213 int _scaleN1;
214 FileIdent _playFieldFile;
216 FileIdent _scriptFile;
217 FileIdent _animFile;
218 int _scaleI;
219 int _scrollThreshold;
220 FileIdent _paletteFile;
221 int _startColor;
222 int _numColors;
223 Common::Array<ExtraCell> _extraCells;
225public:
226 RoomInfo(const byte *data, AccessGameType gameType, bool isCD, bool isDemo);
227};
228
229} // End of namespace Access
230
231#endif /* ACCESS_ROOM_H */
Definition: access.h:141
Definition: room.h:48
Definition: data.h:37
Definition: room.h:36
Definition: room.h:71
virtual void clearRoom()
void handleCommand(int commandId)
void freeTileData()
void freePlayField()
void buildRow(int playY, int screenY)
void executeCommand(int commandId)
void buildColumn(int playX, int screenX)
void buildScreen()
Definition: room.h:200
Definition: stream.h:745
Definition: str.h:59
Definition: access.h:62
Definition: files.h:36
Definition: room.h:202
Definition: rect.h:144