Explorar o código

GUIWidget getSkin/setSkin now returns/accepts a reference instead of a pointer

Marko Pintera %!s(int64=12) %!d(string=hai) anos
pai
achega
74b41eb6d3

+ 4 - 3
BansheeEngine/Include/BsGUIWidget.h

@@ -23,8 +23,8 @@ namespace BansheeEngine
 		 */
 		 */
 		virtual void initialize(CM::Viewport* target, CM::RenderWindow* ownerWindow);
 		virtual void initialize(CM::Viewport* target, CM::RenderWindow* ownerWindow);
 
 
-		void setSkin(const GUISkin* skin);
-		const GUISkin* getSkin() const;
+		void setSkin(const GUISkin& skin);
+		const GUISkin& getSkin() const;
 
 
 		CM::UINT8 getDepth() const { return mDepth; }
 		CM::UINT8 getDepth() const { return mDepth; }
 		void setDepth(CM::UINT8 depth) { mDepth = depth; mWidgetIsDirty = true; }
 		void setDepth(CM::UINT8 depth) { mDepth = depth; mWidgetIsDirty = true; }
@@ -57,6 +57,8 @@ namespace BansheeEngine
 		 * 			must be a child of this widget.
 		 * 			must be a child of this widget.
 		 */
 		 */
 		virtual bool _keyEvent(GUIElement* element, const GUIKeyEvent& ev);
 		virtual bool _keyEvent(GUIElement* element, const GUIKeyEvent& ev);
+
+		static GUISkin DefaultSkin;
 	protected:
 	protected:
 		friend class CM::SceneObject;
 		friend class CM::SceneObject;
 		friend class GUIElement;
 		friend class GUIElement;
@@ -96,6 +98,5 @@ namespace BansheeEngine
 		mutable CM::Vector<CM::HMaterial>::type mCachedMaterials;
 		mutable CM::Vector<CM::HMaterial>::type mCachedMaterials;
 
 
 		const GUISkin* mSkin;
 		const GUISkin* mSkin;
-		static GUISkin DefaultSkin;
 	};
 	};
 }
 }

+ 4 - 4
BansheeEngine/Source/BsGUIButton.cpp

@@ -65,8 +65,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIButton, PoolAlloc>()) GUIButton(parent, style, content, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUIButton, PoolAlloc>()) GUIButton(parent, style, content, getDefaultLayoutOptions(style));
@@ -76,8 +76,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIButton, PoolAlloc>()) GUIButton(parent, style, content, layoutOptions);
 		return new (cm_alloc<GUIButton, PoolAlloc>()) GUIButton(parent, style, content, layoutOptions);

+ 5 - 5
BansheeEngine/Source/BsGUIDropDownList.cpp

@@ -49,8 +49,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIDropDownList, PoolAlloc>()) GUIDropDownList(parent, style, elements, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUIDropDownList, PoolAlloc>()) GUIDropDownList(parent, style, elements, getDefaultLayoutOptions(style));
@@ -60,8 +60,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIDropDownList, PoolAlloc>()) GUIDropDownList(parent, style, elements, layoutOptions);
 		return new (cm_alloc<GUIDropDownList, PoolAlloc>()) GUIDropDownList(parent, style, elements, layoutOptions);
@@ -192,7 +192,7 @@ namespace BansheeEngine
 			mImageDesc.texture = mStyle->active.texture;
 			mImageDesc.texture = mStyle->active.texture;
 			markContentAsDirty();
 			markContentAsDirty();
 
 
-			GUIManager::instance().openDropDownBox(this, mElements, boost::bind(&GUIDropDownList::elementSelected, this, _1), *_getParentWidget().getSkin());
+			GUIManager::instance().openDropDownBox(this, mElements, boost::bind(&GUIDropDownList::elementSelected, this, _1), _getParentWidget().getSkin());
 
 
 			return true;
 			return true;
 		}
 		}

+ 4 - 4
BansheeEngine/Source/BsGUIInputBox.cpp

@@ -58,8 +58,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIInputBox, PoolAlloc>()) GUIInputBox(parent, style, getDefaultLayoutOptions(style), multiline);
 		return new (cm_alloc<GUIInputBox, PoolAlloc>()) GUIInputBox(parent, style, getDefaultLayoutOptions(style), multiline);
@@ -69,8 +69,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIInputBox, PoolAlloc>()) GUIInputBox(parent, style, layoutOptions, multiline);
 		return new (cm_alloc<GUIInputBox, PoolAlloc>()) GUIInputBox(parent, style, layoutOptions, multiline);

+ 4 - 4
BansheeEngine/Source/BsGUILabel.cpp

@@ -124,8 +124,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUILabel, PoolAlloc>()) GUILabel(parent, style, content, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUILabel, PoolAlloc>()) GUILabel(parent, style, content, getDefaultLayoutOptions(style));
@@ -135,8 +135,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUILabel, PoolAlloc>()) GUILabel(parent, style, content, layoutOptions);
 		return new (cm_alloc<GUILabel, PoolAlloc>()) GUILabel(parent, style, content, layoutOptions);

+ 4 - 4
BansheeEngine/Source/BsGUIScrollArea.cpp

@@ -263,8 +263,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIScrollArea, PoolAlloc>()) GUIScrollArea(parent, style, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUIScrollArea, PoolAlloc>()) GUIScrollArea(parent, style, getDefaultLayoutOptions(style));
@@ -274,8 +274,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIScrollArea, PoolAlloc>()) GUIScrollArea(parent, style, layoutOptions);
 		return new (cm_alloc<GUIScrollArea, PoolAlloc>()) GUIScrollArea(parent, style, layoutOptions);

+ 6 - 6
BansheeEngine/Source/BsGUIScrollBar.cpp

@@ -25,19 +25,19 @@ namespace BansheeEngine
 		{
 		{
 			mLayout = &addLayoutXInternal(this);
 			mLayout = &addLayoutXInternal(this);
 
 
-			mUpBtn = GUIButton::create(parent, L"", parent.getSkin()->getStyle("ScrollLeftBtn"));
-			mDownBtn = GUIButton::create(parent, L"", parent.getSkin()->getStyle("ScrollRightBtn"));
+			mUpBtn = GUIButton::create(parent, L"", parent.getSkin().getStyle("ScrollLeftBtn"));
+			mDownBtn = GUIButton::create(parent, L"", parent.getSkin().getStyle("ScrollRightBtn"));
 
 
-			mHandleBtn = GUIScrollBarHandle::create(parent, mHorizontal, GUILayoutOptions::expandableX(6), parent.getSkin()->getStyle("ScrollBarHorzBtn"));
+			mHandleBtn = GUIScrollBarHandle::create(parent, mHorizontal, GUILayoutOptions::expandableX(6), parent.getSkin().getStyle("ScrollBarHorzBtn"));
 		}
 		}
 		else
 		else
 		{
 		{
 			mLayout = &addLayoutYInternal(this);
 			mLayout = &addLayoutYInternal(this);
 
 
-			mUpBtn = GUIButton::create(parent, L"", parent.getSkin()->getStyle("ScrollUpBtn"));
-			mDownBtn = GUIButton::create(parent, L"", parent.getSkin()->getStyle("ScrollDownBtn"));
+			mUpBtn = GUIButton::create(parent, L"", parent.getSkin().getStyle("ScrollUpBtn"));
+			mDownBtn = GUIButton::create(parent, L"", parent.getSkin().getStyle("ScrollDownBtn"));
 
 
-			mHandleBtn = GUIScrollBarHandle::create(parent, mHorizontal, GUILayoutOptions::expandableY(6), parent.getSkin()->getStyle("ScrollBarVertBtn"));
+			mHandleBtn = GUIScrollBarHandle::create(parent, mHorizontal, GUILayoutOptions::expandableY(6), parent.getSkin().getStyle("ScrollBarVertBtn"));
 		}
 		}
 
 
 		mLayout->addSpace(2);
 		mLayout->addSpace(2);

+ 4 - 4
BansheeEngine/Source/BsGUIScrollBarHandle.cpp

@@ -36,8 +36,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIScrollBarHandle, PoolAlloc>()) GUIScrollBarHandle(parent, horizontal, style, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUIScrollBarHandle, PoolAlloc>()) GUIScrollBarHandle(parent, horizontal, style, getDefaultLayoutOptions(style));
@@ -47,8 +47,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIScrollBarHandle, PoolAlloc>()) GUIScrollBarHandle(parent, horizontal, style, layoutOptions);
 		return new (cm_alloc<GUIScrollBarHandle, PoolAlloc>()) GUIScrollBarHandle(parent, horizontal, style, layoutOptions);

+ 4 - 4
BansheeEngine/Source/BsGUIScrollBarHorz.cpp

@@ -29,8 +29,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIScrollBarHorz, PoolAlloc>()) GUIScrollBarHorz(parent, style, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUIScrollBarHorz, PoolAlloc>()) GUIScrollBarHorz(parent, style, getDefaultLayoutOptions(style));
@@ -40,8 +40,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIScrollBarHorz, PoolAlloc>()) GUIScrollBarHorz(parent, style, layoutOptions);
 		return new (cm_alloc<GUIScrollBarHorz, PoolAlloc>()) GUIScrollBarHorz(parent, style, layoutOptions);

+ 4 - 4
BansheeEngine/Source/BsGUIScrollBarVert.cpp

@@ -29,8 +29,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIScrollBarVert, PoolAlloc>()) GUIScrollBarVert(parent, style, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUIScrollBarVert, PoolAlloc>()) GUIScrollBarVert(parent, style, getDefaultLayoutOptions(style));
@@ -40,8 +40,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIScrollBarVert, PoolAlloc>()) GUIScrollBarVert(parent, style, layoutOptions);
 		return new (cm_alloc<GUIScrollBarVert, PoolAlloc>()) GUIScrollBarVert(parent, style, layoutOptions);

+ 8 - 8
BansheeEngine/Source/BsGUITexture.cpp

@@ -43,8 +43,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUITexture, PoolAlloc>()) GUITexture(parent, style, texture, scale, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUITexture, PoolAlloc>()) GUITexture(parent, style, texture, scale, getDefaultLayoutOptions(style));
@@ -55,8 +55,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUITexture, PoolAlloc>()) GUITexture(parent, style, texture, scale, layoutOptions);
 		return new (cm_alloc<GUITexture, PoolAlloc>()) GUITexture(parent, style, texture, scale, layoutOptions);
@@ -66,8 +66,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUITexture, PoolAlloc>()) GUITexture(parent, style, nullptr, scale, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUITexture, PoolAlloc>()) GUITexture(parent, style, nullptr, scale, getDefaultLayoutOptions(style));
@@ -77,8 +77,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUITexture, PoolAlloc>()) GUITexture(parent, style, nullptr, scale, layoutOptions);
 		return new (cm_alloc<GUITexture, PoolAlloc>()) GUITexture(parent, style, nullptr, scale, layoutOptions);

+ 8 - 8
BansheeEngine/Source/BsGUIToggle.cpp

@@ -77,8 +77,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIToggle, PoolAlloc>()) GUIToggle(parent, style, content, nullptr, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUIToggle, PoolAlloc>()) GUIToggle(parent, style, content, nullptr, getDefaultLayoutOptions(style));
@@ -88,8 +88,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIToggle, PoolAlloc>()) GUIToggle(parent, style, content, nullptr, layoutOptions);
 		return new (cm_alloc<GUIToggle, PoolAlloc>()) GUIToggle(parent, style, content, nullptr, layoutOptions);
@@ -99,8 +99,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIToggle, PoolAlloc>()) GUIToggle(parent, style, content, toggleGroup, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUIToggle, PoolAlloc>()) GUIToggle(parent, style, content, toggleGroup, getDefaultLayoutOptions(style));
@@ -110,8 +110,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIToggle, PoolAlloc>()) GUIToggle(parent, style, content, toggleGroup, layoutOptions);
 		return new (cm_alloc<GUIToggle, PoolAlloc>()) GUIToggle(parent, style, content, toggleGroup, layoutOptions);

+ 4 - 4
BansheeEngine/Source/BsGUIViewport.cpp

@@ -41,8 +41,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIViewport, PoolAlloc>()) GUIViewport(parent, style, camera, aspectRatio, fieldOfView, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUIViewport, PoolAlloc>()) GUIViewport(parent, style, camera, aspectRatio, fieldOfView, getDefaultLayoutOptions(style));
@@ -53,8 +53,8 @@ namespace BansheeEngine
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIViewport, PoolAlloc>()) GUIViewport(parent, style, camera, aspectRatio, fieldOfView, layoutOptions);
 		return new (cm_alloc<GUIViewport, PoolAlloc>()) GUIViewport(parent, style, camera, aspectRatio, fieldOfView, layoutOptions);

+ 5 - 5
BansheeEngine/Source/BsGUIWidget.cpp

@@ -216,17 +216,17 @@ namespace BansheeEngine
 		mWidgetIsDirty = true;
 		mWidgetIsDirty = true;
 	}
 	}
 
 
-	void GUIWidget::setSkin(const GUISkin* skin)
+	void GUIWidget::setSkin(const GUISkin& skin)
 	{
 	{
-		mSkin = skin;
+		mSkin = &skin;
 	}
 	}
 
 
-	const GUISkin* GUIWidget::getSkin() const
+	const GUISkin& GUIWidget::getSkin() const
 	{
 	{
 		if(mSkin != nullptr)
 		if(mSkin != nullptr)
-			return mSkin;
+			return *mSkin;
 		else
 		else
-			return &DefaultSkin;
+			return DefaultSkin;
 	}
 	}
 
 
 	bool GUIWidget::isDirty(bool cleanIfDirty)
 	bool GUIWidget::isDirty(bool cleanIfDirty)

+ 2 - 2
CamelotClient/Source/BsEditorWindowBase.cpp

@@ -77,10 +77,10 @@ namespace BansheeEditor
 		mGUI->initialize(mCamera->getViewport().get(), renderWindow.get());
 		mGUI->initialize(mCamera->getViewport().get(), renderWindow.get());
 		mGUI->setDepth(128);
 		mGUI->setDepth(128);
 
 
-		mGUI->setSkin(&EngineGUI::instance().getSkin());
+		mGUI->setSkin(EngineGUI::instance().getSkin());
 
 
 		mWindowFrame = mSceneObject->addComponent<WindowFrameWidget>();
 		mWindowFrame = mSceneObject->addComponent<WindowFrameWidget>();
-		mWindowFrame->setSkin(&EngineGUI::instance().getSkin());
+		mWindowFrame->setSkin(EngineGUI::instance().getSkin());
 		mWindowFrame->initialize(mCamera->getViewport().get(), renderWindow.get());
 		mWindowFrame->initialize(mCamera->getViewport().get(), renderWindow.get());
 		mWindowFrame->setDepth(129);
 		mWindowFrame->setDepth(129);
 
 

+ 4 - 4
CamelotClient/Source/BsGUITabButton.cpp

@@ -28,8 +28,8 @@ namespace BansheeEditor
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUITabButton, PoolAlloc>()) GUITabButton(parent, style, titleBar, index, text, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUITabButton, PoolAlloc>()) GUITabButton(parent, style, titleBar, index, text, getDefaultLayoutOptions(style));
@@ -39,8 +39,8 @@ namespace BansheeEditor
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUITabButton, PoolAlloc>()) GUITabButton(parent, style, titleBar, index, text, layoutOptions);
 		return new (cm_alloc<GUITabButton, PoolAlloc>()) GUITabButton(parent, style, titleBar, index, text, layoutOptions);

+ 4 - 4
CamelotClient/Source/BsGUITabbedTitleBar.cpp

@@ -21,18 +21,18 @@ namespace BansheeEditor
 		mMainArea(nullptr), mMainLayout(nullptr), mParentWidget(parent), mBackgroundArea(nullptr), mUniqueTabIdx(0), mActiveTabIdx(0)
 		mMainArea(nullptr), mMainLayout(nullptr), mParentWidget(parent), mBackgroundArea(nullptr), mUniqueTabIdx(0), mActiveTabIdx(0)
 	{
 	{
 		mBackgroundArea = GUIArea::create(*parent, 0, 0, 1, 13, 9900);
 		mBackgroundArea = GUIArea::create(*parent, 0, 0, 1, 13, 9900);
-		GUIWindowDropArea* titleBarBg = GUIWindowDropArea::create(*parent, parent->getSkin()->getStyle("TitleBarBackground"));
+		GUIWindowDropArea* titleBarBg = GUIWindowDropArea::create(*parent, parent->getSkin().getStyle("TitleBarBackground"));
 		mBackgroundArea->getLayout().addSpace(1);
 		mBackgroundArea->getLayout().addSpace(1);
 		mBackgroundArea->getLayout().addElement(titleBarBg);
 		mBackgroundArea->getLayout().addElement(titleBarBg);
 		mBackgroundArea->getLayout().addSpace(1);
 		mBackgroundArea->getLayout().addSpace(1);
 
 
 		mMainArea = GUIArea::create(*parent, 0, 0, 1, 13, 9899);
 		mMainArea = GUIArea::create(*parent, 0, 0, 1, 13, 9899);
 
 
-		GUIWindowDropArea* dragDropElement = GUIWindowDropArea::create(*parent, GUILayoutOptions::expandableX(13, 20), parent->getSkin()->getStyle("TabbedBarDropArea"));
+		GUIWindowDropArea* dragDropElement = GUIWindowDropArea::create(*parent, GUILayoutOptions::expandableX(13, 20), parent->getSkin().getStyle("TabbedBarDropArea"));
 		mLastDropElement = dragDropElement;
 		mLastDropElement = dragDropElement;
 
 
-		mMinBtn = GUIButton::create(*parent, L"", parent->getSkin()->getStyle("WinMinimizeBtn"));
-		mCloseBtn = GUIButton::create(*parent, L"", parent->getSkin()->getStyle("WinCloseBtn"));
+		mMinBtn = GUIButton::create(*parent, L"", parent->getSkin().getStyle("WinMinimizeBtn"));
+		mCloseBtn = GUIButton::create(*parent, L"", parent->getSkin().getStyle("WinCloseBtn"));
 
 
 		mCloseBtn->onClick.connect(boost::bind(&GUITabbedTitleBar::tabClosed, this));
 		mCloseBtn->onClick.connect(boost::bind(&GUITabbedTitleBar::tabClosed, this));
 
 

+ 4 - 4
CamelotClient/Source/BsGUIWindowDropArea.cpp

@@ -29,8 +29,8 @@ namespace BansheeEditor
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIWindowDropArea, PoolAlloc>()) GUIWindowDropArea(parent, style, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUIWindowDropArea, PoolAlloc>()) GUIWindowDropArea(parent, style, getDefaultLayoutOptions(style));
@@ -40,8 +40,8 @@ namespace BansheeEditor
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIWindowDropArea, PoolAlloc>()) GUIWindowDropArea(parent, style, layoutOptions);
 		return new (cm_alloc<GUIWindowDropArea, PoolAlloc>()) GUIWindowDropArea(parent, style, layoutOptions);

+ 4 - 4
CamelotClient/Source/BsGUIWindowFrame.cpp

@@ -34,8 +34,8 @@ namespace BansheeEditor
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIWindowFrame, PoolAlloc>()) GUIWindowFrame(parent, style, getDefaultLayoutOptions(style));
 		return new (cm_alloc<GUIWindowFrame, PoolAlloc>()) GUIWindowFrame(parent, style, getDefaultLayoutOptions(style));
@@ -45,8 +45,8 @@ namespace BansheeEditor
 	{
 	{
 		if(style == nullptr)
 		if(style == nullptr)
 		{
 		{
-			const GUISkin* skin = parent.getSkin();
-			style = skin->getStyle(getGUITypeName());
+			const GUISkin& skin = parent.getSkin();
+			style = skin.getStyle(getGUITypeName());
 		}
 		}
 
 
 		return new (cm_alloc<GUIWindowFrame, PoolAlloc>()) GUIWindowFrame(parent, style, layoutOptions);
 		return new (cm_alloc<GUIWindowFrame, PoolAlloc>()) GUIWindowFrame(parent, style, layoutOptions);

+ 2 - 2
CamelotClient/Source/BsGUIWindowFrameWidget.cpp

@@ -32,11 +32,11 @@ namespace BansheeEditor
 		GUIWidget::initialize(target, ownerWindow);
 		GUIWidget::initialize(target, ownerWindow);
 
 
 		GUIArea* backgroundArea = GUIArea::createStretchedXY(*this, 0, 0, 0, 0, 500);
 		GUIArea* backgroundArea = GUIArea::createStretchedXY(*this, 0, 0, 0, 0, 500);
-		backgroundArea->getLayout().addElement(GUITexture::create(*this, GUILayoutOptions::expandableXY(), GUIImageScaleMode::RepeatToFit, getSkin()->getStyle("WindowBackground")));
+		backgroundArea->getLayout().addElement(GUITexture::create(*this, GUILayoutOptions::expandableXY(), GUIImageScaleMode::RepeatToFit, getSkin().getStyle("WindowBackground")));
 
 
 		mWindowFrameArea = GUIArea::createStretchedXY(*this, 0, 0, 0, 0, 499);
 		mWindowFrameArea = GUIArea::createStretchedXY(*this, 0, 0, 0, 0, 499);
 
 
-		mWindowFrame = GUIWindowFrame::create(*this, getSkin()->getStyle("WindowFrame"));
+		mWindowFrame = GUIWindowFrame::create(*this, getSkin().getStyle("WindowFrame"));
 		mWindowFrameArea->getLayout().addElement(mWindowFrame);
 		mWindowFrameArea->getLayout().addElement(mWindowFrame);
 
 
 		refreshNonClientAreas();
 		refreshNonClientAreas();

+ 1 - 1
CamelotClient/Source/CmTestTextSprite.cpp

@@ -37,7 +37,7 @@ namespace CamelotFramework
 
 
 	void TestTextSprite::init(const HCamera& camera, const String& text, CM::RenderTexturePtr sceneView)
 	void TestTextSprite::init(const HCamera& camera, const String& text, CM::RenderTexturePtr sceneView)
 	{
 	{
-		setSkin(&EngineGUI::instance().getSkin());
+		setSkin(EngineGUI::instance().getSkin());
 
 
 		GUIArea* area = GUIArea::createStretchedXY(*this, 0, 0, 0, 0);
 		GUIArea* area = GUIArea::createStretchedXY(*this, 0, 0, 0, 0);
 
 

+ 4 - 2
TODODoc.txt

@@ -18,9 +18,11 @@
    some out, even if they contain no data. This would create incomplete RTTI class hierarchy which can cause various issues.
    some out, even if they contain no data. This would create incomplete RTTI class hierarchy which can cause various issues.
  - Notation rules:
  - Notation rules:
     - Method prefixed with _ (i.e. _getDevice()) are internal methods used by the engine systems and normal user should not need to call them unless 
     - Method prefixed with _ (i.e. _getDevice()) are internal methods used by the engine systems and normal user should not need to call them unless 
-	  he really knows what is he doing. Those methods might also be marked with "Internal method" notation in their documentation.
+	  he really knows what is he doing. Those methods might also be marked with "Internal method" notation in their documentation (without the _ prefix).
 	  Only methods that are part of the public interface have this syntax, as private methods are not visible to the user anyway, so there's no need for special notation.
 	  Only methods that are part of the public interface have this syntax, as private methods are not visible to the user anyway, so there's no need for special notation.
-	    - When communicating between system I will use "prefix _" notation interchangeably with friend class approach. Sometimes I prefer to extend to public interface and 
+	    - When communicating between systems I will use "prefix _" notation interchangeably with friend class approach. Sometimes I prefer to extend the public interface and 
 		add a _ prefixed method, and in other cases I prefer not to modify the public interface and make a class a friend and use a private method.
 		add a _ prefixed method, and in other cases I prefer not to modify the public interface and make a class a friend and use a private method.
+	  A lot of the classes are only meant for internal usage. In that case the entire class is marked with "Internal class", but none of its methods are prefixed or specially documented. 
+	  In such class it is assumed all methods are internal and generally aren't meant for normal day to day use.
 	- "Core method" notation in method documentation. This means the method is only meant to be called from the core thread. Calling it from another thread
 	- "Core method" notation in method documentation. This means the method is only meant to be called from the core thread. Calling it from another thread
 	  will cause an exception at best, or cause unpredictable behaviour at worst.
 	  will cause an exception at best, or cause unpredictable behaviour at worst.