Changeset - r7619:d663893bc2b3
[Not reviewed]
master
0 2 0
maedhros - 17 years ago 2007-09-23 10:54:11
maedhros@openttd.org
(svn r11149) -Fix [FS#1225]: Draw building stages for new house ground sprites.
2 files changed with 14 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/macros.h
Show inline comments
 
@@ -341,6 +341,15 @@ template<typename T> static inline T TOG
 
#define GENERAL_SPRITE_COLOR(color) ((color) + PALETTE_RECOLOR_START)
 
#define PLAYER_SPRITE_COLOR(owner) (GENERAL_SPRITE_COLOR(_player_colors[owner]))
 

	
 
/**
 
 * Whether a sprite comes from the original graphics files or a new grf file
 
 * (either supplied by OpenTTD or supplied by the user).
 
 *
 
 * @param sprite The sprite to check
 
 * @return True if it is a new sprite, or false if it is original.
 
 */
 
#define IS_CUSTOM_SPRITE(sprite) ((sprite) >= SPR_SIGNALS_BASE)
 

	
 
extern const byte _ffb_64[128];
 

	
 
/**
src/newgrf_house.cpp
Show inline comments
 
@@ -308,14 +308,18 @@ void DrawTileLayout(const TileInfo *ti, 
 
	SpriteID image = dts->ground_sprite;
 
	SpriteID pal   = dts->ground_pal;
 

	
 
	if (IS_CUSTOM_SPRITE(image)) image += stage;
 

	
 
	if (GB(image, 0, SPRITE_WIDTH) != 0) DrawGroundSprite(image, pal);
 

	
 
	foreach_draw_tile_seq(dtss, dts->seq) {
 
		if (GB(dtss->image, 0, SPRITE_WIDTH) == 0) continue;
 

	
 
		image = dtss->image + stage;
 
		image = dtss->image;
 
		pal   = dtss->pal;
 

	
 
		if (IS_CUSTOM_SPRITE(image)) image += stage;
 

	
 
		if ((HASBIT(image, SPRITE_MODIFIER_OPAQUE) || !HASBIT(_transparent_opt, TO_HOUSES)) && HASBIT(image, PALETTE_MODIFIER_COLOR)) {
 
			if (pal == 0) {
 
				const HouseSpec *hs = GetHouseSpecs(house_id);
0 comments (0 inline, 0 general)