aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2016-08-14 11:06:17 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commit013b55533864e2f59a8a54cb6863cd3994fb35c3 (patch)
tree9fe5c71e52c5c805442cbab001e7971864b9e780 /engines
parenta6d5ad7c998c146b45d29db7a3ddf7bf6c253b74 (diff)
downloadscummvm-rg350-013b55533864e2f59a8a54cb6863cd3994fb35c3.tar.gz
scummvm-rg350-013b55533864e2f59a8a54cb6863cd3994fb35c3.tar.bz2
scummvm-rg350-013b55533864e2f59a8a54cb6863cd3994fb35c3.zip
DM: Add missing code in f125_drawSquareD0L, rename a constant
Diffstat (limited to 'engines')
-rw-r--r--engines/dm/dungeonman.cpp20
-rw-r--r--engines/dm/dungeonman.h2
-rw-r--r--engines/dm/gfx.cpp54
3 files changed, 40 insertions, 36 deletions
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index 7056ab66c1..b745a99527 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -838,8 +838,8 @@ void DungeonMan::f172_setSquareAspect(uint16 *aspectArray, Direction dir, int16
bool frontRandomWallOrnamentAllowed = false;
bool squareIsFakeWall;
- aspectArray[k0_ElemAspect] = Square(AL0307_uc_Square).getType();
- switch (aspectArray[k0_ElemAspect]) {
+ aspectArray[k0_ElementAspect] = Square(AL0307_uc_Square).getType();
+ switch (aspectArray[k0_ElementAspect]) {
case k0_ElementTypeWall:
switch (dir) {
case kDirNorth:
@@ -895,26 +895,26 @@ T0172010_ClosedFakeWall:
break;
case k6_ElementTypeFakeWall:
if (!getFlag(AL0307_uc_Square, k0x0004_FakeWallOpen)) {
- aspectArray[k0_ElemAspect] = k0_ElementTypeWall;
+ aspectArray[k0_ElementAspect] = k0_ElementTypeWall;
leftRandomWallOrnamentAllowed = rightRandomWallOrnamentAllowed = frontRandomWallOrnamentAllowed = getFlag(AL0307_uc_Square, k0x0008_FakeWallRandOrnOrFootPAllowed);
squareIsFakeWall = true;
goto T0172010_ClosedFakeWall;
}
- aspectArray[k0_ElemAspect] = k1_CorridorElemType;
+ aspectArray[k0_ElementAspect] = k1_CorridorElemType;
AL0307_uc_FootprintsAllowed = getFlag(AL0307_uc_Square, k0x0008_FakeWallRandOrnOrFootPAllowed) ? 8 : 0;
// No break on purpose
case k1_CorridorElemType:
case k2_ElementTypePit:
case k5_ElementTypeTeleporter:
- if (aspectArray[k0_ElemAspect] == k1_CorridorElemType) {
+ if (aspectArray[k0_ElementAspect] == k1_CorridorElemType) {
aspectArray[k4_FloorOrnOrdAspect] = f170_getRandomOrnOrdinal(getFlag(AL0307_uc_Square, k0x0008_CorridorRandOrnAllowed), _g269_currMap->_randFloorOrnCount, mapX, mapY, 30);
AL0307_uc_FootprintsAllowed = true;
- } else if (aspectArray[k0_ElemAspect] == k2_ElementTypePit) {
+ } else if (aspectArray[k0_ElementAspect] == k2_ElementTypePit) {
if (getFlag(AL0307_uc_Square, k0x0008_PitOpen)) {
aspectArray[k2_PitInvisibleAspect] = getFlag(AL0307_uc_Square, k0x0004_PitInvisible);
AL0307_uc_FootprintsAllowed &= 0x0001;
} else {
- aspectArray[k0_ElemAspect] = k1_CorridorElemType;
+ aspectArray[k0_ElementAspect] = k1_CorridorElemType;
AL0307_uc_FootprintsAllowed = true;
}
} else { // k5_ElementTypeTeleporter
@@ -935,7 +935,7 @@ T0172010_ClosedFakeWall:
break;
case k3_ElementTypeStairs:
- aspectArray[k0_ElemAspect] = (bool((getFlag(AL0307_uc_Square, k0x0008_StairsNorthSouthOrient) >> 3)) == isOrientedWestEast(dir)) ? k18_ElementTypeStairsSide : k19_ElementTypeStaisFront;
+ aspectArray[k0_ElementAspect] = (bool((getFlag(AL0307_uc_Square, k0x0008_StairsNorthSouthOrient) >> 3)) == isOrientedWestEast(dir)) ? k18_ElementTypeStairsSide : k19_ElementTypeStaisFront;
aspectArray[k2_StairsUpAspect] = getFlag(AL0307_uc_Square, k0x0004_StairsUp);
AL0307_uc_FootprintsAllowed = false;
while ((curThing != Thing::_endOfList) && (curThing.getType() <= k3_SensorThingType))
@@ -943,9 +943,9 @@ T0172010_ClosedFakeWall:
break;
case k4_DoorElemType:
if (bool((getFlag(AL0307_uc_Square, k0x0008_DoorNorthSouthOrient) >> 3)) == isOrientedWestEast(dir)) {
- aspectArray[k0_ElemAspect] = k16_DoorSideElemType;
+ aspectArray[k0_ElementAspect] = k16_DoorSideElemType;
} else {
- aspectArray[k0_ElemAspect] = k17_DoorFrontElemType;
+ aspectArray[k0_ElementAspect] = k17_DoorFrontElemType;
aspectArray[k2_DoorStateAspect] = Square(AL0307_uc_Square).getDoorState();
aspectArray[k3_DoorThingIndexAspect] = f161_getSquareFirstThing(mapX, mapY).getIndex();
}
diff --git a/engines/dm/dungeonman.h b/engines/dm/dungeonman.h
index e75c6c2d57..0f13d071c2 100644
--- a/engines/dm/dungeonman.h
+++ b/engines/dm/dungeonman.h
@@ -161,7 +161,7 @@ enum TextType {
};
enum SquareAspectIndice {
- k0_ElemAspect = 0, // @ C0_ELEMENT
+ k0_ElementAspect = 0, // @ C0_ELEMENT
k1_FirstGroupOrObjectAspect = 1, // @ C1_FIRST_GROUP_OR_OBJECT
k2_RightWallOrnOrdAspect = 2, // @ C2_RIGHT_WALL_ORNAMENT_ORDINAL
k3_FrontWallOrnOrdAspect = 3, // @ C3_FRONT_WALL_ORNAMENT_ORDINAL
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 0cd85fb30c..ec0dcd5da7 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -1448,7 +1448,7 @@ void DisplayMan::f116_drawSquareD3L(Direction dir, int16 posX, int16 posY) {
int16 order;
_vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY);
- switch (squareAspect[k0_ElemAspect]) {
+ switch (squareAspect[k0_ElementAspect]) {
case k19_StairsFrontElemType:
if (squareAspect[k2_StairsUpAspect])
f104_drawFloorPitOrStairsBitmap(_g675_stairsNativeBitmapIndex_Up_Front_D3L, frameStairsUpFrontD3L);
@@ -1489,7 +1489,7 @@ T0116016_blueToad:
T0116017_orangeElk:
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, order);
}
- if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
+ if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
f113_drawField(&g188_FieldAspects[k1_ViewSquare_D3L], g163_FrameWalls[k1_ViewSquare_D3L]._box);
}
}
@@ -1517,7 +1517,7 @@ void DisplayMan::f117_drawSquareD3R(Direction dir, int16 posX, int16 posY) {
uint16 squareAspect[5];
_vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY);
- switch (squareAspect[k0_ElemAspect]) {
+ switch (squareAspect[k0_ElementAspect]) {
case k19_ElementTypeStaisFront:
if (squareAspect[k2_StairsUpAspect]) {
f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g675_stairsNativeBitmapIndex_Up_Front_D3L, frameStairsUpFrontD3R);
@@ -1563,7 +1563,7 @@ T0117017:
T0117018:
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k2_ViewSquare_D3R, order);
}
- if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
+ if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
f113_drawField(&g188_FieldAspects[k2_ViewSquare_D3R], g163_FrameWalls[k2_ViewSquare_D3R]._box);
}
}
@@ -1592,7 +1592,7 @@ void DisplayMan::f118_drawSquareD3C(Direction dir, int16 posX, int16 posY) {
int16 order;
_vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY);
- switch (squareAspect[k0_ElemAspect]) {
+ switch (squareAspect[k0_ElementAspect]) {
case k19_ElementTypeStaisFront:
if (squareAspect[k2_StairsUpAspect]) {
f104_drawFloorPitOrStairsBitmap(_g676_stairsNativeBitmapIndex_Up_Front_D3C, frameStairsUpFrontD3C);
@@ -1632,7 +1632,7 @@ T0118027:
T0118028:
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k0_ViewSquare_D3C, order);
}
- if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
+ if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
f113_drawField(&g188_FieldAspects[k0_ViewSquare_D3C], g163_FrameWalls[k0_ViewSquare_D3C]._box);
}
}
@@ -1662,7 +1662,7 @@ void DisplayMan::f119_drawSquareD2L(Direction dir, int16 posX, int16 posY) {
uint16 squareAspect[5];
_vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY);
- switch (squareAspect[k0_ElemAspect]) {
+ switch (squareAspect[k0_ElementAspect]) {
case k19_ElementTypeStaisFront:
if (squareAspect[k2_StairsUpAspect]) {
f104_drawFloorPitOrStairsBitmap(_g677_stairsNativeBitmapIndex_Up_Front_D2L, frameStairsUpFrontD2L);
@@ -1704,7 +1704,7 @@ T0119020:
f112_drawCeilingPit(k63_ceilingPit_D2L_GraphicIndice, &FrameCeilingPitD2L, posX, posY, false);
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k4_ViewSquare_D2L, order);
}
- if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
+ if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
f113_drawField(&g188_FieldAspects[k4_ViewSquare_D2L], g163_FrameWalls[k4_ViewSquare_D2L]._box);
}
}
@@ -1735,7 +1735,7 @@ void DisplayMan::f120_drawSquareD2R(Direction dir, int16 posX, int16 posY) {
_vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY);
- switch (squareAspect[k0_ElemAspect]) {
+ switch (squareAspect[k0_ElementAspect]) {
case k19_ElementTypeStaisFront:
if (squareAspect[k2_StairsUpAspect]) {
f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g677_stairsNativeBitmapIndex_Up_Front_D2L, frameStairsUpFrontD2R);
@@ -1778,7 +1778,7 @@ T0120028:
T0120029:
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k5_ViewSquare_D2R, order);
}
- if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
+ if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
f113_drawField(&g188_FieldAspects[k5_ViewSquare_D2R], g163_FrameWalls[k5_ViewSquare_D2R]._box);
}
}
@@ -1809,7 +1809,7 @@ void DisplayMan::f121_drawSquareD2C(Direction dir, int16 posX, int16 posY) {
uint16 squareAspect[5];
_vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY);
- switch (squareAspect[k0_ElemAspect]) {
+ switch (squareAspect[k0_ElementAspect]) {
case k19_ElementTypeStaisFront:
if (squareAspect[k2_StairsUpAspect]) {
f104_drawFloorPitOrStairsBitmap(_g678_stairsNativeBitmapIndex_Up_Front_D2C, frameStairsUpFrontD2C);
@@ -1850,7 +1850,7 @@ T0121015:
T0121016:
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k3_ViewSquare_D2C, order);
}
- if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
+ if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
f113_drawField(&g188_FieldAspects[k3_ViewSquare_D2C], g163_FrameWalls[k3_ViewSquare_D2C]._box);
}
}
@@ -1882,7 +1882,7 @@ void DisplayMan::f122_drawSquareD1L(Direction dir, int16 posX, int16 posY) {
_vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY);
- switch (squareAspect[k0_ElemAspect]) {
+ switch (squareAspect[k0_ElementAspect]) {
case k19_ElementTypeStaisFront:
if (squareAspect[k2_StairsUpAspect]) {
f104_drawFloorPitOrStairsBitmap(_g679_stairsNativeBitmapIndex_Up_Front_D1L, frameStairsUpFrontD1L);
@@ -1924,7 +1924,7 @@ T0122020:
T0122021:
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k7_ViewSquare_D1L, order);
}
- if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
+ if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
f113_drawField(&g188_FieldAspects[k7_ViewSquare_D1L], g163_FrameWalls[k7_ViewSquare_D1L]._box);
}
}
@@ -1955,7 +1955,7 @@ void DisplayMan::f123_drawSquareD1R(Direction dir, int16 posX, int16 posY) {
uint16 squareAspect[5];
_vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY);
- switch (squareAspect[k0_ElemAspect]) {
+ switch (squareAspect[k0_ElementAspect]) {
case k19_ElementTypeStaisFront:
if (squareAspect[k2_StairsUpAspect]) {
f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g679_stairsNativeBitmapIndex_Up_Front_D1L, frameStairsUpFrontD1R);
@@ -1997,7 +1997,7 @@ T0123020:
T0123021:
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k8_ViewSquare_D1R, order);
}
- if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
+ if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
f113_drawField(&g188_FieldAspects[k8_ViewSquare_D1R], g163_FrameWalls[k8_ViewSquare_D1R]._box);
}
}
@@ -2015,7 +2015,7 @@ void DisplayMan::f124_drawSquareD1C(Direction dir, int16 posX, int16 posY) {
byte* bitmap;
_vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY);
- switch (_vm->_dungeonMan->_g285_squareAheadElement = (ElementType)squareAspect[k0_ElemAspect]) {
+ switch (_vm->_dungeonMan->_g285_squareAheadElement = (ElementType)squareAspect[k0_ElementAspect]) {
case k19_ElementTypeStaisFront:
if (squareAspect[k2_StairsUpAspect]) {
f104_drawFloorPitOrStairsBitmap(_g680_stairsNativeBitmapIndex_Up_Front_D1C, frameStairsUpFrontD1C);
@@ -2076,19 +2076,19 @@ T0124017:
T0124018:
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k6_ViewSquare_D1C, order);
}
- if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
+ if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
f113_drawField(&g188_FieldAspects[k6_ViewSquare_D1C], g163_FrameWalls[k6_ViewSquare_D1C]._box);
}
}
void DisplayMan::f125_drawSquareD0L(Direction dir, int16 posX, int16 posY) {
static Frame frameStairsSideD0L = Frame(0, 15, 73, 85, 8, 13, 0, 0); // @ G0138_s_Graphic558_Frame_StairsSide_D0L
- static Frame g149_FrameFloorPit_D0L = Frame(0, 31, 124, 135, 16, 12, 0, 0); // @ G0149_s_Graphic558_Frame_FloorPit_D0L
- static Frame g158_FrameCeilingPit_D0L = Frame(0, 15, 0, 3, 8, 4, 0, 0); // @ G0158_s_Graphic558_Frame_CeilingPit_D0L
+ static Frame frameFloorPitD0L = Frame(0, 31, 124, 135, 16, 12, 0, 0); // @ G0149_s_Graphic558_Frame_FloorPit_D0L
+ static Frame frameCeilingPitD0L = Frame(0, 15, 0, 3, 8, 4, 0, 0); // @ G0158_s_Graphic558_Frame_CeilingPit_D0L
uint16 squareAspect[5];
_vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY);
- switch (squareAspect[0]) {
+ switch (squareAspect[k0_ElementAspect]) {
case k18_StairsSideElemType:
if (squareAspect[k2_StairsUpAspect])
f104_drawFloorPitOrStairsBitmap(_g692_stairsNativeBitmapIndex_Side_D0L, frameStairsSideD0L);
@@ -2099,6 +2099,10 @@ void DisplayMan::f125_drawSquareD0L(Direction dir, int16 posX, int16 posY) {
default:
break;
}
+
+ f112_drawCeilingPit(k67_ceilingPitD0L_grahicIndice, &frameCeilingPitD0L, posX, posY, false);
+ if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect])
+ f113_drawField(&g188_FieldAspects[k10_ViewSquare_D0L], g163_FrameWalls[k10_ViewSquare_D0L]._box);
}
void DisplayMan::f126_drawSquareD0R(Direction dir, int16 posX, int16 posY) {
@@ -2109,7 +2113,7 @@ void DisplayMan::f126_drawSquareD0R(Direction dir, int16 posX, int16 posY) {
uint16 squareAspect[5];
_vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY);
- switch (squareAspect[k0_ElemAspect]) {
+ switch (squareAspect[k0_ElementAspect]) {
case k18_ElementTypeStairsSide:
f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g692_stairsNativeBitmapIndex_Side_D0L, frameStairsSideD0R);
return;
@@ -2126,7 +2130,7 @@ void DisplayMan::f126_drawSquareD0R(Direction dir, int16 posX, int16 posY) {
f100_drawWallSetBitmap(_g702_bitmapWallSet_Wall_D0R, g163_FrameWalls[k11_ViewSquare_D0R]);
return;
}
- if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
+ if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
f113_drawField(&g188_FieldAspects[k11_ViewSquare_D0R], g163_FrameWalls[k11_ViewSquare_D0R]._box);
}
}
@@ -2144,7 +2148,7 @@ void DisplayMan::f127_drawSquareD0C(Direction dir, int16 posX, int16 posY) {
uint16 squareAspect[5];
_vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY);
- switch (squareAspect[k0_ElemAspect]) {
+ switch (squareAspect[k0_ElementAspect]) {
case k16_DoorSideElemType:
if (_vm->_championMan->_g407_party._event73Count_ThievesEye) {
memmove(_g74_tmpBitmap, _g709_bitmapWallSet_DoorFrameFront, 32 * 123);
@@ -2170,7 +2174,7 @@ void DisplayMan::f127_drawSquareD0C(Direction dir, int16 posX, int16 posY) {
}
f112_drawCeilingPit(k68_ceilingPitD0C_graphicIndice, &frameCeilingPitD0C, posX, posY, false);
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k9_ViewSquare_D0C, k0x0021_CellOrder_BackLeft_BackRight);
- if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
+ if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
f113_drawField(&g188_FieldAspects[k9_ViewSquare_D0C], g163_FrameWalls[k9_ViewSquare_D0C]._box);
}
}