# void_cmd.cpp

Go to the documentation of this file.

    00001 /* $Id$ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    00008  */
    00009
    00012 #include "stdafx.h"
    00013 #include "tile_cmd.h"
    00014 #include "command_func.h"
    00015 #include "viewport_func.h"
    00016 #include "slope_func.h"
    00017
    00018 #include "table/strings.h"
    00019 #include "table/sprites.h"
    00020
    00021 static void DrawTile_Void(TileInfo *ti)
    00022 {
    00023   DrawGroundSprite(SPR_FLAT_BLACKTILES + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
    00024 }
    00025
    00026
    00027 static uint GetSlopeZ_Void(TileIndex tile, uint x, uint y)
    00028 {
    00029   return TilePixelHeight(tile);
    00030 }
    00031
    00032 static Foundation GetFoundation_Void(TileIndex tile, Slope tileh)
    00033 {
    00034   return FOUNDATION_NONE;
    00035 }
    00036
    00037 static CommandCost ClearTile_Void(TileIndex tile, DoCommandFlag flags)
    00038 {
    00039   CommandCost cost(EXPENSES_CONSTRUCTION);
    00040   return cost;
    00041 }
    00042
    00043
    00044 static void GetTileDesc_Void(TileIndex tile, TileDesc *td)
    00045 {
    00046   td->str = STR_EMPTY;
    00047   td->owner[0] = OWNER_NONE;
    00048 }
    00049
    00050 static void TileLoop_Void(TileIndex tile)
    00051 {
    00052   /* not used */
    00053 }
    00054
    00055 static void ChangeTileOwner_Void(TileIndex tile, Owner old_owner, Owner new_owner)
    00056 {
    00057   /* not used */
    00058 }
    00059
    00060 static TrackStatus GetTileTrackStatus_Void(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
    00061 {
    00062   return 0;
    00063 }
    00064
    00065 static CommandCost TerraformTile_Void(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
    00066 {
    00067   CommandCost cost(EXPENSES_CONSTRUCTION);
    00068   return cost;
    00069 }
    00070
    00071 extern const TileTypeProcs _tile_type_void_procs = {
    00072   DrawTile_Void,            // draw_tile_proc
    00073   GetSlopeZ_Void,           // get_slope_z_proc
    00074   ClearTile_Void,           // clear_tile_proc
    00075   NULL,                     // add_accepted_cargo_proc
    00076   GetTileDesc_Void,         // get_tile_desc_proc
    00077   GetTileTrackStatus_Void,  // get_tile_track_status_proc
    00078   NULL,                     // click_tile_proc
    00079   NULL,                     // animate_tile_proc
    00080   TileLoop_Void,            // tile_loop_clear
    00081   ChangeTileOwner_Void,     // change_tile_owner_clear
    00082   NULL,                     // add_produced_cargo_proc
    00083   NULL,                     // vehicle_enter_tile_proc
    00084   GetFoundation_Void,       // get_foundation_proc
    00085   TerraformTile_Void,       // terraform_tile_proc
    00086 };