@@ -576,12 +576,6 @@ void DrawCell(const Surface &out, Point tilePosition, Point targetBufferPosition
576
576
*/
577
577
void DrawFloorTile (const Surface &out, Point tilePosition, Point targetBufferPosition)
578
578
{
579
- const uint16_t levelPieceId = dPiece[tilePosition.x ][tilePosition.y ];
580
-
581
- // Floor tiles always come in pairs. If the left triangle (mt[0]) exists, so does the right one.
582
- assert (DPieceMicros[levelPieceId].mt [0 ].hasValue () == DPieceMicros[levelPieceId].mt [1 ].hasValue ());
583
- if (!DPieceMicros[levelPieceId].mt [0 ].hasValue ()) return ;
584
-
585
579
const int lightTableIndex = dLight[tilePosition.x ][tilePosition.y ];
586
580
587
581
const uint8_t *tbl = LightTables[lightTableIndex].data ();
@@ -590,10 +584,21 @@ void DrawFloorTile(const Surface &out, Point tilePosition, Point targetBufferPos
590
584
tbl = GetPauseTRN ();
591
585
#endif
592
586
593
- RenderTileFrame (out, targetBufferPosition, TileType::LeftTriangle,
594
- GetDunFrame (DPieceMicros[levelPieceId].mt [0 ].frame ()), DunFrameTriangleHeight, MaskType::Solid, tbl);
595
- RenderTileFrame (out, targetBufferPosition + RightFrameDisplacement, TileType::RightTriangle,
596
- GetDunFrame (DPieceMicros[levelPieceId].mt [1 ].frame ()), DunFrameTriangleHeight, MaskType::Solid, tbl);
587
+ const uint16_t levelPieceId = dPiece[tilePosition.x ][tilePosition.y ];
588
+ {
589
+ const LevelCelBlock levelCelBlock { DPieceMicros[levelPieceId].mt [0 ] };
590
+ if (levelCelBlock.hasValue ()) {
591
+ RenderTileFrame (out, targetBufferPosition, TileType::LeftTriangle,
592
+ GetDunFrame (levelCelBlock.frame ()), DunFrameTriangleHeight, MaskType::Solid, tbl);
593
+ }
594
+ }
595
+ {
596
+ const LevelCelBlock levelCelBlock { DPieceMicros[levelPieceId].mt [1 ] };
597
+ if (levelCelBlock.hasValue ()) {
598
+ RenderTileFrame (out, targetBufferPosition + RightFrameDisplacement, TileType::RightTriangle,
599
+ GetDunFrame (levelCelBlock.frame ()), DunFrameTriangleHeight, MaskType::Solid, tbl);
600
+ }
601
+ }
597
602
}
598
603
599
604
/* *
@@ -840,8 +845,9 @@ void DrawFloor(const Surface &out, Point tilePosition, Point targetBufferPositio
840
845
world_draw_black_tile (out, targetBufferPosition.x , targetBufferPosition.y );
841
846
continue ;
842
847
}
843
- if (!IsFloor (tilePosition)) continue ;
844
- DrawFloorTile (out, tilePosition, targetBufferPosition);
848
+ if (IsFloor (tilePosition)) {
849
+ DrawFloorTile (out, tilePosition, targetBufferPosition);
850
+ }
845
851
}
846
852
// Return to start of row
847
853
tilePosition += Displacement (Direction::West) * columns;
0 commit comments