1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-23 20:24:12 +01:00

Codechange: Pass WindowDesc by reference instead of pointer. (#12771)

WindowDesc as passed to Windows is not optional so don't allow to it to be nullptr.
This commit is contained in:
Peter Nelson
2024-06-11 08:58:03 +01:00
committed by GitHub
parent 18bce69623
commit 4cf6d1dd79
68 changed files with 293 additions and 301 deletions

View File

@@ -359,7 +359,7 @@ struct GameOptionsWindow : Window {
int gui_scale;
static inline WidgetID active_tab = WID_GO_TAB_GENERAL;
GameOptionsWindow(WindowDesc *desc) : Window(desc)
GameOptionsWindow(WindowDesc &desc) : Window(desc)
{
this->opt = &GetGameSettings();
this->reload = false;
@@ -1199,7 +1199,7 @@ static WindowDesc _game_options_desc(
void ShowGameOptions()
{
CloseWindowByClass(WC_GAME_OPTIONS);
new GameOptionsWindow(&_game_options_desc);
new GameOptionsWindow(_game_options_desc);
}
static int SETTING_HEIGHT = 11; ///< Height of a single setting in the tree view in pixels
@@ -2334,7 +2334,7 @@ struct GameSettingsWindow : Window {
Scrollbar *vscroll;
GameSettingsWindow(WindowDesc *desc) : Window(desc), filter_editbox(50)
GameSettingsWindow(WindowDesc &desc) : Window(desc), filter_editbox(50)
{
this->warn_missing = WHR_NONE;
this->warn_lines = 0;
@@ -2909,7 +2909,7 @@ static WindowDesc _settings_selection_desc(
void ShowGameSettings()
{
CloseWindowByClass(WC_GAME_OPTIONS);
new GameSettingsWindow(&_settings_selection_desc);
new GameSettingsWindow(_settings_selection_desc);
}
@@ -2985,7 +2985,7 @@ void DrawBoolButton(int x, int y, bool state, bool clickable)
struct CustomCurrencyWindow : Window {
int query_widget;
CustomCurrencyWindow(WindowDesc *desc) : Window(desc)
CustomCurrencyWindow(WindowDesc &desc) : Window(desc)
{
this->InitNested();
@@ -3217,5 +3217,5 @@ static WindowDesc _cust_currency_desc(
static void ShowCustCurrency()
{
CloseWindowById(WC_CUSTOM_CURRENCY, 0);
new CustomCurrencyWindow(&_cust_currency_desc);
new CustomCurrencyWindow(_cust_currency_desc);
}