(svn r21626) -Codechange: Remove more small static functions.

This commit is contained in:
alberth 2010-12-24 15:06:58 +00:00
parent 62f2771edd
commit 9a5cce382f
1 changed files with 13 additions and 51 deletions

View File

@ -131,33 +131,15 @@ bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_t
return true; return true;
} }
typedef void OnButtonClick(Window *w); /**
* Start a drag for demolishing an area.
static void PlaceProc_BuyLand(TileIndex tile) * @param tile Position of one corner.
{ */
DoCommandP(tile, OBJECT_OWNED_LAND, 0, CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_PURCHASE_THIS_LAND), CcPlaySound1E);
}
void PlaceProc_DemolishArea(TileIndex tile) void PlaceProc_DemolishArea(TileIndex tile)
{ {
VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_DEMOLISH_AREA); 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);
}
static void PlaceProc_LevelLand(TileIndex tile)
{
VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_LEVEL_AREA);
}
/** Enum referring to the widgets of the terraform toolbar */ /** Enum referring to the widgets of the terraform toolbar */
enum TerraformToolbarWidgets { enum TerraformToolbarWidgets {
TTW_SHOW_PLACE_OBJECT, ///< Should the place object button be shown? TTW_SHOW_PLACE_OBJECT, ///< Should the place object button be shown?
@ -267,15 +249,15 @@ struct TerraformToolbarWindow : Window {
{ {
switch (this->last_user_action) { switch (this->last_user_action) {
case TTW_LOWER_LAND: // Lower land button case TTW_LOWER_LAND: // Lower land button
PlaceProc_LowerLand(tile); VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_LOWER_AND_LEVEL_AREA);
break; break;
case TTW_RAISE_LAND: // Raise land button case TTW_RAISE_LAND: // Raise land button
PlaceProc_RaiseLand(tile); VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_RAISE_AND_LEVEL_AREA);
break; break;
case TTW_LEVEL_LAND: // Level land button case TTW_LEVEL_LAND: // Level land button
PlaceProc_LevelLand(tile); VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_LEVEL_AREA);
break; break;
case TTW_DEMOLISH: // Demolish aka dynamite button case TTW_DEMOLISH: // Demolish aka dynamite button
@ -283,7 +265,7 @@ struct TerraformToolbarWindow : Window {
break; break;
case TTW_BUY_LAND: // Buy land button case TTW_BUY_LAND: // Buy land button
PlaceProc_BuyLand(tile); DoCommandP(tile, OBJECT_OWNED_LAND, 0, CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_PURCHASE_THIS_LAND), CcPlaySound1E);
break; break;
case TTW_PLACE_SIGN: // Place sign button case TTW_PLACE_SIGN: // Place sign button
@ -468,26 +450,6 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode)
} }
} }
static void PlaceProc_RaiseBigLand(TileIndex tile)
{
CommonRaiseLowerBigLand(tile, 1);
}
static void PlaceProc_LowerBigLand(TileIndex tile)
{
CommonRaiseLowerBigLand(tile, 0);
}
static void PlaceProc_RockyArea(TileIndex tile)
{
VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_ROCKS);
}
static void PlaceProc_DesertArea(TileIndex tile)
{
VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_DESERT);
}
static const int8 _multi_terraform_coords[][2] = { static const int8 _multi_terraform_coords[][2] = {
{ 0, -2}, { 0, -2},
{ 4, 0}, { -4, 0}, { 0, 2}, { 4, 0}, { -4, 0}, { 0, 2},
@ -736,23 +698,23 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
break; break;
case ETTW_LOWER_LAND: // Lower land button case ETTW_LOWER_LAND: // Lower land button
PlaceProc_LowerBigLand(tile); CommonRaiseLowerBigLand(tile, 0);
break; break;
case ETTW_RAISE_LAND: // Raise land button case ETTW_RAISE_LAND: // Raise land button
PlaceProc_RaiseBigLand(tile); CommonRaiseLowerBigLand(tile, 1);
break; break;
case ETTW_LEVEL_LAND: // Level land button case ETTW_LEVEL_LAND: // Level land button
PlaceProc_LevelLand(tile); VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_LEVEL_AREA);
break; break;
case ETTW_PLACE_ROCKS: // Place rocks button case ETTW_PLACE_ROCKS: // Place rocks button
PlaceProc_RockyArea(tile); VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_ROCKS);
break; break;
case ETTW_PLACE_DESERT: // Place desert button (in tropical climate) case ETTW_PLACE_DESERT: // Place desert button (in tropical climate)
PlaceProc_DesertArea(tile); VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_DESERT);
break; break;
case ETTW_PLACE_OBJECT: // Place transmitter button case ETTW_PLACE_OBJECT: // Place transmitter button