1
0
Fork 0

(svn r11190) -Fix: make snowy roofs of (newgrf) houses also transparent.

release/0.6
rubidium 2007-09-30 19:33:40 +00:00
parent 171374a8f0
commit a2256f6b0f
5 changed files with 11 additions and 5 deletions

View File

@ -346,7 +346,7 @@ void DrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte stage, Ho
HASBIT(_transparent_opt, TO_HOUSES)
);
} else {
AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y);
AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y, HASBIT(_transparent_opt, TO_HOUSES));
}
}
}

View File

@ -196,7 +196,7 @@ void IndustryDrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte r
!HASBIT(image, SPRITE_MODIFIER_OPAQUE) && HASBIT(_transparent_opt, TO_INDUSTRIES)
);
} else {
AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y);
AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y, HASBIT(_transparent_opt, TO_INDUSTRIES));
}
}
}

View File

@ -2115,7 +2115,7 @@ static void DrawTile_Station(TileInfo *ti)
HASBIT(_transparent_opt, TO_BUILDINGS)
);
} else {
AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y);
AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y, HASBIT(_transparent_opt, TO_BUILDINGS));
}
}
}

View File

@ -613,13 +613,19 @@ void EndSpriteCombine()
_cur_vd->combine_sprites = 0;
}
void AddChildSpriteScreen(SpriteID image, SpriteID pal, int x, int y)
void AddChildSpriteScreen(SpriteID image, SpriteID pal, int x, int y, bool transparent)
{
ViewportDrawer *vd = _cur_vd;
ChildScreenSpriteToDraw *cs;
assert((image & SPRITE_MASK) < MAX_SPRITES);
/* make the sprites transparent with the right palette */
if (transparent) {
SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
pal = PALETTE_TO_TRANSPARENT;
}
if (vd->spritelist_mem >= vd->eof_spritelist_mem) {
DEBUG(sprite, 0, "Out of sprite memory");
return;

View File

@ -61,7 +61,7 @@ void DrawGroundSprite(SpriteID image, SpriteID pal);
void DrawGroundSpriteAt(SpriteID image, SpriteID pal, int32 x, int32 y, byte z);
void AddSortableSpriteToDraw(SpriteID image, SpriteID pal, int x, int y, int w, int h, int dz, int z, bool transparent = false, int bb_offset_x = 0, int bb_offset_y = 0, int bb_offset_z = 0);
void *AddStringToDraw(int x, int y, StringID string, uint64 params_1, uint64 params_2);
void AddChildSpriteScreen(SpriteID image, SpriteID pal, int x, int y);
void AddChildSpriteScreen(SpriteID image, SpriteID pal, int x, int y, bool transparent = false);
void StartSpriteCombine();