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 
30 #define TILE_WIDTH 16
31 #define TILE_HEIGHT 16
32 
33 namespace Access {
34 
35 class Plotter {
36 public:
39  int _blockIn;
40  int _delta;
41 public:
42  Plotter();
43 
44  void load(Common::SeekableReadStream *stream, int wallCount, int blockCount);
45 };
46 
47 class JetFrame {
48 public:
49  int _wallCode;
50  int _wallCodeOld;
51  int _wallCode1;
52  int _wallCode1Old;
53 
54  JetFrame() {
55  _wallCode = _wallCodeOld = 0;
56  _wallCode1 = _wallCode1Old = 0;
57  }
58 };
59 
60 enum Function { FN_NONE = 0, FN_CLEAR1 = 1, FN_CLEAR2 = 2, FN_RELOAD = 3, FN_BREAK = 4 };
61 
62 class Room : public Manager {
63 private:
64  void roomLoop();
65 
66  void loadPlayField(int fileNum, int subfile);
67 
68  void commandOff();
69 
70  void swapOrg();
71  int calcLR(int yp);
72  int calcUD(int xp);
73 
74  void takePicture();
75 
79  void cycleCommand(int incr);
80 
81  bool checkCode(int v1, int v2);
82 protected:
83  void loadRoomData(const byte *roomData);
84 
88  void freePlayField();
89 
93  void freeTileData();
94 
95  int checkBoxes();
96  int checkBoxes1(const Common::Point &pt);
97  int checkBoxes2(const Common::Point &pt, int start, int count);
98  void checkBoxes3();
99 
100  int validateBox(int boxId);
101 
105  void executeCommand(int commandId);
106 
107  void clearCamera();
108 
109  virtual void reloadRoom() = 0;
110 
111  virtual void reloadRoom1() = 0;
112 
113  virtual void setupRoom();
114 
115  virtual void doCommands();
116 
117  virtual void mainAreaClick() = 0;
118 
119  virtual void walkCursor();
120 public:
121  Plotter _plotter;
122  Common::Array<JetFrame> _jetFrame;
123  Function _function;
124  int _roomFlag;
125  byte *_playField;
126  int _matrixSize;
127  int _playFieldWidth;
128  int _playFieldHeight;
129  byte *_tile;
130  int _selectCommand;
131  bool _conFlag;
132  int _rMouse[10][2];
133 public:
134  Room(AccessEngine *vm);
135 
136  virtual ~Room();
137 
138  void doRoom();
139 
140  virtual void loadRoom(int roomNumber) = 0;
141 
142  virtual void roomMenu() = 0;
143 
147  virtual void clearRoom();
148 
152  void buildScreen();
153 
157  void buildColumn(int playX, int screenX);
158 
162  void buildRow(int playY, int screenY);
163 
164  virtual void init4Quads() = 0;
165 
166  void setWallCodes();
167 
168  bool codeWalls();
169 
173  void handleCommand(int commandId);
174 };
175 
176 class RoomInfo {
177 public:
179  int _priority;
180  };
181 public:
182  int _roomFlag;
183  int _estIndex;
184  FileIdent _musicFile;
185  int _scaleH1;
186  int _scaleH2;
187  int _scaleN1;
188  FileIdent _playFieldFile;
190  FileIdent _scriptFile;
191  FileIdent _animFile;
192  int _scaleI;
193  int _scrollThreshold;
194  FileIdent _paletteFile;
195  int _startColor;
196  int _numColors;
197  Common::Array<ExtraCell> _extraCells;
199 public:
200  RoomInfo(const byte *data, int gameType, bool isCD, bool isDemo);
201 };
202 
203 } // End of namespace Access
204 
205 #endif /* ACCESS_ROOM_H */
Definition: files.h:35
Definition: room.h:35
Definition: data.h:37
Definition: access.h:84
Definition: stream.h:745
Definition: room.h:47
Definition: rect.h:45
Definition: room.h:178
Definition: room.h:176
Definition: room.h:62
Definition: access.h:62