Skip to content

Commit

Permalink
Fix door draw alignment (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Sep 5, 2015
1 parent b247287 commit cff9c5f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/cdogs/draw.c
Expand Up @@ -219,10 +219,19 @@ static void DrawWallsAndThings(DrawBuffer *b, Vec2i offset)
else if (tile->flags & MAPTILE_OFFSET_PIC)
{
// Drawing doors
// Doors may be offset; vertical doors are drawn centered
// horizontal doors are bottom aligned
Vec2i doorPos = pos;
doorPos.x += (TILE_WIDTH - tile->picAlt->pic.size.x) / 2;
if (tile->picAlt->pic.size.y > 16)
{
doorPos.y +=
TILE_HEIGHT - (tile->picAlt->pic.size.y % TILE_HEIGHT);
}
BlitMasked(
&gGraphicsDevice,
&tile->picAlt->pic,
pos,
doorPos,
GetTileLOSMask(tile),
0);
}
Expand Down

0 comments on commit cff9c5f

Please sign in to comment.