diff --git a/src/common/menu/menu.cpp b/src/common/menu/menu.cpp index 9f2cdf168..e244710eb 100644 --- a/src/common/menu/menu.cpp +++ b/src/common/menu/menu.cpp @@ -132,12 +132,40 @@ DEFINE_ACTION_FUNCTION_NATIVE(DMenuDescriptor, GetDescriptor, GetMenuDescriptor) ACTION_RETURN_OBJECT(GetMenuDescriptor(name.GetIndex())); } +void DListMenuDescriptor::Reset() +{ + // Reset the default settings (ignore all other values in the struct) + mSelectOfsX = 0; + mSelectOfsY = 0; + mSelector.SetInvalid(); + mDisplayTop = 0; + mXpos = 0; + mYpos = 0; + mLinespacing = 0; + mNetgameMessage = ""; + mFont = NULL; + mFontColor = CR_UNTRANSLATED; + mFontColor2 = CR_UNTRANSLATED; + mFromEngine = false; +} + + size_t DListMenuDescriptor::PropagateMark() { for (auto item : mItems) GC::Mark(item); return 0; } +void DOptionMenuDescriptor::Reset() +{ + // Reset the default settings (ignore all other values in the struct) + mPosition = 0; + mScrollTop = 0; + mIndent = 0; + mDontDim = 0; + mFont = BigUpper; +} + size_t DOptionMenuDescriptor::PropagateMark() { for (auto item : mItems) GC::Mark(item); diff --git a/src/common/menu/menu.h b/src/common/menu/menu.h index 2a0f7399b..f8cbe14d1 100644 --- a/src/common/menu/menu.h +++ b/src/common/menu/menu.h @@ -89,23 +89,7 @@ public: bool mCenter; bool mFromEngine; - void Reset() - { - // Reset the default settings (ignore all other values in the struct) - mSelectOfsX = 0; - mSelectOfsY = 0; - mSelector.SetInvalid(); - mDisplayTop = 0; - mXpos = 0; - mYpos = 0; - mLinespacing = 0; - mNetgameMessage = ""; - mFont = NULL; - mFontColor = CR_UNTRANSLATED; - mFontColor2 = CR_UNTRANSLATED; - mFromEngine = false; - } - + void Reset(); size_t PropagateMark() override; }; @@ -138,20 +122,9 @@ public: void CalcIndent(); DMenuItemBase *GetItem(FName name); - void Reset() - { - // Reset the default settings (ignore all other values in the struct) - mPosition = 0; - mScrollTop = 0; - mIndent = 0; - mDontDim = 0; - mFont = BigUpper; - - } + void Reset(); size_t PropagateMark() override; - ~DOptionMenuDescriptor() - { - } + ~DOptionMenuDescriptor() = default; }; @@ -289,6 +262,8 @@ void M_StartMessage(const char *message, int messagemode, FName action = NAME_No DMenu *StartPickerMenu(DMenu *parent, const char *name, FColorCVar *cvar); void M_MarkMenus(); FTextureID GetMenuTexture(const char* const name); +void DeinitMenus(); +bool M_Active(); struct IJoystickConfig; diff --git a/src/common/menu/resolutionmenu.cpp b/src/common/menu/resolutionmenu.cpp index 216e6b85f..6074d018a 100644 --- a/src/common/menu/resolutionmenu.cpp +++ b/src/common/menu/resolutionmenu.cpp @@ -32,8 +32,6 @@ ** */ -#include "doomdef.h" -#include "doomstat.h" #include "c_dispatch.h" #include "c_cvars.h" #include "v_video.h"