File diff r7271:c9129f85e6a4 → r7272:ff5f21406590
src/station_cmd.cpp
Show inline comments
 
@@ -1655,13 +1655,14 @@ CommandCost CmdBuildAirport(TileIndex ti
 
		if (airport_upgrade) UpdateAirplanesOnNewStation(st);
 

	
 
		{
 
			const byte *b = _airport_sections[p1];
 

	
 
			BEGIN_TILE_LOOP(tile_cur, w, h, tile) {
 
				MakeAirport(tile_cur, st->owner, st->index, *b++);
 
				MakeAirport(tile_cur, st->owner, st->index, *b - ((*b < 67) ? 8 : 24));
 
				b++;
 
			} END_TILE_LOOP(tile_cur, w, h, tile)
 
		}
 

	
 
		UpdateStationVirtCoordDirty(st);
 
		UpdateStationAcceptance(st, false);
 
		RebuildStationLists();
 
@@ -1963,15 +1964,15 @@ static CommandCost RemoveDock(Station *s
 

	
 
	return CommandCost(_price.remove_dock);
 
}
 

	
 
#include "table/station_land.h"
 

	
 
const DrawTileSprites *GetStationTileLayout(byte gfx)
 
const DrawTileSprites *GetStationTileLayout(StationType st, byte gfx)
 
{
 
	return &_station_display_datas[gfx];
 
	return &_station_display_datas[st][gfx];
 
}
 

	
 
/* For drawing canal edges on buoys */
 
extern void DrawCanalWater(TileIndex tile);
 

	
 
static void DrawTile_Station(TileInfo *ti)
 
@@ -2025,13 +2026,13 @@ static void DrawTile_Station(TileInfo *t
 
			if (statspec->renderdata != NULL) {
 
				t = &statspec->renderdata[tile < statspec->tiles ? tile : (uint)GetRailStationAxis(ti->tile)];
 
			}
 
		}
 
	}
 

	
 
	if (t == NULL || t->seq == NULL) t = &_station_display_datas[GetStationGfx(ti->tile)];
 
	if (t == NULL || t->seq == NULL) t = &_station_display_datas[GetStationType(ti->tile)][GetStationGfx(ti->tile)];
 

	
 
	SpriteID image = t->ground_sprite;
 
	if (HASBIT(image, SPRITE_MODIFIER_USE_OFFSET)) {
 
		image += GetCustomStationGroundRelocation(statspec, st, ti->tile);
 
		image += rti->custom_ground_offset;
 
	} else {
 
@@ -2081,17 +2082,17 @@ static void DrawTile_Station(TileInfo *t
 
		} else {
 
			AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y);
 
		}
 
	}
 
}
 

	
 
void StationPickerDrawSprite(int x, int y, RailType railtype, RoadType roadtype, int image)
 
void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, RoadType roadtype, int image)
 
{
 
	const RailtypeInfo *rti = GetRailTypeInfo(railtype);
 
	SpriteID pal = PLAYER_SPRITE_COLOR(_local_player);
 
	const DrawTileSprites *t = &_station_display_datas[image];
 
	const DrawTileSprites *t = &_station_display_datas[st][image];
 

	
 
	SpriteID img = t->ground_sprite;
 
	DrawSprite(img + rti->total_offset, HASBIT(img, PALETTE_MODIFIER_COLOR) ? pal : PAL_NONE, x, y);
 

	
 
	if (roadtype == ROADTYPE_TRAM) {
 
		DrawSprite(SPR_TRAMWAY_TRAM + (t->ground_sprite == SPR_ROAD_PAVED_STRAIGHT_X ? 1 : 0), PAL_NONE, x, y);
 
@@ -2177,24 +2178,28 @@ static uint32 GetTileTrackStatus_Station
 

	
 

	
 
static void TileLoop_Station(TileIndex tile)
 
{
 
	// FIXME -- GetTileTrackStatus_Station -> animated stationtiles
 
	// hardcoded.....not good
 
	switch (GetStationGfx(tile)) {
 
		case GFX_RADAR_LARGE_FIRST:
 
		case GFX_WINDSACK_FIRST : // for small airport
 
		case GFX_RADAR_INTERNATIONAL_FIRST:
 
		case GFX_RADAR_METROPOLITAN_FIRST:
 
		case GFX_RADAR_DISTRICTWE_FIRST: // radar district W-E airport
 
		case GFX_WINDSACK_INTERCON_FIRST : // for intercontinental airport
 
			AddAnimatedTile(tile);
 
	switch (GetStationType(tile)) {
 
		case STATION_AIRPORT:
 
			switch (GetStationGfx(tile)) {
 
				case GFX_RADAR_LARGE_FIRST:
 
				case GFX_WINDSACK_FIRST : // for small airport
 
				case GFX_RADAR_INTERNATIONAL_FIRST:
 
				case GFX_RADAR_METROPOLITAN_FIRST:
 
				case GFX_RADAR_DISTRICTWE_FIRST: // radar district W-E airport
 
				case GFX_WINDSACK_INTERCON_FIRST : // for intercontinental airport
 
					AddAnimatedTile(tile);
 
					break;
 
			}
 
			break;
 

	
 
		case GFX_OILRIG_BASE: //(station part)
 
		case GFX_BUOY_BASE:
 
		case STATION_OILRIG: //(station part)
 
		case STATION_BUOY:
 
			TileLoop_Water(tile);
 
			break;
 

	
 
		default: break;
 
	}
 
}