diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -43,9 +43,9 @@ static const uint INVALID_DATAPOINT_POS /****************/ struct GraphLegendWindow : Window { - GraphLegendWindow(const WindowDesc *desc, WindowNumber window_number) : Window() + GraphLegendWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc) { - this->InitNested(desc, window_number); + this->InitNested(window_number); for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) { if (!HasBit(_legend_excluded_companies, c)) this->LowerWidget(c + WID_GL_FIRST_COMPANY); @@ -140,7 +140,7 @@ static const NWidgetPart _nested_graph_l EndContainer(), }; -static const WindowDesc _graph_legend_desc( +static WindowDesc _graph_legend_desc( WDP_AUTO, 0, 0, WC_GRAPH_LEGEND, WC_NONE, 0, @@ -463,8 +463,8 @@ protected: } - BaseGraphWindow(int widget, StringID format_str_y_axis) : - Window(), + BaseGraphWindow(WindowDesc *desc, int widget, StringID format_str_y_axis) : + Window(desc), format_str_y_axis(format_str_y_axis) { SetWindowDirty(WC_GRAPH_LEGEND, 0); @@ -472,12 +472,12 @@ protected: this->graph_widget = widget; } - void InitializeWindow(const WindowDesc *desc, WindowNumber number) + void InitializeWindow(WindowNumber number) { /* Initialise the dataset */ this->UpdateStatistics(true); - this->InitNested(desc, number); + this->InitNested(number); } public: @@ -611,10 +611,10 @@ public: /********************/ struct OperatingProfitGraphWindow : BaseGraphWindow { - OperatingProfitGraphWindow(const WindowDesc *desc, WindowNumber window_number) : - BaseGraphWindow(WID_CV_GRAPH, STR_JUST_CURRENCY_SHORT) + OperatingProfitGraphWindow(WindowDesc *desc, WindowNumber window_number) : + BaseGraphWindow(desc, WID_CV_GRAPH, STR_JUST_CURRENCY_SHORT) { - this->InitializeWindow(desc, window_number); + this->InitializeWindow(window_number); } virtual OverflowSafeInt64 GetGraphData(const Company *c, int j) @@ -642,7 +642,7 @@ static const NWidgetPart _nested_operati EndContainer(), }; -static const WindowDesc _operating_profit_desc( +static WindowDesc _operating_profit_desc( WDP_AUTO, 0, 0, WC_OPERATING_PROFIT, WC_NONE, 0, @@ -661,10 +661,10 @@ void ShowOperatingProfitGraph() /****************/ struct IncomeGraphWindow : BaseGraphWindow { - IncomeGraphWindow(const WindowDesc *desc, WindowNumber window_number) : - BaseGraphWindow(WID_CV_GRAPH, STR_JUST_CURRENCY_SHORT) + IncomeGraphWindow(WindowDesc *desc, WindowNumber window_number) : + BaseGraphWindow(desc, WID_CV_GRAPH, STR_JUST_CURRENCY_SHORT) { - this->InitializeWindow(desc, window_number); + this->InitializeWindow(window_number); } virtual OverflowSafeInt64 GetGraphData(const Company *c, int j) @@ -692,7 +692,7 @@ static const NWidgetPart _nested_income_ EndContainer(), }; -static const WindowDesc _income_graph_desc( +static WindowDesc _income_graph_desc( WDP_AUTO, 0, 0, WC_INCOME_GRAPH, WC_NONE, 0, @@ -709,10 +709,10 @@ void ShowIncomeGraph() /*******************/ struct DeliveredCargoGraphWindow : BaseGraphWindow { - DeliveredCargoGraphWindow(const WindowDesc *desc, WindowNumber window_number) : - BaseGraphWindow(WID_CV_GRAPH, STR_JUST_COMMA) + DeliveredCargoGraphWindow(WindowDesc *desc, WindowNumber window_number) : + BaseGraphWindow(desc, WID_CV_GRAPH, STR_JUST_COMMA) { - this->InitializeWindow(desc, window_number); + this->InitializeWindow(window_number); } virtual OverflowSafeInt64 GetGraphData(const Company *c, int j) @@ -740,7 +740,7 @@ static const NWidgetPart _nested_deliver EndContainer(), }; -static const WindowDesc _delivered_cargo_graph_desc( +static WindowDesc _delivered_cargo_graph_desc( WDP_AUTO, 0, 0, WC_DELIVERED_CARGO, WC_NONE, 0, @@ -757,10 +757,10 @@ void ShowDeliveredCargoGraph() /***********************/ struct PerformanceHistoryGraphWindow : BaseGraphWindow { - PerformanceHistoryGraphWindow(const WindowDesc *desc, WindowNumber window_number) : - BaseGraphWindow(WID_PHG_GRAPH, STR_JUST_COMMA) + PerformanceHistoryGraphWindow(WindowDesc *desc, WindowNumber window_number) : + BaseGraphWindow(desc, WID_PHG_GRAPH, STR_JUST_COMMA) { - this->InitializeWindow(desc, window_number); + this->InitializeWindow(window_number); } virtual OverflowSafeInt64 GetGraphData(const Company *c, int j) @@ -795,7 +795,7 @@ static const NWidgetPart _nested_perform EndContainer(), }; -static const WindowDesc _performance_history_desc( +static WindowDesc _performance_history_desc( WDP_AUTO, 0, 0, WC_PERFORMANCE_HISTORY, WC_NONE, 0, @@ -812,10 +812,10 @@ void ShowPerformanceHistoryGraph() /*****************/ struct CompanyValueGraphWindow : BaseGraphWindow { - CompanyValueGraphWindow(const WindowDesc *desc, WindowNumber window_number) : - BaseGraphWindow(WID_CV_GRAPH, STR_JUST_CURRENCY_SHORT) + CompanyValueGraphWindow(WindowDesc *desc, WindowNumber window_number) : + BaseGraphWindow(desc, WID_CV_GRAPH, STR_JUST_CURRENCY_SHORT) { - this->InitializeWindow(desc, window_number); + this->InitializeWindow(window_number); } virtual OverflowSafeInt64 GetGraphData(const Company *c, int j) @@ -843,7 +843,7 @@ static const NWidgetPart _nested_company EndContainer(), }; -static const WindowDesc _company_value_graph_desc( +static WindowDesc _company_value_graph_desc( WDP_AUTO, 0, 0, WC_COMPANY_VALUE, WC_NONE, 0, @@ -861,8 +861,8 @@ void ShowCompanyValueGraph() struct PaymentRatesGraphWindow : BaseGraphWindow { bool first_init; ///< This value is true until the first initialization of the window has finished. - PaymentRatesGraphWindow(const WindowDesc *desc, WindowNumber window_number) : - BaseGraphWindow(WID_CPR_GRAPH, STR_JUST_CURRENCY_SHORT) + PaymentRatesGraphWindow(WindowDesc *desc, WindowNumber window_number) : + BaseGraphWindow(desc, WID_CPR_GRAPH, STR_JUST_CURRENCY_SHORT) { this->first_init = true; this->num_on_x_axis = 20; @@ -874,7 +874,7 @@ struct PaymentRatesGraphWindow : BaseGra /* Initialise the dataset */ this->OnHundredthTick(); - this->InitNested(desc, window_number); + this->InitNested(window_number); this->UpdateLoweredWidgets(); } @@ -1073,7 +1073,7 @@ static const NWidgetPart _nested_cargo_p EndContainer(), }; -static const WindowDesc _cargo_payment_rates_desc( +static WindowDesc _cargo_payment_rates_desc( WDP_AUTO, 0, 0, WC_PAYMENT_RATES, WC_NONE, 0, @@ -1147,9 +1147,9 @@ private: } public: - CompanyLeagueWindow(const WindowDesc *desc, WindowNumber window_number) : Window() + CompanyLeagueWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc) { - this->InitNested(desc, window_number); + this->InitNested(window_number); this->companies.ForceRebuild(); this->companies.NeedResort(); } @@ -1262,7 +1262,7 @@ static const NWidgetPart _nested_company NWidget(WWT_PANEL, COLOUR_GREY, WID_CL_BACKGROUND), SetMinimalSize(400, 0), SetMinimalTextLines(15, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM), }; -static const WindowDesc _company_league_desc( +static WindowDesc _company_league_desc( WDP_AUTO, 0, 0, WC_COMPANY_LEAGUE, WC_NONE, 0, @@ -1282,11 +1282,11 @@ struct PerformanceRatingDetailWindow : W static CompanyID company; int timeout; - PerformanceRatingDetailWindow(const WindowDesc *desc, WindowNumber window_number) : Window() + PerformanceRatingDetailWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc) { this->UpdateCompanyStats(); - this->InitNested(desc, window_number); + this->InitNested(window_number); this->OnInvalidateData(INVALID_COMPANY); } @@ -1561,7 +1561,7 @@ static const NWidgetPart _nested_perform NWidgetFunction(MakePerformanceDetailPanels), }; -static const WindowDesc _performance_rating_detail_desc( +static WindowDesc _performance_rating_detail_desc( WDP_AUTO, 0, 0, WC_PERFORMANCE_DETAIL, WC_NONE, 0,