summaryrefslogtreecommitdiff
path: root/src/terraform_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-05-26 19:23:42 +0000
committerfrosch <frosch@openttd.org>2013-05-26 19:23:42 +0000
commit56e4a8c4d63b19cb037ac1ba64c5a4d7fde4350b (patch)
treef3e5c225182fce7a451af4e09e943920e0f1cc3c /src/terraform_gui.cpp
parentb10a4f151aa534860dcc61ecf8cba7b3589e6281 (diff)
downloadopenttd-56e4a8c4d63b19cb037ac1ba64c5a4d7fde4350b.tar.xz
(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.
Diffstat (limited to 'src/terraform_gui.cpp')
-rw-r--r--src/terraform_gui.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index d3c28ef9e..22efd7a39 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -147,11 +147,11 @@ void PlaceProc_DemolishArea(TileIndex tile)
struct TerraformToolbarWindow : Window {
int last_user_action; ///< Last started user action.
- TerraformToolbarWindow(const WindowDesc *desc, WindowNumber window_number) : Window()
+ TerraformToolbarWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc)
{
/* This is needed as we like to have the tree available on OnInit. */
- this->CreateNestedTree(desc);
- this->FinishInitNested(desc, window_number);
+ this->CreateNestedTree();
+ this->FinishInitNested(window_number);
this->last_user_action = WIDGET_LIST_END;
}
@@ -266,7 +266,7 @@ struct TerraformToolbarWindow : Window {
VpSelectTilesWithMethod(pt.x, pt.y, select_method);
}
- virtual Point OnInitialPosition(const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
+ virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number)
{
Point pt = GetToolbarAlignedWindowPosition(sm_width);
pt.y += sm_height;
@@ -341,7 +341,7 @@ static const NWidgetPart _nested_terraform_widgets[] = {
EndContainer(),
};
-static const WindowDesc _terraform_desc(
+static WindowDesc _terraform_desc(
WDP_MANUAL, 0, 0,
WC_SCEN_LAND_GEN, WC_NONE,
WDF_CONSTRUCTION,
@@ -536,12 +536,12 @@ static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed)
struct ScenarioEditorLandscapeGenerationWindow : Window {
int last_user_action; ///< Last started user action.
- ScenarioEditorLandscapeGenerationWindow(const WindowDesc *desc, WindowNumber window_number) : Window()
+ ScenarioEditorLandscapeGenerationWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc)
{
- this->CreateNestedTree(desc);
+ this->CreateNestedTree();
NWidgetStacked *show_desert = this->GetWidget<NWidgetStacked>(WID_ETT_SHOW_PLACE_DESERT);
show_desert->SetDisplayedPlane(_settings_game.game_creation.landscape == LT_TROPIC ? 0 : SZSP_NONE);
- this->FinishInitNested(desc, window_number);
+ this->FinishInitNested(window_number);
this->last_user_action = WIDGET_LIST_END;
}
@@ -739,7 +739,7 @@ Hotkey<ScenarioEditorLandscapeGenerationWindow> ScenarioEditorLandscapeGeneratio
Hotkey<ScenarioEditorLandscapeGenerationWindow> *_terraform_editor_hotkeys = ScenarioEditorLandscapeGenerationWindow::terraform_editor_hotkeys;
-static const WindowDesc _scen_edit_land_gen_desc(
+static WindowDesc _scen_edit_land_gen_desc(
WDP_AUTO, 0, 0,
WC_SCEN_LAND_GEN, WC_NONE,
WDF_CONSTRUCTION,