Changeset - r8576:05dfb0d471cd
[Not reviewed]
master
0 2 0
belugas - 16 years ago 2008-02-16 02:37:31
belugas@openttd.org
(svn r12157) -Codechange: Remove a structure definition and replace it with another one closely matching
-Codechange: Replace two magic numbers with according sprite names
2 files changed with 6 insertions and 17 deletions:
0 comments (0 inline, 0 general)
src/table/unmovable_land.h
Show inline comments
 
/* $Id$ */
 

	
 
struct DrawTileUnmovableStruct {
 
	uint16 image;
 
	byte subcoord_x;
 
	byte subcoord_y;
 
	byte width;
 
	byte height;
 
	byte z_size;
 
	byte unused;
 
};
 

	
 
static const DrawTileUnmovableStruct _draw_tile_unmovable_data[] = {
 
	{0xA29, 7, 7, 2, 2, 70, 0},
 
	{0xA2A, 4, 4, 7, 7, 61, 0},
 
static const DrawTileSeqStruct _draw_tile_transmitterlighthouse_data[] = {
 
	{   7,  7,  0,  2,  2, 70, {SPR_UNMOVABLE_TRANSMITTER, PAL_NONE}},
 
	{   4,  4,  0,  7,  7, 61, {SPR_UNMOVABLE_LIGHTHOUSE, PAL_NONE}},
 
};
 

	
 
#define TILE_SEQ_LINE(sz, img) { 0, 0, 0, 16, 16, sz, {img, PAL_NONE} },
 
#define TILE_SEQ_END() { (byte)0x80, 0, 0, 0, 0, 0, {0, 0} }
 

	
 
static const DrawTileSeqStruct _unmovable_display_nothing[] = {
 
	TILE_SEQ_END()
 
};
 

	
 
static const DrawTileSeqStruct _unmovable_display_datas_8[] = {
 
	TILE_SEQ_LINE(20, 0xA34 | (1 << PALETTE_MODIFIER_COLOR))
 
	TILE_SEQ_END()
src/unmovable_cmd.cpp
Show inline comments
 
@@ -158,34 +158,32 @@ CommandCost CmdSellLandArea(TileIndex ti
 

	
 
	return CommandCost(EXPENSES_CONSTRUCTION,- _price.clear_roughland * 2);
 
}
 

	
 
static Foundation GetFoundation_Unmovable(TileIndex tile, Slope tileh);
 

	
 
static void DrawTile_Unmovable(TileInfo *ti)
 
{
 

	
 
	switch (GetUnmovableType(ti->tile)) {
 
		case UNMOVABLE_TRANSMITTER:
 
		case UNMOVABLE_LIGHTHOUSE: {
 
			const DrawTileUnmovableStruct* dtus;
 
			const DrawTileSeqStruct* dtu = &_draw_tile_transmitterlighthouse_data[GetUnmovableType(ti->tile)];
 

	
 
			if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
 
			DrawClearLandTile(ti, 2);
 

	
 
			dtus = &_draw_tile_unmovable_data[GetUnmovableType(ti->tile)];
 

	
 
			AddSortableSpriteToDraw(
 
				dtus->image, PAL_NONE, ti->x | dtus->subcoord_x, ti->y | dtus->subcoord_y,
 
				dtus->width, dtus->height, dtus->z_size, ti->z,
 
				dtu->image.sprite, PAL_NONE, ti->x | dtu->delta_x, ti->y | dtu->delta_y,
 
				dtu->size_x, dtu->size_y, dtu->size_z, ti->z,
 
				IsTransparencySet(TO_STRUCTURES)
 
			);
 
			break;
 
		}
 

	
 
		case UNMOVABLE_STATUE:
 
			/* This should prevent statues from sinking into the ground when on a slope. */
 
			if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, GetFoundation_Unmovable(ti->tile, ti->tileh));
 

	
 
			DrawGroundSprite(SPR_CONCRETE_GROUND, PAL_NONE);
 

	
 
			AddSortableSpriteToDraw(SPR_STATUE_COMPANY, PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)), ti->x, ti->y, 16, 16, 25, ti->z, IsTransparencySet(TO_STRUCTURES));
0 comments (0 inline, 0 general)