30 #include "common/scummsys.h" 31 #include "common/rect.h" 32 #include "common/memstream.h" 33 #include "common/array.h" 53 kDMDoorStateOneFourth = 1,
55 kDMDoorStateThreeFourth = 3,
56 kDMDoorStateClosed = 4,
57 kDMDoorStateDestroyed = 5
61 kDMDoorOrnamentD3LCR = 0,
62 kDMDoorOrnamentD2LCR = 1,
63 kDMDoorOrnamentD1LCR = 2
75 kDMViewLaneCenter = 0,
81 enum ExplosionAspectEnum {
82 kDMExplosionAspectFire = 0,
83 kDMExplosionAspectSpell = 1,
84 kDMExplosionAspectPoison = 2,
85 kDMExplosionAspectSmoke = 3
97 kDMViewWallD3LRight = 0,
98 kDMViewWallD3RLeft = 1,
99 kDMViewWallD3LFront = 2,
100 kDMViewWallD3CFront = 3,
101 kDMViewWallD3RFront = 4,
102 kDMViewWallD2LRight = 5,
103 kDMViewWallD2RLeft = 6,
104 kDMViewWallD2LFront = 7,
105 kDMViewWallD2CFront = 8,
106 kDMViewWallD2RFront = 9,
107 kDMViewWallD1LRight = 10,
108 kDMViewWallD1RLeft = 11,
109 kDMViewWallD1CFront = 12
113 kDMCellOrderNone = 0xFFFF,
114 kDMCellOrderAlcove = 0x0000,
115 kDMCellOrderBackLeft = 0x0001,
116 kDMCellOrderBackRight = 0x0002,
117 kDMCellOrderDoorPass1BackLeft = 0x0018,
118 kDMCellOrderBackLeftBackRight = 0x0021,
119 kDMCellOrderDoorPass1BackRight = 0x0028,
120 kDMCellOrderBackRightFrontRight = 0x0032,
121 kDMCellOrderDoorPass2FrontRight = 0x0039,
122 kDMCellOrderBackLeftFrontLeft = 0x0041,
123 kDMCellOrderDoorPass2FrontLeft = 0x0049,
124 kDMCellOrderDoorPass1BackRightBackLeft = 0x0128,
125 kDMCellOrderDoorPass1BackLeftBackRight = 0x0218,
126 kDMCellOrderBackLeftBackRightFrontRight = 0x0321,
127 kDMCellOrderBackRightFrontLeftFrontRight = 0x0342,
128 kDMCellOrderDoorPass2FrontLeftFrontRight = 0x0349,
129 kDMCellOrderBackRightBackLeftFrontLeft = 0x0412,
130 kDMCellOrderBackLeftFrontRightFrontLeft = 0x0431,
131 kDMCellOrderDoorPass2FrontRightFrontLeft = 0x0439,
132 kDMCellOrderBackLeftBackRightFrontLeftFrontRight = 0x3421,
133 kDMCellOrderBackRightBackLeftFrontRightFrontLeft = 0x4312
137 kDMDerivedBitmapViewport = 0,
138 kDMDerivedBitmapThievesEyeVisibleArea = 1,
139 kDMDerivedBitmapDamageToCreatureMedium = 2,
140 kDMDerivedBitmapDamageToCreatureSmall = 3,
141 kDMDerivedBitmapFirstWallOrnament = 4,
142 kDMDerivedBitmapFirstDoorOrnamentD3 = 68,
143 kDMDerivedBitmapFirstDoorOrnamentD2 = 69,
144 kDMDerivedBitmapFirstDoorButton = 102,
145 kDMDerivedBitmapFirstObject = 104,
146 kDMDerivedBitmapFirstProjectile = 282,
147 kDMDerivedBitmapFirstExplosion = 438,
148 kDMDerivedBitmapFirstCreature = 495
152 kDMViewSquareD4C = -3,
154 kDMViewSquareD4R = -1,
155 kDMViewSquareD3C = 0,
156 kDMViewSquareD3L = 1,
157 kDMViewSquareD3R = 2,
158 kDMViewSquareD2C = 3,
159 kDMViewSquareD2L = 4,
160 kDMViewSquareD2R = 5,
161 kDMViewSquareD1C = 6,
162 kDMViewSquareD1L = 7,
163 kDMViewSquareD1R = 8,
164 kDMViewSquareD0C = 9,
165 kDMViewSquareD0L = 10,
166 kDMViewSquareD0R = 11,
167 kDMViewSquareD3CExplosion = 3,
168 kDMViewSquareD3LExplosion = 4,
169 kDMViewSquareD1CExplosion = 9,
170 kDMViewSquareD0CExplosion = 12
174 kDMViewCellFronLeft = 0,
175 kDMViewCellFrontRight = 1,
176 kDMViewCellBackRight = 2,
177 kDMViewCellBackLeft = 3,
178 kDMViewCellAlcove = 4,
179 kDMViewCellDoorButtonOrWallOrn = 5
183 kDMColorNoTransparency = -1,
185 kDMColorDarkGary = 1,
186 kDMColorLightGray = 2,
187 kDMColorDarkBrown = 3,
189 kDMColorLightBrown = 5,
190 kDMColorDarkGreen = 6,
191 kDMColorLightGreen = 7,
196 kDMColorDarkestGray = 12,
197 kDMColorLightestGray = 13,
203 kDMGraphicIdxDialogBox = 0,
204 kDMGraphicIdxTitle = 1,
205 kDMGraphicIdxEntranceLeftDoor = 2,
206 kDMGraphicIdxEntranceRightDoor = 3,
207 kDMGraphicIdxEntrance = 4,
208 kDMGraphicIdxCredits = 5,
209 kDMGraphicIdxTheEnd = 6,
210 kDMGraphicIdxStatusBoxDeadChampion = 8,
211 kDMGraphicIdxMenuSpellAreaBackground = 9,
212 kDMGraphicIdxMenuActionArea = 10,
213 kDMGraphicIdxMenuSpellAreLines = 11,
214 kDMGraphicIdxMovementArrows = 13,
215 kDMGraphicIdxDamageToCreature = 14,
216 kDMGraphicIdxDamageToChampionSmall = 15,
217 kDMGraphicIdxDamageToChampionBig = 16,
218 kDMGraphicIdxInventory = 17,
219 kDMGraphicIdxArrowForChestContent = 18,
220 kDMGraphicIdxEyeForObjectDescription = 19,
221 kDMGraphicIdxPanelEmpty = 20,
222 kDMGraphicIdxPanelOpenScroll = 23,
223 kDMGraphicIdxPanelOpenChest = 25,
224 kDMGraphicIdxChampionPortraits = 26,
225 kDMGraphicIdxPanelRenameChampion = 27,
226 kDMGraphicIdxChampionIcons = 28,
227 kDMGraphicIdxObjectDescCircle = 29,
228 kDMGraphicIdxFoodLabel = 30,
229 kDMGraphicIdxWaterLabel = 31,
230 kDMGraphicIdxPoisionedLabel = 32,
231 kDMGraphicIdxSlotBoxNormal = 33,
232 kDMGraphicIdxSlotBoxWounded = 34,
233 kDMGraphicIdxSlotBoxActingHand = 35,
234 kDMGraphicIdxBorderPartyShield = 37,
235 kDMGraphicIdxBorderPartyFireshield = 38,
236 kDMGraphicIdxBorderPartySpellshield = 39,
237 kDMGraphicIdxPanelResurectReincarnate = 40,
238 kDMGraphicIdxHoleInWall = 41,
239 kDMGraphicIdxObjectIcons000To031 = 42,
240 kDMGraphicIdxObjectIcons032To063 = 43,
241 kDMGraphicIdxObjectIcons064To095 = 44,
242 kDMGraphicIdxObjectIcons096To127 = 45,
243 kDMGraphicIdxObjectIcons128To159 = 46,
244 kDMGraphicIdxObjectIcons160To191 = 47,
245 kDMGraphicIdxObjectIcons192To223 = 48,
246 kDMGraphicIdxFloorPitD3L = 49,
247 kDMGraphicIdxFloorPitD3C = 50,
248 kDMGraphicIdxFloorPitD2L = 51,
249 kDMGraphicIdxFloorPitD2C = 52,
250 kDMGraphicIdxFloorPitD1L = 53,
251 kDMGraphicIdxFloorPitD1C = 54,
252 kDMGraphicIdxFloorPitD0L = 55,
253 kDMGraphicIdxFloorPitD0C = 56,
254 kDMGraphicIdxFloorPitInvisibleD2L = 57,
255 kDMGraphicIdxFloorPitInvisibleD2C = 58,
256 kDMGraphicIdxFloorPitInvisibleD1L = 59,
257 kDMGraphicIdxFloorPitInvisibleD1C = 60,
258 kDMGraphicIdxFloorPitInvisibleD0L = 61,
259 kDMGraphicIdxFloorPitInvisibleD0C = 62,
260 kDMGraphicIdxCeilingPitD2L = 63,
261 kDMGraphicIdxCeilingPitD2C = 64,
262 kDMGraphicIdxCeilingPitD1L = 65,
263 kDMGraphicIdxCeilingPitD1C = 66,
264 kDMGraphicIdxCeilingPitD0L = 67,
265 kDMGraphicIdxCeilingPitD0C = 68,
266 kDMGraphicIdxFieldMaskD3R = 69,
267 kDMGraphicIdxFieldTeleporter = 73,
268 kDMGraphicIdxInscriptionFont = 120,
269 kDMGraphicIdxWallOrnChampMirror = 208,
270 kDMGraphicIdxFloorOrnD3LFootprints = 241,
271 kDMGraphicIdxDoorMaskDestroyed = 301,
272 kDMGraphicIdxFirstDoorButton = 315,
273 kDMGraphicIdxFirstProjectile = 316,
274 kDMGraphicIdxFirstExplosion = 348,
275 kDMGraphicIdxFirstExplosionPattern = 351,
276 kDMGraphicIdxFirstObject = 360,
277 kDMGraphicIdxFirstCreature = 446,
278 kDMGraphicIdxFont = 557
281 #define kDMMaskDoorInfoCreaturesCanSeeThrough 0x0001 // @ MASK0x0001_CREATURES_CAN_SEE_THROUGH 282 #define kDMMaskDoorInfoProjectilesCanPassThrough 0x0002 // @ MASK0x0002_PROJECTILES_CAN_PASS_THROUGH 283 #define kDMMaskDoorInfoAnimated 0x0004 // @ MASK0x0004_ANIMATED 284 #define kDMMaskDoorFront 0x0008 // @ MASK0x0008_DOOR_FRONT 287 #define kMaskFieldAspectFlipMask 0x0080 // @ MASK0x0080_FLIP_MASK 288 #define kMaskFieldAspectIndex 0x007F // @ MASK0x007F_MASK_INDEX 289 #define kMaskFieldAspectNoMask 255 // @ C255_NO_MASK 291 #define kDMCreatureMaskAdditional 0x0003 // @ MASK0x0003_ADDITIONAL 292 #define kDMCreatureMaskFlipNonAttack 0x0004 // @ MASK0x0004_FLIP_NON_ATTACK 293 #define kDMCreatureMaskSide 0x0008 // @ MASK0x0008_SIDE 294 #define kDMCreatureMaskBack 0x0010 // @ MASK0x0010_BACK 295 #define kDMCreatureMaskAttack 0x0020 // @ MASK0x0020_ATTACK 296 #define kDMCreatureMaskSpecialD2Front 0x0080 // @ MASK0x0080_SPECIAL_D2_FRONT 297 #define kDMCreatureMaskSpecialD2FrontIsFlipped 0x0100 // @ MASK0x0100_SPECIAL_D2_FRONT_IS_FLIPPED_FRONT 298 #define kDMCreatureMaskFlipAttack 0x0200 // @ MASK0x0200_FLIP_ATTACK 299 #define kDMCreatureMaskFlipDuringAttack 0x0400 // @ MASK0x0400_FLIP_DURING_ATTACK 301 #define k2_FloorSetGraphicCount 2 // @ C002_FLOOR_SET_GRAPHIC_COUNT 302 #define k13_WallSetGraphicCount 13 // @ C013_WALL_SET_GRAPHIC_COUNT 303 #define k18_StairsGraphicCount 18 // @ C018_STAIRS_GRAPHIC_COUNT 304 #define k3_DoorSetGraphicsCount 3 // @ C003_DOOR_SET_GRAPHIC_COUNT 305 #define k1_DoorButtonCount 1 // @ C001_DOOR_BUTTON_COUNT 306 #define k3_AlcoveOrnCount 3 // @ C003_ALCOVE_ORNAMENT_COUNT 307 #define k1_FountainOrnCount 1 // @ C001_FOUNTAIN_ORNAMENT_COUNT 308 #define k27_CreatureTypeCount 27 // @ C027_CREATURE_TYPE_COUNT 309 #define k4_ExplosionAspectCount 4 // @ C004_EXPLOSION_ASPECT_COUNT 310 #define k14_ProjectileAspectCount 14 // @ C014_PROJECTILE_ASPECT_COUNT 311 #define k85_ObjAspectCount 85 // @ C085_OBJECT_ASPECT_COUNT 313 #define k0_HalfSizedViewCell_LeftColumn 0 // @ C00_VIEW_CELL_LEFT_COLUMN 314 #define k1_HalfSizedViewCell_RightColumn 1 // @ C01_VIEW_CELL_RIGHT_COLUMN 315 #define k2_HalfSizedViewCell_BackRow 2 // @ C02_VIEW_CELL_BACK_ROW 316 #define k3_HalfSizedViewCell_CenterColumn 3 // @ C03_VIEW_CELL_CENTER_COLUMN 317 #define k4_HalfSizedViewCell_FrontRow 4 // @ C04_VIEW_CELL_FRONT_ROW 320 #define k0_ShiftSet_D0BackD1Front 0 // @ C0_SHIFT_SET_D0_BACK_OR_D1_FRONT 321 #define k1_ShiftSet_D1BackD2Front 1 // @ C1_SHIFT_SET_D1_BACK_OR_D2_FRONT 322 #define k2_ShiftSet_D2BackD3Front 2 // @ C2_SHIFT_SET_D2_BACK_OR_D3_FRONT 324 #define k75_FirstFloorSet 75 // @ C075_GRAPHIC_FIRST_FLOOR_SET 325 #define k77_FirstWallSet 77 // @ C077_GRAPHIC_FIRST_WALL_SET 326 #define k90_FirstStairs 90 // @ C090_GRAPHIC_FIRST_STAIRS 327 #define k108_FirstDoorSet 108 // @ C108_GRAPHIC_FIRST_DOOR_SET 328 #define k120_InscriptionFont 120 // @ C120_GRAPHIC_INSCRIPTION_FONT 329 #define k121_FirstWallOrn 121 // @ C121_GRAPHIC_FIRST_WALL_ORNAMENT 330 #define k247_FirstFloorOrn 247 // @ C247_GRAPHIC_FIRST_FLOOR_ORNAMENT 331 #define k303_FirstDoorOrn 303 // @ C303_GRAPHIC_FIRST_DOOR_ORNAMENT 332 #define k730_DerivedBitmapMaximumCount 730 // @ C730_DERIVED_BITMAP_MAXIMUM_COUNT 334 #define k16_Scale_D3 16 // @ C16_SCALE_D3 335 #define k20_Scale_D2 20 // @ C20_SCALE_D2 338 #define k0x0001_ObjectFlipOnRightMask 0x0001 // @ MASK0x0001_FLIP_ON_RIGHT 339 #define k0x0010_ObjectAlcoveMask 0x0010 // @ MASK0x0010_ALCOVE 342 #define k0x0010_ProjectileSideMask 0x0010 // @ MASK0x0010_SIDE 343 #define k0x0100_ProjectileScaleWithKineticEnergyMask 0x0100 // @ MASK0x0100_SCALE_WITH_KINETIC_ENERGY 344 #define k0x0003_ProjectileAspectTypeMask 0x0003 // @ MASK0x0003_ASPECT_TYPE 347 #define k0_ProjectileAspectHasBackGraphicRotation 0 // @ C0_PROJECTILE_ASPECT_TYPE_HAS_BACK_GRAPHIC_AND_ROTATION 348 #define k1_ProjectileAspectBackGraphic 1 // @ C1_PROJECTILE_ASPECT_TYPE_HAS_BACK_GRAPHIC_AND_NO_ROTATION 349 #define k2_ProjectileAspectHasRotation 2 // @ C2_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_ROTATION 350 #define k3_ProjectileAspectHasNone 3 // @ C3_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_NO_ROTATION 353 #define k3_ProjectileAspectExplosionLightningBolt 3 // @ C03_PROJECTILE_ASPECT_EXPLOSION_LIGHTNING_BOLT 354 #define k10_ProjectileAspectExplosionFireBall 10 // @ C10_PROJECTILE_ASPECT_EXPLOSION_FIREBALL 355 #define k11_ProjectileAspectExplosionDefault 11 // @ C11_PROJECTILE_ASPECT_EXPLOSION_DEFAULT 356 #define k12_ProjectileAspectExplosionSlime 12 // @ C12_PROJECTILE_ASPECT_EXPLOSION_SLIME 357 #define k13_ProjectileAspectExplosionPoisonBoltCloud 13 // @ C13_PROJECTILE_ASPECT_EXPLOSION_POISON_BOLT_POISON_CLOUD 359 #define k0x0080_BlitDoNotUseMask 0x0080 // @ MASK0x0080_DO_NOT_USE_MASK 360 #define kScaleThreshold 32768 367 ExplosionAspect(uint16 byteWidth, uint16 height) :_byteWidth(byteWidth), _height(height) {}
376 Box(int16 x1, int16 x2, int16 y1, int16 y2) {
385 return (_rect.
left <= point.
x) && (point.
x <= _rect.
right) && (_rect.top <= point.
y) && (point.
y <= _rect.bottom);
388 bool isPointInside(int16 x, int16 y) {
395 extern Box g2_BoxMovementArrows;
400 uint16 _srcByteWidth, _srcHeight;
404 _srcByteWidth = _srcHeight = 0;
408 Frame(uint16 destFromX, uint16 destToX, uint16 destFromY, uint16 destToY,
409 uint16 srcWidth, uint16 srcHeight, uint16 srcX, uint16 srcY) :
410 _box(destFromX, destToX, destFromY, destToY),
411 _srcByteWidth(srcWidth), _srcHeight(srcHeight), _srcX(srcX), _srcY(srcY) {}
416 uint16 _nativeBitmapRelativeIndex;
417 uint16 _baseStartUnitIndex;
418 uint16 _transparentColor;
423 uint16 _bitplaneWordCount;
424 FieldAspect(uint16 native, uint16 base, uint16 transparent, byte mask, uint16 byteWidth, uint16 height, uint16 xPos, uint16 bitplane);
430 uint16 _firstNativeBitmapRelativeIndex;
431 uint16 _firstDerivedBitmapIndex;
432 byte _byteWidthFront;
436 byte _byteWidthAttack;
439 byte _coordinateSet_TransparentColor;
440 byte _replacementColorSetIndices;
443 CreatureAspect(uint16 uint161, uint16 uint162, byte byte0, byte byte1, byte byte2, byte byte3, byte byte4, byte byte5, byte byte6, byte byte7)
444 : _firstNativeBitmapRelativeIndex(uint161), _firstDerivedBitmapIndex(uint162), _byteWidthFront(byte0),
445 _heightFront(byte1), _byteWidthSide(byte2), _heightSide(byte3), _byteWidthAttack(byte4),
446 _heightAttack(byte5), _coordinateSet_TransparentColor(byte6), _replacementColorSetIndices(byte7) {}
449 _firstNativeBitmapRelativeIndex(0), _firstDerivedBitmapIndex(0), _byteWidthFront(0),
450 _heightFront(0), _byteWidthSide(0), _heightSide(0), _byteWidthAttack(0),
451 _heightAttack(0), _coordinateSet_TransparentColor(0), _replacementColorSetIndices(0) {}
453 byte getCoordSet() {
return (_coordinateSet_TransparentColor >> 4) & 0xF; }
454 byte getTranspColour() {
return _coordinateSet_TransparentColor & 0xF; }
455 byte getReplColour10() {
return (_replacementColorSetIndices >> 4) & 0xF; }
456 byte getReplColour9() {
return _replacementColorSetIndices & 0xF; }
461 byte _firstNativeBitmapRelativeIndex;
462 byte _firstDerivedBitmapRelativeIndex;
467 ObjectAspect(byte firstN, byte firstD, byte byteWidth, byte h, byte grap, byte coord) :
468 _firstNativeBitmapRelativeIndex(firstN), _firstDerivedBitmapRelativeIndex(firstD),
469 _byteWidth(byteWidth), _height(h), _graphicInfo(grap), _coordinateSet(coord) {}
470 ObjectAspect() : _firstNativeBitmapRelativeIndex(0), _firstDerivedBitmapRelativeIndex(0),
471 _byteWidth(0), _height(0), _graphicInfo(0), _coordinateSet(0) {}
476 byte _firstNativeBitmapRelativeIndex;
477 byte _firstDerivedBitmapRelativeIndex;
482 ProjectileAspect(byte firstN, byte firstD, byte byteWidth, byte h, uint16 grap) :
483 _firstNativeBitmapRelativeIndex(firstN), _firstDerivedBitmapRelativeIndex(firstD),
484 _byteWidth(byteWidth), _height(h), _graphicInfo(grap) {}
487 _firstDerivedBitmapRelativeIndex(0), _byteWidth(0), _height(0), _graphicInfo(0) {}
493 byte _d2ReplacementColor;
494 byte _d3ReplacementColor;
496 CreatureReplColorSet(uint16 col1, uint16 col2, uint16 col3, uint16 col4, uint16 col5, uint16 col6, byte d2Rep, byte d3Rep) {
503 _d2ReplacementColor = d2Rep;
504 _d3ReplacementColor = d3Rep;
513 #define k0_DoorButton 0 // @ C0_DOOR_BUTTON 514 #define k0_WallOrnInscription 0 // @ C0_WALL_ORNAMENT_INSCRIPTION 515 #define k15_FloorOrnFootprints 15 // @ C15_FLOOR_ORNAMENT_FOOTPRINTS 516 #define k15_DoorOrnDestroyedMask 15 // @ C15_DOOR_ORNAMENT_DESTROYED_MASK 517 #define k16_DoorOrnThivesEyeMask 16 // @ C16_DOOR_ORNAMENT_THIEVES_EYE_MASK 519 #define k0_viewportNotDungeonView 0 // @ C0_VIEWPORT_NOT_DUNGEON_VIEW 520 #define k1_viewportDungeonView 1 // @ C1_VIEWPORT_DUNGEON_VIEW 521 #define k2_viewportAsBeforeSleepOrFreezeGame 2 // @ C2_VIEWPORT_AS_BEFORE_SLEEP_OR_FREEZE_GAME 524 #define k112_byteWidthViewport 112 // @ C112_BYTE_WIDTH_VIEWPORT 525 #define k136_heightViewport 136 // @ C136_HEIGHT_VIEWPORT 527 #define k160_byteWidthScreen 160 // @ C160_BYTE_WIDTH_SCREEN 528 #define k200_heightScreen 200 // @ C200_HEIGHT_SCREEN 530 #define k8_byteWidth 8 // @ C008_BYTE_WIDTH 531 #define k16_byteWidth 16 // @ C016_BYTE_WIDTH 532 #define k24_byteWidth 24 // @ C024_BYTE_WIDTH 533 #define k32_byteWidth 32 // @ C032_BYTE_WIDTH 534 #define k40_byteWidth 40 // @ C040_BYTE_WIDTH 535 #define k48_byteWidth 48 // @ C048_BYTE_WIDTH 536 #define k64_byteWidth 64 // @ C064_BYTE_WIDTH 537 #define k72_byteWidth 72 // @ C072_BYTE_WIDTH 538 #define k128_byteWidth 128 // @ C128_BYTE_WIDTH 539 #define k144_byteWidth 144 // @ C144_BYTE_WIDTH 544 Frame _closedOrDestroyed;
546 Frame _leftHorizontal[3];
547 Frame _rightHorizontal[3];
553 #define D00_RGB_BLACK 0x0000 554 #define D01_RGB_DARK_BLUE 0x0004 555 #define D02_RGB_LIGHT_BROWN 0x0842 556 #define D03_RGB_PINK 0x086F 557 #define D04_RGB_LIGHTER_BROWN 0x0A62 558 #define D05_RGB_DARK_GOLD 0x0A82 559 #define D06_RGB_GOLD 0x0CA2 560 #define D07_RGB_RED 0x0F00 561 #define D08_RGB_YELLOW 0x0FF4 562 #define D09_RGB_WHITE 0x0FFF 563 #define D10_MASK_RED_COMPONENT 0x0F00 564 #define D10_MASK_RED_COMPONENT 0x0F00 565 #define D11_MASK_GREEN_COMPONENT 0x00F0 566 #define D12_MASK_BLUE_COMPONENT 0x000F 573 uint16 _grapItemCount;
574 uint32 *_bitmapCompressedByteCount;
575 uint32 *_bitmapDecompressedByteCount;
576 uint32 *_packedItemPos;
577 byte *_packedBitmaps;
581 byte *_palChangesProjectile[4];
586 byte *getCurrentVgaBuffer();
588 void unpackGraphics();
589 void loadFNT1intoBitmap(uint16 index, byte *destBitmap);
591 void viewportSetPalette(uint16 *middleScreenPalette, uint16 *topAndBottomScreen);
592 void viewportBlitToScreen();
594 void drawFloorPitOrStairsBitmapFlippedHorizontally(uint16 nativeIndex,
Frame &frame);
595 void drawFloorPitOrStairsBitmap(uint16 nativeIndex,
Frame &frame);
596 void drawWallSetBitmap(byte *bitmap,
Frame &f);
597 void drawWallSetBitmapWithoutTransparency(byte *bitmap,
Frame &f);
598 void drawSquareD3L(Direction dir, int16 posX, int16 posY);
599 void drawSquareD3R(Direction dir, int16 posX, int16 posY);
600 void drawSquareD3C(Direction dir, int16 posX, int16 posY);
601 void drawSquareD2L(Direction dir, int16 posX, int16 posY);
602 void drawSquareD2R(Direction dir, int16 posX, int16 posY);
603 void drawSquareD2C(Direction dir, int16 posX, int16 posY);
604 void drawSquareD1L(Direction dir, int16 posX, int16 posY);
605 void drawSquareD1R(Direction dir, int16 posX, int16 posY);
606 void drawSquareD1C(Direction dir, int16 posX, int16 posY);
607 void drawSquareD0L(Direction dir, int16 posX, int16 posY);
608 void drawSquareD0R(Direction dir, int16 posX, int16 posY);
609 void drawSquareD0C(Direction dir, int16 posX, int16 posY);
611 void applyCreatureReplColors(
int replacedColor,
int replacementColor);
613 bool isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex);
615 uint16 *_derivedBitmapByteCount;
616 byte **_derivedBitmaps;
618 int16 _stairsNativeBitmapIndexUpFrontD3L;
619 int16 _stairsNativeBitmapIndexUpFrontD3C;
620 int16 _stairsNativeBitmapIndexUpFrontD2L;
621 int16 _stairsNativeBitmapIndexUpFrontD2C;
622 int16 _stairsNativeBitmapIndexUpFrontD1L;
623 int16 _stairsNativeBitmapIndexUpFrontD1C;
624 int16 _stairsNativeBitmapIndexUpFrontD0CLeft;
625 int16 _stairsNativeBitmapIndexDownFrontD3L;
626 int16 _stairsNativeBitmapIndexDownFrontD3C;
627 int16 _stairsNativeBitmapIndexDownFrontD2L;
628 int16 _stairsNativeBitmapIndexDownFrontD2C;
629 int16 _stairsNativeBitmapIndexDownFrontD1L;
630 int16 _stairsNativeBitmapIndexDownFrontD1C;
631 int16 _stairsNativeBitmapIndexDownFrontD0CLeft;
632 int16 _stairsNativeBitmapIndexSideD2L;
633 int16 _stairsNativeBitmapIndexUpSideD1L;
634 int16 _stairsNativeBitmapIndexDownSideD1L;
635 int16 _stairsNativeBitmapIndexSideD0L;
638 byte *_bitmapCeiling;
639 byte *_bitmapWallSetD3L2;
640 byte *_bitmapWallSetD3R2;
641 byte *_bitmapWallSetD3LCR;
642 byte *_bitmapWallSetD2LCR;
644 byte *_bitmapWallSetD1LCR;
646 Box _boxThievesEyeViewPortVisibleArea;
647 byte _palChangesDoorButtonAndWallOrnD3[16];
648 byte _palChangesDoorButtonAndWallOrnD2[16];
650 byte *_bitmapWallSetWallD0L;
651 byte *_bitmapWallSetWallD0R;
652 byte *_bitmapWallSetDoorFrameTopD2LCR;
653 byte *_bitmapWallSetDoorFrameTopD1LCR;
654 byte *_bitmapWallSetDoorFrameLeftD3L;
655 byte *_bitmapWallSetDoorFrameLeftD3C;
656 byte *_bitmapWallSetDoorFrameLeftD2C;
657 byte *_bitmapWallSetDoorFrameLeftD1C;
658 byte *_bitmapWallSetDoorFrameRightD1C;
659 byte *_bitmapWallSetDoorFrameFront;
661 byte *_bitmapWallD3LCRFlipped;
662 byte *_bitmapWallD2LCRFlipped;
663 byte *_bitmapWallD1LCRFlipped;
664 byte *_bitmapWallD0LFlipped;
665 byte *_bitmapWallD0RFlipped;
666 byte *_bitmapWallD3LCRNative;
667 byte *_bitmapWallD2LCRNative;
668 byte *_bitmapWallD1LCRNative;
669 byte *_bitmapWallD0LNative;
670 byte *_bitmapWallD0RNative;
672 int16 _currentWallSet;
673 int16 _currentFloorSet;
675 bool _useFlippedWallAndFootprintsBitmap;
677 byte _wallOrnamentCoordSets[8][13][6];
678 uint16 _doorOrnCoordSets[4][3][6];
679 byte _doorButtonCoordSet[1];
680 uint16 _doorButtonCoordSets[1][4][6];
682 int16 _doorNativeBitmapIndexFrontD3LCR[2];
683 int16 _doorNativeBitmapIndexFrontD2LCR[2];
684 int16 _doorNativeBitmapIndexFrontD1LCR[2];
686 uint16 *_paletteFadeFrom;
687 uint16 _paletteFadeTemporary[16];
691 uint16 _screenHeight;
693 byte *_bitmapViewport;
697 bool _paletteSwitchingEnabled;
698 bool _refreshDungeonViewPaleteRequested;
699 int16 _dungeonViewPaletteIndex;
700 uint16 _blankBuffer[32];
701 uint16 _paletteTopAndBottomScreen[16];
702 uint16 _paletteMiddleScreen[16];
707 void loadWallSet(WallSet
set);
708 void loadFloorSet(FloorSet
set);
710 void loadIntoBitmap(uint16 index, byte *destBitmap);
711 void setUpScreens(uint16 width, uint16 height);
713 void initializeGraphicData();
714 void loadCurrentMapGraphics();
715 void allocateFlippedWallBitmaps();
716 void drawDoorBitmap(
Frame *frame);
717 void drawDoorFrameBitmapFlippedHorizontally(byte *bitmap,
Frame *frame);
718 void drawDoorButton(int16 doorButtonOrdinal, DoorButton doorButton);
721 uint16 getPixelWidth(uint16 index);
723 uint16 getPixelHeight(uint16 index);
725 void copyBitmapAndFlipHorizontal(byte *srcBitmap, byte *destBitmap, uint16 byteWidth, uint16 height);
726 void drawFloorOrnament(uint16 floorOrnOrdinal, ViewFloor viewFloorIndex);
727 void drawDoor(uint16 doorThingIndex, DoorState doorState, int16 *doorNativeBitmapIndices, int16 byteCount,
728 DoorOrnament doorOrnament,
DoorFrames *doorFrames);
729 void drawDoorOrnament(int16 doorOrnOdinal, DoorOrnament doorOrnament);
730 void drawCeilingPit(int16 nativeBitmapIndex,
Frame *frame, int16 mapX, int16 mapY,
bool flipHorizontal);
732 void blitToViewport(byte *bitmap,
Box &box, int16 byteWidth, Color transparent, int16 height);
733 void blitToViewport(byte *bitmap, int16 *box, int16 byteWidth, Color transparent, int16 height);
734 void blitToScreen(byte *bitmap,
const Box *box, int16 byteWidth, Color transparent, int16 height);
741 void blitToBitmap(byte *srcBitmap, byte *destBitmap,
const Box &box, uint16 srcX, uint16 srcY, uint16 srcByteWidth,
742 uint16 destByteWidth, Color transparent, int16 srcHeight, int16 destHight);
744 void blitBoxFilledWithMaskedBitmap(byte *src, byte *dest, byte *mask, byte *tmp,
Box &box, int16 lastUnitIndex,
745 int16 firstUnitIndex, int16 destByteWidth, Color transparent,
746 int16 xPos, int16 yPos, int16 destHeight, int16 height2);
748 void blitToBitmapShrinkWithPalChange(byte *srcBitmap, byte *destBitmap,
749 int16 srcPixelWidth, int16 srcHight, int16 destPixelWidth, int16 destHeight, byte *palChange);
750 void flipBitmapHorizontal(byte *bitmap, uint16 byteWidth, uint16 height);
751 void flipBitmapVertical(byte *bitmap, uint16 byteWidth, uint16 height);
752 byte *getExplosionBitmap(uint16 explosionAspIndex, uint16
scale, int16 &returnByteWidth, int16 &returnHeight);
754 void fillBitmap(byte *bitmap, Color color, uint16 byteWidth, uint16 height);
755 void fillScreen(Color color);
757 void fillScreenBox(
Box &box, Color color);
759 void fillBoxBitmap(byte *destBitmap,
Box &box, Color color, int16 byteWidth, int16 height);
760 void drawDungeon(Direction dir, int16 posX, int16 posY);
761 void drawFloorAndCeiling();
763 void drawViewport(int16 palSwitchingRequestedState);
765 byte *getNativeBitmapOrGraphic(uint16 index);
767 uint32 getCompressedDataSize(uint16 index);
770 int16 getScaledBitmapByteCount(int16 byteWidth, int16 height, int16 scale);
771 int16 getScaledDimension(int16 dimension, int16 scale);
772 void drawObjectsCreaturesProjectilesExplosions(
Thing thingParam, Direction directionParam,
773 int16 mapXpos, int16 mapYpos, int16 viewSquareIndex,
774 CellOrder orderedViewCellOrdinals);
775 uint16 getNormalizedByteWidth(uint16 byteWidth);
776 uint16 getVerticalOffsetM23(uint16 val);
777 uint16 getHorizontalOffsetM22(uint16 val);
779 int16 _championPortraitOrdinal;
780 int16 _currMapAlcoveOrnIndices[k3_AlcoveOrnCount];
781 int16 _currMapFountainOrnIndices[k1_FountainOrnCount];
785 byte *_currMapAllowedCreatureTypes;
786 byte _currMapWallOrnIndices[16];
787 byte _currMapFloorOrnIndices[16];
788 byte _currMapDoorOrnIndices[18];
790 int16 _currMapViAltarIndex;
792 Thing _inscriptionThing;
794 bool _drawFloorAndCeilingRequested;
798 bool _useByteBoxCoordinates;
799 bool _doNotDrawFluxcagesDuringEndgame;
801 Frame _doorFrameLeftD1C;
802 Frame _doorFrameRightD1C;
804 Box _boxMovementArrows;
805 byte _palChangeSmoke[16];
806 byte _projectileScales[7];
808 Frame _frameWallD3R2;
809 Frame _frameWalls163[12];
813 uint16 _palCredits[16];
814 uint16 _palDungeonView[6][16];
815 byte _palChangesCreatureD3[16];
816 byte _palChangesCreatureD2[16];
817 byte _palChangesNoChanges[16];
818 byte _palChangesFloorOrnD3[16];
819 byte _palChangesFloorOrnD2[16];
821 bool isDerivedBitmapInCache(int16 derivedBitmapIndex);
822 byte *getDerivedBitmap(int16 derivedBitmapIndex);
823 void addDerivedBitmap(int16 derivedBitmapIndex);
824 void releaseBlock(uint16 index);
825 uint16 getDarkenedColor(uint16 RGBcolor);
826 void startEndFadeToPalette(uint16 *P0849_pui_Palette);
827 void buildPaletteChangeCopperList(uint16 *middleScreen, uint16 *topAndBottom);
828 void shadeScreenBox(
Box *box, Color color) {
warning(
"STUB METHOD: shadeScreenBox"); }
831 void initConstants();
832 uint16 getBitmapByteCount(uint16 pixelWidth, uint16 height);
void warning(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
int16 right
Definition: rect.h:146
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
int16 left
Definition: rect.h:145
Definition: champion.h:35
Definition: memstream.h:43
int16 x
Definition: rect.h:46
int16 y
Definition: rect.h:47