aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2016-08-16 22:36:10 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commitc62e449bbf5db1276c3a1978fa6d764cbada7d00 (patch)
treef498af888ff2943394e6075d6caaf4bbd10615e3 /engines
parenteb2b298631da9466835d4f18b08b6cfc2e116f5f (diff)
downloadscummvm-rg350-c62e449bbf5db1276c3a1978fa6d764cbada7d00.tar.gz
scummvm-rg350-c62e449bbf5db1276c3a1978fa6d764cbada7d00.tar.bz2
scummvm-rg350-c62e449bbf5db1276c3a1978fa6d764cbada7d00.zip
DM: Refactor f116_drawSquareD3L, remove 4 GOTOs
Diffstat (limited to 'engines')
-rw-r--r--engines/dm/gfx.cpp38
1 files changed, 23 insertions, 15 deletions
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 04b0da7c5f..2f46c7c1a2 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -1220,7 +1220,7 @@ void DisplayMan::f116_drawSquareD3L(Direction dir, int16 posX, int16 posY) {
uint16 squareAspect[5];
int16 order;
-
+ bool skip = false;
_vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY);
switch (squareAspect[k0_ElementAspect]) {
case k19_StairsFrontElemType:
@@ -1228,19 +1228,24 @@ void DisplayMan::f116_drawSquareD3L(Direction dir, int16 posX, int16 posY) {
f104_drawFloorPitOrStairsBitmap(_g675_stairsNativeBitmapIndex_Up_Front_D3L, frameStairsUpFrontD3L);
else
f104_drawFloorPitOrStairsBitmap(_g682_stairsNativeBitmapIndex_Down_Front_D3L, frameStairsDownFrontD3L);
- goto T0116015_redEagle;
+ order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight;
+ /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
+ f108_drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k0_viewFloor_D3L);
+ break;
case k0_WallElemType:
f100_drawWallSetBitmap(_g698_bitmapWallSet_Wall_D3LCR, _frameWalls163[k1_ViewSquare_D3L]);
f107_isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k0_ViewWall_D3L_RIGHT);
- if (f107_isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k2_ViewWall_D3L_FRONT)) {
+ if (f107_isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k2_ViewWall_D3L_FRONT))
order = k0x0000_CellOrder_Alcove;
- goto T0116017_orangeElk;
- }
- return;
+ else
+ return;
+ break;
case k16_ElementTypeDoorSide:
case k18_ElementTypeStairsSide:
order = k0x0321_CellOrder_BackLeft_BackRight_FrontRight;
- goto T0116016_blueToad;
+ /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
+ f108_drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k0_viewFloor_D3L);
+ break;
case k17_ElementTypeDoorFront:
f108_drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k0_viewFloor_D3L);
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight);
@@ -1248,24 +1253,27 @@ void DisplayMan::f116_drawSquareD3L(Direction dir, int16 posX, int16 posY) {
f111_drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect],
_g693_doorNativeBitmapIndex_Front_D3LCR, M75_bitmapByteCount(48, 41), k0_ViewDoorOrnament_D3LCR, &doorFrameD3L);
order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight;
- goto T0116017_orangeElk;
+ break;
case k2_ElementTypePit:
if (!squareAspect[k2_PitInvisibleAspect])
f104_drawFloorPitOrStairsBitmap(k49_FloorPit_D3L_GraphicIndice, frameFloorPitD3L);
// no break on purpose
case k5_ElementTypeTeleporter:
case k1_ElementTypeCorridor:
-T0116015_redEagle:
order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight;
-T0116016_blueToad:
-/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
+ /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
f108_drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k0_viewFloor_D3L);
-T0116017_orangeElk:
- f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, order);
+ break;
+ default:
+ skip = true;
+ break;
}
- if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) {
+
+ if (!skip)
+ f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, order);
+
+ if ((squareAspect[k0_ElementAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect])
f113_drawField(&_fieldAspects188[k1_ViewSquare_D3L], _frameWalls163[k1_ViewSquare_D3L]._box);
- }
}
void DisplayMan::f117_drawSquareD3R(Direction dir, int16 posX, int16 posY) {