From e82d0867b2fe7caafb3ef8cff35d68ee62b4dfb7 Mon Sep 17 00:00:00 2001 From: elexis Date: Tue, 20 Aug 2019 10:51:29 +0000 Subject: [PATCH] Erase unused variable following 77b81d8761, clean two stray includes from c19f3608a5. Confess a wrong word in a comment in c9c82d9daf and a typo in a comment in 9985fcf5bd. Differential Revision: https://code.wildfiregames.com/D2203 This was SVN commit r22720. --- source/gui/CGUI.cpp | 2 +- source/gui/CGUISprite.h | 19 ++----------------- source/gui/GUIRenderer.h | 6 +----- source/gui/GUIutil.cpp | 6 +++--- source/gui/GUIutil.h | 11 +---------- 5 files changed, 8 insertions(+), 36 deletions(-) diff --git a/source/gui/CGUI.cpp b/source/gui/CGUI.cpp index 5edb41e002..8a7271dd4a 100644 --- a/source/gui/CGUI.cpp +++ b/source/gui/CGUI.cpp @@ -989,7 +989,7 @@ void CGUI::Xeromyces_ReadSprite(XMBElement Element, CXeromyces* pFile) if (m_Sprites.find(name) != m_Sprites.end()) LOGWARNING("GUI sprite name '%s' used more than once; first definition will be discarded", name.c_str()); - // shared_ptr to link the effect to every sprite, faster than copy. + // shared_ptr to link the effect to every image, faster than copy. std::shared_ptr effects; for (XMBElement child : Element.GetChildNodes()) diff --git a/source/gui/CGUISprite.h b/source/gui/CGUISprite.h index ccd96044f2..2bb3f0b917 100644 --- a/source/gui/CGUISprite.h +++ b/source/gui/CGUISprite.h @@ -16,22 +16,8 @@ */ /* -A GUI Sprite - ---Overview-- - A GUI Sprite, which is actually a collage of several sprites. - ---Usage-- - - Used internally and declared in XML files, read documentations - on how. - ---More info-- - - Check GUI.h - */ #ifndef INCLUDED_CGUISPRITE @@ -39,6 +25,7 @@ A GUI Sprite #include "GUIbase.h" +#include "gui/GUIRenderer.h" #include "lib/res/graphics/ogl_tex.h" #include @@ -147,8 +134,6 @@ public: std::vector m_Images; }; -#include "GUIRenderer.h" - // An instance of a sprite, usually stored in IGUIObjects - basically a string // giving the sprite's name, but with some extra data to cache rendering // calculations between draw calls. @@ -169,7 +154,7 @@ public: operator bool() const { return !m_SpriteName.empty(); }; /** - * Returns this spirte if it has been set, otherwise the given fallback sprite. + * Returns this sprite if it has been set, otherwise the given fallback sprite. */ const CGUISpriteInstance& operator||(const CGUISpriteInstance& fallback) const { diff --git a/source/gui/GUIRenderer.h b/source/gui/GUIRenderer.h index e2587f6a52..d799681c97 100644 --- a/source/gui/GUIRenderer.h +++ b/source/gui/GUIRenderer.h @@ -27,6 +27,7 @@ #include +class CGUISprite; struct SGUIImageEffects; struct SGUIImage; @@ -65,12 +66,7 @@ namespace GUIRenderer DrawCalls(const DrawCalls&); DrawCalls& operator=(const DrawCalls&); }; -} -#include "gui/CGUISprite.h" - -namespace GUIRenderer -{ void UpdateDrawCallCache(const CGUI* pGUI, DrawCalls& Calls, const CStr& SpriteName, const CRect& Size, int CellID, std::map& Sprites); void Draw(DrawCalls& Calls, float Z); diff --git a/source/gui/GUIutil.cpp b/source/gui/GUIutil.cpp index 5d6bea090d..d333a70669 100644 --- a/source/gui/GUIutil.cpp +++ b/source/gui/GUIutil.cpp @@ -129,7 +129,7 @@ PSRETURN GUI::GetSetting(const IGUIObject* pObject, const CStr& Setting, T& V template PSRETURN GUI::SetSetting(IGUIObject* pObject, const CStr& Setting, T& Value, const bool& SkipMessage) { - return SetSettingWrap(pObject, Setting, Value, SkipMessage, + return SetSettingWrap(pObject, Setting, SkipMessage, [&pObject, &Setting, &Value]() { static_cast* >(pObject->m_Settings[Setting])->m_pSetting = std::move(Value); }); @@ -138,14 +138,14 @@ PSRETURN GUI::SetSetting(IGUIObject* pObject, const CStr& Setting, T& Value, template PSRETURN GUI::SetSetting(IGUIObject* pObject, const CStr& Setting, const T& Value, const bool& SkipMessage) { - return SetSettingWrap(pObject, Setting, Value, SkipMessage, + return SetSettingWrap(pObject, Setting, SkipMessage, [&pObject, &Setting, &Value]() { static_cast* >(pObject->m_Settings[Setting])->m_pSetting = Value; }); } template -PSRETURN GUI::SetSettingWrap(IGUIObject* pObject, const CStr& Setting, const T& Value, const bool& SkipMessage, const std::function& valueSet) +PSRETURN GUI::SetSettingWrap(IGUIObject* pObject, const CStr& Setting, const bool& SkipMessage, const std::function& valueSet) { ENSURE(pObject != NULL); diff --git a/source/gui/GUIutil.h b/source/gui/GUIutil.h index 906616a709..d73d8f60ed 100644 --- a/source/gui/GUIutil.h +++ b/source/gui/GUIutil.h @@ -16,17 +16,8 @@ */ /* -GUI util - ---Overview-- - Contains help class GUI<>, which gives us templated parameter to all functions within GUI. - ---More info-- - - Check GUI.h - */ #ifndef INCLUDED_GUIUTIL @@ -189,7 +180,7 @@ private: * Changes the value of the setting by calling the valueSet functon that performs either a copy or move assignment. * Updates some internal data depending on the setting changed. */ - static PSRETURN SetSettingWrap(IGUIObject* pObject, const CStr& Setting, const T& Value, const bool& SkipMessage, const std::function& valueSet); + static PSRETURN SetSettingWrap(IGUIObject* pObject, const CStr& Setting, const bool& SkipMessage, const std::function& valueSet); // templated typedef of function pointer typedef void (IGUIObject::*void_Object_pFunction_argT)(const T& arg);