From 86c043ea5228a7b5a39527e50b2dc150a65f6266 Mon Sep 17 00:00:00 2001 From: cutealien Date: Tue, 11 Oct 2011 17:35:47 +0000 Subject: [PATCH] All gui-elements now use "SColor" instead of "const SColor&" to unify interfaces somewhat (it doesn't really matter which way it's done - the only bad solution is doing it different in every second function). I don't dare changing the one occurrence of "const SColor&" in IGUISkin as skins are so often overloaded and so changing that would break too much user-code, will do that once IGUISkin is more seriously reworked. Sorry for anyone already overloading gui-elements IGUIEditBox, IGUIListBox, IGUIStaticText - you will have to change that as well. But I think in the long run it's better having this at least a little less inconsistent. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3941 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/IGUIEditBox.h | 2 +- include/IGUIListBox.h | 4 ++-- source/Irrlicht/CGUIEditBox.cpp | 2 +- source/Irrlicht/CGUIEditBox.h | 2 +- source/Irrlicht/CGUIListBox.cpp | 4 ++-- source/Irrlicht/CGUIListBox.h | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/IGUIEditBox.h b/include/IGUIEditBox.h index cdbf740a..6eb2254f 100644 --- a/include/IGUIEditBox.h +++ b/include/IGUIEditBox.h @@ -48,7 +48,7 @@ namespace gui virtual void setOverrideColor(video::SColor color) = 0; //! Gets the override color - virtual video::SColor const & getOverrideColor() const = 0; + virtual video::SColor getOverrideColor() const = 0; //! Sets if the text should use the override color or the color in the gui skin. /** \param enable: If set to true, the override color, which can be set diff --git a/include/IGUIListBox.h b/include/IGUIListBox.h index 76c293a2..15ad63cf 100644 --- a/include/IGUIListBox.h +++ b/include/IGUIListBox.h @@ -89,10 +89,10 @@ namespace gui virtual bool isAutoScrollEnabled() const = 0; //! set all item colors at given index to color - virtual void setItemOverrideColor(u32 index, const video::SColor &color) = 0; + virtual void setItemOverrideColor(u32 index, video::SColor color) = 0; //! set all item colors of specified type at given index to color - virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, const video::SColor &color) = 0; + virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color) = 0; //! clear all item colors at index virtual void clearItemOverrideColor(u32 index) = 0; diff --git a/source/Irrlicht/CGUIEditBox.cpp b/source/Irrlicht/CGUIEditBox.cpp index 9c8eea7c..30ff3b9b 100644 --- a/source/Irrlicht/CGUIEditBox.cpp +++ b/source/Irrlicht/CGUIEditBox.cpp @@ -115,7 +115,7 @@ void CGUIEditBox::setOverrideColor(video::SColor color) } -video::SColor const& CGUIEditBox::getOverrideColor() const +video::SColor CGUIEditBox::getOverrideColor() const { return OverrideColor; } diff --git a/source/Irrlicht/CGUIEditBox.h b/source/Irrlicht/CGUIEditBox.h index 88fb0f28..c16c78a3 100644 --- a/source/Irrlicht/CGUIEditBox.h +++ b/source/Irrlicht/CGUIEditBox.h @@ -43,7 +43,7 @@ namespace gui virtual void setOverrideColor(video::SColor color); //! Gets the override color - virtual video::SColor const & getOverrideColor() const; + virtual video::SColor getOverrideColor() const; //! Sets if the text should use the overide color or the //! color in the gui skin. diff --git a/source/Irrlicht/CGUIListBox.cpp b/source/Irrlicht/CGUIListBox.cpp index c300233b..82956a32 100644 --- a/source/Irrlicht/CGUIListBox.cpp +++ b/source/Irrlicht/CGUIListBox.cpp @@ -811,7 +811,7 @@ void CGUIListBox::swapItems(u32 index1, u32 index2) } -void CGUIListBox::setItemOverrideColor(u32 index, const video::SColor &color) +void CGUIListBox::setItemOverrideColor(u32 index, video::SColor color) { for ( u32 c=0; c < EGUI_LBC_COUNT; ++c ) { @@ -821,7 +821,7 @@ void CGUIListBox::setItemOverrideColor(u32 index, const video::SColor &color) } -void CGUIListBox::setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, const video::SColor &color) +void CGUIListBox::setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color) { if ( index >= Items.size() || colorType < 0 || colorType >= EGUI_LBC_COUNT ) return; diff --git a/source/Irrlicht/CGUIListBox.h b/source/Irrlicht/CGUIListBox.h index 0577d88b..0d9bded4 100644 --- a/source/Irrlicht/CGUIListBox.h +++ b/source/Irrlicht/CGUIListBox.h @@ -95,10 +95,10 @@ namespace gui virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options); //! set all item colors at given index to color - virtual void setItemOverrideColor(u32 index, const video::SColor &color); + virtual void setItemOverrideColor(u32 index, video::SColor color); //! set all item colors of specified type at given index to color - virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, const video::SColor &color); + virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color); //! clear all item colors at index virtual void clearItemOverrideColor(u32 index);