2005-07-24 14:12:37 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
|
|
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2010-08-09 06:48:52 +00:00
|
|
|
/** @file void_cmd.cpp Handling of void tiles. */
|
2007-02-23 18:55:07 +00:00
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
#include "stdafx.h"
|
2007-12-21 22:50:51 +00:00
|
|
|
#include "tile_cmd.h"
|
2007-12-21 21:50:46 +00:00
|
|
|
#include "command_func.h"
|
2008-01-09 09:57:48 +00:00
|
|
|
#include "viewport_func.h"
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2008-01-13 01:21:35 +00:00
|
|
|
#include "table/strings.h"
|
|
|
|
#include "table/sprites.h"
|
|
|
|
|
2010-08-09 06:48:52 +00:00
|
|
|
static void DrawTile_Void(TileInfo *ti)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2010-01-03 20:55:00 +00:00
|
|
|
DrawGroundSprite(SPR_SHADOW_CELL, PAL_NONE);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-08-09 06:48:52 +00:00
|
|
|
static uint GetSlopeZ_Void(TileIndex tile, uint x, uint y)
|
2005-10-19 14:49:46 +00:00
|
|
|
{
|
2009-04-25 22:04:13 +00:00
|
|
|
return TilePixelHeight(tile);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2010-08-09 06:48:52 +00:00
|
|
|
static Foundation GetFoundation_Void(TileIndex tile, Slope tileh)
|
2005-10-22 06:39:32 +00:00
|
|
|
{
|
2007-07-26 16:51:10 +00:00
|
|
|
return FOUNDATION_NONE;
|
2004-08-13 18:27:33 +00:00
|
|
|
}
|
|
|
|
|
2010-08-09 06:48:52 +00:00
|
|
|
static CommandCost ClearTile_Void(TileIndex tile, DoCommandFlag flags)
|
2005-06-24 12:38:35 +00:00
|
|
|
{
|
2009-04-21 23:40:56 +00:00
|
|
|
return_cmd_error(STR_ERROR_OFF_EDGE_OF_MAP);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-08-09 06:48:52 +00:00
|
|
|
static void GetTileDesc_Void(TileIndex tile, TileDesc *td)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
|
|
|
td->str = STR_EMPTY;
|
2008-05-21 22:15:39 +00:00
|
|
|
td->owner[0] = OWNER_NONE;
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2010-08-09 06:48:52 +00:00
|
|
|
static void TileLoop_Void(TileIndex tile)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
|
|
|
/* not used */
|
|
|
|
}
|
|
|
|
|
2010-08-09 06:48:52 +00:00
|
|
|
static void ChangeTileOwner_Void(TileIndex tile, Owner old_owner, Owner new_owner)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
|
|
|
/* not used */
|
|
|
|
}
|
|
|
|
|
2010-08-09 06:48:52 +00:00
|
|
|
static TrackStatus GetTileTrackStatus_Void(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-08-09 06:48:52 +00:00
|
|
|
static CommandCost TerraformTile_Void(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
|
2007-08-30 17:17:04 +00:00
|
|
|
{
|
2009-04-21 23:40:56 +00:00
|
|
|
return_cmd_error(STR_ERROR_OFF_EDGE_OF_MAP);
|
2007-08-30 17:17:04 +00:00
|
|
|
}
|
|
|
|
|
2010-08-09 06:48:52 +00:00
|
|
|
extern const TileTypeProcs _tile_type_void_procs = {
|
|
|
|
DrawTile_Void, // draw_tile_proc
|
|
|
|
GetSlopeZ_Void, // get_slope_z_proc
|
|
|
|
ClearTile_Void, // clear_tile_proc
|
2009-06-25 20:08:59 +00:00
|
|
|
NULL, // add_accepted_cargo_proc
|
2010-08-09 06:48:52 +00:00
|
|
|
GetTileDesc_Void, // get_tile_desc_proc
|
|
|
|
GetTileTrackStatus_Void, // get_tile_track_status_proc
|
2009-06-25 20:08:59 +00:00
|
|
|
NULL, // click_tile_proc
|
|
|
|
NULL, // animate_tile_proc
|
2010-08-09 06:48:52 +00:00
|
|
|
TileLoop_Void, // tile_loop_clear
|
|
|
|
ChangeTileOwner_Void, // change_tile_owner_clear
|
2009-06-27 17:05:20 +00:00
|
|
|
NULL, // add_produced_cargo_proc
|
2009-03-15 00:32:18 +00:00
|
|
|
NULL, // vehicle_enter_tile_proc
|
2010-08-09 06:48:52 +00:00
|
|
|
GetFoundation_Void, // get_foundation_proc
|
|
|
|
TerraformTile_Void, // terraform_tile_proc
|
2004-08-09 17:04:08 +00:00
|
|
|
};
|