diff options
author | Bendegúz Nagy | 2016-06-29 22:08:10 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | e6c3389e53cad4069c696132ed4ef7a3c1d6991c (patch) | |
tree | 7eef52030b11501cf7a7004ea7bba7ab750992c1 /engines/dm | |
parent | 6daa5c572e3a96602be4df5115126415cecc72f7 (diff) | |
download | scummvm-rg350-e6c3389e53cad4069c696132ed4ef7a3c1d6991c.tar.gz scummvm-rg350-e6c3389e53cad4069c696132ed4ef7a3c1d6991c.tar.bz2 scummvm-rg350-e6c3389e53cad4069c696132ed4ef7a3c1d6991c.zip |
DM: Continue F0460_START_InitializeGraphicData
Diffstat (limited to 'engines/dm')
-rw-r--r-- | engines/dm/TODOs/methodtree.txt | 50 | ||||
-rw-r--r-- | engines/dm/dm.cpp | 29 | ||||
-rw-r--r-- | engines/dm/dm.h | 5 | ||||
-rw-r--r-- | engines/dm/gfx.cpp | 156 | ||||
-rw-r--r-- | engines/dm/gfx.h | 107 |
5 files changed, 313 insertions, 34 deletions
diff --git a/engines/dm/TODOs/methodtree.txt b/engines/dm/TODOs/methodtree.txt index 71846ef3bc..10ed85fa5c 100644 --- a/engines/dm/TODOs/methodtree.txt +++ b/engines/dm/TODOs/methodtree.txt @@ -1,3 +1,53 @@ +F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF + F0113_DUNGEONVIEW_DrawField // dummy + F0133_VIDEO_BlitBoxFilledWithMaskedBitmap + FIELD_ASPECT + F0114_DUNGEONVIEW_GetExplosionBitmap + F0133_VIDEO_BlitBoxFilledWithMaskedBitmap + F0141_DUNGEON_GetObjectInfoIndex + F0142_DUNGEON_GetProjectileAspect + F0176_GROUP_GetCreatureOrdinalInCell + G0017_auc_Graphic562_PaletteChanges_NoChanges + G0075_apuc_PaletteChanges_Projectile + G0077_B_DoNotDrawFluxcagesDuringEndgame + G0105_s_Graphic558_Box_ExplosionPattern_D0C + G0163_as_Graphic558_Frame_Walls + G0188_as_Graphic558_FieldAspects + G0209_as_Graphic558_ObjectAspects + G0210_as_Graphic558_ProjectileAspects + G0212_auc_Graphic558_PaletteChanges_Smoke + G0213_auc_Graphic558_PaletteChanges_FloorOrnament_D3 + G0214_auc_Graphic558_PaletteChanges_FloorOrnament_D2 + G0215_auc_Graphic558_ProjectileScales + G0216_auc_Graphic558_ExplosionBaseScales + G0217_aauc_Graphic558_ObjectPileShiftSetIndices + G0218_aaaauc_Graphic558_ObjectCoordinateSets + G0219_as_Graphic558_CreatureAspects + G0221_auc_Graphic558_PaletteChanges_Creature_D3 + G0222_auc_Graphic558_PaletteChanges_Creature_D2 + G0223_aac_Graphic558_ShiftSets + G0224_aaaauc_Graphic558_CreatureCoordinateSets + G0225_aai_Graphic558_CenteredExplosionCoordinates + G0226_aaai_Graphic558_ExplosionCoordinates + G0227_aai_Graphic558_RebirthStep2ExplosionCoordinates + G0228_aai_Graphic558_RebirthStep1ExplosionCoordinates + G0237_as_Graphic559_ObjectInfo + G0243_as_Graphic559_CreatureInfo + G0291_aauc_DungeonViewClickableBoxes + G0292_aT_PileTopObject + G0370_ps_Events + G0375_ps_ActiveGroups + OBJECT_ASPECT + GROUP + ACTIVE_GROUP + CREATURE_INFO + CREATURE_ASPECT + PROJECTILE + EXPLOSION + FIELD_ASPECT + + + F0380_COMMAND_ProcessQueue_CPSC // in progress C080_COMMAND_CLICK_IN_DUNGEON_VIEW // cool F0377_COMMAND_ProcessType80_ClickInDungeonView // done so-so diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index 138e7b8777..0df836a45a 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -60,16 +60,27 @@ void turnDirLeft(direction &dir) { dir = (direction)((dir - 1) & 3); } direction returnOppositeDir(direction dir) { return (direction)((dir + 2) & 3); } bool isOrientedWestEast(direction dir) { return dir & 1; } +uint16 getFlag(uint16 val, uint16 mask) { + return val & mask; +} + +void setFlag(uint16 &val, uint16 mask) { + val |= mask; +} + +void clearFlag(uint16 &val, uint16 mask) { + val &= ~mask; +} DMEngine::DMEngine(OSystem *syst) : Engine(syst), _console(nullptr) { - // Do not load data files - // Do not initialize graphics here - // Do not initialize audio devices here - // Do these from run - - //Specify all default directories - //const Common::FSNode gameDataDir(ConfMan.get("example")); - //SearchMan.addSubDirectoryMatching(gameDataDir, "example2"); +// Do not load data files +// Do not initialize graphics here +// Do not initialize audio devices here +// Do these from run + +//Specify all default directories +//const Common::FSNode gameDataDir(ConfMan.get("example")); +//SearchMan.addSubDirectoryMatching(gameDataDir, "example2"); DebugMan.addDebugChannel(kDMDebugExample, "example", "example desc"); // register random source @@ -210,7 +221,7 @@ void DMEngine::gameloop() { _dungeonMan->_currMap._partyPosX = 10; _dungeonMan->_currMap._partyPosY = 4; _dungeonMan->_currMap._partyDir = kDirNorth; - + warning("DUMMY CODE: setting InventoryMan::_inventoryChampionOrdinal to zero"); _inventoryMan->_inventoryChampionOrdinal = 0; diff --git a/engines/dm/dm.h b/engines/dm/dm.h index 19eda10dfd..7b68e6d5a3 100644 --- a/engines/dm/dm.h +++ b/engines/dm/dm.h @@ -65,6 +65,11 @@ direction returnOppositeDir(direction dir); bool isOrientedWestEast(direction dir); +uint16 getFlag(uint16 val, uint16 mask); +void setFlag(uint16 &val, uint16 mask); +void clearFlag(uint16 &val, uint16 mask); + + enum ThingType { kPartyThingType = -1, // @ CM1_THING_TYPE_PARTY, special value kDoorThingType = 0, diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index b1c5c6a700..0c55fe557e 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -39,6 +39,24 @@ namespace DM { Box gBoxMovementArrows = Box(224, 319, 124, 168); +ExplosionAspect gExplosionAspects[kExplosionAspectCount] = { // @ G0211_as_Graphic558_ExplosionAspects + /* { ByteWidth, Height } */ + ExplosionAspect(80, 111), /* Fire */ +ExplosionAspect(64, 97), /* Spell */ +ExplosionAspect(80, 91), /* Poison */ +ExplosionAspect(80, 91)}; /* Death */ + +#define kDerivedBitmapMaximumCount 730 // @ C730_DERIVED_BITMAP_MAXIMUM_COUNT + +byte gProjectileScales[7] = { + 13, /* D4 Back */ + 16, /* D4 Front */ + 19, /* D3 Back */ + 22, /* D3 Front */ + 25, /* D2 Back */ + 28, /* D2 Front */ + 32}; /* D1 Back */ + enum StairFrameIndex { kFrameStairsUpFront_D3L = 0, // @ G0110_s_Graphic558_Frame_StairsUpFront_D3L kFrameStairsUpFront_D3C = 1, // @ G0111_s_Graphic558_Frame_StairsUpFront_D3C @@ -598,6 +616,7 @@ DisplayMan::DisplayMan(DMEngine *dmEngine) : _vm(dmEngine) { _floorBitmap = nullptr; _ceilingBitmap = nullptr; _currMapAllowedCreatureTypes = nullptr; + _derivedBitmapByteCount = nullptr; _screenWidth = _screenHeight = 0; _championPortraitOrdinal = 0; @@ -686,21 +705,126 @@ void DisplayMan::loadGraphics() { unpackGraphics(); - for (uint16 i = kDoorOrnDestroyedMask; i <= kDoorOrnThivesEyeMask; ++i) { - _currMapDoorOrnInfo[i][kNativeBitmapIndex] = i + (kDoorMaskDestroyedIndice - kDoorOrnDestroyedMask); - _currMapDoorOrnInfo[i][kNativeCoordinateSet] = 1; + loadFloorSet(kFloorSetStone); + loadWallSet(kWallSetStone); + + + + if (!_derivedBitmapByteCount) + _derivedBitmapByteCount = new uint16[kDerivedBitmapMaximumCount]; + + _derivedBitmapByteCount[kDerivedBitmapViewport] = 224 * 136; + _derivedBitmapByteCount[kDerivedBitmapThievesEyeVisibleArea] = 96 * 95; + _derivedBitmapByteCount[kDerivedBitmapDamageToCreatureMedium] = 64 * 37; + _derivedBitmapByteCount[kDerivedBitmapDamageToCreatureSmall] = 48 * 37; + + for (int16 doorOrnamentIndex = kDoorOrnDestroyedMask; doorOrnamentIndex <= kDoorOrnThivesEyeMask; doorOrnamentIndex++) { + _currMapDoorOrnInfo[doorOrnamentIndex][kNativeBitmapIndex] = doorOrnamentIndex + (kDoorMaskDestroyedIndice - kDoorOrnDestroyedMask); + _currMapDoorOrnInfo[doorOrnamentIndex][kCoordinateSet] = 1; + + _derivedBitmapByteCount[doorOrnamentIndex * 2 + kDerivedBitmapFirstDoorOrnament_D3] = 48 * 41; + _derivedBitmapByteCount[doorOrnamentIndex * 2 + kDerivedBitmapFirstDoorOrnament_D2] = 64 * 61; + } + + _currMapFloorOrnInfo[kFloorOrnFootprints][kNativeBitmapIndex] = kFloorOrn_15_D3L_footprints; + _currMapFloorOrnInfo[kFloorOrnFootprints][kCoordinateSet] = 1; + + ObjectAspect *objectAspect = gObjectAspects; + int16 derivedBitmapIndex; + for (int16 objectAspectIndex = 0; objectAspectIndex < kObjAspectCount; ++objectAspectIndex, ++objectAspect) { + derivedBitmapIndex = kDerivedBitmapFirstObject + objectAspect->_firstDerivedBitmapRelativeIndex; + + _derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(objectAspect->_width, objectAspect->_height, kScale16_D3); + _derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(objectAspect->_width, objectAspect->_height, kScale20_D2); + + if (getFlag(objectAspect->_graphicInfo, kObjectFlipOnRightMask)) { + _derivedBitmapByteCount[derivedBitmapIndex] = _derivedBitmapByteCount[derivedBitmapIndex - 2]; + derivedBitmapIndex++; + _derivedBitmapByteCount[derivedBitmapIndex] = _derivedBitmapByteCount[derivedBitmapIndex - 2]; + derivedBitmapIndex++; + } + + if (getFlag(objectAspect->_graphicInfo, kObjectAlcoveMask)) { + _derivedBitmapByteCount[derivedBitmapIndex] = _derivedBitmapByteCount[derivedBitmapIndex - 2]; + derivedBitmapIndex++; + _derivedBitmapByteCount[derivedBitmapIndex] = _derivedBitmapByteCount[derivedBitmapIndex - 2]; + } } - _currMapFloorOrnInfo[kFloorOrnFootprints][kNativeBitmapIndex] = 1; - _currMapFloorOrnInfo[kFloorOrnFootprints][kNativeCoordinateSet] = 1; + ProjectileAspect *projectileAspect = gProjectileAspect; + for (int16 projectileAspectIndex = 0; projectileAspectIndex < kProjectileAspectCount; projectileAspectIndex++, projectileAspect++) { + + if (!getFlag(projectileAspect->_graphicInfo, kProjectileScaleWithKineticEnergyMask)) { + derivedBitmapIndex = kDerivedBitmapFirstProjectile + projectileAspect->_firstDerivedBitmapRelativeIndex; + + for (int16 projectileScaleIndex = 0; projectileScaleIndex < 6; projectileScaleIndex++) { + int16 bitmapPixelCount = getScaledBitmapPixelCount(projectileAspect->_width, projectileAspect->_height, gProjectileScales[projectileScaleIndex]); + _derivedBitmapByteCount[derivedBitmapIndex] = bitmapPixelCount; + + if (getFlag(projectileAspect->_graphicInfo, kProjectileAspectTypeMask) != kProjectileAspectHasNone) { + _derivedBitmapByteCount[derivedBitmapIndex + 6] = bitmapPixelCount; + + if (getFlag(projectileAspect->_graphicInfo, kProjectileAspectTypeMask) != kProjectileAspectHasRotation) { + _derivedBitmapByteCount[derivedBitmapIndex + 12] = bitmapPixelCount; + } + } + } + } + } _palChangesProjectile[0] = gPalChangesFloorOrn_D3; _palChangesProjectile[1] = gPalChangesFloorOrn_D2; _palChangesProjectile[2] = _palChangesProjectile[3] = gPalChangesNoChanges; - loadFloorSet(kFloorSetStone); - loadWallSet(kWallSetStone); + derivedBitmapIndex = kDerivedBitmapFirstExplosion; + ExplosionAspect *expAsp = gExplosionAspects; + for (uint16 expAspIndex = 0; expAspIndex < kExplosionAspectCount; ++expAspIndex, expAsp++) { + for (int16 scale = 4; scale < 32; scale += 2) + _derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(expAsp->_pixelWidth, expAsp->_height, scale); + + if (expAspIndex == kExplosionAspectSmoke) { + _derivedBitmapByteCount[derivedBitmapIndex++] = expAsp->_pixelWidth * expAsp->_height; + } + } + + derivedBitmapIndex = kDerivedBitmapFirstCreature; + CreatureAspect *creatureAsp; + for (int16 creatureIndex = 0; creatureIndex < kCreatureTypeCount; creatureIndex++) { + creatureAsp = &gCreatureAspects[creatureIndex]; + + int16 creatureGraphicInfo = gCreatureInfo[creatureIndex]._graphicInfo; + creatureAsp->_firstDerivedBitmapIndex = derivedBitmapIndex; + + int16 creatureFrontBitmapD3PixelCount; + _derivedBitmapByteCount[derivedBitmapIndex++] = creatureFrontBitmapD3PixelCount = getScaledBitmapPixelCount(creatureAsp->_byteWidthFront, creatureAsp->_heightFront, kScale16_D3); + + int16 creatureFrontBitmapD2PixelCount; + _derivedBitmapByteCount[derivedBitmapIndex++] = creatureFrontBitmapD2PixelCount = getScaledBitmapPixelCount(creatureAsp->_byteWidthFront, creatureAsp->_heightFront, kScale20_D2); + + if (getFlag(creatureGraphicInfo, kCreatureInfoMaskSide)) { + _derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(creatureAsp->_byteWidthSide, creatureAsp->_heightSide, kScale16_D3); + _derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(creatureAsp->_byteWidthSide, creatureAsp->_heightSide, kScale20_D2); + } + if (getFlag(creatureGraphicInfo, kCreatureInfoMaskBack)) { + _derivedBitmapByteCount[derivedBitmapIndex++] = creatureFrontBitmapD3PixelCount; + _derivedBitmapByteCount[derivedBitmapIndex++] = creatureFrontBitmapD2PixelCount; + } + + if (getFlag(creatureGraphicInfo, kCreatureInfoMaskAttack)) { + _derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(creatureAsp->_byteWidthAttack, creatureAsp->_heightAttack, kScale16_D3); + _derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(creatureAsp->_byteWidthAttack, creatureAsp->_heightAttack, kScale20_D2); + } + + int16 additionalFronGraphicCount; + if (additionalFronGraphicCount = getFlag(creatureGraphicInfo, kCreatureInfoMaskAdditional)) { + do { + _derivedBitmapByteCount[derivedBitmapIndex++] = creatureAsp->_byteWidthFront * creatureAsp->_heightFront; + _derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(creatureAsp->_byteWidthFront, creatureAsp->_heightFront, kScale16_D3); + _derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(creatureAsp->_byteWidthFront, creatureAsp->_heightFront, kScale20_D2); + } while (--additionalFronGraphicCount); + } + } } void DisplayMan::unpackGraphics() { @@ -1329,21 +1453,21 @@ void DisplayMan::loadCurrentMapGraphics() { if (ornIndice == gFountainOrnIndices[ornCounter]) _currMapFountainOrnIndices[fountainCount++] = i; - _currMapWallOrnInfo[i][kNativeCoordinateSet] = gWallOrnCoordSetIndices[ornIndice]; + _currMapWallOrnInfo[i][kCoordinateSet] = gWallOrnCoordSetIndices[ornIndice]; } for (uint16 i = 0; i < currMap._floorOrnCount; ++i) { uint16 ornIndice = _currMapFloorOrnIndices[i]; uint16 nativeIndice = kFirstFloorOrn + ornIndice * 6; _currMapFloorOrnInfo[i][kNativeBitmapIndex] = nativeIndice; - _currMapFloorOrnInfo[i][kNativeCoordinateSet] = gFloorOrnCoordSetIndices[ornIndice]; + _currMapFloorOrnInfo[i][kCoordinateSet] = gFloorOrnCoordSetIndices[ornIndice]; } for (uint16 i = 0; i < currMap._doorOrnCount; ++i) { uint16 ornIndice = _currMapDoorOrnIndices[i]; uint16 nativeIndice = kFirstDoorOrn + ornIndice; _currMapDoorOrnInfo[i][kNativeBitmapIndex] = nativeIndice; - _currMapDoorOrnInfo[i][kNativeCoordinateSet] = gDoorOrnCoordIndices[ornIndice]; + _currMapDoorOrnInfo[i][kCoordinateSet] = gDoorOrnCoordIndices[ornIndice]; } applyCreatureReplColors(9, 8); @@ -1432,7 +1556,7 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex int16 wallOrnIndex = wallOrnOrd - 1; int16 nativeBitmapIndex = _currMapWallOrnInfo[wallOrnIndex][kNativeBitmapIndex]; - uint16 *coordinateSetA = gWallOrnCoordSets[_currMapWallOrnInfo[wallOrnIndex][kNativeCoordinateSet]][viewWallIndex]; + uint16 *coordinateSetA = gWallOrnCoordSets[_currMapWallOrnInfo[wallOrnIndex][kCoordinateSet]][viewWallIndex]; isAlcove = _vm->_dungeonMan->isWallOrnAnAlcove(wallOrnIndex); isInscription = (wallOrnIndex == _vm->_dungeonMan->_currMapInscriptionWallOrnIndex); if (isInscription) { @@ -1492,7 +1616,7 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex } else { coordinateSetOffset = 0; uint16 *coordSetB; - int16 wallOrnCoordSetIndex = _currMapWallOrnInfo[wallOrnIndex][kNativeCoordinateSet]; + int16 wallOrnCoordSetIndex = _currMapWallOrnInfo[wallOrnIndex][kCoordinateSet]; flipHorizontal = (viewWallIndex == kViewWall_D2R_LEFT) || (viewWallIndex == kViewWall_D3R_LEFT); if (flipHorizontal) { coordSetB = gWallOrnCoordSets[wallOrnCoordSetIndex][kViewWall_D1R_LEFT]; @@ -1587,6 +1711,14 @@ uint32 DisplayMan::getCompressedDataSize(uint16 index) { return _packedItemPos[index + 1] - _packedItemPos[index]; } +int16 DisplayMan::getScaledBitmapPixelCount(int16 pixelWidth, int16 pixelHeight, int16 scale) { + return getScaledDimension(pixelWidth, scale) * getScaledDimension(pixelHeight, scale); +} + +int16 DisplayMan::getScaledDimension(int16 dimension, int16 scale) { + return (dimension * scale + scale / 2) / 32; +} + void DisplayMan::clearScreenBox(Color color, Box &box, Viewport &viewport) { uint16 width = box._x2 - box._x1; for (int y = box._y1 + viewport._posY; y < box._y2 + viewport._posY; ++y) diff --git a/engines/dm/gfx.h b/engines/dm/gfx.h index b6a32c5065..0e7bcf65ec 100644 --- a/engines/dm/gfx.h +++ b/engines/dm/gfx.h @@ -32,9 +32,89 @@ #include "common/rect.h" #include "common/memstream.h" #include "dm.h" +#include "common/array.h" namespace DM { +#define kFloorSetGraphicCount 2 // @ C002_FLOOR_SET_GRAPHIC_COUNT +#define kWallSetGraphicCount 13 // @ C013_WALL_SET_GRAPHIC_COUNT +#define kStairsGraphicCount 18 // @ C018_STAIRS_GRAPHIC_COUNT +#define kDoorSetGraphicsCount 3 // @ C003_DOOR_SET_GRAPHIC_COUNT +#define kDoorButtonCount 1 // @ C001_DOOR_BUTTON_COUNT +#define kNativeBitmapIndex 0 // @ C0_NATIVE_BITMAP_INDEX +#define kCoordinateSet 1 // @ C1_COORDINATE_SET +#define kCreatureTypeCount 27 // @ C027_CREATURE_TYPE_COUNT +#define kExplosionAspectCount 4 // @ C004_EXPLOSION_ASPECT_COUNT +#define kObjAspectCount 85 // @ C085_OBJECT_ASPECT_COUNT +#define kProjectileAspectCount 14 // @ C014_PROJECTILE_ASPECT_COUNT + +/* Explosion aspects */ +#define kExplosionAspectFire 0 // @ C0_EXPLOSION_ASPECT_FIRE +#define kExplosionAspectSpell 1 // @ C1_EXPLOSION_ASPECT_SPELL +#define kExplosionAspectPoison 2 // @ C2_EXPLOSION_ASPECT_POISON +#define kExplosionAspectSmoke 3 // @ C3_EXPLOSION_ASPECT_SMOKE + +/* Creature info GraphicInfo */ +#define kCreatureInfoMaskAdditional 0x0003 // @ MASK0x0003_ADDITIONAL +#define kCreatureInfoMaskFlipNonAttack 0x0004 // @ MASK0x0004_FLIP_NON_ATTACK +#define kCreatureInfoMaskSide 0x0008 // @ MASK0x0008_SIDE +#define kCreatureInfoMaskBack 0x0010 // @ MASK0x0010_BACK +#define kCreatureInfoMaskAttack 0x0020 // @ MASK0x0020_ATTACK +#define kCreatureInfoMaskSpecialD2Front 0x0080 // @ MASK0x0080_SPECIAL_D2_FRONT +#define kCreatureInfoMaskSpecialD2FrontIsFlipped 0x0100 // @ MASK0x0100_SPECIAL_D2_FRONT_IS_FLIPPED_FRONT +#define kCreatureInfoMaskFlipAttack 0x0200 // @ MASK0x0200_FLIP_ATTACK +#define kCreatureInfoMaskFlipDuringAttack 0x0400 // @ MASK0x0400_FLIP_DURING_ATTACK + +class ExplosionAspect { +public: + uint16 _pixelWidth; + uint16 _height; + + ExplosionAspect(uint16 byteWidth, uint16 height) :_pixelWidth(byteWidth * 2), _height(height) {} +}; // @ EXPLOSION_ASPECT + +extern ExplosionAspect gExplosionAspects[kExplosionAspectCount]; + +extern byte gProjectileScales[7]; // @ G0215_auc_Graphic558_ProjectileScales + + +#define kDerivedBitmapViewport 0 // @ C000_DERIVED_BITMAP_VIEWPORT +#define kDerivedBitmapThievesEyeVisibleArea 1 // @ C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA +#define kDerivedBitmapDamageToCreatureMedium 2 // @ C002_DERIVED_BITMAP_DAMAGE_TO_CREATURE_MEDIUM +#define kDerivedBitmapDamageToCreatureSmall 3 // @ C003_DERIVED_BITMAP_DAMAGE_TO_CREATURE_SMALL +#define kDerivedBitmapFirstWallOrnament 4 // @ C004_DERIVED_BITMAP_FIRST_WALL_ORNAMENT +#define kDerivedBitmapFirstDoorOrnament_D3 68 // @ C068_DERIVED_BITMAP_FIRST_DOOR_ORNAMENT_D3 +#define kDerivedBitmapFirstDoorOrnament_D2 69 // @ C069_DERIVED_BITMAP_FIRST_DOOR_ORNAMENT_D2 +#define kDerivedBitmapFirstDoorButton 102 // @ C102_DERIVED_BITMAP_FIRST_DOOR_BUTTON +#define kDerivedBitmapFirstObject 104 // @ C104_DERIVED_BITMAP_FIRST_OBJECT +#define kDerivedBitmapFirstProjectile 282 // @ C282_DERIVED_BITMAP_FIRST_PROJECTILE +#define kDerivedBitmapFirstExplosion 438 // @ C438_DERIVED_BITMAP_FIRST_EXPLOSION +#define kDerivedBitmapFirstCreature 495 // @ C495_DERIVED_BITMAP_FIRST_CREATURE + + +#define kScale16_D3 16 // @ C16_SCALE_D3 +#define kScale20_D2 20 // @ C20_SCALE_D2 +/* Object aspect GraphicInfo */ +#define kObjectFlipOnRightMask 0x0001 // @ MASK0x0001_FLIP_ON_RIGHT +#define kObjectAlcoveMask 0x0010 // @ MASK0x0010_ALCOVE + +/* Projectile aspect GraphicInfo */ +#define kProjectileSideMask 0x0010 // @ MASK0x0010_SIDE +#define kProjectileScaleWithKineticEnergyMask 0x0100 // @ MASK0x0100_SCALE_WITH_KINETIC_ENERGY +#define kProjectileAspectTypeMask 0x0003 // @ MASK0x0003_ASPECT_TYPE + +/* Projectile aspect type */ +#define kProjectileAspectHasBackGraphicRotation 0 // @ C0_PROJECTILE_ASPECT_TYPE_HAS_BACK_GRAPHIC_AND_ROTATION +#define kProjectileAspectBackGraphic 1 // @ C1_PROJECTILE_ASPECT_TYPE_HAS_BACK_GRAPHIC_AND_NO_ROTATION +#define kProjectileAspectHasRotation 2 // @ C2_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_ROTATION +#define kProjectileAspectHasNone 3 // @ C3_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_NO_ROTATION + +/* Projectile aspects */ +#define kProjectileAspectExplosionLightningBolt 3 // @ C03_PROJECTILE_ASPECT_EXPLOSION_LIGHTNING_BOLT +#define kProjectileAspectExplosionFireBall 10 // @ C10_PROJECTILE_ASPECT_EXPLOSION_FIREBALL +#define kProjectileAspectExplosionDefault 11 // @ C11_PROJECTILE_ASPECT_EXPLOSION_DEFAULT +#define kProjectileAspectExplosionSlime 12 // @ C12_PROJECTILE_ASPECT_EXPLOSION_SLIME +#define kProjectileAspectExplosionPoisonBoltCloud 13 // @ C13_PROJECTILE_ASPECT_EXPLOSION_POISON_BOLT_POISON_CLOUD enum ViewCell { kViewCellFronLeft = 0, // @ C00_VIEW_CELL_FRONT_LEFT @@ -80,7 +160,8 @@ enum GraphicIndice { kPanelOpenChestIndice = 25, // @ C025_GRAPHIC_PANEL_OPEN_CHEST kEyeForObjectDescriptionIndice = 19, // @ C019_GRAPHIC_EYE_FOR_OBJECT_DESCRIPTION kArrowForChestContentIndice = 18, // @ C018_GRAPHIC_ARROW_FOR_CHEST_CONTENT - kObjectDescCircleIndice = 29 // @ C029_GRAPHIC_OBJECT_DESCRIPTION_CIRCLE + kObjectDescCircleIndice = 29, // @ C029_GRAPHIC_OBJECT_DESCRIPTION_CIRCLE + kFloorOrn_15_D3L_footprints = 241 // @ C241_GRAPHIC_FLOOR_ORNAMENT_15_D3L_FOOTPRINTS }; extern uint16 gPalSwoosh[16]; @@ -248,17 +329,6 @@ extern Viewport gDungeonViewport; #define kAlcoveOrnCount 3 #define kFountainOrnCount 1 -#define kFloorSetGraphicCount 2 // @ C002_FLOOR_SET_GRAPHIC_COUNT -#define kWallSetGraphicCount 13 // @ C013_WALL_SET_GRAPHIC_COUNT -#define kStairsGraphicCount 18 // @ C018_STAIRS_GRAPHIC_COUNT -#define kDoorSetGraphicsCount 3 // @ C003_DOOR_SET_GRAPHIC_COUNT -#define kDoorButtonCount 1 // @ C001_DOOR_BUTTON_COUNT -#define kNativeBitmapIndex 0 // @ C0_NATIVE_BITMAP_INDEX -#define kNativeCoordinateSet 1 // @ C1_COORDINATE_SET -#define kCreatureTypeCount 27 // @ C027_CREATURE_TYPE_COUNT -#define kExplosionAspectCount 4 // @ C004_EXPLOSION_ASPECT_COUNT -#define kObjAspectCount 85 // @ C085_OBJECT_ASPECT_COUNT -#define kProjectileAspectCount 14 // @ C014_PROJECTILE_ASPECT_COUNT #define kDoorButton 0 // @ C0_DOOR_BUTTON #define kWallOrnInscription 0 // @ C0_WALL_ORNAMENT_INSCRIPTION @@ -320,6 +390,8 @@ class DisplayMan { bool isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex); // @ F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF + uint16 *_derivedBitmapByteCount;// @ G0639_pui_DerivedBitmapByteCount + public: // some methods use this for a stratchpad, don't make assumptions about content between function calls byte *_tmpBitmap; @@ -332,7 +404,7 @@ public: void setUpScreens(uint16 width, uint16 height); void loadGraphics(); // @ F0479_MEMORY_ReadGraphicsDatHeader, F0460_START_InitializeGraphicData - void loadCurrentMapGraphics(); + void loadCurrentMapGraphics(); // @ F0096_DUNGEONVIEW_LoadCurrentMapGraphics_CPSDF void loadPalette(uint16 *palette); /// Gives the width of an IMG0 type item @@ -369,6 +441,9 @@ public: Common::MemoryReadStream getCompressedData(uint16 index); uint32 getCompressedDataSize(uint16 index); + int16 getScaledBitmapPixelCount(int16 pixelWidth, int16 pixelHeight, int16 scale); // @ F0459_START_GetScaledBitmapByteCount + int16 getScaledDimension(int16 dimension, int16 scale); // @ M78_SCALED_DIMENSION + int16 _championPortraitOrdinal; // @ G0289_i_DungeonView_ChampionPortraitOrdinal int16 _currMapAlcoveOrnIndices[kAlcoveOrnCount]; // @ G0267_ai_CurrentMapAlcoveOrnamentIndices int16 _currMapFountainOrnIndices[kFountainOrnCount]; // @ G0268_ai_CurrentMapFountainOrnamentIndices @@ -385,6 +460,12 @@ public: Thing _inscriptionThing; // @ G0290_T_DungeonView_InscriptionThing bool _useByteBoxCoordinates; // @ G0578_B_UseByteBoxCoordinates + + bool isDerivedBitmapInCache(int16 derivedBitmapIndex); // @ F0491_CACHE_IsDerivedBitmapInCache + byte *getDerivedBitmap(int16 derivedBitmapIndex); // @ F0492_CACHE_GetDerivedBitmap + + + }; } |