File diff r7848:705b74bab657 → r7849:cfd99cb69695
src/newgrf_house.cpp
Show inline comments
 
@@ -22,12 +22,13 @@
 
#include "newgrf_house.h"
 
#include "newgrf_spritegroup.h"
 
#include "newgrf_callbacks.h"
 
#include "newgrf_town.h"
 
#include "newgrf_sound.h"
 
#include "newgrf_commons.h"
 
#include "transparency.h"
 

	
 
static BuildingCounts    _building_counts;
 
static HouseClassMapping _class_mapping[HOUSE_CLASS_MAX];
 

	
 
HouseOverrideManager _house_mngr(NEW_HOUSE_OFFSET, HOUSE_MAX, INVALID_HOUSE_ID);
 

	
 
@@ -317,13 +318,13 @@ void DrawTileLayout(const TileInfo *ti, 
 

	
 
		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 ((HASBIT(image, SPRITE_MODIFIER_OPAQUE) || !IsTransparencySet(TO_HOUSES)) && HASBIT(image, PALETTE_MODIFIER_COLOR)) {
 
			if (pal == 0) {
 
				const HouseSpec *hs = GetHouseSpecs(house_id);
 
				if (HASBIT(hs->callback_mask, CBM_HOUSE_COLOUR)) {
 
					uint16 callback = GetHouseCallback(CBID_HOUSE_COLOUR, 0, 0, house_id, GetTownByTile(ti->tile), ti->tile);
 
					if (callback != CALLBACK_FAILED) {
 
						/* If bit 14 is set, we should use a 2cc colour map, else use the callback value. */
 
@@ -340,16 +341,16 @@ void DrawTileLayout(const TileInfo *ti, 
 
		if ((byte)dtss->delta_z != 0x80) {
 
			AddSortableSpriteToDraw(
 
				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,
 
				HASBIT(_transparent_opt, TO_HOUSES)
 
				IsTransparencySet(TO_HOUSES)
 
			);
 
		} else {
 
			AddChildSpriteScreen(image, pal, (byte)dtss->delta_x, (byte)dtss->delta_y, HASBIT(_transparent_opt, TO_HOUSES));
 
			AddChildSpriteScreen(image, pal, (byte)dtss->delta_x, (byte)dtss->delta_y, IsTransparencySet(TO_HOUSES));
 
		}
 
	}
 
}
 

	
 
void DrawNewHouseTile(TileInfo *ti, HouseID house_id)
 
{