File diff r18300:87ebd90f3b7f → r18301:0c1dfbaba57a
src/newgrf_industrytiles.cpp
Show inline comments
 
@@ -227,49 +227,49 @@ uint16 GetIndustryTileCallback(CallbackI
 
	assert(industry != NULL && IsValidTile(tile));
 
	assert(industry->index == INVALID_INDUSTRY || IsTileType(tile, MP_INDUSTRY));
 

	
 
	NewIndustryTileResolver(&object, gfx_id, tile, industry);
 
	object.callback = callback;
 
	object.callback_param1 = param1;
 
	object.callback_param2 = param2;
 

	
 
	group = SpriteGroup::Resolve(GetIndustryTileSpec(gfx_id)->grf_prop.spritegroup[0], &object);
 
	if (group == NULL || group->type != SGT_CALLBACK) return CALLBACK_FAILED;
 

	
 
	return group->GetCallbackResult();
 
}
 

	
 
bool DrawNewIndustryTile(TileInfo *ti, Industry *i, IndustryGfx gfx, const IndustryTileSpec *inds)
 
{
 
	const SpriteGroup *group;
 
	ResolverObject object;
 

	
 
	if (ti->tileh != SLOPE_FLAT) {
 
		bool draw_old_one = true;
 
		if (HasBit(inds->callback_mask, CBM_INDT_DRAW_FOUNDATIONS)) {
 
			/* Called to determine the type (if any) of foundation to draw for industry tile */
 
			uint32 callback_res = GetIndustryTileCallback(CBID_INDTILE_DRAW_FOUNDATIONS, 0, 0, gfx, i, ti->tile);
 
			draw_old_one = (callback_res != 0);
 
			if (callback_res != CALLBACK_FAILED) draw_old_one = ConvertBooleanCallback(inds->grf_prop.grffile, CBID_INDTILE_DRAW_FOUNDATIONS, callback_res);
 
		}
 

	
 
		if (draw_old_one) DrawFoundation(ti, FOUNDATION_LEVELED);
 
	}
 

	
 
	NewIndustryTileResolver(&object, gfx, ti->tile, i);
 

	
 
	group = SpriteGroup::Resolve(inds->grf_prop.spritegroup[0], &object);
 
	if (group == NULL || group->type != SGT_TILELAYOUT) {
 
		return false;
 
	} else {
 
		/* Limit the building stage to the number of stages supplied. */
 
		const TileLayoutSpriteGroup *tlgroup = (const TileLayoutSpriteGroup *)group;
 
		byte stage = GetIndustryConstructionStage(ti->tile);
 
		IndustryDrawTileLayout(ti, tlgroup, i->random_colour, stage, gfx);
 
		return true;
 
	}
 
}
 

	
 
extern bool IsSlopeRefused(Slope current, Slope refused);
 

	
 
/**
 
 * Check the slope of a tile of a new industry.
 
 * @param ind_base_tile Base tile of the industry.