فهرست منبع

Ported a good section of GUI/2D to Banshee

Marko Pintera 12 سال پیش
والد
کامیت
a3340532f8
44فایلهای تغییر یافته به همراه439 افزوده شده و 408 حذف شده
  1. 27 6
      BansheeEngine/BansheeEngine.vcxproj
  2. 79 4
      BansheeEngine/BansheeEngine.vcxproj.filters
  3. 7 7
      BansheeEngine/Include/BsGUIElement.h
  4. 18 0
      BansheeEngine/Include/BsGUIElementStyle.h
  5. 52 0
      BansheeEngine/Include/BsGUILabel.h
  6. 4 4
      BansheeEngine/Include/BsGUIManager.h
  7. 9 9
      BansheeEngine/Include/BsGUIMaterialManager.h
  8. 18 0
      BansheeEngine/Include/BsGUIMouseEvent.h
  9. 19 0
      BansheeEngine/Include/BsGUISkin.h
  10. 43 0
      BansheeEngine/Include/BsGUIWidget.h
  11. 0 0
      BansheeEngine/Include/BsGUIWindowFrame.h
  12. 6 6
      BansheeEngine/Include/BsImageSprite.h
  13. 25 3
      BansheeEngine/Include/BsPrerequisites.h
  14. 13 13
      BansheeEngine/Include/BsSprite.h
  15. 29 0
      BansheeEngine/Include/BsSpriteTexture.h
  16. 8 8
      BansheeEngine/Include/BsTextSprite.h
  17. 0 52
      BansheeEngine/Include/CmGUILabel.h
  18. 6 4
      BansheeEngine/Source/BsGUIElement.cpp
  19. 5 5
      BansheeEngine/Source/BsGUILabel.cpp
  20. 4 4
      BansheeEngine/Source/BsGUIManager.cpp
  21. 4 2
      BansheeEngine/Source/BsGUIMaterialManager.cpp
  22. 5 3
      BansheeEngine/Source/BsGUISkin.cpp
  23. 7 5
      BansheeEngine/Source/BsGUIWidget.cpp
  24. 6 6
      BansheeEngine/Source/BsImageSprite.cpp
  25. 5 3
      BansheeEngine/Source/BsSprite.cpp
  26. 4 2
      BansheeEngine/Source/BsSpriteTexture.cpp
  27. 5 3
      BansheeEngine/Source/BsTextSprite.cpp
  28. 3 3
      CamelotClient/CamelotClient.cpp
  29. 1 0
      CamelotClient/CamelotClient.vcxproj
  30. 5 3
      CamelotClient/CmEditorWindow.cpp
  31. 4 6
      CamelotClient/CmEditorWindow.h
  32. 8 6
      CamelotClient/CmTestTextSprite.cpp
  33. 3 3
      CamelotClient/CmTestTextSprite.h
  34. 1 21
      CamelotCore/CamelotCore.vcxproj
  35. 4 70
      CamelotCore/CamelotCore.vcxproj.filters
  36. 0 18
      CamelotCore/Include/CmGUIElementStyle.h
  37. 0 18
      CamelotCore/Include/CmGUIMouseEvent.h
  38. 0 19
      CamelotCore/Include/CmGUISkin.h
  39. 0 43
      CamelotCore/Include/CmGUIWidget.h
  40. 0 1
      CamelotCore/Include/CmGameObject.h
  41. 0 13
      CamelotCore/Include/CmPrerequisites.h
  42. 0 29
      CamelotCore/Include/CmSpriteTexture.h
  43. 1 6
      CamelotCore/Source/CmApplication.cpp
  44. 1 0
      CamelotCore/Source/CmBuiltinMaterialManager.cpp

+ 27 - 6
BansheeEngine/BansheeEngine.vcxproj

@@ -85,7 +85,7 @@
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\CamelotCore\Include;..\CamelotUtility\Include;..\Dependencies\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.\Include;..\CamelotCore\Include;..\CamelotUtility\Include;..\Dependencies\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>BS_EXPORTS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
@@ -99,7 +99,7 @@
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\CamelotCore\Include;..\CamelotUtility\Include;..\Dependencies\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.\Include;..\CamelotCore\Include;..\CamelotUtility\Include;..\Dependencies\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>BS_EXPORTS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
@@ -115,7 +115,7 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>..\CamelotCore\Include;..\CamelotUtility\Include;..\Dependencies\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.\Include;..\CamelotCore\Include;..\CamelotUtility\Include;..\Dependencies\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>BS_EXPORTS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
@@ -133,7 +133,7 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>..\CamelotCore\Include;..\CamelotUtility\Include;..\Dependencies\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.\Include;..\CamelotCore\Include;..\CamelotUtility\Include;..\Dependencies\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>BS_EXPORTS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
@@ -147,10 +147,31 @@
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="Include\BsPrerequisites.h" />
-    <ClInclude Include="Include\CmGUILabel.h" />
+    <ClInclude Include="Include\BsGUIElement.h" />
+    <ClInclude Include="Include\BsGUIElementStyle.h" />
+    <ClInclude Include="Include\BsGUILabel.h" />
+    <ClInclude Include="Include\BsGUIManager.h" />
+    <ClInclude Include="Include\BsGUIMaterialManager.h" />
+    <ClInclude Include="Include\BsGUIMouseEvent.h" />
+    <ClInclude Include="Include\BsGUISkin.h" />
+    <ClInclude Include="Include\BsGUIWidget.h" />
+    <ClInclude Include="Include\BsGUIWindowFrame.h" />
+    <ClInclude Include="Include\BsImageSprite.h" />
+    <ClInclude Include="Include\BsSprite.h" />
+    <ClInclude Include="Include\BsSpriteTexture.h" />
+    <ClInclude Include="Include\BsTextSprite.h" />
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="Include\CmGUILabel.cpp" />
+    <ClCompile Include="Source\BsGUIElement.cpp" />
+    <ClCompile Include="Source\BsGUILabel.cpp" />
+    <ClCompile Include="Source\BsGUIManager.cpp" />
+    <ClCompile Include="Source\BsGUIMaterialManager.cpp" />
+    <ClCompile Include="Source\BsGUISkin.cpp" />
+    <ClCompile Include="Source\BsGUIWidget.cpp" />
+    <ClCompile Include="Source\BsImageSprite.cpp" />
+    <ClCompile Include="Source\BsSprite.cpp" />
+    <ClCompile Include="Source\BsSpriteTexture.cpp" />
+    <ClCompile Include="Source\BsTextSprite.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">

+ 79 - 4
BansheeEngine/BansheeEngine.vcxproj.filters

@@ -13,18 +13,93 @@
       <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
       <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
     </Filter>
+    <Filter Include="Header Files\GUI">
+      <UniqueIdentifier>{d21e5e3c-e647-46a5-99e6-e2fdeb3dc842}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\GUI">
+      <UniqueIdentifier>{e362bd0a-2c27-483e-96c9-60603548be35}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\2D">
+      <UniqueIdentifier>{e3db645e-b8cb-48fc-9eef-75c31ab7cd8b}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\2D">
+      <UniqueIdentifier>{95b6f738-cc0a-4dde-81f8-b0246ab32938}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="Include\BsPrerequisites.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="Include\CmGUILabel.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsGUIElement.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUIElementStyle.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUILabel.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUIManager.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUIMaterialManager.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUIMouseEvent.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUIWidget.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUISkin.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUIWindowFrame.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsImageSprite.h">
+      <Filter>Header Files\2D</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsSprite.h">
+      <Filter>Header Files\2D</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsSpriteTexture.h">
+      <Filter>Header Files\2D</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsTextSprite.h">
+      <Filter>Header Files\2D</Filter>
     </ClInclude>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="Include\CmGUILabel.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsGUIElement.cpp">
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsGUILabel.cpp">
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsGUIManager.cpp">
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsGUIMaterialManager.cpp">
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsGUISkin.cpp">
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsGUIWidget.cpp">
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsImageSprite.cpp">
+      <Filter>Source Files\2D</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsSprite.cpp">
+      <Filter>Source Files\2D</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsSpriteTexture.cpp">
+      <Filter>Source Files\2D</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsTextSprite.cpp">
+      <Filter>Source Files\2D</Filter>
     </ClCompile>
   </ItemGroup>
 </Project>

+ 7 - 7
CamelotCore/Include/CmGUIElement.h → BansheeEngine/Include/BsGUIElement.h

@@ -1,11 +1,11 @@
 #pragma once
 
-#include "CmPrerequisites.h"
+#include "BsPrerequisites.h"
 #include "CmRect.h"
 
-namespace CamelotEngine
+namespace BansheeEngine
 {
-	class CM_EXPORT GUIElement
+	class BS_EXPORT GUIElement
 	{
 	public:
 		GUIElement(GUIWidget* parent);
@@ -28,7 +28,7 @@ namespace CamelotEngine
 		 * 		
 		 * @return	Handle to the material.
 		 */
-		virtual const HMaterial& getMaterial(UINT32 renderElementIdx) const = 0;
+		virtual const CM::HMaterial& getMaterial(UINT32 renderElementIdx) const = 0;
 
 		/**
 		 * @brief	Returns the number of quads that the specified render element will use. You will need this
@@ -57,9 +57,9 @@ namespace CamelotEngine
 		 * @param	maxNumQuads			Total number of quads the buffers were allocated for. Used only for memory safety.
 		 * @param	renderElementIdx	Zero-based index of the render element.
 		 */
-		virtual void fillBuffer(Vector2* vertices, Vector2* uv, UINT32* indices, UINT32 startingQuad, UINT32 maxNumQuads, UINT32 renderElementIdx) const = 0;
+		virtual void fillBuffer(CM::Vector2* vertices, CM::Vector2* uv, UINT32* indices, UINT32 startingQuad, UINT32 maxNumQuads, UINT32 renderElementIdx) const = 0;
 
-		const Rect& getBounds() const { return mBounds; }
+		const CM::Rect& getBounds() const { return mBounds; }
 
 		void setDepth(INT32 depth) { mDepth = depth; }
 		INT32 getDepth() const { return mDepth; }
@@ -75,7 +75,7 @@ namespace CamelotEngine
 		virtual ~GUIElement();
 
 		GUIWidget* mParent;
-		Rect mBounds;
+		CM::Rect mBounds;
 		INT32 mDepth;
 		const GUIElementStyle* mStyle;
 

+ 18 - 0
BansheeEngine/Include/BsGUIElementStyle.h

@@ -0,0 +1,18 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+
+namespace BansheeEngine
+{
+	struct BS_EXPORT GUIElementStyle
+	{
+		GUIElementStyle()
+			:fontSize(8)
+		{
+
+		}
+
+		CM::HFont font;
+		UINT32 fontSize;
+	};
+}

+ 52 - 0
BansheeEngine/Include/BsGUILabel.h

@@ -0,0 +1,52 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "BsGUIElement.h"
+#include "BsTextSprite.h"
+
+namespace BansheeEngine
+{
+	class BS_EXPORT GUILabel : public GUIElement
+	{
+	public:
+		static const CM::String& getGUITypeName();
+
+		static GUILabel* create(GUIWidget* parent, const CM::String& text);
+		static GUILabel* create(GUIWidget* parent, const CM::String& text, TextHorzAlign horzAlign, TextVertAlign vertAlign);
+		static GUILabel* create(GUIWidget* parent, const CM::String& text, UINT32 fixedWidth, UINT32 fixedHeight, bool wordWrap);
+		static GUILabel* create(GUIWidget* parent, const CM::String& text, UINT32 fixedWidth, UINT32 fixedHeight, bool wordWrap, TextHorzAlign horzAlign, TextVertAlign vertAlign);
+
+	protected:
+		~GUILabel();
+
+		/**
+		 * @copydoc GUIElement::getNumRenderElements()
+		 */
+		virtual UINT32 getNumRenderElements() const;
+
+		/**
+		 * @copydoc GUIElement::getMaterial()
+		 */
+		virtual const CM::HMaterial& getMaterial(UINT32 renderElementIdx) const;
+
+		/**
+		 * @copydoc GUIElement::getNumQuads()
+		 */
+		virtual UINT32 getNumQuads(UINT32 renderElementIdx) const;
+
+		/**
+		 * @copydoc GUIElement::fillBuffer()
+		 */
+		virtual void fillBuffer(CM::Vector2* vertices, CM::Vector2* uv, UINT32* indices, UINT32 startingQuad, UINT32 maxNumQuads, UINT32 renderElementIdx) const;
+	private:
+		TextSprite* mTextSprite;
+		CM::String mText;
+		UINT32 mFixedWidth, mFixedHeight;
+		bool mWordWrap;
+		TextHorzAlign mHorzAlign;
+		TextVertAlign mVertAlign;
+
+		GUILabel(GUIWidget* parent, const CM::String& text, UINT32 fixedWidth, UINT32 fixedHeight, 
+			bool wordWrap, TextHorzAlign horzAlign, TextVertAlign vertAlign);
+	};
+}

+ 4 - 4
CamelotCore/Include/CmGUIManager.h → BansheeEngine/Include/BsGUIManager.h

@@ -1,20 +1,20 @@
 #pragma once
 
-#include "CmPrerequisites.h"
+#include "BsPrerequisites.h"
 #include "CmModule.h"
 
-namespace CamelotEngine
+namespace BansheeEngine
 {
 	/**
 	 * @brief	Manages the rendering of all GUI widgets in the scene. 
 	 */
-	class CM_EXPORT GUIManager : public Module<GUIManager>
+	class BS_EXPORT GUIManager : public CM::Module<GUIManager>
 	{
 	public:
 		void registerWidget(GUIWidget* widget);
 		void unregisterWidget(GUIWidget* widget);
 
 	private:
-		vector<GUIWidget*>::type mWidgets;
+		std::vector<GUIWidget*> mWidgets;
 	};
 }

+ 9 - 9
CamelotCore/Include/CmGUIMaterialManager.h → BansheeEngine/Include/BsGUIMaterialManager.h

@@ -1,15 +1,15 @@
 #pragma once
 
-#include "CmPrerequisites.h"
+#include "BsPrerequisites.h"
 #include "CmModule.h"
 
-namespace CamelotEngine
+namespace BansheeEngine
 {
 	/**
 	 * @brief	Manages the materials used by the GUI system. Ensures that the GUI system doesn't
 	 * 			create an unnecessarily large amount of equivalent materials.
 	 */
-	class CM_EXPORT GUIMaterialManager : public Module<GUIMaterialManager>
+	class BS_EXPORT GUIMaterialManager : public CM::Module<GUIMaterialManager>
 	{
 	public:
 		/**
@@ -20,7 +20,7 @@ namespace CamelotEngine
 		 *			
 		 *			Make sure to release all materials with a call to "releaseMaterial()".
 		 */
-		const HMaterial& requestTextMaterial(const HTexture& texture) const;
+		const CM::HMaterial& requestTextMaterial(const CM::HTexture& texture) const;
 
 		/**
 		 * @brief	Creates a new material, or returns a reference to an existing one based on
@@ -30,13 +30,13 @@ namespace CamelotEngine
 		 *			
 		 *			Make sure to release all materials with a call to "releaseMaterial()".
 		 */
-		const HMaterial& requestImageMaterial(const HTexture& texture) const;
+		const CM::HMaterial& requestImageMaterial(const CM::HTexture& texture) const;
 
 		/**
 		 * @brief	Releases the held reference to the material. This allows us to fully unload a material
 		 * 			and their textures when they are no longer being used.
 		 */
-		void releaseMaterial(const HMaterial& material) const;
+		void releaseMaterial(const CM::HMaterial& material) const;
 	private:
 		struct GUIMaterial
 		{
@@ -44,11 +44,11 @@ namespace CamelotEngine
 				:refCount(0)
 			{ }
 
-			HMaterial handle;
+			CM::HMaterial handle;
 			UINT32 refCount;
 		};
 
-		mutable vector<GUIMaterial>::type mTextMaterials;
-		mutable vector<GUIMaterial>::type mImageMaterials;
+		mutable std::vector<GUIMaterial> mTextMaterials;
+		mutable std::vector<GUIMaterial> mImageMaterials;
 	};
 }

+ 18 - 0
BansheeEngine/Include/BsGUIMouseEvent.h

@@ -0,0 +1,18 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "CmVector2.h"
+
+namespace BansheeEngine
+{
+	class BS_EXPORT GUIMouseEvent
+	{
+	public:
+		GUIMouseEvent(const CM::Vector2& position)
+			:mPosition(position)
+		{ }
+
+	private:
+		CM::Vector2 mPosition;
+	};
+}

+ 19 - 0
BansheeEngine/Include/BsGUISkin.h

@@ -0,0 +1,19 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "BsGUIElementStyle.h"
+
+namespace BansheeEngine
+{
+	class BS_EXPORT GUISkin
+	{
+	public:
+		const GUIElementStyle* getStyle(const CM::String& guiElemType) const;
+		void setStyle(const CM::String& guiElemType, const GUIElementStyle& style);
+
+	private:
+		static GUIElementStyle DefaultStyle;
+
+		std::unordered_map<std::string, GUIElementStyle> mStyles;
+	};
+}

+ 43 - 0
BansheeEngine/Include/BsGUIWidget.h

@@ -0,0 +1,43 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "CmOverlay.h"
+#include "BsTextSprite.h"
+#include "CmORect.h"
+
+namespace BansheeEngine
+{
+	class BS_EXPORT GUIWidget : public CM::Overlay
+	{
+	public:
+		virtual ~GUIWidget();
+
+		void setSkin(const GUISkin* skin);
+		const GUISkin* getGUISkin() const;
+
+		virtual void render(const CM::Camera* camera, CM::DeferredRenderContextPtr& renderContext) const;
+	protected:
+		friend class SceneObject;
+		friend class GUIElement;
+
+		GUIWidget(const CM::HSceneObject& parent);
+
+		void mouseEvent(const GUIMouseEvent& ev);
+
+		void registerElement(GUIElement* elem);
+	private:
+
+		void updateMeshes() const;
+		void updateBounds() const;
+
+		std::vector<GUIElement*> mElements;
+		
+		mutable CM::Rect mBounds;
+		mutable std::vector<std::pair<CM::ORect, GUIElement*>> mCachedBounds;
+		mutable std::vector<CM::HMesh> mCachedMeshes;
+		mutable std::vector<CM::HMaterial> mCachedMaterials;
+
+		const GUISkin* mSkin;
+		static GUISkin DefaultSkin;
+	};
+}

+ 0 - 0
CamelotCore/Include/CmGUIWindowFrame.h → BansheeEngine/Include/BsGUIWindowFrame.h


+ 6 - 6
CamelotCore/Include/CmImageSprite.h → BansheeEngine/Include/BsImageSprite.h

@@ -1,9 +1,9 @@
 #pragma once
 
-#include "CmPrerequisites.h"
-#include "CmSprite.h"
+#include "BsPrerequisites.h"
+#include "BsSprite.h"
 
-namespace CamelotEngine
+namespace BansheeEngine
 {
 	struct IMAGE_SPRITE_DESC
 	{
@@ -12,17 +12,17 @@ namespace CamelotEngine
 			borderTop(0), borderBottom(0)
 		{ }
 
-		Point offset;
+		CM::Point offset;
 		UINT32 width;
 		UINT32 height;
-		Rect clipRect;
+		CM::Rect clipRect;
 		SpriteAnchor anchor;
 
 		SpriteTexturePtr texture;
 		UINT32 borderLeft, borderRight, borderTop, borderBottom;
 	};
 
-	class CM_EXPORT ImageSprite : public Sprite
+	class BS_EXPORT ImageSprite : public Sprite
 	{
 	public:
 		ImageSprite();

+ 25 - 3
BansheeEngine/Include/BsPrerequisites.h

@@ -18,11 +18,13 @@
 #    define BS_EXPORT
 #endif
 
+#include "CmGameObject.h"
+
+// To avoid a lot of typing
+namespace CM = CamelotEngine;
+
 namespace BansheeEngine
 {
-	// To avoid a lot of typing
-	namespace CM = CamelotEngine;
-
 	typedef char INT8;
 	typedef unsigned char UINT8;
 	typedef short INT16;
@@ -38,4 +40,24 @@ namespace BansheeEngine
 	typedef unsigned long long UINT64;
 	typedef long long INT64;
 #endif
+
+	// GUI
+	class GUIManager;
+	class GUIWidget;
+	class GUIElement;
+	class GUILabel;
+	class GUISkin;
+	struct GUIElementStyle;
+	struct GUIMouseEvent;
+
+	// 2D
+	class TextSprite;
+	class SpriteTexture;
+
+	typedef std::shared_ptr<TextSprite> TextSpritePtr;
+	typedef std::shared_ptr<SpriteTexture> SpriteTexturePtr;
+
+	typedef CM::GameObjectHandle<GUIWidget> HGUIWidget;
 }
+
+namespace BS = BansheeEngine;

+ 13 - 13
CamelotCore/Include/CmSprite.h → BansheeEngine/Include/BsSprite.h

@@ -1,10 +1,10 @@
 #pragma once
 
-#include "CmPrerequisites.h"
+#include "BsPrerequisites.h"
 #include "CmPoint.h"
 #include "CmRect.h"
 
-namespace CamelotEngine
+namespace BansheeEngine
 {
 	enum SpriteAnchor
 	{
@@ -25,20 +25,20 @@ namespace CamelotEngine
 			:vertices(nullptr), uvs(nullptr), indexes(nullptr), numQuads(0)
 		{ }
 
-		Vector2* vertices;
-		Vector2* uvs;
+		CM::Vector2* vertices;
+		CM::Vector2* uvs;
 		UINT32* indexes;
 		UINT32 numQuads;
-		HMaterial material;
+		CM::HMaterial material;
 	};
 
-	class CM_EXPORT Sprite
+	class BS_EXPORT Sprite
 	{
 	public:
 		Sprite();
 		virtual ~Sprite();
 
-		const Rect& getBounds() const { return mBounds; }
+		const CM::Rect& getBounds() const { return mBounds; }
 
 		/**
 		 * @brief	Returns the number of separate render elements in the sprite. Normally this is one, but some sprites
@@ -55,7 +55,7 @@ namespace CamelotEngine
 		 * 		
 		 * @return	Handle to the material.
 		 */
-		const HMaterial& getMaterial(UINT32 renderElementIdx) const;
+		const CM::HMaterial& getMaterial(UINT32 renderElementIdx) const;
 
 		/**
 		 * @brief	Returns the number of quads that the specified render element will use. You will need this
@@ -84,16 +84,16 @@ namespace CamelotEngine
 		 * @param	maxNumQuads			Total number of quads the buffers were allocated for. Used only for memory safety.
 		 * @param	renderElementIdx	Zero-based index of the render element.
 		 */
-		UINT32 fillBuffer(Vector2* vertices, Vector2* uv, UINT32* indices, UINT32 startingQuad, UINT32 maxNumQuads, UINT32 renderElementIdx) const;
+		UINT32 fillBuffer(CM::Vector2* vertices, CM::Vector2* uv, UINT32* indices, UINT32 startingQuad, UINT32 maxNumQuads, UINT32 renderElementIdx) const;
 
 	protected:
-		mutable Rect mBounds;
-		mutable vector<SpriteRenderElement>::type mCachedRenderElements;
+		mutable CM::Rect mBounds;
+		mutable std::vector<SpriteRenderElement> mCachedRenderElements;
 
 		void updateBounds() const;
 		void clearMesh() const;
 
-		void clipToRect(Vector2* vertices, Vector2* uv, UINT32 numQuads, const Rect& clipRect) const;
-		Point getAnchorOffset(SpriteAnchor anchor, UINT32 width, UINT32 height) const;
+		void clipToRect(CM::Vector2* vertices, CM::Vector2* uv, UINT32 numQuads, const CM::Rect& clipRect) const;
+		CM::Point getAnchorOffset(SpriteAnchor anchor, UINT32 width, UINT32 height) const;
 	};
 }

+ 29 - 0
BansheeEngine/Include/BsSpriteTexture.h

@@ -0,0 +1,29 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "CmVector2.h"
+
+namespace BansheeEngine
+{
+	/**
+	 * @brief	Texture interface that attempts to hide the underlying texture. This primarily allows us
+	 * 			to create a sprite texture atlas, without requiring any of the sprite classes to directly
+	 * 			know about it.
+	 */
+	class BS_EXPORT SpriteTexture
+	{
+	public:
+		SpriteTexture(const CM::HTexture& baseTexture);
+
+		const CM::HTexture& getTexture() const;
+		CM::Vector2 transformUV(const CM::Vector2& uv) const;
+
+	private:
+		CM::HTexture mBaseTexture;
+
+		bool mUsingAtlas;
+		CM::HTexture mAtlasTexture;
+		CM::Vector2 mUVOffset;
+		CM::Vector2 mUVScale;
+	};
+}

+ 8 - 8
CamelotCore/Include/CmTextSprite.h → BansheeEngine/Include/BsTextSprite.h

@@ -1,9 +1,9 @@
 #pragma once
 
-#include "CmPrerequisites.h"
-#include "CmSprite.h"
+#include "BsPrerequisites.h"
+#include "BsSprite.h"
 
-namespace CamelotEngine
+namespace BansheeEngine
 {
 	enum TextHorzAlign
 	{
@@ -22,21 +22,21 @@ namespace CamelotEngine
 			horzAlign(THA_Left), vertAlign(TVA_Top), wordWrap(false)
 		{ }
 
-		Point offset;
+		CM::Point offset;
 		UINT32 width;
 		UINT32 height;
-		Rect clipRect;
+		CM::Rect clipRect;
 		SpriteAnchor anchor;
 
-		String text;
-		HFont font;
+		CM::String text;
+		CM::HFont font;
 		UINT32 fontSize;
 		TextHorzAlign horzAlign;
 		TextVertAlign vertAlign;
 		bool wordWrap;
 	};
 
-	class CM_EXPORT TextSprite : public Sprite
+	class BS_EXPORT TextSprite : public Sprite
 	{
 	public:
 		TextSprite();

+ 0 - 52
BansheeEngine/Include/CmGUILabel.h

@@ -1,52 +0,0 @@
-#pragma once
-
-#include "BsPrerequisites.h"
-#include "CmGUIElement.h"
-#include "CmTextSprite.h"
-
-namespace BansheeEngine
-{
-	class BS_EXPORT GUILabel : public CM::GUIElement
-	{
-	public:
-		static const CM::String& getGUITypeName();
-
-		static GUILabel* create(CM::GUIWidget* parent, const CM::String& text);
-		static GUILabel* create(CM::GUIWidget* parent, const CM::String& text, CM::TextHorzAlign horzAlign, CM::TextVertAlign vertAlign);
-		static GUILabel* create(CM::GUIWidget* parent, const CM::String& text, UINT32 fixedWidth, UINT32 fixedHeight, bool wordWrap);
-		static GUILabel* create(CM::GUIWidget* parent, const CM::String& text, UINT32 fixedWidth, UINT32 fixedHeight, bool wordWrap, CM::TextHorzAlign horzAlign, CM::TextVertAlign vertAlign);
-
-	protected:
-		~GUILabel();
-
-		/**
-		 * @copydoc GUIElement::getNumRenderElements()
-		 */
-		virtual UINT32 getNumRenderElements() const;
-
-		/**
-		 * @copydoc GUIElement::getMaterial()
-		 */
-		virtual const CM::HMaterial& getMaterial(UINT32 renderElementIdx) const;
-
-		/**
-		 * @copydoc GUIElement::getNumQuads()
-		 */
-		virtual UINT32 getNumQuads(UINT32 renderElementIdx) const;
-
-		/**
-		 * @copydoc GUIElement::fillBuffer()
-		 */
-		virtual void fillBuffer(CM::Vector2* vertices, CM::Vector2* uv, UINT32* indices, UINT32 startingQuad, UINT32 maxNumQuads, UINT32 renderElementIdx) const;
-	private:
-		CM::TextSprite* mTextSprite;
-		CM::String mText;
-		UINT32 mFixedWidth, mFixedHeight;
-		bool mWordWrap;
-		CM::TextHorzAlign mHorzAlign;
-		CM::TextVertAlign mVertAlign;
-
-		GUILabel(CM::GUIWidget* parent, const CM::String& text, UINT32 fixedWidth, UINT32 fixedHeight, 
-			bool wordWrap, CM::TextHorzAlign horzAlign, CM::TextVertAlign vertAlign);
-	};
-}

+ 6 - 4
CamelotCore/Source/CmGUIElement.cpp → BansheeEngine/Source/BsGUIElement.cpp

@@ -1,9 +1,11 @@
-#include "CmGUIElement.h"
-#include "CmGUIWidget.h"
-#include "CmGUISkin.h"
+#include "BsGUIElement.h"
+#include "BsGUIWidget.h"
+#include "BsGUISkin.h"
 #include "CmException.h"
 
-namespace CamelotEngine
+using namespace CamelotEngine;
+
+namespace BansheeEngine
 {
 	GUIElement::GUIElement(GUIWidget* parent)
 		:mParent(parent)

+ 5 - 5
BansheeEngine/Include/CmGUILabel.cpp → BansheeEngine/Source/BsGUILabel.cpp

@@ -1,8 +1,8 @@
-#include "CmGUILabel.h"
-#include "CmGUIElementStyle.h"
-#include "CmTextSprite.h"
-#include "CmGUISkin.h"
-#include "CmGUIWidget.h"
+#include "BsGUILabel.h"
+#include "BsGUIElementStyle.h"
+#include "BsTextSprite.h"
+#include "BsGUISkin.h"
+#include "BsGUIWidget.h"
 
 using namespace CamelotEngine;
 

+ 4 - 4
CamelotCore/Source/CmGUIManager.cpp → BansheeEngine/Source/BsGUIManager.cpp

@@ -1,12 +1,12 @@
-#include "CmGUIManager.h"
-#include "CmGUIWidget.h"
-#include "CmGUIElement.h"
+#include "BsGUIManager.h"
+#include "BsGUIWidget.h"
+#include "BsGUIElement.h"
 #include "CmMaterial.h"
 #include "CmMeshData.h"
 #include "CmMesh.h"
 #include "CmUtil.h"
 
-namespace CamelotEngine
+namespace BansheeEngine
 {
 	void GUIManager::registerWidget(GUIWidget* widget)
 	{

+ 4 - 2
CamelotCore/Source/CmGUIMaterialManager.cpp → BansheeEngine/Source/BsGUIMaterialManager.cpp

@@ -1,9 +1,11 @@
-#include "CmGUIMaterialManager.h"
+#include "BsGUIMaterialManager.h"
 #include "CmMaterial.h"
 #include "CmDebug.h"
 #include "CmBuiltinMaterialManager.h"
 
-namespace CamelotEngine
+using namespace CamelotEngine;
+
+namespace BansheeEngine
 {
 	const HMaterial& GUIMaterialManager::requestTextMaterial(const HTexture& texture) const
 	{

+ 5 - 3
CamelotCore/Source/CmGUISkin.cpp → BansheeEngine/Source/BsGUISkin.cpp

@@ -1,8 +1,10 @@
-#include "CmGUISkin.h"
-#include "CmGUIElementStyle.h"
+#include "BsGUISkin.h"
+#include "BsGUIElementStyle.h"
 #include "CmDebug.h"
 
-namespace CamelotEngine
+using namespace CamelotEngine;
+
+namespace BansheeEngine
 {
 	GUIElementStyle GUISkin::DefaultStyle;
 

+ 7 - 5
CamelotCore/Source/CmGUIWidget.cpp → BansheeEngine/Source/BsGUIWidget.cpp

@@ -1,7 +1,7 @@
-#include "CmGUIWidget.h"
-#include "CmGUIManager.h"
-#include "CmGUISkin.h"
-#include "CmGUILabel.h"
+#include "BsGUIWidget.h"
+#include "BsGUIManager.h"
+#include "BsGUISkin.h"
+#include "BsGUILabel.h"
 #include "CmDeferredRenderContext.h"
 #include "CmMaterial.h"
 #include "CmPass.h"
@@ -10,7 +10,9 @@
 #include "CmViewport.h"
 #include "CmSceneObject.h"
 
-namespace CamelotEngine
+using namespace CamelotEngine;
+
+namespace BansheeEngine
 {
 	GUISkin GUIWidget::DefaultSkin;
 

+ 6 - 6
CamelotCore/Source/CmImageSprite.cpp → BansheeEngine/Source/BsImageSprite.cpp

@@ -1,8 +1,10 @@
-#include "CmImageSprite.h"
-#include "CmSpriteTexture.h"
-#include "CmGUIMaterialManager.h"
+#include "BsImageSprite.h"
+#include "BsSpriteTexture.h"
+#include "BsGUIMaterialManager.h"
 
-namespace CamelotEngine
+using namespace CamelotEngine;
+
+namespace BansheeEngine
 {
 	ImageSprite::ImageSprite()
 	{
@@ -18,8 +20,6 @@ namespace CamelotEngine
 			return;
 		}
 
-		
-
 		// Actually generate a mesh
 		if(mCachedRenderElements.size() < 1)
 			mCachedRenderElements.resize(1);

+ 5 - 3
CamelotCore/Source/CmSprite.cpp → BansheeEngine/Source/BsSprite.cpp

@@ -1,8 +1,10 @@
-#include "CmTextSprite.h"
+#include "BsTextSprite.h"
+#include "BsGUIMaterialManager.h"
 #include "CmVector2.h"
-#include "CmGUIMaterialManager.h"
 
-namespace CamelotEngine
+using namespace CamelotEngine;
+
+namespace BansheeEngine
 {
 	Sprite::Sprite()
 	{

+ 4 - 2
CamelotCore/Source/CmSpriteTexture.cpp → BansheeEngine/Source/BsSpriteTexture.cpp

@@ -1,6 +1,8 @@
-#include "CmSpriteTexture.h"
+#include "BsSpriteTexture.h"
 
-namespace CamelotEngine
+using namespace CamelotEngine;
+
+namespace BansheeEngine
 {
 	SpriteTexture::SpriteTexture(const HTexture& baseTexture)
 		:mBaseTexture(baseTexture), mUsingAtlas(false)

+ 5 - 3
CamelotCore/Source/CmTextSprite.cpp → BansheeEngine/Source/BsTextSprite.cpp

@@ -1,12 +1,14 @@
-#include "CmTextSprite.h"
+#include "BsTextSprite.h"
+#include "BsGUIMaterialManager.h"
 #include "CmDebug.h"
 #include "CmFontDesc.h"
 #include "CmFont.h"
 #include "CmVector2.h"
 #include "CmMath.h"
-#include "CmGUIMaterialManager.h"
 
-namespace CamelotEngine
+using namespace CamelotEngine;
+
+namespace BansheeEngine
 {
 	const int SPACE_CHAR = 32;
 

+ 3 - 3
CamelotClient/CamelotClient.cpp

@@ -68,8 +68,8 @@ int CALLBACK WinMain(
 	HSceneObject testModelGO = SceneObject::create("TestMesh");
 	HRenderable testRenderable = testModelGO->addComponent<Renderable>();
 
-	HSceneObject testTextGO = SceneObject::create("TestText");
-	GameObjectHandle<TestTextSprite> textSprite = testTextGO->addComponent<TestTextSprite>();
+	//HSceneObject testTextGO = SceneObject::create("TestText");
+	//GameObjectHandle<TestTextSprite> textSprite = testTextGO->addComponent<TestTextSprite>();
 
 	HFont font;
 	
@@ -87,7 +87,7 @@ int CALLBACK WinMain(
 		font = Importer::instance().import("C:\\arial.ttf", fontImportOptions);
 	}
 
-	textSprite->setText(camera, "Testing in a new row, does this work?", font, 12);
+	//textSprite->setText(camera, "Testing in a new row, does this work?", font, 12);
 
 #if defined DX9
 	///////////////// HLSL 9 SHADERS //////////////////////////

+ 1 - 0
CamelotClient/CamelotClient.vcxproj

@@ -118,6 +118,7 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <AdditionalDependencies>CamelotCore.lib;CamelotUtility.lib;BansheeEngine.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>..\lib\$(Platform)\$(Configuration);..\Dependencies\lib\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <ShowProgress>NotSet</ShowProgress>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

+ 5 - 3
CamelotClient/CmEditorWindow.cpp

@@ -2,12 +2,14 @@
 #include "CmRenderWindow.h"
 #include "CmApplication.h"
 #include "CmSceneObject.h"
-#include "CmGUIWidget.h"
-#include "CmGUILabel.h"
-#include "CmGUISkin.h"
+#include "BsGUIWidget.h"
+#include "BsGUILabel.h"
+#include "BsGUISkin.h"
 #include "CmOverlayManager.h"
 #include "CmCamera.h"
 
+using namespace CamelotEngine;
+
 namespace CamelotEditor
 {
 	EditorWindow::EditorWindow(const String& name, const HFont& dbgFont, UINT32 dbgFontSize)

+ 4 - 6
CamelotClient/CmEditorWindow.h

@@ -1,20 +1,18 @@
 #pragma once
 
-#include "CmPrerequisites.h"
-
-using namespace CamelotEngine;
+#include "BsPrerequisites.h"
 
 namespace CamelotEditor
 {
 	class EditorWindow
 	{
 	public:
-		EditorWindow(const String& name, const HFont& dbgFont, CamelotEngine::UINT32 dbgFontSize);
+		EditorWindow(const CM::String& name, const CM::HFont& dbgFont, CamelotEngine::UINT32 dbgFontSize);
 		virtual ~EditorWindow();
 
 	private:
-		RenderWindowPtr mRenderWindow;
+		CM::RenderWindowPtr mRenderWindow;
 
-		GUISkin* mSkin; // dbg only
+		BS::GUISkin* mSkin; // dbg only
 	};
 }

+ 8 - 6
CamelotClient/CmTestTextSprite.cpp

@@ -3,11 +3,11 @@
 #include "CmRenderable.h"
 #include "CmMesh.h"
 #include "CmVector2.h"
-#include "CmTextSprite.h"
+#include "BsTextSprite.h"
 #include "CmFont.h"
 #include "CmMaterial.h"
-#include "CmGUILabel.h"
-#include "CmGUISkin.h"
+#include "BsGUILabel.h"
+#include "BsGUISkin.h"
 #include "CmOverlayManager.h"
 
 using namespace BansheeEngine;
@@ -21,13 +21,15 @@ namespace CamelotEngine
 
 	TestTextSprite::~TestTextSprite()
 	{
-		if(mSkin != nullptr)
-			CM_DELETE(mSkin, GUISkin, GUIAlloc);
+
+		// TODO - temporarily not deleting this
+		//if(mSkin != nullptr)
+		//	CM_DELETE(mSkin, GUISkin, PoolAlloc);
 	}
 
 	void TestTextSprite::setText(const HCamera& camera, const String& text, HFont font, UINT32 fontSize)
 	{
-		mSkin = CM_NEW(GUISkin, GUIAlloc) GUISkin();
+		mSkin = CM_NEW(GUISkin, PoolAlloc) GUISkin();
 
 		OverlayManager::instance().attachOverlay(camera.get(), this);		
 

+ 3 - 3
CamelotClient/CmTestTextSprite.h

@@ -1,16 +1,16 @@
 #include "BsPrerequisites.h"
-#include "CmGUIWidget.h"
+#include "BsGUIWidget.h"
 
 namespace CamelotEngine
 {
-	class TestTextSprite : public GUIWidget
+	class TestTextSprite : public BansheeEngine::GUIWidget
 	{
 	protected:
 		friend class SceneObject;
 
 		TestTextSprite(const HSceneObject& parent);
 
-		GUISkin* mSkin;
+		BansheeEngine::GUISkin* mSkin;
 	public:
 		~TestTextSprite();
 

+ 1 - 21
CamelotCore/CamelotCore.vcxproj

@@ -179,8 +179,6 @@
     <ClInclude Include="Include\CmGameObjectHandle.h" />
     <ClInclude Include="Include\CmGameObject.h" />
     <ClInclude Include="Include\CmGameObjectRTTI.h" />
-    <ClInclude Include="Include\CmGUIMouseEvent.h" />
-    <ClInclude Include="Include\CmGUIWindowFrame.h" />
     <ClInclude Include="Include\CmSceneObjectRTTI.h" />
     <ClInclude Include="Include\CmMemAllocCategories.h" />
     <ClInclude Include="Include\CmOverlay.h" />
@@ -219,15 +217,8 @@
     <ClInclude Include="Include\CmGpuProgramManager.h" />
     <ClInclude Include="Include\CmGpuProgramParams.h" />
     <ClInclude Include="Include\CmGpuProgramRTTI.h" />
-    <ClInclude Include="Include\CmGUIElement.h" />
-    <ClInclude Include="Include\CmGUIElementStyle.h" />
-    <ClInclude Include="Include\CmGUIManager.h" />
-    <ClInclude Include="Include\CmGUIMaterialManager.h" />
-    <ClInclude Include="Include\CmGUISkin.h" />
-    <ClInclude Include="Include\CmGUIWidget.h" />
     <ClInclude Include="Include\CmHardwareBuffer.h" />
     <ClInclude Include="Include\CmHardwareBufferManager.h" />
-    <ClInclude Include="Include\CmImageSprite.h" />
     <ClInclude Include="Include\CmImportOptions.h" />
     <ClInclude Include="Include\CmImportOptionsRTTI.h" />
     <ClInclude Include="Include\CmIndexBuffer.h" />
@@ -237,7 +228,6 @@
     <ClInclude Include="Include\CmOverlayManager.h" />
     <ClInclude Include="Include\CmPixelBuffer.h" />
     <ClInclude Include="Include\CmGpuProgIncludeImporter.h" />
-    <ClInclude Include="Include\CmSpriteTexture.h" />
     <ClInclude Include="Include\CmTextureView.h" />
     <ClInclude Include="Include\CmVertexBuffer.h" />
     <ClInclude Include="Include\CmHighLevelGpuProgram.h" />
@@ -296,21 +286,19 @@
     <ClInclude Include="Include\CmComponent.h" />
     <ClInclude Include="Include\CmShader.h" />
     <ClInclude Include="Include\CmBlendState.h" />
-    <ClInclude Include="Include\CmSprite.h" />
     <ClInclude Include="Include\stdafx.h" />
     <ClInclude Include="Include\targetver.h" />
     <ClInclude Include="Include\CmVertexDeclarationRTTI.h" />
     <ClInclude Include="Include\CmTechnique.h" />
-    <ClInclude Include="Include\CmTextSprite.h" />
     <ClInclude Include="Include\Win32\CmOSCursorImpl.h" />
     <ClInclude Include="Source\CmMeshRTTI.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="Include\CmMaterialManager.cpp" />
     <ClCompile Include="Source\CamelotRenderer.cpp" />
+    <ClCompile Include="Source\CmBuiltinMaterialManager.cpp" />
     <ClCompile Include="Source\CmGameObjectHandle.cpp" />
     <ClCompile Include="Source\CmGameObject.cpp" />
-    <ClCompile Include="Source\CmImageSprite.cpp" />
     <ClCompile Include="Source\CmOverlay.cpp" />
     <ClCompile Include="Source\CmApplication.cpp" />
     <ClCompile Include="Source\CmBlendState.cpp" />
@@ -335,11 +323,6 @@
     <ClCompile Include="Source\CmGpuProgramImportOptions.cpp" />
     <ClCompile Include="Source\CmGpuProgramManager.cpp" />
     <ClCompile Include="Source\CmGpuProgramParams.cpp" />
-    <ClCompile Include="Source\CmGUIElement.cpp" />
-    <ClCompile Include="Source\CmGUIManager.cpp" />
-    <ClCompile Include="Source\CmGUIMaterialManager.cpp" />
-    <ClCompile Include="Source\CmGUISkin.cpp" />
-    <ClCompile Include="Source\CmGUIWidget.cpp" />
     <ClCompile Include="Source\CmHardwareBufferManager.cpp" />
     <ClCompile Include="Source\CmImportOptions.cpp" />
     <ClCompile Include="Source\CmIndexBuffer.cpp" />
@@ -350,9 +333,6 @@
     <ClCompile Include="Source\CmOverlayManager.cpp" />
     <ClCompile Include="Source\CmPixelBuffer.cpp" />
     <ClCompile Include="Source\CmGpuProgIncludeImporter.cpp" />
-    <ClCompile Include="Source\CmSprite.cpp" />
-    <ClCompile Include="Source\CmSpriteTexture.cpp" />
-    <ClCompile Include="Source\CmTextSprite.cpp" />
     <ClCompile Include="Source\CmTextureView.cpp" />
     <ClCompile Include="Source\CmVertexBuffer.cpp" />
     <ClCompile Include="Source\CmHighLevelGpuProgram.cpp" />

+ 4 - 70
CamelotCore/CamelotCore.vcxproj.filters

@@ -91,12 +91,6 @@
     <Filter Include="Source Files\2D">
       <UniqueIdentifier>{500c1648-85c9-4410-86e3-c16d102b4347}</UniqueIdentifier>
     </Filter>
-    <Filter Include="Header Files\GUI">
-      <UniqueIdentifier>{0a7006f4-fd1d-49f9-92c5-b5c7b64c2578}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Source Files\GUI">
-      <UniqueIdentifier>{62806522-68be-448c-8669-b8b211de0e15}</UniqueIdentifier>
-    </Filter>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="Include\CmWindowEventUtilities.h">
@@ -420,39 +414,6 @@
     <ClInclude Include="Include\CmFontImportOptionsRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\CmSprite.h">
-      <Filter>Header Files\2D</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\CmTextSprite.h">
-      <Filter>Header Files\2D</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\CmImageSprite.h">
-      <Filter>Header Files\2D</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\CmGUIWidget.h">
-      <Filter>Header Files\GUI</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\CmGUIElement.h">
-      <Filter>Header Files\GUI</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\CmGUIManager.h">
-      <Filter>Header Files\GUI</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\CmSpriteTexture.h">
-      <Filter>Header Files\2D</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\CmGUIMaterialManager.h">
-      <Filter>Header Files\GUI</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\CmBuiltinMaterialManager.h">
-      <Filter>Source Files\Material</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\CmGUIElementStyle.h">
-      <Filter>Header Files\GUI</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\CmGUISkin.h">
-      <Filter>Header Files\GUI</Filter>
-    </ClInclude>
     <ClInclude Include="Include\CmOverlay.h">
       <Filter>Header Files\2D</Filter>
     </ClInclude>
@@ -477,11 +438,8 @@
     <ClInclude Include="Include\CmGameObjectRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\CmGUIMouseEvent.h">
-      <Filter>Header Files\GUI</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\CmGUIWindowFrame.h">
-      <Filter>Header Files\GUI</Filter>
+    <ClInclude Include="Include\CmBuiltinMaterialManager.h">
+      <Filter>Header Files\Material</Filter>
     </ClInclude>
   </ItemGroup>
   <ItemGroup>
@@ -704,30 +662,9 @@
     <ClCompile Include="Source\CmFontImportOptions.cpp">
       <Filter>Source Files\Text</Filter>
     </ClCompile>
-    <ClCompile Include="Source\CmSprite.cpp">
-      <Filter>Source Files\2D</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\CmTextSprite.cpp">
-      <Filter>Source Files\2D</Filter>
-    </ClCompile>
     <ClCompile Include="Source\CmMeshDataRTTI.cpp">
       <Filter>Source Files\RTTI</Filter>
     </ClCompile>
-    <ClCompile Include="Source\CmGUIWidget.cpp">
-      <Filter>Source Files\GUI</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\CmGUIElement.cpp">
-      <Filter>Source Files\GUI</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\CmGUIManager.cpp">
-      <Filter>Source Files\GUI</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\CmGUIMaterialManager.cpp">
-      <Filter>Source Files\GUI</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\CmGUISkin.cpp">
-      <Filter>Source Files\GUI</Filter>
-    </ClCompile>
     <ClCompile Include="Source\CmOverlay.cpp">
       <Filter>Source Files\2D</Filter>
     </ClCompile>
@@ -743,11 +680,8 @@
     <ClCompile Include="Source\CmGameObject.cpp">
       <Filter>Source Files\Scene</Filter>
     </ClCompile>
-    <ClCompile Include="Source\CmSpriteTexture.cpp">
-      <Filter>Source Files\2D</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\CmImageSprite.cpp">
-      <Filter>Source Files\2D</Filter>
+    <ClCompile Include="Source\CmBuiltinMaterialManager.cpp">
+      <Filter>Source Files\Material</Filter>
     </ClCompile>
   </ItemGroup>
 </Project>

+ 0 - 18
CamelotCore/Include/CmGUIElementStyle.h

@@ -1,18 +0,0 @@
-#pragma once
-
-#include "CmPrerequisites.h"
-
-namespace CamelotEngine
-{
-	struct CM_EXPORT GUIElementStyle
-	{
-		GUIElementStyle()
-			:fontSize(8)
-		{
-
-		}
-
-		HFont font;
-		UINT32 fontSize;
-	};
-}

+ 0 - 18
CamelotCore/Include/CmGUIMouseEvent.h

@@ -1,18 +0,0 @@
-#pragma once
-
-#include "CmPrerequisites.h"
-#include "CmVector2.h"
-
-namespace CamelotEngine
-{
-	class CM_EXPORT GUIMouseEvent
-	{
-	public:
-		GUIMouseEvent(const Vector2& position)
-			:mPosition(position)
-		{ }
-
-	private:
-		Vector2 mPosition;
-	};
-}

+ 0 - 19
CamelotCore/Include/CmGUISkin.h

@@ -1,19 +0,0 @@
-#pragma once
-
-#include "CmPrerequisites.h"
-#include "CmGUIElementStyle.h"
-
-namespace CamelotEngine
-{
-	class CM_EXPORT GUISkin
-	{
-	public:
-		const GUIElementStyle* getStyle(const String& guiElemType) const;
-		void setStyle(const String& guiElemType, const GUIElementStyle& style);
-
-	private:
-		static GUIElementStyle DefaultStyle;
-
-		unordered_map<std::string, GUIElementStyle>::type mStyles;
-	};
-}

+ 0 - 43
CamelotCore/Include/CmGUIWidget.h

@@ -1,43 +0,0 @@
-#pragma once
-
-#include "CmPrerequisites.h"
-#include "CmOverlay.h"
-#include "CmTextSprite.h"
-#include "CmORect.h"
-
-namespace CamelotEngine
-{
-	class CM_EXPORT GUIWidget : public Overlay
-	{
-	public:
-		virtual ~GUIWidget();
-
-		void setSkin(const GUISkin* skin);
-		const GUISkin* getGUISkin() const;
-
-		virtual void render(const Camera* camera, DeferredRenderContextPtr& renderContext) const;
-	protected:
-		friend class SceneObject;
-		friend class GUIElement;
-
-		GUIWidget(const HSceneObject& parent);
-
-		void mouseEvent(const GUIMouseEvent& ev);
-
-		void registerElement(GUIElement* elem);
-	private:
-
-		void updateMeshes() const;
-		void updateBounds() const;
-
-		vector<GUIElement*>::type mElements;
-		
-		mutable Rect mBounds;
-		mutable vector<std::pair<ORect, GUIElement*>>::type mCachedBounds;
-		mutable vector<HMesh>::type mCachedMeshes;
-		mutable vector<HMaterial>::type mCachedMaterials;
-
-		const GUISkin* mSkin;
-		static GUISkin DefaultSkin;
-	};
-}

+ 0 - 1
CamelotCore/Include/CmGameObject.h

@@ -31,5 +31,4 @@ namespace CamelotEngine
 	typedef GameObjectHandle<Component> HComponent;
 	typedef GameObjectHandle<Camera> HCamera;
 	typedef GameObjectHandle<Renderable> HRenderable;
-	typedef GameObjectHandle<GUIWidget> HGUIWidget;
 }

+ 0 - 13
CamelotCore/Include/CmPrerequisites.h

@@ -149,8 +149,6 @@ namespace CamelotEngine {
 	class CoreObject;
 	class ImportOptions;
 	struct FontData;
-	class TextSprite;
-	class SpriteTexture;
 	class GameObject;
 	// Asset import
 	class SpecificImporter;
@@ -168,15 +166,6 @@ namespace CamelotEngine {
 	// 2D
 	class Overlay;
 	class OverlayManager;
-	class SpriteTexture;
-	// GUI
-	class GUIManager;
-	class GUIWidget;
-	class GUIElement;
-	class GUILabel;
-	struct GUIElementStyle;
-	class GUISkin;
-	struct GUIMouseEvent;
 	// RTTI
 	class MeshRTTI;
 	// Desc structs
@@ -234,10 +223,8 @@ namespace CamelotEngine
 	typedef std::shared_ptr<ImportOptions> ImportOptionsPtr;
 	typedef std::shared_ptr<const ImportOptions> ConstImportOptionsPtr;
 	typedef std::shared_ptr<Font> FontPtr;
-	typedef std::shared_ptr<TextSprite> TextSpritePtr;
 	typedef std::shared_ptr<Overlay> OverlayPtr;
 	typedef std::shared_ptr<InputHandler> InputHandlerPtr;
-	typedef std::shared_ptr<SpriteTexture> SpriteTexturePtr;
 }
 
 /************************************************************************/

+ 0 - 29
CamelotCore/Include/CmSpriteTexture.h

@@ -1,29 +0,0 @@
-#pragma once
-
-#include "CmPrerequisites.h"
-#include "CmVector2.h"
-
-namespace CamelotEngine
-{
-	/**
-	 * @brief	Texture interface that attempts to hide the underlying texture. This primarily allows us
-	 * 			to create a sprite texture atlas, without requiring any of the sprite classes to directly
-	 * 			know about it.
-	 */
-	class CM_EXPORT SpriteTexture
-	{
-	public:
-		SpriteTexture(const HTexture& baseTexture);
-
-		const HTexture& getTexture() const;
-		Vector2 transformUV(const Vector2& uv) const;
-
-	private:
-		HTexture mBaseTexture;
-
-		bool mUsingAtlas;
-		HTexture mAtlasTexture;
-		Vector2 mUVOffset;
-		Vector2 mUVScale;
-	};
-}

+ 1 - 6
CamelotCore/Source/CmApplication.cpp

@@ -28,8 +28,6 @@
 #include "CmRenderer.h"
 #include "CmDeferredRenderContext.h"
 #include "CmOverlayManager.h"
-#include "CmGUIMaterialManager.h"
-#include "CmGUIManager.h"
 
 #include "CmMaterial.h"
 #include "CmShader.h"
@@ -84,8 +82,7 @@ namespace CamelotEngine
 		FontManager::startUp(CM_NEW(FontManager, GenAlloc) FontManager());
 
 		OverlayManager::startUp(CM_NEW(OverlayManager, GenAlloc) OverlayManager());
-		GUIMaterialManager::startUp(CM_NEW(GUIMaterialManager, GenAlloc) GUIMaterialManager());
-		GUIManager::startUp(CM_NEW(GUIManager, GenAlloc) GUIManager());
+
 
 		Importer::startUp(CM_NEW(Importer, GenAlloc) Importer());
 		loadPlugin("CamelotFreeImgImporter"); // TODO - Load this automatically somehow
@@ -162,8 +159,6 @@ namespace CamelotEngine
 		MeshManager::shutDown();
 
 		SceneManager::shutDown();
-		GUIManager::shutDown();
-		GUIMaterialManager::shutDown();
 		OverlayManager::shutDown();
 
 		RendererManager::shutDown();

+ 1 - 0
CamelotCore/Source/CmBuiltinMaterialManager.cpp

@@ -0,0 +1 @@
+#include "CmBuiltinMaterialManager.h"