diff --git a/source/gui/CGUI.cpp b/source/gui/CGUI.cpp index 16b32d610e..47036e807f 100755 --- a/source/gui/CGUI.cpp +++ b/source/gui/CGUI.cpp @@ -215,7 +215,7 @@ CGUI::~CGUI() //------------------------------------------------------------------- // Functions //------------------------------------------------------------------- -IGUIObject *CGUI::ConstructObject(const CStr &str) +IGUIObject *CGUI::ConstructObject(const CStr& str) { if (m_ObjectTypes.count(str) > 0) return (*m_ObjectTypes[str])(); @@ -332,7 +332,7 @@ void CGUI::Draw() glPopMatrix(); } -void CGUI::DrawSprite(const CStr &SpriteName, +void CGUI::DrawSprite(const CStr& SpriteName, const float &Z, const CRect &Rect, const CRect &Clipping) @@ -457,7 +457,7 @@ void CGUI::UpdateObjects() m_pAllObjects = AllObjects; } -bool CGUI::ObjectExists(const CStr &Name) const +bool CGUI::ObjectExists(const CStr& Name) const { return m_pAllObjects.count(Name) != 0; } @@ -473,7 +473,7 @@ struct SGenerateTextImage // TODO Gee: CRect => CPoint ? void SetupSpriteCall(const bool &Left, SGUIText::SSpriteCall &SpriteCall, const int &width, const int &y, - const CSize &Size, const CStr &TextureName, + const CSize &Size, const CStr& TextureName, const int &BufferZone) { // TODO Gee: Temp hardcoded values @@ -500,7 +500,7 @@ struct SGenerateTextImage }; SGUIText CGUI::GenerateText(const CGUIString &string, /*const CColor &Color, */ - const CStr &Font, const int &Width, const int &BufferZone) + const CStr& Font, const int &Width, const int &BufferZone) { SGUIText Text; // object we're generating @@ -771,7 +771,7 @@ void CGUI::DrawText(const SGUIText &Text, const CColor &DefaultColor, } } -void CGUI::ReportParseError(const CStr &str, ...) +void CGUI::ReportParseError(const CStr& str, ...) { // Print header if (m_Errors==0) diff --git a/source/gui/CGUI.h b/source/gui/CGUI.h index 387cc226f0..bb34ca6cad 100755 --- a/source/gui/CGUI.h +++ b/source/gui/CGUI.h @@ -108,7 +108,7 @@ public: * @param Rect Position and Size * @param Clipping The sprite shouldn't be drawn outside this rectangle */ - void DrawSprite(const CStr &SpriteName, const float &Z, + void DrawSprite(const CStr& SpriteName, const float &Z, const CRect &Rect, const CRect &Clipping=CRect()); /** @@ -151,7 +151,7 @@ public: * @param Name String name of object * @return true if object exists */ - bool ObjectExists(const CStr &Name) const; + bool ObjectExists(const CStr& Name) const; /** * The GUI needs to have all object types inputted and @@ -168,7 +168,7 @@ public: * * @see CGUI#ConstructObject() */ - void AddObjectType(const CStr &str, ConstructObjectFunction pFunc) { m_ObjectTypes[str] = pFunc; } + void AddObjectType(const CStr& str, ConstructObjectFunction pFunc) { m_ObjectTypes[str] = pFunc; } /** * Update Resolution, should be called every time the resolution @@ -197,7 +197,7 @@ public: * @param BufferZone space between text and edge, and space between text and images. */ SGUIText GenerateText(const CGUIString &Text, /*const CColor &Color, */ - const CStr &Font, const int &Width, const int &BufferZone); + const CStr& Font, const int &Width, const int &BufferZone); private: /** @@ -228,7 +228,7 @@ private: * * @param str Error message */ - void ReportParseError(const CStr &str, ...); + void ReportParseError(const CStr& str, ...); /** * You input the name of the object type, and let's @@ -238,7 +238,7 @@ private: * @param str Name of object type * @return Newly constructed IGUIObject (but constructed as a subclass) */ - IGUIObject *ConstructObject(const CStr &str); + IGUIObject *ConstructObject(const CStr& str); //-------------------------------------------------------- /** @name XML Reading Xerces C++ specific subroutines diff --git a/source/gui/GUIbase.h b/source/gui/GUIbase.h index 6c01e29436..351f42f937 100755 --- a/source/gui/GUIbase.h +++ b/source/gui/GUIbase.h @@ -84,7 +84,7 @@ struct SGUIMessage { SGUIMessage() {} SGUIMessage(const EGUIMessageType &_type) : type(_type) {} - SGUIMessage(const EGUIMessageType &_type, const CStr &_value) : type(_type), value(_value) {} + SGUIMessage(const EGUIMessageType &_type, const CStr& _value) : type(_type), value(_value) {} ~SGUIMessage() {} /** diff --git a/source/gui/GUItext.cpp b/source/gui/GUItext.cpp index 7103d5310b..1c906e7f02 100755 --- a/source/gui/GUItext.cpp +++ b/source/gui/GUItext.cpp @@ -30,7 +30,7 @@ void CGUIString::SFeedback::Reset() } void CGUIString::GenerateTextCall(SFeedback &Feedback, - const CStr &DefaultFont, /*const CColor &DefaultColor,*/ + const CStr& DefaultFont, /*const CColor &DefaultColor,*/ const int &from, const int &to) const { // Reset width and height, because they will be determined with incrementation @@ -159,7 +159,7 @@ void CGUIString::GenerateTextCall(SFeedback &Feedback, } } -bool CGUIString::TextChunk::Tag::SetTagType(const CStr &tagtype) +bool CGUIString::TextChunk::Tag::SetTagType(const CStr& tagtype) { CStr _tagtype = tagtype.UpperCase(); @@ -208,7 +208,7 @@ bool CGUIString::TextChunk::Tag::SetTagType(const CStr &tagtype) return false; } -void CGUIString::SetValue(const CStr &str) +void CGUIString::SetValue(const CStr& str) { // clear m_TextChunks.clear(); diff --git a/source/gui/GUItext.h b/source/gui/GUItext.h index 31945efcda..885aaf25aa 100755 --- a/source/gui/GUItext.h +++ b/source/gui/GUItext.h @@ -187,7 +187,7 @@ public: * @param tagtype TagType by string, like 'IMG' for [IMG] * @return True if m_TagType was set. */ - bool SetTagType(const CStr &tagtype); + bool SetTagType(const CStr& tagtype); /** * In [B=Hello][/B] @@ -255,7 +255,7 @@ public: * Set the value, the string will automatically * be parsed when set. */ - void SetValue(const CStr &str); + void SetValue(const CStr& str); /** * Get String, without tags @@ -277,7 +277,7 @@ public: * @param to to chacter n. */ void GenerateTextCall(SFeedback &Feedback, - const CStr &DefaultFont, /*const CColor &DefaultColor,*/ + const CStr& DefaultFont, /*const CColor &DefaultColor,*/ const int &from, const int &to) const; /** diff --git a/source/gui/GUIutil.cpp b/source/gui/GUIutil.cpp index fd4fe8b591..e0adb031bd 100755 --- a/source/gui/GUIutil.cpp +++ b/source/gui/GUIutil.cpp @@ -11,14 +11,14 @@ gee@pyro.nu using namespace std; template -bool __ParseString(const CStr &Value, T &tOutput) +bool __ParseString(const CStr& Value, T &tOutput) { // TODO Gee: Unsupported, report error/warning return false; } template <> -bool __ParseString(const CStr &Value, bool &Output) +bool __ParseString(const CStr& Value, bool &Output) { if (Value == CStr(_T("true"))) Output = true; @@ -32,21 +32,21 @@ bool __ParseString(const CStr &Value, bool &Output) } template <> -bool __ParseString(const CStr &Value, int &Output) +bool __ParseString(const CStr& Value, int &Output) { Output = Value.ToInt(); return true; } template <> -bool __ParseString(const CStr &Value, float &Output) +bool __ParseString(const CStr& Value, float &Output) { Output = Value.ToFloat(); return true; } template <> -bool __ParseString(const CStr &Value, CRect &Output) +bool __ParseString(const CStr& Value, CRect &Output) { // Use the parser to parse the values CParser parser; @@ -77,13 +77,13 @@ bool __ParseString(const CStr &Value, CRect &Output) } template <> -bool __ParseString(const CStr &Value, CClientArea &Output) +bool __ParseString(const CStr& Value, CClientArea &Output) { return Output.SetClientArea(Value); } template <> -bool __ParseString(const CStr &Value, CColor &Output) +bool __ParseString(const CStr& Value, CColor &Output) { // Use the parser to parse the values CParser parser; @@ -118,7 +118,7 @@ bool __ParseString(const CStr &Value, CColor &Output) } template <> -bool __ParseString(const CStr &Value, CGUIString &Output) +bool __ParseString(const CStr& Value, CGUIString &Output) { const char * buf = Value; @@ -134,7 +134,7 @@ CClientArea::CClientArea() : pixel(0,0,0,0), percent(0,0,0,0) { } -CClientArea::CClientArea(const CStr &Value) +CClientArea::CClientArea(const CStr& Value) { SetClientArea(Value); } @@ -156,7 +156,7 @@ CRect CClientArea::GetClientArea(const CRect &parent) const return client; } -bool CClientArea::SetClientArea(const CStr &Value) +bool CClientArea::SetClientArea(const CStr& Value) { // Get value in STL string format string _Value = (const TCHAR*)Value; @@ -272,7 +272,7 @@ bool CClientArea::SetClientArea(const CStr &Value) //-------------------------------------------------------- // Utilities implementation //-------------------------------------------------------- -IGUIObject * CInternalCGUIAccessorBase::GetObjectPointer(CGUI &GUIinstance, const CStr &Object) +IGUIObject * CInternalCGUIAccessorBase::GetObjectPointer(CGUI &GUIinstance, const CStr& Object) { // if (!GUIinstance.ObjectExists(Object)) // return NULL; @@ -280,7 +280,7 @@ IGUIObject * CInternalCGUIAccessorBase::GetObjectPointer(CGUI &GUIinstance, cons return GUIinstance.m_pAllObjects.find(Object)->second; } -const IGUIObject * CInternalCGUIAccessorBase::GetObjectPointer(const CGUI &GUIinstance, const CStr &Object) +const IGUIObject * CInternalCGUIAccessorBase::GetObjectPointer(const CGUI &GUIinstance, const CStr& Object) { // if (!GUIinstance.ObjectExists(Object)) // return NULL; diff --git a/source/gui/GUIutil.h b/source/gui/GUIutil.h index 8ea961503c..f4b01e8a71 100755 --- a/source/gui/GUIutil.h +++ b/source/gui/GUIutil.h @@ -34,28 +34,28 @@ class CClientArea; class CGUIString; template -bool __ParseString(const CStr &Value, T &tOutput); +bool __ParseString(const CStr& Value, T &tOutput); template <> -bool __ParseString(const CStr &Value, bool &Output); +bool __ParseString(const CStr& Value, bool &Output); template <> -bool __ParseString(const CStr &Value, int &Output); +bool __ParseString(const CStr& Value, int &Output); template <> -bool __ParseString(const CStr &Value, float &Output); +bool __ParseString(const CStr& Value, float &Output); template <> -bool __ParseString(const CStr &Value, CRect &Output); +bool __ParseString(const CStr& Value, CRect &Output); template <> -bool __ParseString(const CStr &Value, CClientArea &Output); +bool __ParseString(const CStr& Value, CClientArea &Output); template <> -bool __ParseString(const CStr &Value, CColor &Output); +bool __ParseString(const CStr& Value, CColor &Output); template <> -bool __ParseString(const CStr &Value, CGUIString &Output); +bool __ParseString(const CStr& Value, CGUIString &Output); /** * @author Gustav Larsson @@ -69,7 +69,7 @@ class CClientArea { public: CClientArea(); - CClientArea(const CStr &Value); + CClientArea(const CStr& Value); /// Pixel modifiers CRect pixel; @@ -97,7 +97,7 @@ public: * @return true if success, false if failure. If false then the client area * will be unchanged. */ - bool SetClientArea(const CStr &Value); + bool SetClientArea(const CStr& Value); }; //-------------------------------------------------------- @@ -119,10 +119,10 @@ class CInternalCGUIAccessorBase { protected: /// Get object pointer - static IGUIObject * GetObjectPointer(CGUI &GUIinstance, const CStr &Object); + static IGUIObject * GetObjectPointer(CGUI &GUIinstance, const CStr& Object); /// const version - static const IGUIObject * GetObjectPointer(const CGUI &GUIinstance, const CStr &Object); + static const IGUIObject * GetObjectPointer(const CGUI &GUIinstance, const CStr& Object); /// Wrapper for ResetStates static void QueryResetting(IGUIObject *pObject); @@ -156,7 +156,7 @@ public: * @param Setting Setting by name * @param Value Stores value here, note type T! */ - static PS_RESULT GetSetting(const IGUIObject *pObject, const CStr &Setting, T &Value) + static PS_RESULT GetSetting(const IGUIObject *pObject, const CStr& Setting, T &Value) { if (pObject == NULL) return PS_OBJECT_FAIL; @@ -183,7 +183,7 @@ public: * @param Setting Setting by name * @param Value Sets value to this, note type T! */ - static PS_RESULT SetSetting(IGUIObject *pObject, const CStr &Setting, const T &Value) + static PS_RESULT SetSetting(IGUIObject *pObject, const CStr& Setting, const T &Value) { if (pObject == NULL) return PS_OBJECT_FAIL; @@ -222,8 +222,8 @@ public: * Can safely be removed. */ static PS_RESULT GetSetting( - const CStr &Object, - const CStr &Setting, T &Value) + const CStr& Object, + const CStr& Setting, T &Value) { return GetSetting(g_GUI, Object, Setting, Value); } @@ -238,8 +238,8 @@ public: * @param Value Stores value here, note type T! */ static PS_RESULT GetSetting( - const CGUI &GUIinstance, const CStr &Object, - const CStr &Setting, T &Value) + const CGUI &GUIinstance, const CStr& Object, + const CStr& Setting, T &Value) { if (!GUIinstance.ObjectExists(Object)) return PS_OBJECT_FAIL; @@ -256,7 +256,7 @@ public: * Can safely be removed. */ static PS_RESULT SetSetting( - const CStr &Object, const CStr &Setting, const T &Value) + const CStr& Object, const CStr& Setting, const T &Value) { return SetSetting(g_GUI, Object, Setting, Value); } @@ -275,8 +275,8 @@ public: * @param Value Sets value to this, note type T! */ static PS_RESULT SetSetting( - CGUI &GUIinstance, const CStr &Object, - const CStr &Setting, const T &Value) + CGUI &GUIinstance, const CStr& Object, + const CStr& Setting, const T &Value) { if (!GUIinstance.ObjectExists(Object)) return PS_OBJECT_FAIL; @@ -300,7 +300,7 @@ public: * @param sec Secondary sprite if Primary should fail * @return Resulting string */ - static CStr FallBackSprite(const CStr &prim, const CStr &sec) + static CStr FallBackSprite(const CStr& prim, const CStr& sec) { // CStr() == empty string, null return ((prim!=CStr())?(prim):(sec)); @@ -333,7 +333,7 @@ public: * * @see _mem_ParseString() */ - static bool ParseString(const CStr &Value, T &tOutput) + static bool ParseString(const CStr& Value, T &tOutput) { return __ParseString(Value, tOutput); } diff --git a/source/gui/IGUIButtonBehavior.cpp b/source/gui/IGUIButtonBehavior.cpp index abb1beb54c..5986bd1e3f 100755 --- a/source/gui/IGUIButtonBehavior.cpp +++ b/source/gui/IGUIButtonBehavior.cpp @@ -93,10 +93,10 @@ CColor IGUIButtonBehavior::ChooseColor() void IGUIButtonBehavior::DrawButton(const CRect &rect, const float &z, - const CStr &sprite, - const CStr &sprite_over, - const CStr &sprite_pressed, - const CStr &sprite_disabled) + const CStr& sprite, + const CStr& sprite_over, + const CStr& sprite_pressed, + const CStr& sprite_disabled) { if (GetGUI()) { diff --git a/source/gui/IGUIButtonBehavior.h b/source/gui/IGUIButtonBehavior.h index 140545cc1c..fc222b0c92 100755 --- a/source/gui/IGUIButtonBehavior.h +++ b/source/gui/IGUIButtonBehavior.h @@ -74,10 +74,10 @@ public: */ void DrawButton(const CRect &rect, const float &z, - const CStr &sprite, - const CStr &sprite_over, - const CStr &sprite_pressed, - const CStr &sprite_disabled); + const CStr& sprite, + const CStr& sprite_over, + const CStr& sprite_pressed, + const CStr& sprite_disabled); /** * Choosing which color of the following according to diff --git a/source/gui/IGUIObject.cpp b/source/gui/IGUIObject.cpp index 6bdaa1257e..022ef5cc26 100755 --- a/source/gui/IGUIObject.cpp +++ b/source/gui/IGUIObject.cpp @@ -135,7 +135,7 @@ void IGUIObject::Destroy() m_Settings[Name].m_pSetting = new type(); \ break; -void IGUIObject::AddSetting(const EGUISettingType &Type, const CStr &Name) +void IGUIObject::AddSetting(const EGUISettingType &Type, const CStr& Name) { // Is name already taken? if (m_Settings.count(Name) >= 1) @@ -201,7 +201,7 @@ void IGUIObject::UpdateMouseOver(IGUIObject * const &pMouseOver) } } -bool IGUIObject::SettingExists(const CStr &Setting) const +bool IGUIObject::SettingExists(const CStr& Setting) const { // Because GetOffsets will direct dynamically defined // classes with polymorifsm to respective ms_SettingsInfo @@ -222,7 +222,7 @@ bool IGUIObject::SettingExists(const CStr &Setting) const GUI::SetSetting(this, Setting, _Value); \ } -void IGUIObject::SetSetting(const CStr &Setting, const CStr &Value) +void IGUIObject::SetSetting(const CStr& Setting, const CStr& Value) { if (!SettingExists(Setting)) { @@ -299,7 +299,7 @@ void IGUIObject::UpdateCachedSize() } -void IGUIObject::LoadStyle(CGUI &GUIinstance, const CStr &StyleName) +void IGUIObject::LoadStyle(CGUI &GUIinstance, const CStr& StyleName) { // Fetch style if (GUIinstance.m_Styles.count(StyleName)==1) diff --git a/source/gui/IGUIObject.h b/source/gui/IGUIObject.h index a4beb67df7..2b98d74aca 100755 --- a/source/gui/IGUIObject.h +++ b/source/gui/IGUIObject.h @@ -159,7 +159,7 @@ public: CStr GetName() const { return m_Name; } /// Get object name - void SetName(const CStr &Name) { m_Name = Name; } + void SetName(const CStr& Name) { m_Name = Name; } /** * Adds object and its children to the map, it's name being the @@ -213,7 +213,7 @@ public: * @param Setting setting name * @return True if settings exist. */ - bool SettingExists(const CStr &Setting) const; + bool SettingExists(const CStr& Setting) const; /** * All sizes are relative to resolution, and the calculation @@ -253,7 +253,7 @@ public: * * @throws PS_RESULT */ - void SetSetting(const CStr &Setting, const CStr &Value); + void SetSetting(const CStr& Setting, const CStr& Value); //@} protected: @@ -275,7 +275,7 @@ protected: * @param Type Setting type * @param Name Setting reference name */ - void AddSetting(const EGUISettingType &Type, const CStr &Name); + void AddSetting(const EGUISettingType &Type, const CStr& Name); /** * Calls Destroy on all children, and deallocates all memory. @@ -307,7 +307,7 @@ protected: * @param GUIinstance Reference to the GUI * @param StyleName Style by name */ - void LoadStyle(CGUI &GUIinstance, const CStr &StyleName); + void LoadStyle(CGUI &GUIinstance, const CStr& StyleName); /** * Loads a style. diff --git a/source/gui/IGUIScrollBar.h b/source/gui/IGUIScrollBar.h index 292238a950..ccc9c55d10 100755 --- a/source/gui/IGUIScrollBar.h +++ b/source/gui/IGUIScrollBar.h @@ -282,7 +282,7 @@ public: * Set Scroll bar style string * @param style String with scroll bar style reference name */ - void SetScrollBarStyle(const CStr &style) { m_ScrollBarStyle = style; } + void SetScrollBarStyle(const CStr& style) { m_ScrollBarStyle = style; } /** * Get style used by the scrollbar diff --git a/source/gui/IGUIScrollBarOwner.cpp b/source/gui/IGUIScrollBarOwner.cpp index 7885c52bfb..535a68a87b 100755 --- a/source/gui/IGUIScrollBarOwner.cpp +++ b/source/gui/IGUIScrollBarOwner.cpp @@ -50,7 +50,7 @@ void SetGUI(CGUI * const &pGUI) scrollbar->SetGUI(m_pGUI); } */ -const SGUIScrollBarStyle * IGUIScrollBarOwner::GetScrollBarStyle(const CStr &style) const +const SGUIScrollBarStyle * IGUIScrollBarOwner::GetScrollBarStyle(const CStr& style) const { if (!GetGUI()) { diff --git a/source/gui/IGUIScrollBarOwner.h b/source/gui/IGUIScrollBarOwner.h index 3cfbc90e8d..87b53bfb5d 100755 --- a/source/gui/IGUIScrollBarOwner.h +++ b/source/gui/IGUIScrollBarOwner.h @@ -67,7 +67,7 @@ public: /** * Interface for the m_ScrollBar to use. */ - virtual const SGUIScrollBarStyle *GetScrollBarStyle(const CStr &style) const; + virtual const SGUIScrollBarStyle *GetScrollBarStyle(const CStr& style) const; /** * Add a scroll-bar