mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Remove ZeroedMemoryAllocator from WindowDesc.
All members which are not intended to be changed are now const to ensure they are setpull/13377/head
parent
95df7ea483
commit
b7a82819de
|
@ -114,9 +114,6 @@ WindowDesc::WindowDesc(WindowPosition def_pos, const char *ini_key, int16_t def_
|
||||||
flags(flags),
|
flags(flags),
|
||||||
nwid_parts(nwid_parts),
|
nwid_parts(nwid_parts),
|
||||||
hotkeys(hotkeys),
|
hotkeys(hotkeys),
|
||||||
pref_sticky(false),
|
|
||||||
pref_width(0),
|
|
||||||
pref_height(0),
|
|
||||||
default_width_trad(def_width_trad),
|
default_width_trad(def_width_trad),
|
||||||
default_height_trad(def_height_trad)
|
default_height_trad(def_height_trad)
|
||||||
{
|
{
|
||||||
|
|
|
@ -156,7 +156,7 @@ struct HotkeyList;
|
||||||
/**
|
/**
|
||||||
* High level window description
|
* High level window description
|
||||||
*/
|
*/
|
||||||
struct WindowDesc : ZeroedMemoryAllocator {
|
struct WindowDesc {
|
||||||
|
|
||||||
WindowDesc(WindowPosition default_pos, const char *ini_key, int16_t def_width_trad, int16_t def_height_trad,
|
WindowDesc(WindowPosition default_pos, const char *ini_key, int16_t def_width_trad, int16_t def_height_trad,
|
||||||
WindowClass window_class, WindowClass parent_class, uint32_t flags,
|
WindowClass window_class, WindowClass parent_class, uint32_t flags,
|
||||||
|
@ -166,17 +166,17 @@ struct WindowDesc : ZeroedMemoryAllocator {
|
||||||
~WindowDesc();
|
~WindowDesc();
|
||||||
|
|
||||||
const std::source_location source_location; ///< Source location of this definition
|
const std::source_location source_location; ///< Source location of this definition
|
||||||
WindowPosition default_pos; ///< Preferred position of the window. @see WindowPosition()
|
const WindowPosition default_pos; ///< Preferred position of the window. @see WindowPosition()
|
||||||
WindowClass cls; ///< Class of the window, @see WindowClass.
|
const WindowClass cls; ///< Class of the window, @see WindowClass.
|
||||||
WindowClass parent_cls; ///< Class of the parent window. @see WindowClass
|
const WindowClass parent_cls; ///< Class of the parent window. @see WindowClass
|
||||||
const char *ini_key; ///< Key to store window defaults in openttd.cfg. \c nullptr if nothing shall be stored.
|
const char *ini_key; ///< Key to store window defaults in openttd.cfg. \c nullptr if nothing shall be stored.
|
||||||
uint32_t flags; ///< Flags. @see WindowDefaultFlag
|
const uint32_t flags; ///< Flags. @see WindowDefaultFlag
|
||||||
const std::span<const NWidgetPart> nwid_parts; ///< Span of nested widget parts describing the window.
|
const std::span<const NWidgetPart> nwid_parts; ///< Span of nested widget parts describing the window.
|
||||||
HotkeyList *hotkeys; ///< Hotkeys for the window.
|
const HotkeyList *hotkeys; ///< Hotkeys for the window.
|
||||||
|
|
||||||
bool pref_sticky; ///< Preferred stickyness.
|
bool pref_sticky = false; ///< Preferred stickyness.
|
||||||
int16_t pref_width; ///< User-preferred width of the window. Zero if unset.
|
int16_t pref_width = 0; ///< User-preferred width of the window. Zero if unset.
|
||||||
int16_t pref_height; ///< User-preferred height of the window. Zero if unset.
|
int16_t pref_height = 0; ///< User-preferred height of the window. Zero if unset.
|
||||||
|
|
||||||
int16_t GetDefaultWidth() const;
|
int16_t GetDefaultWidth() const;
|
||||||
int16_t GetDefaultHeight() const;
|
int16_t GetDefaultHeight() const;
|
||||||
|
@ -185,8 +185,8 @@ struct WindowDesc : ZeroedMemoryAllocator {
|
||||||
static void SaveToConfig();
|
static void SaveToConfig();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int16_t default_width_trad; ///< Preferred initial width of the window (pixels at 1x zoom).
|
const int16_t default_width_trad; ///< Preferred initial width of the window (pixels at 1x zoom).
|
||||||
int16_t default_height_trad; ///< Preferred initial height of the window (pixels at 1x zoom).
|
const int16_t default_height_trad; ///< Preferred initial height of the window (pixels at 1x zoom).
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete copy constructor to prevent compilers from
|
* Delete copy constructor to prevent compilers from
|
||||||
|
|
Loading…
Reference in New Issue