diff options
Diffstat (limited to 'src/unmovable_cmd.cpp')
-rw-r--r-- | src/unmovable_cmd.cpp | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp index bc63a8523..b67a1a0a2 100644 --- a/src/unmovable_cmd.cpp +++ b/src/unmovable_cmd.cpp @@ -107,7 +107,8 @@ int32 CmdBuildCompanyHQ(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) static void DrawTile_Unmovable(TileInfo *ti) { - uint32 image, ormod; + SpriteID image; + SpriteID pal; switch (GetUnmovableType(ti->tile)) { case UNMOVABLE_TRANSMITTER: @@ -120,29 +121,45 @@ static void DrawTile_Unmovable(TileInfo *ti) dtus = &_draw_tile_unmovable_data[GetUnmovableType(ti->tile)]; image = dtus->image; - if (_display_opt & DO_TRANS_BUILDINGS) MAKE_TRANSPARENT(image); + if (_display_opt & DO_TRANS_BUILDINGS) { + SETBIT(image, PALETTE_MODIFIER_TRANSPARENT); + pal = PALETTE_TO_TRANSPARENT; + } else { + pal = PAL_NONE; + } AddSortableSpriteToDraw( - image, ti->x | dtus->subcoord_x, ti->y | dtus->subcoord_y, + image, pal, ti->x | dtus->subcoord_x, ti->y | dtus->subcoord_y, dtus->width, dtus->height, dtus->z_size, ti->z ); break; } case UNMOVABLE_STATUE: - DrawGroundSprite(SPR_CONCRETE_GROUND); - - image = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)); - image += PALETTE_MODIFIER_COLOR | SPR_STATUE_COMPANY; - if (_display_opt & DO_TRANS_BUILDINGS) MAKE_TRANSPARENT(image); - AddSortableSpriteToDraw(image, ti->x, ti->y, 16, 16, 25, ti->z); + DrawGroundSprite(SPR_CONCRETE_GROUND, PAL_NONE); + + image = SPR_STATUE_COMPANY; + if (_display_opt & DO_TRANS_BUILDINGS) { + SETBIT(image, PALETTE_MODIFIER_TRANSPARENT); + pal = PALETTE_TO_TRANSPARENT; + } else { + pal = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)); + } + AddSortableSpriteToDraw(image, pal, ti->x, ti->y, 16, 16, 25, ti->z); break; case UNMOVABLE_OWNED_LAND: DrawClearLandTile(ti, 0); + image = SPR_BOUGHT_LAND; + if (_display_opt & DO_TRANS_BUILDINGS) { + SETBIT(image, PALETTE_MODIFIER_TRANSPARENT); + pal = PALETTE_TO_TRANSPARENT; + } else { + pal = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)); + } AddSortableSpriteToDraw( - PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)) + PALETTE_MODIFIER_COLOR + SPR_BOUGHT_LAND, + image, pal, ti->x + TILE_SIZE / 2, ti->y + TILE_SIZE / 2, 1, 1, 10, GetSlopeZ(ti->x + TILE_SIZE / 2, ti->y + TILE_SIZE / 2) ); DrawBridgeMiddle(ti); @@ -151,24 +168,26 @@ static void DrawTile_Unmovable(TileInfo *ti) default: { const DrawTileSeqStruct* dtss; const DrawTileSprites* t; + SpriteID palette; assert(IsCompanyHQ(ti->tile)); if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, ti->tileh); - ormod = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)); + palette = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)); t = &_unmovable_display_datas[GetCompanyHQSection(ti->tile)]; - DrawGroundSprite(t->ground_sprite | ormod); + DrawGroundSprite(t->ground_sprite, palette); foreach_draw_tile_seq(dtss, t->seq) { image = dtss->image; if (_display_opt & DO_TRANS_BUILDINGS) { - MAKE_TRANSPARENT(image); + SETBIT(image, PALETTE_MODIFIER_TRANSPARENT); + pal = PALETTE_TO_TRANSPARENT; } else { - image |= ormod; + pal = palette; } AddSortableSpriteToDraw( - image, + image, pal, ti->x + dtss->delta_x, ti->y + dtss->delta_y, dtss->size_x, dtss->size_y, dtss->size_z, ti->z + dtss->delta_z |