Changeset - r9149:24d36511073e
[Not reviewed]
master
0 3 0
rubidium - 16 years ago 2008-05-08 13:30:50
rubidium@openttd.org
(svn r13011) -Codechange: move PlaceProc_BuyLand out of rail_gui.cpp to the place where it is used and remove some unneeded globalisations of some other PlaceProc functions.
3 files changed with 6 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/rail_gui.cpp
Show inline comments
 
@@ -242,29 +242,24 @@ void CcBuildRailTunnel(bool success, Til
 
		ResetObjectToPlace();
 
	} else {
 
		SetRedErrorSquare(_build_tunnel_endtile);
 
	}
 
}
 

	
 
static void PlaceRail_Tunnel(TileIndex tile)
 
{
 
	DoCommandP(tile, _cur_railtype, 0, CcBuildRailTunnel,
 
		CMD_BUILD_TUNNEL | CMD_MSG(STR_5016_CAN_T_BUILD_TUNNEL_HERE));
 
}
 

	
 
void PlaceProc_BuyLand(TileIndex tile)
 
{
 
	DoCommandP(tile, 0, 0, CcPlaySound1E, CMD_PURCHASE_LAND_AREA | CMD_NO_WATER | CMD_MSG(STR_5806_CAN_T_PURCHASE_THIS_LAND));
 
}
 

	
 
static void PlaceRail_ConvertRail(TileIndex tile)
 
{
 
	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CONVERT_RAIL);
 
}
 

	
 
static void PlaceRail_AutoSignals(TileIndex tile)
 
{
 
	VpStartPlaceSizing(tile, VPM_SIGNALDIRS, DDSP_BUILD_SIGNALS);
 
}
 

	
 

	
 
/** Enum referring to the widgets of the build rail toolbar */
src/terraform_gui.cpp
Show inline comments
 
@@ -150,40 +150,45 @@ bool GUIPlaceProcDragXY(const WindowEven
 
typedef void OnButtonClick(Window *w);
 

	
 
static const uint16 _terraform_keycodes[] = {
 
	'Q',
 
	'W',
 
	'E',
 
	'D',
 
	'U',
 
	'I',
 
	'O',
 
};
 

	
 
static void PlaceProc_BuyLand(TileIndex tile)
 
{
 
	DoCommandP(tile, 0, 0, CcPlaySound1E, CMD_PURCHASE_LAND_AREA | CMD_NO_WATER | CMD_MSG(STR_5806_CAN_T_PURCHASE_THIS_LAND));
 
}
 

	
 
void PlaceProc_DemolishArea(TileIndex tile)
 
{
 
	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_DEMOLISH_AREA);
 
}
 

	
 
static void PlaceProc_RaiseLand(TileIndex tile)
 
{
 
	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_RAISE_AND_LEVEL_AREA);
 
}
 

	
 
static void PlaceProc_LowerLand(TileIndex tile)
 
{
 
	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_LOWER_AND_LEVEL_AREA);
 
}
 

	
 
void PlaceProc_LevelLand(TileIndex tile)
 
static void PlaceProc_LevelLand(TileIndex tile)
 
{
 
	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_LEVEL_AREA);
 
}
 

	
 
static void TerraformClick_Lower(Window *w)
 
{
 
	HandlePlacePushButton(w, 4, ANIMCURSOR_LOWERLAND, VHM_POINT, PlaceProc_LowerLand);
 
}
 

	
 
static void TerraformClick_Raise(Window *w)
 
{
 
	HandlePlacePushButton(w, 5, ANIMCURSOR_RAISELAND, VHM_POINT, PlaceProc_RaiseLand);
src/tilehighlight_func.h
Show inline comments
 
@@ -3,26 +3,24 @@
 
/** @file tilehighlight_func.h Functions related to tile highlights. */
 

	
 
#ifndef TILEHIGHLIGHT_FUNC_H
 
#define TILEHIGHLIGHT_FUNC_H
 

	
 
#include "gfx_type.h"
 
#include "window_type.h"
 
#include "viewport_type.h"
 
#include "tilehighlight_type.h"
 

	
 
typedef void PlaceProc(TileIndex tile);
 
void PlaceProc_DemolishArea(TileIndex tile);
 
void PlaceProc_LevelLand(TileIndex tile);
 
void PlaceProc_BuyLand(TileIndex tile);
 
bool GUIPlaceProcDragXY(const WindowEvent *e);
 

	
 
bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, ViewportHighlightMode mode, PlaceProc *placeproc);
 
void SetObjectToPlaceWnd(CursorID icon, SpriteID pal, ViewportHighlightMode mode, Window *w);
 
void SetObjectToPlace(CursorID icon, SpriteID pal, ViewportHighlightMode mode, WindowClass window_class, WindowNumber window_num);
 
void ResetObjectToPlace();
 

	
 
void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method);
 
void VpStartPlaceSizing(TileIndex tile, ViewportPlaceMethod method, ViewportDragDropSelectionProcess process);
 
void VpSetPresizeRange(TileIndex from, TileIndex to);
 
void VpSetPlaceSizingLimit(int limit);
 

	
0 comments (0 inline, 0 general)