From 893bccf4c8fcfdaf2a8c2cfb49a08fc98164bb9e Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 4 Jul 2009 21:06:17 +0000 Subject: [PATCH] (svn r16744) [0.7] -Backport from trunk: - Fix: r16660 and r16669 are needed to make r16709 work as it should. - Fix: some small 'errors' in the English language file --- src/clear_cmd.cpp | 15 +------ src/dummy_land.cpp | 15 +------ src/landscape.cpp | 10 ----- src/lang/english.txt | 94 ++++++++++++++++++++-------------------- src/rail_cmd.cpp | 7 +-- src/road_cmd.cpp | 8 +--- src/tile_cmd.h | 17 +++++++- src/town_cmd.cpp | 12 +---- src/tree_cmd.cpp | 15 +------ src/tunnelbridge_cmd.cpp | 16 +------ src/unmovable_cmd.cpp | 7 +-- src/water_cmd.cpp | 7 +-- 12 files changed, 75 insertions(+), 148 deletions(-) diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp index 1f1a7a50cd..5fa1f9d8ea 100644 --- a/src/clear_cmd.cpp +++ b/src/clear_cmd.cpp @@ -123,11 +123,6 @@ static void GetAcceptedCargo_Clear(TileIndex tile, AcceptedCargo ac) /* unused */ } -static void AnimateTile_Clear(TileIndex tile) -{ - /* unused */ -} - void TileLoopClearHelper(TileIndex tile) { byte self; @@ -317,12 +312,6 @@ get_out:; } while (--i); } -static bool ClickTile_Clear(TileIndex tile) -{ - /* not used */ - return false; -} - static TrackStatus GetTileTrackStatus_Clear(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side) { return 0; @@ -369,8 +358,8 @@ extern const TileTypeProcs _tile_type_clear_procs = { GetAcceptedCargo_Clear, ///< get_accepted_cargo_proc GetTileDesc_Clear, ///< get_tile_desc_proc GetTileTrackStatus_Clear, ///< get_tile_track_status_proc - ClickTile_Clear, ///< click_tile_proc - AnimateTile_Clear, ///< animate_tile_proc + NULL, ///< click_tile_proc + NULL, ///< animate_tile_proc TileLoop_Clear, ///< tile_loop_clear ChangeTileOwner_Clear, ///< change_tile_owner_clear NULL, ///< get_produced_cargo_proc diff --git a/src/dummy_land.cpp b/src/dummy_land.cpp index 50d33fade8..e6059bb935 100644 --- a/src/dummy_land.cpp +++ b/src/dummy_land.cpp @@ -43,22 +43,11 @@ static void GetTileDesc_Dummy(TileIndex tile, TileDesc *td) td->owner[0] = OWNER_NONE; } -static void AnimateTile_Dummy(TileIndex tile) -{ - /* not used */ -} - static void TileLoop_Dummy(TileIndex tile) { /* not used */ } -static bool ClickTile_Dummy(TileIndex tile) -{ - /* not used */ - return false; -} - static void ChangeTileOwner_Dummy(TileIndex tile, Owner old_owner, Owner new_owner) { /* not used */ @@ -81,8 +70,8 @@ extern const TileTypeProcs _tile_type_dummy_procs = { GetAcceptedCargo_Dummy, // get_accepted_cargo_proc GetTileDesc_Dummy, // get_tile_desc_proc GetTileTrackStatus_Dummy, // get_tile_track_status_proc - ClickTile_Dummy, // click_tile_proc - AnimateTile_Dummy, // animate_tile_proc + NULL, // click_tile_proc + NULL, // animate_tile_proc TileLoop_Dummy, // tile_loop_clear ChangeTileOwner_Dummy, // change_tile_owner_clear NULL, // get_produced_cargo_proc diff --git a/src/landscape.cpp b/src/landscape.cpp index 6d88595074..391f56a366 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -510,16 +510,6 @@ void GetAcceptedCargo(TileIndex tile, AcceptedCargo ac) _tile_type_procs[GetTileType(tile)]->get_accepted_cargo_proc(tile, ac); } -void AnimateTile(TileIndex tile) -{ - _tile_type_procs[GetTileType(tile)]->animate_tile_proc(tile); -} - -bool ClickTile(TileIndex tile) -{ - return _tile_type_procs[GetTileType(tile)]->click_tile_proc(tile); -} - void GetTileDesc(TileIndex tile, TileDesc *td) { _tile_type_procs[GetTileType(tile)]->get_tile_desc_proc(tile, td); diff --git a/src/lang/english.txt b/src/lang/english.txt index bdba92bf97..3b64ab85fd 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -760,7 +760,7 @@ STR_JUST_RAW_STRING :{RAW_STRING} STR_JUST_INT :{NUM} STR_0317_CAN_ONLY_BE_BUILT_IN_RAINFOREST :{WHITE}...can only be built in rainforest areas STR_0318_CAN_ONLY_BE_BUILT_IN_DESERT :{WHITE}...can only be built in desert areas -STR_0319_PAUSED :{YELLOW}* * PAUSED * * +STR_0319_PAUSED :{YELLOW}* * PAUSED * * STR_031B_SCREENSHOT_SUCCESSFULLY :{WHITE}Screenshot successfully saved as '{RAW_STRING}' STR_031C_SCREENSHOT_FAILED :{WHITE}Screenshot failed! @@ -1301,14 +1301,14 @@ STR_NETWORK_YEARS_CAPTION :{BLACK}Years STR_NETWORK_YEARS_CAPTION_TIP :{BLACK}Number of years{}the game is running STR_NETWORK_GAME_INFO :{SILVER}GAME INFO -STR_NETWORK_CLIENTS :{SILVER}Clients: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} -STR_NETWORK_LANGUAGE :{SILVER}Language: {WHITE}{STRING} -STR_NETWORK_TILESET :{SILVER}Tileset: {WHITE}{STRING} -STR_NETWORK_MAP_SIZE :{SILVER}Map size: {WHITE}{COMMA}x{COMMA} -STR_NETWORK_SERVER_VERSION :{SILVER}Server version: {WHITE}{RAW_STRING} -STR_NETWORK_SERVER_ADDRESS :{SILVER}Server address: {WHITE}{RAW_STRING} : {NUM} -STR_NETWORK_START_DATE :{SILVER}Start date: {WHITE}{DATE_SHORT} -STR_NETWORK_CURRENT_DATE :{SILVER}Current date: {WHITE}{DATE_SHORT} +STR_NETWORK_CLIENTS :{SILVER}Clients: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} +STR_NETWORK_LANGUAGE :{SILVER}Language: {WHITE}{STRING} +STR_NETWORK_TILESET :{SILVER}Tileset: {WHITE}{STRING} +STR_NETWORK_MAP_SIZE :{SILVER}Map size: {WHITE}{COMMA}x{COMMA} +STR_NETWORK_SERVER_VERSION :{SILVER}Server version: {WHITE}{RAW_STRING} +STR_NETWORK_SERVER_ADDRESS :{SILVER}Server address: {WHITE}{RAW_STRING} : {NUM} +STR_NETWORK_START_DATE :{SILVER}Start date: {WHITE}{DATE_SHORT} +STR_NETWORK_CURRENT_DATE :{SILVER}Current date: {WHITE}{DATE_SHORT} STR_NETWORK_PASSWORD :{SILVER}Password protected! STR_NETWORK_SERVER_OFFLINE :{SILVER}SERVER OFFLINE STR_NETWORK_SERVER_FULL :{SILVER}SERVER FULL @@ -1390,7 +1390,7 @@ STR_NETWORK_LANG_LATVIAN :Latvian STR_NETWORK_GAME_LOBBY :{WHITE}Multiplayer game lobby -STR_NETWORK_PREPARE_TO_JOIN :{BLACK}Preparing to join: {ORANGE}{RAW_STRING} +STR_NETWORK_PREPARE_TO_JOIN :{BLACK}Preparing to join: {ORANGE}{RAW_STRING} STR_NETWORK_COMPANY_LIST_TIP :{BLACK}A list of all companies currently in this game. You can either join one or start a new one if there is a free company slot STR_NETWORK_NEW_COMPANY :{BLACK}New company STR_NETWORK_NEW_COMPANY_TIP :{BLACK}Create a new company @@ -1403,16 +1403,16 @@ STR_NETWORK_REFRESH_TIP :{BLACK}Refresh STR_NETWORK_COMPANY_INFO :{SILVER}COMPANY INFO -STR_NETWORK_COMPANY_NAME :{SILVER}Company name: {WHITE}{RAW_STRING} -STR_NETWORK_INAUGURATION_YEAR :{SILVER}Inauguration: {WHITE}{NUM} -STR_NETWORK_VALUE :{SILVER}Company value: {WHITE}{CURRENCY} -STR_NETWORK_CURRENT_BALANCE :{SILVER}Current balance: {WHITE}{CURRENCY} -STR_NETWORK_LAST_YEARS_INCOME :{SILVER}Last year's income: {WHITE}{CURRENCY} -STR_NETWORK_PERFORMANCE :{SILVER}Performance: {WHITE}{NUM} +STR_NETWORK_COMPANY_NAME :{SILVER}Company name: {WHITE}{RAW_STRING} +STR_NETWORK_INAUGURATION_YEAR :{SILVER}Inauguration: {WHITE}{NUM} +STR_NETWORK_VALUE :{SILVER}Company value: {WHITE}{CURRENCY} +STR_NETWORK_CURRENT_BALANCE :{SILVER}Current balance: {WHITE}{CURRENCY} +STR_NETWORK_LAST_YEARS_INCOME :{SILVER}Last year's income: {WHITE}{CURRENCY} +STR_NETWORK_PERFORMANCE :{SILVER}Performance: {WHITE}{NUM} -STR_NETWORK_VEHICLES :{SILVER}Vehicles: {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP} -STR_NETWORK_STATIONS :{SILVER}Stations: {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP} -STR_NETWORK_PLAYERS :{SILVER}Players: {WHITE}{RAW_STRING} +STR_NETWORK_VEHICLES :{SILVER}Vehicles: {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP} +STR_NETWORK_STATIONS :{SILVER}Stations: {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP} +STR_NETWORK_PLAYERS :{SILVER}Players: {WHITE}{RAW_STRING} STR_NETWORK_CONNECTING :{WHITE}Connecting... @@ -1439,23 +1439,23 @@ STR_NETWORK_CLIENT_LIST :{WHITE}Client L STR_NETWORK_COMPANY_LIST_SPECTATE :{WHITE}Spectate STR_NETWORK_COMPANY_LIST_NEW_COMPANY :{WHITE}New Company -STR_NETWORK_ERR_NOTAVAILABLE :{WHITE} No network devices found or compiled without ENABLE_NETWORK -STR_NETWORK_ERR_NOSERVER :{WHITE} Could not find any network games -STR_NETWORK_ERR_NOCONNECTION :{WHITE} The server didn't answer the request -STR_NETWORK_ERR_NEWGRF_MISMATCH :{WHITE} Could not connect due to NewGRF mismatch -STR_NETWORK_ERR_DESYNC :{WHITE} Network-Game synchronisation failed -STR_NETWORK_ERR_LOSTCONNECTION :{WHITE} Network-Game connection lost -STR_NETWORK_ERR_SAVEGAMEERROR :{WHITE} Could not load savegame -STR_NETWORK_ERR_SERVER_START :{WHITE} Could not start the server -STR_NETWORK_ERR_CLIENT_START :{WHITE} Could not connect -STR_NETWORK_ERR_TIMEOUT :{WHITE} Connection #{NUM} timed out -STR_NETWORK_ERR_SERVER_ERROR :{WHITE} A protocol-error was made and the connection was closed -STR_NETWORK_ERR_WRONG_REVISION :{WHITE} The revision of this client does not match the server's revision -STR_NETWORK_ERR_WRONG_PASSWORD :{WHITE} Wrong password -STR_NETWORK_ERR_SERVER_FULL :{WHITE} The server is full -STR_NETWORK_ERR_SERVER_BANNED :{WHITE} You are banned from this server -STR_NETWORK_ERR_KICKED :{WHITE} You were kicked out of the game -STR_NETWORK_ERR_CHEATER :{WHITE} Cheating is not allowed on this server +STR_NETWORK_ERR_NOTAVAILABLE :{WHITE}No network devices found or compiled without ENABLE_NETWORK +STR_NETWORK_ERR_NOSERVER :{WHITE}Could not find any network games +STR_NETWORK_ERR_NOCONNECTION :{WHITE}The server didn't answer the request +STR_NETWORK_ERR_NEWGRF_MISMATCH :{WHITE}Could not connect due to NewGRF mismatch +STR_NETWORK_ERR_DESYNC :{WHITE}Network-Game synchronisation failed +STR_NETWORK_ERR_LOSTCONNECTION :{WHITE}Network-Game connection lost +STR_NETWORK_ERR_SAVEGAMEERROR :{WHITE}Could not load savegame +STR_NETWORK_ERR_SERVER_START :{WHITE}Could not start the server +STR_NETWORK_ERR_CLIENT_START :{WHITE}Could not connect +STR_NETWORK_ERR_TIMEOUT :{WHITE}Connection #{NUM} timed out +STR_NETWORK_ERR_SERVER_ERROR :{WHITE}A protocol-error was made and the connection was closed +STR_NETWORK_ERR_WRONG_REVISION :{WHITE}The revision of this client does not match the server's revision +STR_NETWORK_ERR_WRONG_PASSWORD :{WHITE}Wrong password +STR_NETWORK_ERR_SERVER_FULL :{WHITE}The server is full +STR_NETWORK_ERR_SERVER_BANNED :{WHITE}You are banned from this server +STR_NETWORK_ERR_KICKED :{WHITE}You were kicked out of the game +STR_NETWORK_ERR_CHEATER :{WHITE}Cheating is not allowed on this server ############ Leave those lines in this order!! STR_NETWORK_ERR_CLIENT_GENERAL :general error @@ -1752,14 +1752,14 @@ STR_204A_BUILD_STATUE_OF_COMPANY :Build statue of STR_204B_FUND_NEW_BUILDINGS :Fund new buildings STR_204C_BUY_EXCLUSIVE_TRANSPORT :Buy exclusive transport rights STR_TOWN_BRIBE_THE_LOCAL_AUTHORITY :Bribe the local authority -STR_204D_INITIATE_A_SMALL_LOCAL :{WHITE}{STRING}{}{YELLOW} Initiate a small local advertising campaign, to attract more passengers and cargo to your transport services.{} Cost: {CURRENCY} -STR_204E_INITIATE_A_MEDIUM_LOCAL :{WHITE}{STRING}{}{YELLOW} Initiate a medium local advertising campaign, to attract more passengers and cargo to your transport services.{} Cost: {CURRENCY} -STR_204F_INITIATE_A_LARGE_LOCAL :{WHITE}{STRING}{}{YELLOW} Initiate a large local advertising campaign, to attract more passengers and cargo to your transport services.{} Cost: {CURRENCY} -STR_2050_FUND_THE_RECONSTRUCTION :{WHITE}{STRING}{}{YELLOW} Fund the reconstruction of the urban road network. Causes considerable disruption to road traffic for up to 6 months.{} Cost: {CURRENCY} -STR_2051_BUILD_A_STATUE_IN_HONOR :{WHITE}{STRING}{}{YELLOW} Build a statue in honour of your company.{} Cost: {CURRENCY} -STR_2052_FUND_THE_CONSTRUCTION_OF :{WHITE}{STRING}{}{YELLOW} Fund the construction of new commercial buildings in the town.{} Cost: {CURRENCY} -STR_2053_BUY_1_YEAR_S_EXCLUSIVE :{WHITE}{STRING}{}{YELLOW} Buy 1 year's exclusive transport rights in town. Town authority will only allow passengers and cargo to use your company's stations.{} Cost: {CURRENCY} -STR_TOWN_BRIBE_THE_LOCAL_AUTHORITY_DESC :{WHITE}{STRING}{}{YELLOW} Bribe the local authority to increase your rating, at the risk of a severe penalty if caught.{} Cost: {CURRENCY} +STR_204D_INITIATE_A_SMALL_LOCAL :{WHITE}{STRING}{}{YELLOW}Initiate a small local advertising campaign, to attract more passengers and cargo to your transport services.{}Cost: {CURRENCY} +STR_204E_INITIATE_A_MEDIUM_LOCAL :{WHITE}{STRING}{}{YELLOW}Initiate a medium local advertising campaign, to attract more passengers and cargo to your transport services.{}Cost: {CURRENCY} +STR_204F_INITIATE_A_LARGE_LOCAL :{WHITE}{STRING}{}{YELLOW}Initiate a large local advertising campaign, to attract more passengers and cargo to your transport services.{}Cost: {CURRENCY} +STR_2050_FUND_THE_RECONSTRUCTION :{WHITE}{STRING}{}{YELLOW}Fund the reconstruction of the urban road network. Causes considerable disruption to road traffic for up to 6 months.{}Cost: {CURRENCY} +STR_2051_BUILD_A_STATUE_IN_HONOR :{WHITE}{STRING}{}{YELLOW}Build a statue in honour of your company.{}Cost: {CURRENCY} +STR_2052_FUND_THE_CONSTRUCTION_OF :{WHITE}{STRING}{}{YELLOW}Fund the construction of new commercial buildings in the town.{}Cost: {CURRENCY} +STR_2053_BUY_1_YEAR_S_EXCLUSIVE :{WHITE}{STRING}{}{YELLOW}Buy 1 year's exclusive transport rights in town. Town authority will only allow passengers and cargo to use your company's stations.{}Cost: {CURRENCY} +STR_TOWN_BRIBE_THE_LOCAL_AUTHORITY_DESC :{WHITE}{STRING}{}{YELLOW}Bribe the local authority to increase your rating, at the risk of a severe penalty if caught.{}Cost: {CURRENCY} STR_2055_TRAFFIC_CHAOS_IN_ROAD_REBUILDING :{BIGFONT}{BLACK}Traffic chaos in {TOWN}!{}{}Road rebuilding programme funded by {RAW_STRING} brings 6 months of misery to motorists! STR_2056 :{TINYFONT}{WHITE}{TOWN} STR_2057 :{ORANGE}{TOWN}{BLACK} ({COMMA}) @@ -2206,7 +2206,7 @@ STR_7024 :{COMMA} STR_7025_OPERATING_PROFIT_GRAPH :{WHITE}Operating Profit Graph STR_7026_BANK_BALANCE :{WHITE}Bank Balance STR_7027_LOAN :{WHITE}Loan -STR_MAX_LOAN :{WHITE}Max Loan: {BLACK}{CURRENCY} +STR_MAX_LOAN :{WHITE}Max Loan: {BLACK}{CURRENCY} STR_7028 :{BLACK}{CURRENCY} STR_7029_BORROW :{BLACK}Borrow {SKIP}{SKIP}{CURRENCY} STR_702A_REPAY :{BLACK}Repay {SKIP}{SKIP}{CURRENCY} @@ -3283,14 +3283,14 @@ STR_MAGLEV_VEHICLES :Maglev Vehicles STR_TINY_BLACK :{BLACK}{TINYFONT}{COMMA} STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Cost: {GOLD}{CURRENCY}{BLACK} Weight: {GOLD}{WEIGHT_S} -STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Speed: {GOLD}{VELOCITY}{BLACK} Power: {GOLD}{POWER} +STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Speed: {GOLD}{VELOCITY}{BLACK} Power: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Speed: {GOLD}{VELOCITY} STR_PURCHASE_INFO_RUNNINGCOST :{BLACK}Running Cost: {GOLD}{CURRENCY}/yr STR_PURCHASE_INFO_CAPACITY :{BLACK}Capacity: {GOLD}{CARGO} {STRING} STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}Designed: {GOLD}{NUM}{BLACK} Life: {GOLD}{COMMA} years STR_PURCHASE_INFO_RELIABILITY :{BLACK}Max. Reliability: {GOLD}{COMMA}% STR_PURCHASE_INFO_COST :{BLACK}Cost: {GOLD}{CURRENCY} -STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Weight: {GOLD}{WEIGHT_S} ({WEIGHT_S}) +STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Weight: {GOLD}{WEIGHT_S} ({WEIGHT_S}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Cost: {GOLD}{CURRENCY}{BLACK} Speed: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Capacity: {GOLD}{COMMA} passengers, {COMMA} bags of mail STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Powered Wagons: {GOLD}+{POWER}{BLACK} Weight: {GOLD}+{WEIGHT_S} diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index bcf70df147..fe454f716d 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -2078,11 +2078,6 @@ static void GetAcceptedCargo_Track(TileIndex tile, AcceptedCargo ac) /* not used */ } -static void AnimateTile_Track(TileIndex tile) -{ - /* not used */ -} - static void TileLoop_Track(TileIndex tile) { RailGroundType old_ground = GetRailGroundType(tile); @@ -2621,7 +2616,7 @@ extern const TileTypeProcs _tile_type_rail_procs = { GetTileDesc_Track, // get_tile_desc_proc GetTileTrackStatus_Track, // get_tile_track_status_proc ClickTile_Track, // click_tile_proc - AnimateTile_Track, // animate_tile_proc + NULL, // animate_tile_proc TileLoop_Track, // tile_loop_clear ChangeTileOwner_Track, // change_tile_owner_clear NULL, // get_produced_cargo_proc diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index fe363c23a0..8142f09a9d 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -1292,12 +1292,6 @@ static void GetAcceptedCargo_Road(TileIndex tile, AcceptedCargo ac) /* not used */ } -static void AnimateTile_Road(TileIndex tile) -{ - if (IsLevelCrossing(tile)) MarkTileDirtyByTile(tile); -} - - static const Roadside _town_road_types[][2] = { { ROADSIDE_GRASS, ROADSIDE_GRASS }, { ROADSIDE_PAVED, ROADSIDE_PAVED }, @@ -1646,7 +1640,7 @@ extern const TileTypeProcs _tile_type_road_procs = { GetTileDesc_Road, // get_tile_desc_proc GetTileTrackStatus_Road, // get_tile_track_status_proc ClickTile_Road, // click_tile_proc - AnimateTile_Road, // animate_tile_proc + NULL, // animate_tile_proc TileLoop_Road, // tile_loop_clear ChangeTileOwner_Road, // change_tile_owner_clear NULL, // get_produced_cargo_proc diff --git a/src/tile_cmd.h b/src/tile_cmd.h index e7c1787785..bc192fb2d5 100644 --- a/src/tile_cmd.h +++ b/src/tile_cmd.h @@ -16,6 +16,7 @@ #include "direction_type.h" #include "track_type.h" #include "transport_type.h" +#include "tile_map.h" /** The returned bits of VehicleEnterTile. */ enum VehicleEnterTileStatus { @@ -155,8 +156,20 @@ TrackStatus GetTileTrackStatus(TileIndex tile, TransportType mode, uint sub_mode VehicleEnterTileStatus VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y); void GetAcceptedCargo(TileIndex tile, AcceptedCargo ac); void ChangeTileOwner(TileIndex tile, Owner old_owner, Owner new_owner); -void AnimateTile(TileIndex tile); -bool ClickTile(TileIndex tile); void GetTileDesc(TileIndex tile, TileDesc *td); +static inline void AnimateTile(TileIndex tile) +{ + AnimateTileProc *proc = _tile_type_procs[GetTileType(tile)]->animate_tile_proc; + assert(proc != NULL); + proc(tile); +} + +static inline bool ClickTile(TileIndex tile) +{ + ClickTileProc *proc = _tile_type_procs[GetTileType(tile)]->click_tile_proc; + if (proc == NULL) return false; + return proc(tile); +} + #endif /* TILE_CMD_H */ diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index ec765b6418..05b240f33f 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -511,16 +511,6 @@ static void TileLoop_Town(TileIndex tile) _current_company = OWNER_NONE; } -/** - * Dummy tile callback function for handling tile clicks in towns - * @param tile unused - */ -static bool ClickTile_Town(TileIndex tile) -{ - /* not used */ - return false; -} - static CommandCost ClearTile_Town(TileIndex tile, DoCommandFlag flags) { if (flags & DC_AUTO) return_cmd_error(STR_2004_BUILDING_MUST_BE_DEMOLISHED); @@ -2772,7 +2762,7 @@ extern const TileTypeProcs _tile_type_town_procs = { GetAcceptedCargo_Town, // get_accepted_cargo_proc GetTileDesc_Town, // get_tile_desc_proc GetTileTrackStatus_Town, // get_tile_track_status_proc - ClickTile_Town, // click_tile_proc + NULL, // click_tile_proc AnimateTile_Town, // animate_tile_proc TileLoop_Town, // tile_loop_clear ChangeTileOwner_Town, // change_tile_owner_clear diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index 1f778b4c7d..61bca20966 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -562,11 +562,6 @@ static void GetTileDesc_Trees(TileIndex tile, TileDesc *td) td->owner[0] = GetTileOwner(tile); } -static void AnimateTile_Trees(TileIndex tile) -{ - /* not used */ -} - static void TileLoopTreesDesert(TileIndex tile) { switch (GetTropicZone(tile)) { @@ -742,12 +737,6 @@ void OnTick_Trees() } } -static bool ClickTile_Trees(TileIndex tile) -{ - /* not used */ - return false; -} - static TrackStatus GetTileTrackStatus_Trees(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side) { return 0; @@ -776,8 +765,8 @@ extern const TileTypeProcs _tile_type_trees_procs = { GetAcceptedCargo_Trees, // get_accepted_cargo_proc GetTileDesc_Trees, // get_tile_desc_proc GetTileTrackStatus_Trees, // get_tile_track_status_proc - ClickTile_Trees, // click_tile_proc - AnimateTile_Trees, // animate_tile_proc + NULL, // click_tile_proc + NULL, // animate_tile_proc TileLoop_Trees, // tile_loop_clear ChangeTileOwner_Trees, // change_tile_owner_clear NULL, // get_produced_cargo_proc diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 8dbddaede9..5737546442 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -1285,11 +1285,6 @@ static void GetTileDesc_TunnelBridge(TileIndex tile, TileDesc *td) } -static void AnimateTile_TunnelBridge(TileIndex tile) -{ - /* not used */ -} - static void TileLoop_TunnelBridge(TileIndex tile) { bool snow_or_desert = HasTunnelBridgeSnowOrDesert(tile); @@ -1313,13 +1308,6 @@ static void TileLoop_TunnelBridge(TileIndex tile) } } -static bool ClickTile_TunnelBridge(TileIndex tile) -{ - /* not used */ - return false; -} - - static TrackStatus GetTileTrackStatus_TunnelBridge(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side) { TransportType transport_type = GetTunnelBridgeTransportType(tile); @@ -1541,8 +1529,8 @@ extern const TileTypeProcs _tile_type_tunnelbridge_procs = { GetAcceptedCargo_TunnelBridge, // get_accepted_cargo_proc GetTileDesc_TunnelBridge, // get_tile_desc_proc GetTileTrackStatus_TunnelBridge, // get_tile_track_status_proc - ClickTile_TunnelBridge, // click_tile_proc - AnimateTile_TunnelBridge, // animate_tile_proc + NULL, // click_tile_proc + NULL, // animate_tile_proc TileLoop_TunnelBridge, // tile_loop_clear ChangeTileOwner_TunnelBridge, // change_tile_owner_clear NULL, // get_produced_cargo_proc diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp index 9bf26dc963..ccaf3b3668 100644 --- a/src/unmovable_cmd.cpp +++ b/src/unmovable_cmd.cpp @@ -319,11 +319,6 @@ static void GetTileDesc_Unmovable(TileIndex tile, TileDesc *td) td->owner[0] = GetTileOwner(tile); } -static void AnimateTile_Unmovable(TileIndex tile) -{ - /* not used */ -} - static void TileLoop_Unmovable(TileIndex tile) { if (!IsCompanyHQ(tile)) return; @@ -505,7 +500,7 @@ extern const TileTypeProcs _tile_type_unmovable_procs = { GetTileDesc_Unmovable, // get_tile_desc_proc GetTileTrackStatus_Unmovable, // get_tile_track_status_proc ClickTile_Unmovable, // click_tile_proc - AnimateTile_Unmovable, // animate_tile_proc + NULL, // animate_tile_proc TileLoop_Unmovable, // tile_loop_clear ChangeTileOwner_Unmovable, // change_tile_owner_clear NULL, // get_produced_cargo_proc diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 4433be1dd4..7b49b3fcfb 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -706,11 +706,6 @@ static void GetTileDesc_Water(TileIndex tile, TileDesc *td) td->owner[0] = GetTileOwner(tile); } -static void AnimateTile_Water(TileIndex tile) -{ - /* not used */ -} - static void FloodVehicle(Vehicle *v); /** @@ -1164,7 +1159,7 @@ extern const TileTypeProcs _tile_type_water_procs = { GetTileDesc_Water, // get_tile_desc_proc GetTileTrackStatus_Water, // get_tile_track_status_proc ClickTile_Water, // click_tile_proc - AnimateTile_Water, // animate_tile_proc + NULL, // animate_tile_proc TileLoop_Water, // tile_loop_clear ChangeTileOwner_Water, // change_tile_owner_clear NULL, // get_produced_cargo_proc