ScummVM API documentation
gfx.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/*
23 * Based on the Reverse Engineering work of Christophe Fontanel,
24 * maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/)
25 */
26
27#ifndef DM_GFX_H
28#define DM_GFX_H
29
30#include "common/scummsys.h"
31#include "common/rect.h"
32#include "common/memstream.h"
33#include "common/array.h"
34
35#include "dm/dm.h"
36
37namespace DM {
38
39enum ViewFloor {
40 kDMViewFloorD3L = 0, // @ C0_VIEW_FLOOR_D3L
41 kDMViewFloorD3C = 1, // @ C1_VIEW_FLOOR_D3C
42 kDMViewFloorD3R = 2, // @ C2_VIEW_FLOOR_D3R
43 kDMViewFloorD2L = 3, // @ C3_VIEW_FLOOR_D2L
44 kDMViewFloorD2C = 4, // @ C4_VIEW_FLOOR_D2C
45 kDMViewFloorD2R = 5, // @ C5_VIEW_FLOOR_D2R
46 kDMViewFloorD1L = 6, // @ C6_VIEW_FLOOR_D1L
47 kDMViewFloorD1C = 7, // @ C7_VIEW_FLOOR_D1C
48 kDMViewFloorD1R = 8 // @ C8_VIEW_FLOOR_D1R
49};
50
51enum DoorState {
52 kDMDoorStateOpen = 0, // @ C0_DOOR_STATE_OPEN
53 kDMDoorStateOneFourth = 1, // @ C1_DOOR_STATE_CLOSED_ONE_FOURTH
54 kDMDoorStateHalf = 2, // @ k2_DoorStateAspect_CLOSED_HALF
55 kDMDoorStateThreeFourth = 3, // @ C3_DOOR_STATE_CLOSED_THREE_FOURTH
56 kDMDoorStateClosed = 4, // @ C4_DOOR_STATE_CLOSED
57 kDMDoorStateDestroyed = 5 // @ C5_DOOR_STATE_DESTROYED
58};
59
61 uint16 _recordType;
62 int16 _parentRecordIndex;
63 int16 _data1;
64 int16 _data2;
65};
66
68 const LayoutRange *_nextRange;
69 int16 _firstIndex;
70 int16 _lastIndex;
71 const LayoutRecord *_records;
72};
73
74struct Struct3 {
75 uint8 _s3m1; // Type: 1: graphic index, 2: bitmap pointer
76 int8 _s3m2;
77 int16 _x;
78 int16 _y;
79 int16 _width;
80 int16 _height;
81 union {
82 int16 _graphicIndex;
83 byte *_bitmap;
84 } _s3u;
85};
86
87struct Struct2 {
88 byte *_s2m1; // Bitmap pointer
89 int16 _x;
90 int16 _y;
91 int16 _width;
92 int16 _height;
93};
94
95enum DoorOrnament {
96 kDMDoorOrnamentD3LCR = 0, // @ C0_VIEW_DOOR_ORNAMENT_D3LCR
97 kDMDoorOrnamentD2LCR = 1, // @ C1_VIEW_DOOR_ORNAMENT_D2LCR
98 kDMDoorOrnamentD1LCR = 2 // @ C2_VIEW_DOOR_ORNAMENT_D1LCR
99};
100
101enum ZoneIndex {
102 kDMZoneScreen = 2, // @ C002_ZONE_SCREEN
103 kDMZoneViewport = 7, // @ C007_ZONE_VIEWPORT
104 kDMZoneMovementArrows = 9, // @ C009_ZONE_MOVEMENT_ARROWS
105 kDMZoneActionArea = 11, // @ C011_ZONE_ACTION_AREA
106 kDMZoneSpellArea = 13, // @ C013_ZONE_SPELL_AREA
107 kDMZoneMessageArea = 15, // @ C015_ZONE_MESSAGE_AREA
108 kDMZoneSpellAreaSetMagicCaster = 221, // @ C221_ZONE_SPELL_AREA_SET_MAGIC_CASTER
109 kDMZoneSpellAreaMagicCasterTab = 224, // @ C224_ZONE_SPELL_AREA_MAGIC_CASTER_TAB
110 kDMZoneViewportCeiling = 700, // @ C700_ZONE_VIEWPORT_CEILING_AREA
111 kDMZoneViewportFloor = 701, // @ C701_ZONE_VIEWPORT_FLOOR_AREA
112 kDMZoneWallD3L2 = 702, // @ C702_ZONE_WALL_D3L2
113 kDMZoneWallD3R2 = 703, // @ C703_ZONE_WALL_D3R2
114 kDMZoneWallD3C = 704, // @ C704_ZONE_WALL_D3C
115 kDMZoneWallD3L = 705, // @ C705_ZONE_WALL_D3L
116 kDMZoneWallD3R = 706, // @ C706_ZONE_WALL_D3R
117 kDMZoneWallD2L2 = 707, // @ C707_ZONE_WALL_D2L2
118 kDMZoneWallD2R2 = 708, // @ C708_ZONE_WALL_D2R2
119 kDMZoneWallD2C = 709, // @ C709_ZONE_WALL_D2C
120 kDMZoneWallD2L = 710, // @ C710_ZONE_WALL_D2L
121 kDMZoneWallD2R = 711, // @ C711_ZONE_WALL_D2R
122 kDMZoneWallD1C = 712, // @ C712_ZONE_WALL_D1C
123 kDMZoneWallD1L = 713, // @ C713_ZONE_WALL_D1L
124 kDMZoneWallD1R = 714, // @ C714_ZONE_WALL_D1R
125 kDMZoneWallD0C = 715, // @ C715_ZONE_WALL_D0C
126 kDMZoneWallD0L = 716, // @ C716_ZONE_WALL_D0L
127 kDMZoneWallD0R = 717, // @ C717_ZONE_WALL_D0R
128 kDMZoneDoorFrameLeftD3L = 718, // @ C718_ZONE_DOOR_FRAME_LEFT_D3L
129 kDMZoneDoorFrameRightD3L = 719, // @ C719_ZONE_DOOR_FRAME_RIGHT_D3L
130 kDMZoneDoorFrameLeftD3R = 720, // @ C720_ZONE_DOOR_FRAME_LEFT_D3R
131 kDMZoneDoorFrameRightD3R = 721, // @ C721_ZONE_DOOR_FRAME_RIGHT_D3R
132 kDMZoneDoorFrameLeftD3C = 722, // @ C722_ZONE_DOOR_FRAME_LEFT_D3C
133 kDMZoneDoorFrameRightD3C = 723, // @ C723_ZONE_DOOR_FRAME_RIGHT_D3C
134 kDMZoneDoorFrameLeftD2C = 724, // @ C724_ZONE_DOOR_FRAME_LEFT_D2C
135 kDMZoneDoorFrameRightD2C = 725, // @ C725_ZONE_DOOR_FRAME_RIGHT_D2C
136 kDMZoneDoorFrameLeftD1C = 726, // @ C726_ZONE_DOOR_FRAME_LEFT_D1C
137 kDMZoneDoorFrameRightD1C = 727, // @ C727_ZONE_DOOR_FRAME_RIGHT_D1C
138 kDMZoneDoorFrameD0C = 728, // @ C728_ZONE_DOOR_FRAME_D0C
139 kDMZoneDoorFrameTopD2L = 729, // @ C729_ZONE_DOOR_FRAME_TOP_D2L
140 kDMZoneDoorFrameTopD2C = 730, // @ C730_ZONE_DOOR_FRAME_TOP_D2C
141 kDMZoneDoorFrameTopD2R = 731, // @ C731_ZONE_DOOR_FRAME_TOP_D2R
142 kDMZoneDoorFrameTopD1L = 732, // @ C732_ZONE_DOOR_FRAME_TOP_D1L
143 kDMZoneDoorFrameTopD1C = 733, // @ C733_ZONE_DOOR_FRAME_TOP_D1C
144 kDMZoneDoorFrameTopD1R = 734, // @ C734_ZONE_DOOR_FRAME_TOP_D1R
145 kDMZonePortraitOnWall = 737, // @ M635_ZONE_PORTRAIT_ON_WALL
146 kDMZoneStairsUpFrontD3L = 802, // @ C802_ZONE_STAIRS_UP_FRONT_D3L
147 kDMZoneStairsUpFrontD3C = 803, // @ C803_ZONE_STAIRS_UP_FRONT_D3C
148 kDMZoneStairsUpFrontD3R = 804, // @ C804_ZONE_STAIRS_UP_FRONT_D3R
149 kDMZoneStairsUpFrontD2L = 805, // @ C805_ZONE_STAIRS_UP_FRONT_D2L
150 kDMZoneStairsUpFrontD2C = 806, // @ C806_ZONE_STAIRS_UP_FRONT_D2C
151 kDMZoneStairsUpFrontD2R = 807, // @ C807_ZONE_STAIRS_UP_FRONT_D2R
152 kDMZoneStairsUpFrontD1L = 808, // @ C808_ZONE_STAIRS_UP_FRONT_D1L
153 kDMZoneStairsUpFrontD1C = 809, // @ C809_ZONE_STAIRS_UP_FRONT_D1C
154 kDMZoneStairsUpFrontD1R = 810, // @ C810_ZONE_STAIRS_UP_FRONT_D1R
155 kDMZoneStairsUpFrontD0L = 811, // @ C811_ZONE_STAIRS_UP_FRONT_D0L
156 kDMZoneStairsUpFrontD0R = 812, // @ C812_ZONE_STAIRS_UP_FRONT_D0R
157 kDMZoneStairsDownFrontD3L = 815, // @ C815_ZONE_STAIRS_DOWN_FRONT_D3L
158 kDMZoneStairsDownFrontD3C = 816, // @ C816_ZONE_STAIRS_DOWN_FRONT_D3C
159 kDMZoneStairsDownFrontD3R = 817, // @ C817_ZONE_STAIRS_DOWN_FRONT_D3R
160 kDMZoneStairsDownFrontD2L = 818, // @ C818_ZONE_STAIRS_DOWN_FRONT_D2L
161 kDMZoneStairsDownFrontD2C = 819, // @ C819_ZONE_STAIRS_DOWN_FRONT_D2C
162 kDMZoneStairsDownFrontD2R = 820, // @ C820_ZONE_STAIRS_DOWN_FRONT_D2R
163 kDMZoneStairsDownFrontD1L = 821, // @ C821_ZONE_STAIRS_DOWN_FRONT_D1L
164 kDMZoneStairsDownFrontD1C = 822, // @ C822_ZONE_STAIRS_DOWN_FRONT_D1C
165 kDMZoneStairsDownFrontD1R = 823, // @ C823_ZONE_STAIRS_DOWN_FRONT_D1R
166 kDMZoneStairsDownFrontD0L = 824, // @ C824_ZONE_STAIRS_DOWN_FRONT_D0L
167 kDMZoneStairsDownFrontD0R = 825, // @ C825_ZONE_STAIRS_DOWN_FRONT_D0R
168 kDMZoneStairsSideD2L = 826, // @ C826_ZONE_STAIRS_SIDE_D2L
169 kDMZoneStairsSideD2R = 827, // @ C827_ZONE_STAIRS_SIDE_D2R
170 kDMZoneStairsUpSideD1L = 828, // @ C828_ZONE_STAIRS_UP_SIDE_D1L
171 kDMZoneStairsUpSideD1R = 829, // @ C829_ZONE_STAIRS_UP_SIDE_D1R
172 kDMZoneStairsDownSideD1L = 830, // @ C830_ZONE_STAIRS_DOWN_SIDE_D1L
173 kDMZoneStairsDownSideD1R = 831, // @ C831_ZONE_STAIRS_DOWN_SIDE_D1R
174 kDMZoneStairsSideD0L = 832, // @ C832_ZONE_STAIRS_SIDE_D0L
175 kDMZoneStairsSideD0R = 833, // @ C833_ZONE_STAIRS_SIDE_D0R
176 kDMZoneFloorPitD3L = 852, // @ C852_ZONE_FLOORPIT_D3L
177 kDMZoneFloorPitD3C = 853, // @ C853_ZONE_FLOORPIT_D3C
178 kDMZoneFloorPitD3R = 854, // @ C854_ZONE_FLOORPIT_D3R
179 kDMZoneFloorPitD2L = 855, // @ C855_ZONE_FLOORPIT_D2L
180 kDMZoneFloorPitD2C = 856, // @ C856_ZONE_FLOORPIT_D2C
181 kDMZoneFloorPitD2R = 857, // @ C857_ZONE_FLOORPIT_D2R
182 kDMZoneFloorPitD1L = 858, // @ C858_ZONE_FLOORPIT_D1L
183 kDMZoneFloorPitD1C = 859, // @ C859_ZONE_FLOORPIT_D1C
184 kDMZoneFloorPitD1R = 860, // @ C860_ZONE_FLOORPIT_D1R
185 kDMZoneFloorPitD0L = 861, // @ C861_ZONE_FLOORPIT_D0L
186 kDMZoneFloorPitD0C = 862, // @ C862_ZONE_FLOORPIT_D0C
187 kDMZoneFloorPitD0R = 863, // @ C863_ZONE_FLOORPIT_D0R
188 kDMZoneCeilingPitD2L = 864, // @ C864_ZONE_CEILING_PIT_D2L
189 kDMZoneCeilingPitD2C = 865, // @ C865_ZONE_CEILING_PIT_D2C
190 kDMZoneCeilingPitD2R = 866, // @ C866_ZONE_CEILING_PIT_D2R
191 kDMZoneCeilingPitD1L = 867, // @ C867_ZONE_CEILING_PIT_D1L
192 kDMZoneCeilingPitD1C = 868, // @ C868_ZONE_CEILING_PIT_D1C
193 kDMZoneCeilingPitD1R = 869, // @ C869_ZONE_CEILING_PIT_D1R
194 kDMZoneCeilingPitD0L = 870, // @ C870_ZONE_CEILING_PIT_D0L
195 kDMZoneCeilingPitD0C = 871, // @ C871_ZONE_CEILING_PIT_D0C
196 kDMZoneCeilingPitD0R = 872, // @ C872_ZONE_CEILING_PIT_D0R
197 kDMZoneDoorButton = 1950, // @ C1950_ZONE_DOOR_BUTTON
198 kDMZoneDoorD3L2 = 3700,
199 kDMZoneDoorD3R2 = 3710,
200 kDMZoneDoorD3L = 3720,
201 kDMZoneDoorD3C = 3730,
202 kDMZoneDoorD3R = 3740,
203 kDMZoneDoorD2L = 3750,
204 kDMZoneDoorD2C = 3760,
205 kDMZoneDoorD2R = 3770,
206 kDMZoneDoorD1L = 3780,
207 kDMZoneDoorD1C = 3790,
208 kDMZoneDoorD1R = 3800
209};
210
211enum NegGraphicIndex {
212 kDMNegGraphicFloor = -1,
213 kDMNegGraphicCeiling = -2,
214 kDMNegGraphicWallD3L2 = -3,
215 kDMNegGraphicWallD3R2 = -4,
216 kDMNegGraphicWallD3C = -5,
217 kDMNegGraphicWallD3L = -6,
218 kDMNegGraphicWallD3R = -7,
219 kDMNegGraphicWallD2L2 = -8,
220 kDMNegGraphicWallD2R2 = -9,
221 kDMNegGraphicWallD2C = -10,
222 kDMNegGraphicWallD2L = -11,
223 kDMNegGraphicWallD2R = -12,
224 kDMNegGraphicWallD1C = -13,
225 kDMNegGraphicWallD1L = -14,
226 kDMNegGraphicWallD1R = -15,
227 kDMNegGraphicWallD0L = -16,
228 kDMNegGraphicWallD0R = -17
229};
230
231enum DoorButton {
232 kDMDoorButtonD3R = 0, // @ C0_VIEW_DOOR_BUTTON_D3R
233 kDMDoorButtonD3C = 1, // @ C1_VIEW_DOOR_BUTTON_D3C
234 kDMDoorButtonD2C = 2, // @ C2_VIEW_DOOR_BUTTON_D2C
235 kDMDoorButtonD1C = 3 // @ C3_VIEW_DOOR_BUTTON_D1C
236};
237
238/* View lanes */
239enum ViewLane {
240 kDMViewLaneCenter = 0, // @ C0_VIEW_LANE_CENTER
241 kDMViewLaneLeft = 1, // @ C1_VIEW_LANE_LEFT
242 kDMViewLaneRight = 2 // @ C2_VIEW_LANE_RIGHT
243};
244
245/* Explosion aspects */
246enum ExplosionAspectEnum {
247 kDMExplosionAspectFire = 0, // @ C0_EXPLOSION_ASPECT_FIRE
248 kDMExplosionAspectSpell = 1, // @ C1_EXPLOSION_ASPECT_SPELL
249 kDMExplosionAspectPoison = 2, // @ C2_EXPLOSION_ASPECT_POISON
250 kDMExplosionAspectSmoke = 3 // @ C3_EXPLOSION_ASPECT_SMOKE
251};
252
253enum WallSet {
254 kDMWallSetStone = 0 // @ C0_WALL_SET_STONE
255};
256
257enum FloorSet {
258 kDMFloorSetStone = 0 // @ C0_FLOOR_SET_STONE
259};
260
261enum ViewWall {
262 kDMViewWallD3LRight = 0, // @ C00_VIEW_WALL_D3L_RIGHT
263 kDMViewWallD3RLeft = 1, // @ C01_VIEW_WALL_D3R_LEFT
264 kDMViewWallD3LFront = 2, // @ C02_VIEW_WALL_D3L_FRONT
265 kDMViewWallD3CFront = 3, // @ C03_VIEW_WALL_D3C_FRONT
266 kDMViewWallD3RFront = 4, // @ C04_VIEW_WALL_D3R_FRONT
267 kDMViewWallD2LRight = 5, // @ C05_VIEW_WALL_D2L_RIGHT
268 kDMViewWallD2RLeft = 6, // @ C06_VIEW_WALL_D2R_LEFT
269 kDMViewWallD2LFront = 7, // @ C07_VIEW_WALL_D2L_FRONT
270 kDMViewWallD2CFront = 8, // @ C08_VIEW_WALL_D2C_FRONT
271 kDMViewWallD2RFront = 9, // @ C09_VIEW_WALL_D2R_FRONT
272 kDMViewWallD1LRight = 10, // @ C10_VIEW_WALL_D1L_RIGHT
273 kDMViewWallD1RLeft = 11, // @ C11_VIEW_WALL_D1R_LEFT
274 kDMViewWallD1CFront = 12 // @ C12_VIEW_WALL_D1C_FRONT
275};
276
277enum CellOrder {
278 kDMCellOrderNone = 0xFFFF,
279 kDMCellOrderAlcove = 0x0000, // @ C0000_CELL_ORDER_ALCOVE
280 kDMCellOrderBackLeft = 0x0001, // @ C0001_CELL_ORDER_BACKLEFT
281 kDMCellOrderBackRight = 0x0002, // @ C0002_CELL_ORDER_BACKRIGHT
282 kDMCellOrderDoorPass1BackLeft = 0x0018, // @ C0018_CELL_ORDER_DOORPASS1_BACKLEFT
283 kDMCellOrderBackLeftBackRight = 0x0021, // @ C0021_CELL_ORDER_BACKLEFT_BACKRIGHT
284 kDMCellOrderDoorPass1BackRight = 0x0028, // @ C0028_CELL_ORDER_DOORPASS1_BACKRIGHT
285 kDMCellOrderBackRightFrontRight = 0x0032, // @ C0032_CELL_ORDER_BACKRIGHT_FRONTRIGHT
286 kDMCellOrderDoorPass2FrontRight = 0x0039, // @ C0039_CELL_ORDER_DOORPASS2_FRONTRIGHT
287 kDMCellOrderBackLeftFrontLeft = 0x0041, // @ C0041_CELL_ORDER_BACKLEFT_FRONTLEFT
288 kDMCellOrderDoorPass2FrontLeft = 0x0049, // @ C0049_CELL_ORDER_DOORPASS2_FRONTLEFT
289 kDMCellOrderDoorPass1BackRightBackLeft = 0x0128, // @ C0128_CELL_ORDER_DOORPASS1_BACKRIGHT_BACKLEFT
290 kDMCellOrderDoorPass1BackLeftBackRight = 0x0218, // @ C0218_CELL_ORDER_DOORPASS1_BACKLEFT_BACKRIGHT
291 kDMCellOrderBackLeftBackRightFrontRight = 0x0321, // @ C0321_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTRIGHT
292 kDMCellOrderBackRightFrontLeftFrontRight = 0x0342, // @ C0342_CELL_ORDER_BACKRIGHT_FRONTLEFT_FRONTRIGHT
293 kDMCellOrderDoorPass2FrontLeftFrontRight = 0x0349, // @ C0349_CELL_ORDER_DOORPASS2_FRONTLEFT_FRONTRIGHT
294 kDMCellOrderBackRightBackLeftFrontLeft = 0x0412, // @ C0412_CELL_ORDER_BACKRIGHT_BACKLEFT_FRONTLEFT
295 kDMCellOrderBackLeftFrontRightFrontLeft = 0x0431, // @ C0431_CELL_ORDER_BACKLEFT_FRONTRIGHT_FRONTLEFT
296 kDMCellOrderDoorPass2FrontRightFrontLeft = 0x0439, // @ C0439_CELL_ORDER_DOORPASS2_FRONTRIGHT_FRONTLEFT
297 kDMCellOrderBackLeftBackRightFrontLeftFrontRight = 0x3421, // @ C3421_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTLEFT_FRONTRIGHT
298 kDMCellOrderBackRightBackLeftFrontRightFrontLeft = 0x4312 // @ C4312_CELL_ORDER_BACKRIGHT_BACKLEFT_FRONTRIGHT_FRONTLEFT
299};
300
301enum DerivedBitmap {
302 kDMDerivedBitmapViewport = 0, // @ C000_DERIVED_BITMAP_VIEWPORT
303 kDMDerivedBitmapThievesEyeVisibleArea = 1, // @ C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA
304 kDMDerivedBitmapDamageToCreatureMedium = 2, // @ C002_DERIVED_BITMAP_DAMAGE_TO_CREATURE_MEDIUM
305 kDMDerivedBitmapDamageToCreatureSmall = 3, // @ C003_DERIVED_BITMAP_DAMAGE_TO_CREATURE_SMALL
306 kDMDerivedBitmapFirstWallOrnament = 4, // @ C004_DERIVED_BITMAP_FIRST_WALL_ORNAMENT
307 kDMDerivedBitmapFirstDoorOrnamentD3 = 68, // @ C068_DERIVED_BITMAP_FIRST_DOOR_ORNAMENT_D3
308 kDMDerivedBitmapFirstDoorOrnamentD2 = 69, // @ C069_DERIVED_BITMAP_FIRST_DOOR_ORNAMENT_D2
309 kDMDerivedBitmapFirstDoorButton = 102, // @ C102_DERIVED_BITMAP_FIRST_DOOR_BUTTON
310 kDMDerivedBitmapFirstObject = 104, // @ C104_DERIVED_BITMAP_FIRST_OBJECT
311 kDMDerivedBitmapFirstProjectile = 282, // @ C282_DERIVED_BITMAP_FIRST_PROJECTILE
312 kDMDerivedBitmapFirstExplosion = 438, // @ C438_DERIVED_BITMAP_FIRST_EXPLOSION
313 kDMDerivedBitmapFirstCreature = 495 // @ C495_DERIVED_BITMAP_FIRST_CREATURE
314};
315
316enum ViewSquare {
317 kDMViewSquareD4C = -3, // @ CM3_VIEW_SQUARE_D4C
318 kViewSquareD4L = -2, // @ CM2_VIEW_SQUARE_D4L
319 kDMViewSquareD4R = -1, // @ CM1_VIEW_SQUARE_D4R
320 kDMViewSquareD3C = 0, // @ C00_VIEW_SQUARE_D3C
321 kDMViewSquareD3L = 1, // @ C01_VIEW_SQUARE_D3L
322 kDMViewSquareD3R = 2, // @ C02_VIEW_SQUARE_D3R
323 kDMViewSquareD2C = 3, // @ C03_VIEW_SQUARE_D2C
324 kDMViewSquareD2L = 4, // @ C04_VIEW_SQUARE_D2L
325 kDMViewSquareD2R = 5, // @ C05_VIEW_SQUARE_D2R
326 kDMViewSquareD1C = 6, // @ C06_VIEW_SQUARE_D1C
327 kDMViewSquareD1L = 7, // @ C07_VIEW_SQUARE_D1L
328 kDMViewSquareD1R = 8, // @ C08_VIEW_SQUARE_D1R
329 kDMViewSquareD0C = 9, // @ C09_VIEW_SQUARE_D0C
330 kDMViewSquareD0L = 10, // @ C10_VIEW_SQUARE_D0L
331 kDMViewSquareD0R = 11, // @ C11_VIEW_SQUARE_D0R
332 kDMViewSquareD3CExplosion = 3, // @ C03_VIEW_SQUARE_D3C_EXPLOSION
333 kDMViewSquareD3LExplosion = 4, // @ C04_VIEW_SQUARE_D3L_EXPLOSION
334 kDMViewSquareD1CExplosion = 9, // @ C09_VIEW_SQUARE_D1C_EXPLOSION
335 kDMViewSquareD0CExplosion = 12 // @ C12_VIEW_SQUARE_D0C_EXPLOSION
336};
337
338enum ViewCell {
339 kDMViewCellFronLeft = 0, // @ C00_VIEW_CELL_FRONT_LEFT
340 kDMViewCellFrontRight = 1, // @ C01_VIEW_CELL_FRONT_RIGHT
341 kDMViewCellBackRight = 2, // @ C02_VIEW_CELL_BACK_RIGHT
342 kDMViewCellBackLeft = 3, // @ C03_VIEW_CELL_BACK_LEFT
343 kDMViewCellAlcove = 4, // @ C04_VIEW_CELL_ALCOVE
344 kDMViewCellDoorButtonOrWallOrn = 5 // @ C05_VIEW_CELL_DOOR_BUTTON_OR_WALL_ORNAMENT
345};
346
347enum Color {
348 kDMColorNoTransparency = -1,
349 kDMColorBlack = 0,
350 kDMColorDarkGary = 1,
351 kDMColorLightGray = 2,
352 kDMColorDarkBrown = 3,
353 kDMColorCyan = 4,
354 kDMColorLightBrown = 5,
355 kDMColorDarkGreen = 6,
356 kDMColorLightGreen = 7,
357 kDMColorRed = 8,
358 kDMColorGold = 9,
359 kDMColorFlesh = 10,
360 kDMColorYellow = 11,
361 kDMColorDarkestGray = 12,
362 kDMColorLightestGray = 13,
363 kDMColorBlue = 14,
364 kDMColorWhite = 15
365};
366
367enum GraphicIndice {
368 kDMGraphicIdxDialogBox = 0, // @ C000_GRAPHIC_DIALOG_BOX
369 kDMGraphicIdxTitle = 1, // @ C001_GRAPHIC_TITLE
370 kDMGraphicIdxEntranceLeftDoor = 2, // @ C002_GRAPHIC_ENTRANCE_LEFT_DOOR
371 kDMGraphicIdxEntranceRightDoor = 3, // @ C003_GRAPHIC_ENTRANCE_RIGHT_DOOR
372 kDMGraphicIdxEntrance = 4, // @ C004_GRAPHIC_ENTRANCE
373 kDMGraphicIdxCredits = 5, // @ C005_GRAPHIC_CREDITS
374 kDMGraphicIdxTheEnd = 6, // @ C006_GRAPHIC_THE_END
375 kDMGraphicIdxStatusBoxDeadChampion = 8, // @ C008_GRAPHIC_STATUS_BOX_DEAD_CHAMPION
376 kDMGraphicIdxMenuSpellAreaBackground = 9, // @ C009_GRAPHIC_MENU_SPELL_AREA_BACKGROUND
377 kDMGraphicIdxMenuActionArea = 10, // @ C010_GRAPHIC_MENU_ACTION_AREA
378 kDMGraphicIdxMenuSpellAreLines = 11, // @ C011_GRAPHIC_MENU_SPELL_AREA_LINES
379 kDMGraphicIdxMovementArrows = 13, // @ C013_GRAPHIC_MOVEMENT_ARROWS
380 kDMGraphicIdxDamageToCreature = 14, // @ C014_GRAPHIC_DAMAGE_TO_CREATURE
381 kDMGraphicIdxDamageToChampionSmall = 15, // @ C015_GRAPHIC_DAMAGE_TO_CHAMPION_SMALL
382 kDMGraphicIdxDamageToChampionBig = 16, // @ C016_GRAPHIC_DAMAGE_TO_CHAMPION_BIG
383 kDMGraphicIdxInventory = 17, // @ C017_GRAPHIC_INVENTORY
384 kDMGraphicIdxArrowForChestContent = 18, // @ C018_GRAPHIC_ARROW_FOR_CHEST_CONTENT
385 kDMGraphicIdxEyeForObjectDescription = 19, // @ C019_GRAPHIC_EYE_FOR_OBJECT_DESCRIPTION
386 kDMGraphicIdxPanelEmpty = 20, // @ C020_GRAPHIC_PANEL_EMPTY
387 kDMGraphicIdxPanelOpenScroll = 23, // @ C023_GRAPHIC_PANEL_OPEN_SCROLL
388 kDMGraphicIdxPanelOpenChest = 25, // @ C025_GRAPHIC_PANEL_OPEN_CHEST
389 kDMGraphicIdxChampionPortraits = 26, // @ C026_GRAPHIC_CHAMPION_PORTRAITS
390 kDMGraphicIdxPanelRenameChampion = 27, // @ C027_GRAPHIC_PANEL_RENAME_CHAMPION
391 kDMGraphicIdxChampionIcons = 28, // @ C028_GRAPHIC_CHAMPION_ICONS
392 kDMGraphicIdxObjectDescCircle = 29, // @ C029_GRAPHIC_OBJECT_DESCRIPTION_CIRCLE
393 kDMGraphicIdxFoodLabel = 30, // @ C030_GRAPHIC_FOOD_LABEL
394 kDMGraphicIdxWaterLabel = 31, // @ C031_GRAPHIC_WATER_LABEL
395 kDMGraphicIdxPoisionedLabel = 32, // @ C032_GRAPHIC_POISONED_LABEL
396 kDMGraphicIdxSlotBoxNormal = 33, // @ C033_GRAPHIC_SLOT_BOX_NORMAL
397 kDMGraphicIdxSlotBoxWounded = 34, // @ C034_GRAPHIC_SLOT_BOX_WOUNDED
398 kDMGraphicIdxSlotBoxActingHand = 35, // @ C035_GRAPHIC_SLOT_BOX_ACTING_HAND
399 kDMGraphicIdxBorderPartyShield = 37, // @ C037_GRAPHIC_BORDER_PARTY_SHIELD
400 kDMGraphicIdxBorderPartyFireshield = 38, // @ C038_GRAPHIC_BORDER_PARTY_FIRESHIELD
401 kDMGraphicIdxBorderPartySpellshield = 39, // @ C039_GRAPHIC_BORDER_PARTY_SPELLSHIELD
402 kDMGraphicIdxPanelResurectReincarnate = 40, // @ C040_GRAPHIC_PANEL_RESURRECT_REINCARNATE
403 kDMGraphicIdxHoleInWall = 41, // @ C041_GRAPHIC_HOLE_IN_WALL
404 kDMGraphicIdxObjectIcons000To031 = 42, // @ C042_GRAPHIC_OBJECT_ICONS_000_TO_031
405 kDMGraphicIdxObjectIcons032To063 = 43, // @ C043_GRAPHIC_OBJECT_ICONS_032_TO_063
406 kDMGraphicIdxObjectIcons064To095 = 44, // @ C044_GRAPHIC_OBJECT_ICONS_064_TO_095
407 kDMGraphicIdxObjectIcons096To127 = 45, // @ C045_GRAPHIC_OBJECT_ICONS_096_TO_127
408 kDMGraphicIdxObjectIcons128To159 = 46, // @ C046_GRAPHIC_OBJECT_ICONS_128_TO_159
409 kDMGraphicIdxObjectIcons160To191 = 47, // @ C047_GRAPHIC_OBJECT_ICONS_160_TO_191
410 kDMGraphicIdxObjectIcons192To223 = 48, // @ C048_GRAPHIC_OBJECT_ICONS_192_TO_223
411 kDMGraphicIdxFloorPitD3L = 49, // @ C049_GRAPHIC_FLOOR_PIT_D3L
412 kDMGraphicIdxFloorPitD3C = 50, // @ C050_GRAPHIC_FLOOR_PIT_D3C
413 kDMGraphicIdxFloorPitD2L = 51, // @ C051_GRAPHIC_FLOOR_PIT_D2L
414 kDMGraphicIdxFloorPitD2C = 52, // @ C052_GRAPHIC_FLOOR_PIT_D2C
415 kDMGraphicIdxFloorPitD1L = 53, // @ C053_GRAPHIC_FLOOR_PIT_D1L
416 kDMGraphicIdxFloorPitD1C = 54, // @ C054_GRAPHIC_FLOOR_PIT_D1C
417 kDMGraphicIdxFloorPitD0L = 55, // @ C055_GRAPHIC_FLOOR_PIT_D0L
418 kDMGraphicIdxFloorPitD0C = 56, // @ C056_GRAPHIC_FLOOR_PIT_D0C
419 kDMGraphicIdxFloorPitInvisibleD2L = 57, // @ C057_GRAPHIC_FLOOR_PIT_INVISIBLE_D2L
420 kDMGraphicIdxFloorPitInvisibleD2C = 58, // @ C058_GRAPHIC_FLOOR_PIT_INVISIBLE_D2C
421 kDMGraphicIdxFloorPitInvisibleD1L = 59, // @ C059_GRAPHIC_FLOOR_PIT_INVISIBLE_D1L
422 kDMGraphicIdxFloorPitInvisibleD1C = 60, // @ C060_GRAPHIC_FLOOR_PIT_INVISIBLE_D1C
423 kDMGraphicIdxFloorPitInvisibleD0L = 61, // @ C061_GRAPHIC_FLOOR_PIT_INVISIBLE_D0L
424 kDMGraphicIdxFloorPitInvisibleD0C = 62, // @ C062_GRAPHIC_FLOOR_PIT_INVISIBLE_D0C
425 kDMGraphicIdxCeilingPitD2L = 63, // @ C063_GRAPHIC_CEILING_PIT_D2L
426 kDMGraphicIdxCeilingPitD2C = 64, // @ C064_GRAPHIC_CEILING_PIT_D2C
427 kDMGraphicIdxCeilingPitD1L = 65, // @ C065_GRAPHIC_CEILING_PIT_D1L
428 kDMGraphicIdxCeilingPitD1C = 66, // @ C066_GRAPHIC_CEILING_PIT_D1C
429 kDMGraphicIdxCeilingPitD0L = 67, // @ C067_GRAPHIC_CEILING_PIT_D0L
430 kDMGraphicIdxCeilingPitD0C = 68, // @ C068_GRAPHIC_CEILING_PIT_D0C
431 kDMGraphicIdxFieldMaskD3R = 69, // @ C069_GRAPHIC_FIELD_MASK_D3R
432 kDMGraphicIdxFieldTeleporter = 73, // @ C073_GRAPHIC_FIELD_TELEPORTER
433 kDMGraphicIdxInscriptionFont = 120, // @ C120_GRAPHIC_INSCRIPTION_FONT
434 kDMGraphicIdxWallOrnChampMirror = 208, // @ C208_GRAPHIC_WALL_ORNAMENT_43_CHAMPION_MIRROR
435 kDMGraphicIdxFloorOrnD3LFootprints = 241, // @ C241_GRAPHIC_FLOOR_ORNAMENT_15_D3L_FOOTPRINTS
436 kDMGraphicIdxDoorMaskDestroyed = 301, // @ C301_GRAPHIC_DOOR_MASK_DESTROYED
437 kDMGraphicIdxFirstDoorButton = 315, // @ C315_GRAPHIC_FIRST_DOOR_BUTTON
438 kDMGraphicIdxFirstProjectile = 316, // @ C316_GRAPHIC_FIRST_PROJECTILE
439 kDMGraphicIdxFirstExplosion = 348, // @ C348_GRAPHIC_FIRST_EXPLOSION
440 kDMGraphicIdxFirstExplosionPattern = 351, // @ C351_GRAPHIC_FIRST_EXPLOSION_PATTERN
441 kDMGraphicIdxFirstObject = 360, // @ C360_GRAPHIC_FIRST_OBJECT
442 kDMGraphicIdxFirstCreature = 446, // @ C446_GRAPHIC_FIRST_CREATURE
443 kDMGraphicIdxFont = 557, // @ C557_GRAPHIC_FONT
444 kDMObjectNamesGraphicIndice = 556 // @ C556_GRAPHIC_OBJECT_NAMES
445};
446
447#define kDMMaskDoorInfoCreaturesCanSeeThrough 0x0001 // @ MASK0x0001_CREATURES_CAN_SEE_THROUGH
448#define kDMMaskDoorInfoProjectilesCanPassThrough 0x0002 // @ MASK0x0002_PROJECTILES_CAN_PASS_THROUGH
449#define kDMMaskDoorInfoAnimated 0x0004 // @ MASK0x0004_ANIMATED
450#define kDMMaskDoorFront 0x0008 // @ MASK0x0008_DOOR_FRONT
451
452/* Field Aspect Mask */
453#define kMaskFieldAspectFlipMask 0x0080 // @ MASK0x0080_FLIP_MASK
454#define kMaskFieldAspectIndex 0x007F // @ MASK0x007F_MASK_INDEX
455#define kMaskFieldAspectNoMask 255 // @ C255_NO_MASK
456
457#define kDMCreatureMaskAdditional 0x0003 // @ MASK0x0003_ADDITIONAL
458#define kDMCreatureMaskFlipNonAttack 0x0004 // @ MASK0x0004_FLIP_NON_ATTACK
459#define kDMCreatureMaskSide 0x0008 // @ MASK0x0008_SIDE
460#define kDMCreatureMaskBack 0x0010 // @ MASK0x0010_BACK
461#define kDMCreatureMaskAttack 0x0020 // @ MASK0x0020_ATTACK
462#define kDMCreatureMaskSpecialD2Front 0x0080 // @ MASK0x0080_SPECIAL_D2_FRONT
463#define kDMCreatureMaskSpecialD2FrontIsFlipped 0x0100 // @ MASK0x0100_SPECIAL_D2_FRONT_IS_FLIPPED_FRONT
464#define kDMCreatureMaskFlipAttack 0x0200 // @ MASK0x0200_FLIP_ATTACK
465#define kDMCreatureMaskFlipDuringAttack 0x0400 // @ MASK0x0400_FLIP_DURING_ATTACK
466
467#define k2_FloorSetGraphicCount 2 // @ C002_FLOOR_SET_GRAPHIC_COUNT
468#define k13_WallSetGraphicCount 13 // @ C013_WALL_SET_GRAPHIC_COUNT
469#define k40_WallSetGraphicCountDOS 40 // @ M647_WALL_SET_GRAPHIC_COUNT
470#define k18_StairsGraphicCount 18 // @ C018_STAIRS_GRAPHIC_COUNT
471#define k3_DoorSetGraphicsCount 3 // @ C003_DOOR_SET_GRAPHIC_COUNT
472#define k1_DoorButtonCount 1 // @ C001_DOOR_BUTTON_COUNT
473#define k3_AlcoveOrnCount 3 // @ C003_ALCOVE_ORNAMENT_COUNT
474#define k1_FountainOrnCount 1 // @ C001_FOUNTAIN_ORNAMENT_COUNT
475#define k27_CreatureTypeCount 27 // @ C027_CREATURE_TYPE_COUNT
476#define k4_ExplosionAspectCount 4 // @ C004_EXPLOSION_ASPECT_COUNT
477#define k14_ProjectileAspectCount 14 // @ C014_PROJECTILE_ASPECT_COUNT
478#define k85_ObjAspectCount 85 // @ C085_OBJECT_ASPECT_COUNT
479
480#define k0_HalfSizedViewCell_LeftColumn 0 // @ C00_VIEW_CELL_LEFT_COLUMN
481#define k1_HalfSizedViewCell_RightColumn 1 // @ C01_VIEW_CELL_RIGHT_COLUMN
482#define k2_HalfSizedViewCell_BackRow 2 // @ C02_VIEW_CELL_BACK_ROW
483#define k3_HalfSizedViewCell_CenterColumn 3 // @ C03_VIEW_CELL_CENTER_COLUMN
484#define k4_HalfSizedViewCell_FrontRow 4 // @ C04_VIEW_CELL_FRONT_ROW
485
486/* Shift sets */
487#define k0_ShiftSet_D0BackD1Front 0 // @ C0_SHIFT_SET_D0_BACK_OR_D1_FRONT
488#define k1_ShiftSet_D1BackD2Front 1 // @ C1_SHIFT_SET_D1_BACK_OR_D2_FRONT
489#define k2_ShiftSet_D2BackD3Front 2 // @ C2_SHIFT_SET_D2_BACK_OR_D3_FRONT
490
491#define k9_MenuSpellAreaLinesDOS 9 // @ C009_GRAPHIC_MENU_SPELL_AREA_LINES
492#define k75_FirstFloorSet 75 // @ C075_GRAPHIC_FIRST_FLOOR_SET
493#define k78_FirstFloorSetDOS 78 // @ M644_GRAPHIC_FIRST_FLOOR_SET
494#define k77_FirstWallSet 77 // @ C077_GRAPHIC_FIRST_WALL_SET
495#define k86_FirstWallSetDOS 86 // @ M646_GRAPHIC_FIRST_WALL_SET
496#define k90_FirstStairs 90 // @ C090_GRAPHIC_FIRST_STAIRS
497#define k108_FirstStairsDOS 108 // @ M645_GRAPHIC_FIRST_STAIRS
498#define k108_FirstDoorSet 108 // @ C108_GRAPHIC_FIRST_DOOR_SET
499#define k246_FirstDoorSetDOS 246 // @ M633_GRAPHIC_FIRST_DOOR_SET
500#define k120_InscriptionFont 120 // @ C120_GRAPHIC_INSCRIPTION_FONT
501#define k258_InscriptionFontDOS 258 // @ M648_GRAPHIC_INSCRIPTION_FONT
502#define k121_FirstWallOrn 121 // @ C121_GRAPHIC_FIRST_WALL_ORNAMENT
503#define k259_FirstWallOrnDOS 259 // @ M615_GRAPHIC_FIRST_WALL_ORNAMENT
504#define k247_FirstFloorOrn 247 // @ C247_GRAPHIC_FIRST_FLOOR_ORNAMENT
505#define k385_FirstFloorOrnDOS 385 // @ M616_GRAPHIC_FIRST_FLOOR_ORNAMENT
506#define k439_DoorMaskDestroyedDOS 439 // @ M649_GRAPHIC_DOOR_MASK_DESTROYED
507#define k303_FirstDoorOrn 303 // @ C303_GRAPHIC_FIRST_DOOR_ORNAMENT
508#define k441_FirstDoorOrnDOS 441 // @ M617_GRAPHIC_FIRST_DOOR_ORNAMENT
509#define k453_FirstDoorButtonDOS 453 // @ M634_GRAPHIC_FIRST_DOOR_BUTTON
510#define k454_FirstProjectileDOS 454 // @ M613_GRAPHIC_FIRST_PROJECTILE
511#define k486_FirstExplosionDOS 486 // @ M614_GRAPHIC_FIRST_EXPLOSION
512#define k489_FirstExplosionPatternDOS 489 // @ M636_GRAPHIC_FIRST_EXPLOSION_PATTERN
513#define k498_FirstObjectDOS 498 // @ M612_GRAPHIC_FIRST_OBJECT
514#define k584_FirstCreatureDOS 584 // @ M618_GRAPHIC_FIRST_CREATURE
515#define k695_FontDOS 695 // @ M653_GRAPHIC_FONT
516#define k694_ObjectNamesDOS 694 // @ M564_GRAPHIC_OBJECT_NAMES
517#define k730_DerivedBitmapMaximumCount 730 // @ C730_DERIVED_BITMAP_MAXIMUM_COUNT
518
519#define k16_Scale_D3 16 // @ C16_SCALE_D3
520#define k20_Scale_D2 20 // @ C20_SCALE_D2
521
522/* Object aspect GraphicInfo */
523#define k0x0001_ObjectFlipOnRightMask 0x0001 // @ MASK0x0001_FLIP_ON_RIGHT
524#define k0x0010_ObjectAlcoveMask 0x0010 // @ MASK0x0010_ALCOVE
525
526/* Projectile aspect GraphicInfo */
527#define k0x0010_ProjectileSideMask 0x0010 // @ MASK0x0010_SIDE
528#define k0x0100_ProjectileScaleWithKineticEnergyMask 0x0100 // @ MASK0x0100_SCALE_WITH_KINETIC_ENERGY
529#define k0x0003_ProjectileAspectTypeMask 0x0003 // @ MASK0x0003_ASPECT_TYPE
530
531/* Projectile aspect type */
532#define k0_ProjectileAspectHasBackGraphicRotation 0 // @ C0_PROJECTILE_ASPECT_TYPE_HAS_BACK_GRAPHIC_AND_ROTATION
533#define k1_ProjectileAspectBackGraphic 1 // @ C1_PROJECTILE_ASPECT_TYPE_HAS_BACK_GRAPHIC_AND_NO_ROTATION
534#define k2_ProjectileAspectHasRotation 2 // @ C2_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_ROTATION
535#define k3_ProjectileAspectHasNone 3 // @ C3_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_NO_ROTATION
536
537/* Projectile aspects */
538#define k3_ProjectileAspectExplosionLightningBolt 3 // @ C03_PROJECTILE_ASPECT_EXPLOSION_LIGHTNING_BOLT
539#define k10_ProjectileAspectExplosionFireBall 10 // @ C10_PROJECTILE_ASPECT_EXPLOSION_FIREBALL
540#define k11_ProjectileAspectExplosionDefault 11 // @ C11_PROJECTILE_ASPECT_EXPLOSION_DEFAULT
541#define k12_ProjectileAspectExplosionSlime 12 // @ C12_PROJECTILE_ASPECT_EXPLOSION_SLIME
542#define k13_ProjectileAspectExplosionPoisonBoltCloud 13 // @ C13_PROJECTILE_ASPECT_EXPLOSION_POISON_BOLT_POISON_CLOUD
543
544#define k0x0080_BlitDoNotUseMask 0x0080 // @ MASK0x0080_DO_NOT_USE_MASK
545#define kScaleThreshold 32768
546
548public:
549 uint16 _byteWidth;
550 uint16 _height;
551
552 ExplosionAspect(uint16 byteWidth, uint16 height) :_byteWidth(byteWidth), _height(height) {}
553 ExplosionAspect() : _byteWidth(0), _height(0) {}
554}; // @ EXPLOSION_ASPECT
555
556// in all cases, where a function takes a Box, it expects it to contain inclusive boundaries
557class Box {
558public:
559 Common::Rect _rect;
560
561 Box(int16 x1, int16 x2, int16 y1, int16 y2) {
562 // +1 because Rect.constains is not inclusive for right and bottom, at the opposite of the isPointInside
563 _rect = Common::Rect(x1, y1, x2, y2);
564 }
565
566 Box() = default;
567
568 bool isPointInside(Common::Point point) {
569 // not using Common::Rect::contains() because we need both boundaries to be included
570 return (_rect.left <= point.x) && (point.x <= _rect.right) && (_rect.top <= point.y) && (point.y <= _rect.bottom);
571 }
572
573 bool isPointInside(int16 x, int16 y) {
574 return isPointInside(Common::Point(x, y));
575 }
576
577 void setToZero() { _rect = Common::Rect(0, 0, 0, 0); }
578}; // @ BOX_BYTE, BOX_WORD
579
580extern Box g2_BoxMovementArrows; // @ G0002_s_Graphic562_Box_MovementArrows
581
582class Frame {
583public:
584 Box _box;
585 uint16 _srcByteWidth, _srcHeight;
586 uint16 _srcX, _srcY;
587
588 Frame(){
589 _srcByteWidth = _srcHeight = 0;
590 _srcX = _srcY = 0;
591 }
592
593 Frame(uint16 destFromX, uint16 destToX, uint16 destFromY, uint16 destToY,
594 uint16 srcWidth, uint16 srcHeight, uint16 srcX, uint16 srcY) :
595 _box(destFromX, destToX, destFromY, destToY),
596 _srcByteWidth(srcWidth), _srcHeight(srcHeight), _srcX(srcX), _srcY(srcY) {}
597};
598
600public:
601 uint16 _nativeBitmapRelativeIndex;
602 uint16 _baseStartUnitIndex; /* Index of the unit (16 pixels = 8 bytes) in bitmap where blit will start from. A random value of 0 or 1 is added to this base index */
603 uint16 _transparentColor; /* Bit 7: Do not use mask if set, Bits 6-0: Transparent color index. 0xFF = no transparency */
604 byte _mask; /* Bit 7: Flip, Bits 6-0: Mask index. 0xFF = no mask */
605 uint16 _byteWidth;
606 uint16 _height;
607 uint16 _xPos;
608 uint16 _bitplaneWordCount;
609 FieldAspect(uint16 native, uint16 base, uint16 transparent, byte mask, uint16 byteWidth, uint16 height, uint16 xPos, uint16 bitplane);
610 FieldAspect();
611}; // @ FIELD_ASPECT
612
614public:
615 uint16 _firstNativeBitmapRelativeIndex;
616 uint16 _firstDerivedBitmapIndex;
617 byte _byteWidthFront;
618 byte _heightFront;
619 byte _byteWidthSide;
620 byte _heightSide;
621 byte _byteWidthAttack;
622 byte _heightAttack;
623private:
624 byte _coordinateSet_TransparentColor;
625 byte _replacementColorSetIndices;
626public:
627
628 CreatureAspect(uint16 uint161, uint16 uint162, byte byte0, byte byte1, byte byte2, byte byte3, byte byte4, byte byte5, byte byte6, byte byte7)
629 : _firstNativeBitmapRelativeIndex(uint161), _firstDerivedBitmapIndex(uint162), _byteWidthFront(byte0),
630 _heightFront(byte1), _byteWidthSide(byte2), _heightSide(byte3), _byteWidthAttack(byte4),
631 _heightAttack(byte5), _coordinateSet_TransparentColor(byte6), _replacementColorSetIndices(byte7) {}
632
634 _firstNativeBitmapRelativeIndex(0), _firstDerivedBitmapIndex(0), _byteWidthFront(0),
635 _heightFront(0), _byteWidthSide(0), _heightSide(0), _byteWidthAttack(0),
636 _heightAttack(0), _coordinateSet_TransparentColor(0), _replacementColorSetIndices(0) {}
637
638 byte getCoordSet() { return (_coordinateSet_TransparentColor >> 4) & 0xF; } // @ M71_COORDINATE_SET
639 byte getTranspColour() { return _coordinateSet_TransparentColor & 0xF; } // @ M72_TRANSPARENT_COLOR
640 byte getReplColour10() { return (_replacementColorSetIndices >> 4) & 0xF; } // @ M74_COLOR_10_REPLACEMENT_COLOR_SET
641 byte getReplColour9() { return _replacementColorSetIndices & 0xF; } // @ M73_COLOR_09_REPLACEMENT_COLOR_SET
642}; // @ CREATURE_ASPECT
643
645public:
646 byte _firstNativeBitmapRelativeIndex;
647 byte _firstDerivedBitmapRelativeIndex;
648 byte _byteWidth;
649 byte _height;
650 byte _graphicInfo; /* Bits 7-5 and 3-1 Unreferenced */
651 byte _coordinateSet;
652 ObjectAspect(byte firstN, byte firstD, byte byteWidth, byte h, byte grap, byte coord) :
653 _firstNativeBitmapRelativeIndex(firstN), _firstDerivedBitmapRelativeIndex(firstD),
654 _byteWidth(byteWidth), _height(h), _graphicInfo(grap), _coordinateSet(coord) {}
655 ObjectAspect() : _firstNativeBitmapRelativeIndex(0), _firstDerivedBitmapRelativeIndex(0),
656 _byteWidth(0), _height(0), _graphicInfo(0), _coordinateSet(0) {}
657}; // @ OBJECT_ASPECT
658
660public:
661 byte _firstNativeBitmapRelativeIndex;
662 byte _firstDerivedBitmapRelativeIndex;
663 byte _byteWidth;
664 byte _height;
665 uint16 _graphicInfo; /* Bits 15-9, 7-5 and 3-2 Unreferenced */
666
667 ProjectileAspect(byte firstN, byte firstD, byte byteWidth, byte h, uint16 grap) :
668 _firstNativeBitmapRelativeIndex(firstN), _firstDerivedBitmapRelativeIndex(firstD),
669 _byteWidth(byteWidth), _height(h), _graphicInfo(grap) {}
670
671 ProjectileAspect() : _firstNativeBitmapRelativeIndex(0),
672 _firstDerivedBitmapRelativeIndex(0), _byteWidth(0), _height(0), _graphicInfo(0) {}
673}; // @ PROJECTIL_ASPECT
674
676public:
677 uint16 _RGBColor[6];
678 byte _d2ReplacementColor;
679 byte _d3ReplacementColor;
680
681 CreatureReplColorSet(uint16 col1, uint16 col2, uint16 col3, uint16 col4, uint16 col5, uint16 col6, byte d2Rep, byte d3Rep) {
682 _RGBColor[0] = col1;
683 _RGBColor[1] = col2;
684 _RGBColor[2] = col3;
685 _RGBColor[3] = col4;
686 _RGBColor[4] = col5;
687 _RGBColor[5] = col6;
688 _d2ReplacementColor = d2Rep;
689 _d3ReplacementColor = d3Rep;
690 }
691}; // @ CREATURE_REPLACEMENT_COLOR_SET
692
694 int16 nativeIndice;
695 int16 coordinateSet;
696};
697
698#define k0_DoorButton 0 // @ C0_DOOR_BUTTON
699#define k0_WallOrnInscription 0 // @ C0_WALL_ORNAMENT_INSCRIPTION
700#define k15_FloorOrnFootprints 15 // @ C15_FLOOR_ORNAMENT_FOOTPRINTS
701#define k15_DoorOrnDestroyedMask 15 // @ C15_DOOR_ORNAMENT_DESTROYED_MASK
702#define k16_DoorOrnThivesEyeMask 16 // @ C16_DOOR_ORNAMENT_THIEVES_EYE_MASK
703
704#define k0_viewportNotDungeonView 0 // @ C0_VIEWPORT_NOT_DUNGEON_VIEW
705#define k1_viewportDungeonView 1 // @ C1_VIEWPORT_DUNGEON_VIEW
706#define k2_viewportAsBeforeSleepOrFreezeGame 2 // @ C2_VIEWPORT_AS_BEFORE_SLEEP_OR_FREEZE_GAME
707
708
709#define k112_byteWidthViewport 112 // @ C112_BYTE_WIDTH_VIEWPORT
710#define k136_heightViewport 136 // @ C136_HEIGHT_VIEWPORT
711
712#define k160_byteWidthScreen 160 // @ C160_BYTE_WIDTH_SCREEN
713#define k200_heightScreen 200 // @ C200_HEIGHT_SCREEN
714
715#define k8_byteWidth 8 // @ C008_BYTE_WIDTH
716#define k16_byteWidth 16 // @ C016_BYTE_WIDTH
717#define k24_byteWidth 24 // @ C024_BYTE_WIDTH
718#define k32_byteWidth 32 // @ C032_BYTE_WIDTH
719#define k40_byteWidth 40 // @ C040_BYTE_WIDTH
720#define k48_byteWidth 48 // @ C048_BYTE_WIDTH
721#define k64_byteWidth 64 // @ C064_BYTE_WIDTH
722#define k72_byteWidth 72 // @ C072_BYTE_WIDTH
723#define k128_byteWidth 128 // @ C128_BYTE_WIDTH
724#define k144_byteWidth 144 // @ C144_BYTE_WIDTH
725
726
728public:
729 Frame _closedOrDestroyed;
730 Frame _vertical[3];
731 Frame _leftHorizontal[3];
732 Frame _rightHorizontal[3];
733 DoorFrames(Frame f1, Frame f2_1, Frame f2_2, Frame f2_3,
734 Frame f3_1, Frame f3_2, Frame f3_3,
735 Frame f4_1, Frame f4_2, Frame f4_3);
736}; // @ DOOR_FRAMES
737
738#define D00_RGB_BLACK 0x0000
739#define D01_RGB_DARK_BLUE 0x0004
740#define D02_RGB_LIGHT_BROWN 0x0842
741#define D03_RGB_PINK 0x086F
742#define D04_RGB_LIGHTER_BROWN 0x0A62
743#define D05_RGB_DARK_GOLD 0x0A82
744#define D06_RGB_GOLD 0x0CA2
745#define D07_RGB_RED 0x0F00
746#define D08_RGB_YELLOW 0x0FF4
747#define D09_RGB_WHITE 0x0FFF
748#define D10_MASK_RED_COMPONENT 0x0F00
749#define D10_MASK_RED_COMPONENT 0x0F00
750#define D11_MASK_GREEN_COMPONENT 0x00F0
751#define D12_MASK_BLUE_COMPONENT 0x000F
752
753struct ColorDef { // @ COLOR_DEF
754 uint8 index;
755 uint8 r, g, b;
756};
757
759 friend class DM::TextMan;
760
761 DMEngine *_vm;
762
763 uint16 _grapItemCount; // @ G0632_ui_GraphicCount
764 uint32 *_bitmapCompressedByteCount;
765 uint32 *_bitmapDecompressedByteCount;
766 uint32 *_packedItemPos;
767 byte *_packedBitmaps;
768 byte **_bitmaps;
769 DoorFrames *_doorFrameD1C;
770 // pointers are not owned by these fields
771 byte *_palChangesProjectile[4]; // @G0075_apuc_PaletteChanges_Projectile
772
773 DisplayMan(const DisplayMan &other); // no implementation on purpose
774 void operator=(const DisplayMan &rhs); // no implementation on purpose
775
776 byte *getCurrentVgaBuffer();
777 // the original function has two position parameters, but they are always set to zero
778 void unpackGraphics();
779 void loadFNT1intoBitmap(uint16 index, byte *destBitmap);
780
781 void viewportSetPalette(uint16 *middleScreenPalette, uint16 *topAndBottomScreen); // @ F0565_VIEWPORT_SetPalette
782 void viewportBlitToScreen(); // @ F0566_VIEWPORT_BlitToScreen
783
784 void drawBitmapDOS(byte *srcBitmap, int16 zoneIndex, bool flipHorizontal = false, Color transparentColor = kDMColorFlesh, uint16 explicitWidth = 0, uint16 explicitHeight = 0); // @ F0791_DUNGEONVIEW_DrawBitmapXX
785 void drawFloorPitOrStairsBitmapFlippedHorizontally(uint16 nativeIndex, Frame &frame, int16 zoneIndexDOS = -1); // @ F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally
786 void drawFloorPitOrStairsBitmap(uint16 nativeIndex, Frame &frame, int16 zoneIndexDOS = -1); // @ F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap
787 void drawWallSetBitmap(byte *bitmap, Frame &f); // @ F0100_DUNGEONVIEW_DrawWallSetBitmap
788 void drawWallSetBitmapWithoutTransparency(byte *bitmap, Frame &f); // @ F0101_DUNGEONVIEW_DrawWallSetBitmapWithoutTransparency
789
790 // DOS Layout Tree Engine (GET_COORD)
791 const LayoutRecord *getLayoutRecord(int16 layoutRecordIndex); // @ F0634_GetLayoutRecord
792 byte *initBitmapStruct2(int16 graphicIndex, Struct2 *outStruct); // @ F0630_InitBitmapStruct2
793 int16 *getCoord(byte *bitmap, int16 *outXYZ, int16 zoneIndex, int16 *inOutX, int16 *inOutY); // @ F0635_
794public:
795 bool getZoneBox(int16 zoneIndex, int16 graphicIndex, Box &outBox);
796private:
797 void drawWallSetBitmapDOS(int16 zoneIndex, int16 normalNegIndex, int16 oppositeNegIndex, bool withoutTransparency = false);
798 void loadLayoutData(uint16 graphicIndex); // @ F0640_LoadLayoutData
799
800 struct DynLayoutRange {
801 DynLayoutRange *_nextRange;
802 int16 _firstIndex;
803 int16 _lastIndex;
804 LayoutRecord *_records;
805 };
806 DynLayoutRange *_dosLayoutData;
807 Common::Array<DynLayoutRange *> _dosLayoutRangeAllocs;
808
809 void drawSquareD3L(Direction dir, int16 posX, int16 posY); // @ F0116_DUNGEONVIEW_DrawSquareD3L
810 void drawSquareD3R(Direction dir, int16 posX, int16 posY); // @ F0117_DUNGEONVIEW_DrawSquareD3R
811 void drawSquareD3C(Direction dir, int16 posX, int16 posY); // @ F0118_DUNGEONVIEW_DrawSquareD3C_CPSF
812 void drawSquareD2L(Direction dir, int16 posX, int16 posY); // @ F0119_DUNGEONVIEW_DrawSquareD2L
813 void drawSquareD2R(Direction dir, int16 posX, int16 posY); // @ F0120_DUNGEONVIEW_DrawSquareD2R_CPSF
814 void drawSquareD2C(Direction dir, int16 posX, int16 posY); // @ F0121_DUNGEONVIEW_DrawSquareD2C
815 void drawSquareD1L(Direction dir, int16 posX, int16 posY); // @ F0122_DUNGEONVIEW_DrawSquareD1L
816 void drawSquareD1R(Direction dir, int16 posX, int16 posY); // @ F0123_DUNGEONVIEW_DrawSquareD1R
817 void drawSquareD1C(Direction dir, int16 posX, int16 posY); // @ F0124_DUNGEONVIEW_DrawSquareD1C
818 void drawSquareD0L(Direction dir, int16 posX, int16 posY); // @ F0125_DUNGEONVIEW_DrawSquareD0L
819 void drawSquareD0R(Direction dir, int16 posX, int16 posY); // @ F0126_DUNGEONVIEW_DrawSquareD0R
820 void drawSquareD0C(Direction dir, int16 posX, int16 posY); // @ F0127_DUNGEONVIEW_DrawSquareD0C
821
822 void applyCreatureReplColors(int replacedColor, int replacementColor); // @ F0093_DUNGEONVIEW_ApplyCreatureReplacementColors
823
824 bool isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex); // @ F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF
825
826 Struct3 _negativeBitmaps[45]; // @ G2002_NegativeBitmaps
827 uint16 *_derivedBitmapByteCount; // @ G0639_pui_DerivedBitmapByteCount
828 byte **_derivedBitmaps; // @ G0638_pui_DerivedBitmapBlockIndices
829
830 int16 _stairsNativeBitmapIndexUpFrontD3L; // @ G0675_i_StairsNativeBitmapIndex_Up_Front_D3L
831 int16 _stairsNativeBitmapIndexUpFrontD3C; // @ G0676_i_StairsNativeBitmapIndex_Up_Front_D3C
832 int16 _stairsNativeBitmapIndexUpFrontD2L; // @ G0677_i_StairsNativeBitmapIndex_Up_Front_D2L
833 int16 _stairsNativeBitmapIndexUpFrontD2C; // @ G0678_i_StairsNativeBitmapIndex_Up_Front_D2C
834 int16 _stairsNativeBitmapIndexUpFrontD1L; // @ G0679_i_StairsNativeBitmapIndex_Up_Front_D1L
835 int16 _stairsNativeBitmapIndexUpFrontD1C; // @ G0680_i_StairsNativeBitmapIndex_Up_Front_D1C
836 int16 _stairsNativeBitmapIndexUpFrontD0CLeft; // @ G0681_i_StairsNativeBitmapIndex_Up_Front_D0C_Left
837 int16 _stairsNativeBitmapIndexDownFrontD3L; // @ G0682_i_StairsNativeBitmapIndex_Down_Front_D3L
838 int16 _stairsNativeBitmapIndexDownFrontD3C; // @ G0683_i_StairsNativeBitmapIndex_Down_Front_D3C
839 int16 _stairsNativeBitmapIndexDownFrontD2L; // @ G0684_i_StairsNativeBitmapIndex_Down_Front_D2L
840 int16 _stairsNativeBitmapIndexDownFrontD2C; // @ G0685_i_StairsNativeBitmapIndex_Down_Front_D2C
841 int16 _stairsNativeBitmapIndexDownFrontD1L; // @ G0686_i_StairsNativeBitmapIndex_Down_Front_D1L
842 int16 _stairsNativeBitmapIndexDownFrontD1C; // @ G0687_i_StairsNativeBitmapIndex_Down_Front_D1C
843 int16 _stairsNativeBitmapIndexDownFrontD0CLeft; // @ G0688_i_StairsNativeBitmapIndex_Down_Front_D0C_Left
844 int16 _stairsNativeBitmapIndexSideD2L; // @ G0689_i_StairsNativeBitmapIndex_Side_D2L
845 int16 _stairsNativeBitmapIndexUpSideD1L; // @ G0690_i_StairsNativeBitmapIndex_Up_Side_D1L
846 int16 _stairsNativeBitmapIndexDownSideD1L; // @ G0691_i_StairsNativeBitmapIndex_Down_Side_D1L
847 int16 _stairsNativeBitmapIndexSideD0L; // @ G0692_i_StairsNativeBitmapIndex_Side_D0L
848
849 byte *_bitmapFloor; // @ G0084_puc_Bitmap_Floor
850 byte *_bitmapCeiling; // @ G0085_puc_Bitmap_Ceiling
851 byte *_bitmapWallSetD2L2;
852 byte *_bitmapWallSetD2R2;
853 byte *_bitmapWallSetD3L2; // @ G0697_puc_Bitmap_WallSet_Wall_D3L2
854 byte *_bitmapWallSetD3R2; // @ G0696_puc_Bitmap_WallSet_Wall_D3R2
855 byte *_bitmapWallSetD3LCR; // @ G0698_puc_Bitmap_WallSet_Wall_D3LCR
856 byte *_bitmapWallSetD2LCR; // @ G0699_puc_Bitmap_WallSet_Wall_D2LCR
857 byte *_bitmapWallSetD1L;
858 byte *_bitmapWallSetD1R;
859 byte *_bitmapWallSetD2L;
860 byte *_bitmapWallSetD2R;
861 byte *_bitmapWallSetD3L;
862 byte *_bitmapWallSetD3R;
863public:
864 byte *_bitmapWallSetD1LCR; // @ G0700_puc_Bitmap_WallSet_Wall_D1LCR
865private:
866 Box _boxThievesEyeViewPortVisibleArea; // @ G0106_s_Graphic558_Box_ThievesEye_ViewportVisibleArea
867 byte _palChangesDoorButtonAndWallOrnD3[16]; // @ G0198_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D3
868 byte _palChangesDoorButtonAndWallOrnD2[16]; // @ G0199_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D2
869
870 byte *_bitmapWallSetWallD0L; // @ G0701_puc_Bitmap_WallSet_Wall_D0L
871 byte *_bitmapWallSetWallD0R; // @ G0702_puc_Bitmap_WallSet_Wall_D0R
872 byte *_bitmapWallSetDoorFrameTopD2LCR; // @ G0703_puc_Bitmap_WallSet_DoorFrameTop_D2LCR
873 byte *_bitmapWallSetDoorFrameTopD1LCR; // @ G0704_puc_Bitmap_WallSet_DoorFrameTop_D1LCR
874 byte *_bitmapWallSetDoorFrameLeftD3L; // @ G0705_puc_Bitmap_WallSet_DoorFrameLeft_D3L
875 byte *_bitmapWallSetDoorFrameLeftD3C; // @ G0706_puc_Bitmap_WallSet_DoorFrameLeft_D3C
876 byte *_bitmapWallSetDoorFrameLeftD2C; // @ G0707_puc_Bitmap_WallSet_DoorFrameLeft_D2C
877 byte *_bitmapWallSetDoorFrameLeftD1C; // @ G0708_puc_Bitmap_WallSet_DoorFrameLeft_D1C
878 byte *_bitmapWallSetDoorFrameRightD1C; // @ G0710_puc_Bitmap_WallSet_DoorFrameRight_D1C
879 byte *_bitmapWallSetDoorFrameFront; // @ G0709_puc_Bitmap_WallSet_DoorFrameFront
880
881 byte *_bitmapWallD3LCRFlipped; // @ G0090_puc_Bitmap_WallD3LCR_Flipped;
882 byte *_bitmapWallD2LCRFlipped; // @ G0091_puc_Bitmap_WallD2LCR_Flipped;
883 byte *_bitmapWallD1LCRFlipped; // @ G0092_puc_Bitmap_WallD1LCR_Flipped;
884 byte *_bitmapWallD0LFlipped; // @ G0093_puc_Bitmap_WallD0L_Flipped;
885 byte *_bitmapWallD0RFlipped; // @ G0094_puc_Bitmap_WallD0R_Flipped;
886 byte *_bitmapWallD3LCRNative; // @ G0095_puc_Bitmap_WallD3LCR_Native;
887 byte *_bitmapWallD2LCRNative; // @ G0096_puc_Bitmap_WallD2LCR_Native;
888 byte *_bitmapWallD1LCRNative; // @ G0097_puc_Bitmap_WallD1LCR_Native;
889 byte *_bitmapWallD0LNative; // @ G0098_puc_Bitmap_WallD0L_Native;
890 byte *_bitmapWallD0RNative; // @ G0099_puc_Bitmap_WallD0R_Native;
891
892 int16 _currentWallSet; // @ G0231_i_CurrentWallSet
893 int16 _currentFloorSet;// @ G0230_i_CurrentFloorSet
894
895 bool _useFlippedWallAndFootprintsBitmap; // @ G0076_B_UseFlippedWallAndFootprintsBitmaps
896
897 byte _wallOrnamentCoordSets[8][13][6]; // @ G0205_aaauc_Graphic558_WallOrnamentCoordinateSets
898 uint16 _doorOrnCoordSets[4][3][6]; // @ G0207_aaauc_Graphic558_DoorOrnamentCoordinateSet
899 byte _doorButtonCoordSet[1]; // @ G0197_auc_Graphic558_DoorButtonCoordinateSet
900 uint16 _doorButtonCoordSets[1][4][6]; // @ G0208_aaauc_Graphic558_DoorButtonCoordinate
901
902 int16 _doorNativeBitmapIndexFrontD3LCR[2]; // @ G0693_ai_DoorNativeBitmapIndex_Front_D3LCR
903 int16 _doorNativeBitmapIndexFrontD2LCR[2]; // @ G0694_ai_DoorNativeBitmapIndex_Front_D2LCR
904 int16 _doorNativeBitmapIndexFrontD1LCR[2]; // @ G0695_ai_DoorNativeBitmapIndex_Front_D1LCR
905
906 uint16 *_paletteFadeFrom; // @ K0017_pui_Palette_FadeFrom
907 uint16 _paletteFadeTemporary[16]; // @ K0016_aui_Palette_FadeTemporary
908public:
909
910 uint16 _screenWidth;
911 uint16 _screenHeight;
912 byte *_bitmapScreen; // @ G0348_pl_Bitmap_Screen
913 byte *_bitmapViewport; // @ G0296_puc_Bitmap_Viewport
914
915 // some methods use this for a stratchpad, don't make assumptions about content between function calls
916 byte *_tmpBitmap; // @ G0074_puc_Bitmap_Temporary
917 bool _paletteSwitchingEnabled; // @ G0322_B_PaletteSwitchingEnabled
918 bool _refreshDungeonViewPaleteRequested; // @ G0342_B_RefreshDungeonViewPaletteRequested
919 int16 _dungeonViewPaletteIndex; // @ G0304_i_DungeonViewPaletteIndex
920 int16 _lastVgaViewportPaletteIndex = -1; // @ G2123_
921 int16 _creditsPaletteIndex = 6; // @ C06_CREDITS
922 int16 _entrancePaletteIndex = 7; // @ C07_ENTRANCE_DM
923 int16 _inventoryPaletteIndex = 8; // @ C08_INVENTORY
924 int16 _interfacePaletteIndex = 9; // @ C09_ICON
925 int16 _blackPaletteIndex = 10; // @ C10_ENTRANCE_BLACK
926 int16 _bluePaletteIndex = 11; // @ C11_BLUE
927 int16 _titlePresentsPaletteIndex = 12; // @ C12_PRESENTS
928 int16 _titleDungeonPaletteIndex = 13; // @ C13_DUNGEON
929 int16 _titleMasterPaletteIndex = 14; // @ C14_MASTER
930 uint16 _blankBuffer[32]; // @G0345_aui_BlankBuffer
931 byte _vgaPalette[32 * 3]; // @ G8183_aac_FullPalette
932 uint16 _paletteTopAndBottomScreen[16]; // @ G0347_aui_Palette_TopAndBottomScreen
933 uint16 _paletteMiddleScreen[16]; // @ G0346_aui_Palette_MiddleScreen
934
935 explicit DisplayMan(DMEngine *dmEngine);
936 ~DisplayMan();
937
938 void loadWallSet(WallSet set); // @ F0095_DUNGEONVIEW_LoadWallSet
939 void loadFloorSet(FloorSet set); // @ F0094_DUNGEONVIEW_LoadFloorSet
940
941 void loadIntoBitmap(uint16 index, byte *destBitmap); // @ F0466_EXPAND_GraphicToBitmap
942 void setUpScreens(uint16 width, uint16 height);
943 void loadGraphics(); // @ F0479_MEMORY_ReadGraphicsDatHeader
944 void initializeGraphicData(); // @ F0460_START_InitializeGraphicData
945 void loadCurrentMapGraphics(); // @ F0096_DUNGEONVIEW_LoadCurrentMapGraphics_CPSDF
946 void allocateFlippedWallBitmaps(); // @ F0461_START_AllocateFlippedWallBitmaps
947 void drawDoorBitmap(Frame *frame);// @ F0102_DUNGEONVIEW_DrawDoorBitmap
948 void drawDoorFrameBitmapFlippedHorizontally(byte *bitmap, Frame *frame); // @ F0103_DUNGEONVIEW_DrawDoorFrameBitmapFlippedHorizontally
949 void drawDoorButton(int16 doorButtonOrdinal, DoorButton doorButton); // @ F0110_DUNGEONVIEW_DrawDoorButton
950
952 uint16 getPixelWidth(uint16 index);
954 uint16 getPixelHeight(uint16 index);
956 bool getBitmapDimensions(const byte *bitmap, uint16 &width, uint16 &height);
957
958 uint16 getGraphicIndex(uint16 index) const;
959
960 void copyBitmapAndFlipHorizontal(byte *srcBitmap, byte *destBitmap, uint16 byteWidth, uint16 height); // @ F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal
961 void drawFloorOrnament(uint16 floorOrnOrdinal, ViewFloor viewFloorIndex); // @ F0108_DUNGEONVIEW_DrawFloorOrnament
962 void drawDoor(uint16 doorThingIndex, DoorState doorState, int16 *doorNativeBitmapIndices, int16 byteCount,
963 DoorOrnament doorOrnament, DoorFrames *doorFrames, int16 zoneIndexDOS = -1);
964 void drawDoorOrnament(int16 doorOrnOdinal, DoorOrnament doorOrnament); // @ F0109_DUNGEONVIEW_DrawDoorOrnament
965 void drawCeilingPit(int16 nativeBitmapIndex, Frame *frame, int16 mapX, int16 mapY, bool flipHorizontal, int16 zoneIndexDOS = -1); // @ F0112_DUNGEONVIEW_DrawCeilingPit
966
967 void blitToViewport(byte *bitmap, Box &box, int16 byteWidth, Color transparent, int16 height); // @ F0020_MAIN_BlitToViewport
968 void blitToViewport(byte *bitmap, int16 *box, int16 byteWidth, Color transparent, int16 height); // @ F0020_MAIN_BlitToViewport
969 void blitToScreen(byte *bitmap, const Box *box, int16 byteWidth, Color transparent, int16 height); // @ F0021_MAIN_BlitToScreen
970
971
972 /* srcHeight and destHeight are not necessary for blitting, only error checking, thus they are defaulted for existing code which
973 does not pass anything, newly imported calls do pass srcHeght and srcWidth, so this is a convenience change so the parameters
974 match the original exactly, if need arises for heights then we'll have to retrospectively add them in old function calls*/
975 /* Expects inclusive boundaries in box */
976 void blitToBitmap(byte *srcBitmap, byte *destBitmap, const Box &box, uint16 srcX, uint16 srcY, uint16 srcByteWidth,
977 uint16 destByteWidth, Color transparent, int16 srcHeight, int16 destHight); // @ F0132_VIDEO_Blit
978 /* Expects inclusive boundaries in box */
979 void blitBoxFilledWithMaskedBitmap(byte *src, byte *dest, byte *mask, byte *tmp, Box &box, int16 lastUnitIndex,
980 int16 firstUnitIndex, int16 destByteWidth, int16 transparent,
981 int16 xPos, int16 yPos, int16 destHeight, int16 height2); // @ F0133_VIDEO_BlitBoxFilledWithMaskedBitmap
982 // this function takes pixel widths
983 void blitToBitmapShrinkWithPalChange(byte *srcBitmap, byte *destBitmap,
984 int16 srcPixelWidth, int16 srcHight, int16 destPixelWidth, int16 destHeight, byte *palChange); // @ F0129_VIDEO_BlitShrinkWithPaletteChanges
985 void flipBitmapHorizontal(byte *bitmap, uint16 byteWidth, uint16 height); // @ F0130_VIDEO_FlipHorizontal
986 void flipBitmapVertical(byte *bitmap, uint16 byteWidth, uint16 height);
987 byte *getExplosionBitmap(uint16 explosionAspIndex, uint16 scale, int16 &returnByteWidth, int16 &returnHeight); // @ F0114_DUNGEONVIEW_GetExplosionBitmap
988
989 void fillBitmap(byte *bitmap, Color color, uint16 byteWidth, uint16 height); // @ F0134_VIDEO_FillBitmap
990 void fillScreen(Color color);
991 /* Expects inclusive boundaries in box */
992 void fillScreenBox(Box &box, Color color); // @ D24_FillScreenBox, F0550_VIDEO_FillScreenBox
993 /* Expects inclusive boundaries in box */
994 void fillBoxBitmap(byte *destBitmap, Box &box, Color color, int16 byteWidth, int16 height); // @ F0135_VIDEO_FillBox
995 void drawDungeon(Direction dir, int16 posX, int16 posY); // @ F0128_DUNGEONVIEW_Draw_CPSF
996 void drawFloorAndCeiling(); // @ F0098_DUNGEONVIEW_DrawFloorAndCeiling
997 void updateScreen();
998 void drawViewport(int16 palSwitchingRequestedState); // @ F0097_DUNGEONVIEW_DrawViewport
999
1000 byte *getNativeBitmapOrGraphic(uint16 index); // @ F0489_MEMORY_GetNativeBitmapOrGraphic
1001 Common::MemoryReadStream getCompressedData(uint16 index);
1002 uint32 getCompressedDataSize(uint16 index);
1003 void drawField(FieldAspect *fieldAspect, Box &box); // @ F0113_DUNGEONVIEW_DrawField
1004
1005 int16 getScaledBitmapByteCount(int16 byteWidth, int16 height, int16 scale); // @ F0459_START_GetScaledBitmapByteCount
1006 int16 getScaledDimension(int16 dimension, int16 scale); // @ M78_SCALED_DIMENSION
1007 void drawObjectsCreaturesProjectilesExplosions(Thing thingParam, Direction directionParam,
1008 int16 mapXpos, int16 mapYpos, int16 viewSquareIndex,
1009 CellOrder orderedViewCellOrdinals); // @ F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF
1010 uint16 getNormalizedByteWidth(uint16 byteWidth); // @ M77_NORMALIZED_BYTE_WIDTH
1011 uint16 getVerticalOffsetM23(uint16 val); // @ M23_VERTICAL_OFFSET
1012 uint16 getHorizontalOffsetM22(uint16 val); // @ M22_HORIZONTAL_OFFSET
1013
1014 int16 _championPortraitOrdinal; // @ G0289_i_DungeonView_ChampionPortraitOrdinal
1015 int16 _currMapAlcoveOrnIndices[k3_AlcoveOrnCount]; // @ G0267_ai_CurrentMapAlcoveOrnamentIndices
1016 int16 _currMapFountainOrnIndices[k1_FountainOrnCount]; // @ G0268_ai_CurrentMapFountainOrnamentIndices
1017 OrnamentInfo _currMapWallOrnInfo[16]; // @ G0101_aai_CurrentMapWallOrnamentsInfo
1018 OrnamentInfo _currMapFloorOrnInfo[16]; // @ G0102_aai_CurrentMapFloorOrnamentsInfo
1019 OrnamentInfo _currMapDoorOrnInfo[17]; // @ G0103_aai_CurrentMapDoorOrnamentsInfo
1020 byte *_currMapAllowedCreatureTypes; // @ G0264_puc_CurrentMapAllowedCreatureTypes
1021 byte _currMapWallOrnIndices[16]; // @ G0261_auc_CurrentMapWallOrnamentIndices
1022 byte _currMapFloorOrnIndices[16]; // @ G0262_auc_CurrentMapFloorOrnamentIndices
1023 byte _currMapDoorOrnIndices[18]; // @ G0263_auc_CurrentMapDoorOrnamentIndices
1024
1025 int16 _currMapViAltarIndex; // @ G0266_i_CurrentMapViAltarWallOrnamentIndex
1026
1027 Thing _inscriptionThing; // @ G0290_T_DungeonView_InscriptionThing
1028
1029 bool _drawFloorAndCeilingRequested; // @ G0297_B_DrawFloorAndCeilingRequested
1030
1031 // This tells blitting functions whether to assume a BYTE_BOX or a WORD_BOX has been passed to them,
1032 // I only use WORD_BOX, so this will probably deem useless
1033 bool _useByteBoxCoordinates; // @ G0578_B_UseByteBoxCoordinates
1034 bool _doNotDrawFluxcagesDuringEndgame; // @ G0077_B_DoNotDrawFluxcagesDuringEndgame
1035
1036 Frame _doorFrameLeftD1C; // @ G0170_s_Graphic558_Frame_DoorFrameLeft_D1C
1037 Frame _doorFrameRightD1C; // @ G0171_s_Graphic558_Frame_DoorFrameRight_D1C
1038 FieldAspect _fieldAspects188[12];
1039 Box _boxMovementArrows;
1040 byte _palChangeSmoke[16];
1041 byte _projectileScales[7];
1042 ExplosionAspect _explosionAspects[k4_ExplosionAspectCount];
1043 Frame _frameWallD3R2;
1044 Frame _frameWalls163[12];
1045 CreatureAspect _creatureAspects219[k27_CreatureTypeCount];
1046 ObjectAspect _objectAspects209[k85_ObjAspectCount]; // @ G0209_as_Graphic558_ObjectAspects
1047 ProjectileAspect _projectileAspect[k14_ProjectileAspectCount]; // @ G0210_as_Graphic558_ProjectileAspects
1048 uint16 _palCredits[16]; // @ G0019_aui_Graphic562_Palette_Credits
1049 uint16 _palDungeonView[6][16]; // @ G0021_aaui_Graphic562_Palette_DungeonView
1050 byte _palChangesCreatureD3[16]; // @ G0221_auc_Graphic558_PaletteChanges_Creature_D3
1051 byte _palChangesCreatureD2[16]; // @ G0222_auc_Graphic558_PaletteChanges_Creature_D2
1052 byte _palChangesNoChanges[16]; // @ G0017_auc_Graphic562_PaletteChanges_NoChanges
1053 byte _palChangesFloorOrnD3[16]; // @ G0213_auc_Graphic558_PaletteChanges_FloorOrnament_D3
1054 byte _palChangesFloorOrnD2[16]; // @ G0214_auc_Graphic558_PaletteChanges_FloorOrnament_D2
1055
1056 bool isDerivedBitmapInCache(int16 derivedBitmapIndex); // @ F0491_CACHE_IsDerivedBitmapInCache
1057 byte *getDerivedBitmap(int16 derivedBitmapIndex); // @ F0492_CACHE_GetDerivedBitmap
1058 void addDerivedBitmap(int16 derivedBitmapIndex); // @ F0493_CACHE_AddDerivedBitmap
1059 void releaseBlock(uint16 index); // @ F0480_CACHE_ReleaseBlock
1060 uint16 getDarkenedColor(uint16 RGBcolor);
1061 void startEndFadeToPalette(uint16 *P0849_pui_Palette); // @ F0436_STARTEND_FadeToPalette
1062 void buildPaletteChangeCopperList(uint16 *middleScreen, uint16 *topAndBottom); // @ F0508_AMIGA_BuildPaletteChangeCopperList
1063 void setMultipleColorsInPalette(int16 paletteIndex); // @ F8157_VIDRV_08_SetMultipleColorsInPalette
1064 void shadeScreenBox(Box *box, Color color); // @ F0136_VIDEO_ShadeScreenBox
1065
1066private:
1067 void initConstants();
1068 uint16 getBitmapByteCount(uint16 pixelWidth, uint16 height); // @ M75_BITMAP_BYTE_COUNT
1069};
1070
1071}
1072
1073#endif
Definition: memstream.h:43
Definition: gfx.h:557
Definition: gfx.h:613
Definition: gfx.h:675
Definition: dm.h:169
Definition: gfx.h:758
uint16 getPixelWidth(uint16 index)
Gives the width of an IMG0 type item.
uint16 getPixelHeight(uint16 index)
Gives the height of an IMG1 type item.
bool getBitmapDimensions(const byte *bitmap, uint16 &width, uint16 &height)
Looks up actual decompressed dimensions of a display bitmap buffer.
Definition: gfx.h:727
Definition: gfx.h:547
Definition: gfx.h:599
Definition: gfx.h:582
Definition: gfx.h:644
Definition: gfx.h:659
Definition: text.h:42
Definition: dm.h:135
T y
Definition: rect.h:49
T x
Definition: rect.h:48
Definition: rect.h:144
T right
Definition: rect.h:171
T left
Definition: rect.h:170
Definition: rect.h:536
Definition: gfx.h:753
Definition: gfx.h:67
Definition: gfx.h:60
Definition: gfx.h:693
Definition: gfx.h:87
Definition: gfx.h:74