Codechange: Make all NWidgetPart arrays constexpr.
This ensures that the arrays are not created at runtime and prevents using non-constexpr values.
This commit is contained in:

committed by
Peter Nelson

parent
71b7ba0daa
commit
7737aa6640
@@ -69,7 +69,7 @@ void SetNewLandscapeType(byte landscape)
|
||||
}
|
||||
|
||||
/** Widgets of GenerateLandscapeWindow when generating world */
|
||||
static const NWidgetPart _nested_generate_landscape_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_generate_landscape_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
|
||||
NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_MAPGEN_WORLD_GENERATION_CAPTION, STR_NULL),
|
||||
@@ -193,7 +193,7 @@ static const NWidgetPart _nested_generate_landscape_widgets[] = {
|
||||
};
|
||||
|
||||
/** Widgets of GenerateLandscapeWindow when loading heightmap */
|
||||
static const NWidgetPart _nested_heightmap_load_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_heightmap_load_widgets[] = {
|
||||
/* Window header. */
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
|
||||
@@ -1254,7 +1254,7 @@ struct CreateScenarioWindow : public Window
|
||||
}
|
||||
};
|
||||
|
||||
static const NWidgetPart _nested_create_scenario_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_create_scenario_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
|
||||
NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_SE_MAPGEN_CAPTION, STR_NULL),
|
||||
@@ -1327,7 +1327,7 @@ void ShowCreateScenario()
|
||||
new CreateScenarioWindow(&_create_scenario_desc, GLWM_SCENARIO);
|
||||
}
|
||||
|
||||
static const NWidgetPart _nested_generate_progress_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_generate_progress_widgets[] = {
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GENERATION_WORLD, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY),
|
||||
NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup),
|
||||
|
Reference in New Issue
Block a user