mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-13 07:10:57 +00:00
(svn r13565) -Change [FS#2077]: when invisibility is set, sprite sequences are now drawn until first non-opaque sprite is found (bit 14 not set)
This is to balance performance, code complexity and NewGRF requirements
This commit is contained in:
parent
883ffd1683
commit
811ae0ac3f
@ -330,15 +330,15 @@ void DrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte stage, Ho
|
||||
|
||||
if (GB(image, 0, SPRITE_WIDTH) != 0) DrawGroundSprite(image, pal);
|
||||
|
||||
/* End now, if houses are invisible */
|
||||
if (IsInvisibilitySet(TO_HOUSES)) return;
|
||||
|
||||
foreach_draw_tile_seq(dtss, dts->seq) {
|
||||
if (GB(dtss->image.sprite, 0, SPRITE_WIDTH) == 0) continue;
|
||||
|
||||
image = dtss->image.sprite;
|
||||
pal = dtss->image.pal;
|
||||
|
||||
/* Stop drawing sprite sequence once we meet a sprite that doesn't have to be opaque */
|
||||
if (IsInvisibilitySet(TO_HOUSES) && !HasBit(image, SPRITE_MODIFIER_OPAQUE)) return;
|
||||
|
||||
if (IS_CUSTOM_SPRITE(image)) image += stage;
|
||||
|
||||
if ((HasBit(image, SPRITE_MODIFIER_OPAQUE) || !IsTransparencySet(TO_HOUSES)) && HasBit(image, PALETTE_MODIFIER_COLOR)) {
|
||||
|
@ -187,15 +187,15 @@ void IndustryDrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte r
|
||||
|
||||
if (GB(image, 0, SPRITE_WIDTH) != 0) DrawGroundSprite(image, pal);
|
||||
|
||||
/* End now if industries are invisible */
|
||||
if (IsInvisibilitySet(TO_INDUSTRIES)) return;
|
||||
|
||||
foreach_draw_tile_seq(dtss, dts->seq) {
|
||||
if (GB(dtss->image.sprite, 0, SPRITE_WIDTH) == 0) continue;
|
||||
|
||||
image = dtss->image.sprite;
|
||||
pal = dtss->image.pal;
|
||||
|
||||
/* Stop drawing sprite sequence once we meet a sprite that doesn't have to be opaque */
|
||||
if (IsInvisibilitySet(TO_INDUSTRIES) && !HasBit(image, SPRITE_MODIFIER_OPAQUE)) return;
|
||||
|
||||
if (IS_CUSTOM_SPRITE(image)) image += stage;
|
||||
|
||||
if (HasBit(image, PALETTE_MODIFIER_COLOR)) {
|
||||
|
@ -1847,13 +1847,13 @@ default_waypoint:
|
||||
|
||||
if (HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti);
|
||||
|
||||
/* End now if buildings are invisible */
|
||||
if (IsInvisibilitySet(TO_BUILDINGS)) return;
|
||||
|
||||
foreach_draw_tile_seq(dtss, dts->seq) {
|
||||
SpriteID image = dtss->image.sprite;
|
||||
SpriteID pal;
|
||||
|
||||
/* Stop drawing sprite sequence once we meet a sprite that doesn't have to be opaque */
|
||||
if (IsInvisibilitySet(TO_BUILDINGS) && !HasBit(image, SPRITE_MODIFIER_OPAQUE)) return;
|
||||
|
||||
/* Unlike stations, our default waypoint has no variation for
|
||||
* different railtype, so don't use the railtype offset if
|
||||
* no relocation is set */
|
||||
|
@ -2221,12 +2221,13 @@ static void DrawTile_Station(TileInfo *ti)
|
||||
DrawTramCatenary(ti, axis == AXIS_X ? ROAD_X : ROAD_Y);
|
||||
}
|
||||
|
||||
/* End now if buildings are invisible */
|
||||
if (IsInvisibilitySet(TO_BUILDINGS)) return;
|
||||
|
||||
const DrawTileSeqStruct *dtss;
|
||||
foreach_draw_tile_seq(dtss, t->seq) {
|
||||
SpriteID image = dtss->image.sprite;
|
||||
|
||||
/* Stop drawing sprite sequence once we meet a sprite that doesn't have to be opaque */
|
||||
if (IsInvisibilitySet(TO_BUILDINGS) && !HasBit(image, SPRITE_MODIFIER_OPAQUE)) return;
|
||||
|
||||
if (relocation == 0 || HasBit(image, SPRITE_MODIFIER_USE_OFFSET)) {
|
||||
image += total_offset;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user