Kaynağa Gözat

More work on preparing documentation for Doxygen generation

BearishSun 10 yıl önce
ebeveyn
işleme
1350df4605
67 değiştirilmiş dosya ile 6195 ekleme ve 6289 silme
  1. 92 84
      BansheeCore/Include/BsBlendStateRTTI.h
  2. 95 143
      BansheeCore/Include/BsCommonTypes.h
  3. 109 121
      BansheeCore/Include/BsComponent.h
  4. 58 54
      BansheeCore/Include/BsComponentRTTI.h
  5. 127 150
      BansheeCore/Include/BsCoreApplication.h
  6. 24 0
      BansheeCore/Include/BsCorePrerequisites.h
  7. 91 101
      BansheeCore/Include/BsCoreSceneManager.h
  8. 40 36
      BansheeCore/Include/BsDeferredCallManager.h
  9. 51 43
      BansheeCore/Include/BsDepthStencilStateRTTI.h
  10. 98 107
      BansheeCore/Include/BsFont.h
  11. 165 163
      BansheeCore/Include/BsFontDesc.h
  12. 84 109
      BansheeCore/Include/BsFontImportOptions.h
  13. 64 56
      BansheeCore/Include/BsFontImportOptionsRTTI.h
  14. 29 25
      BansheeCore/Include/BsFontManager.h
  15. 139 159
      BansheeCore/Include/BsFontRTTI.h
  16. 41 48
      BansheeCore/Include/BsGameObject.h
  17. 288 295
      BansheeCore/Include/BsGameObjectHandle.h
  18. 65 57
      BansheeCore/Include/BsGameObjectHandleRTTI.h
  19. 153 173
      BansheeCore/Include/BsGameObjectManager.h
  20. 95 89
      BansheeCore/Include/BsGameObjectRTTI.h
  21. 70 62
      BansheeCore/Include/BsGpuProgramRTTI.h
  22. 38 32
      BansheeCore/Include/BsGpuResourceDataRTTI.h
  23. 38 32
      BansheeCore/Include/BsIconUtility.h
  24. 38 31
      BansheeCore/Include/BsImportOptionsRTTI.h
  25. 8 0
      BansheeCore/Include/BsMaterialParamsRTTI.h
  26. 16 22
      BansheeCore/Include/BsMaterialRTTI.h
  27. 59 51
      BansheeCore/Include/BsMeshBaseRTTI.h
  28. 82 74
      BansheeCore/Include/BsMeshDataRTTI.h
  29. 68 60
      BansheeCore/Include/BsMeshImportOptionsRTTI.h
  30. 82 78
      BansheeCore/Include/BsMeshUtility.h
  31. 12 4
      BansheeCore/Include/BsPassRTTI.h
  32. 99 91
      BansheeCore/Include/BsPixelDataRTTI.h
  33. 227 274
      BansheeCore/Include/BsPixelUtil.h
  34. 46 42
      BansheeCore/Include/BsPixelVolume.h
  35. 91 97
      BansheeCore/Include/BsPrefab.h
  36. 155 152
      BansheeCore/Include/BsPrefabDiff.h
  37. 19 11
      BansheeCore/Include/BsPrefabDiffRTTI.h
  38. 61 53
      BansheeCore/Include/BsPrefabRTTI.h
  39. 116 122
      BansheeCore/Include/BsPrefabUtility.h
  40. 53 45
      BansheeCore/Include/BsRasterizerStateRTTI.h
  41. 118 110
      BansheeCore/Include/BsResourceHandleRTTI.h
  42. 58 60
      BansheeCore/Include/BsResourceManifestRTTI.h
  43. 44 36
      BansheeCore/Include/BsResourceMetaDataRTTI.h
  44. 49 41
      BansheeCore/Include/BsResourceRTTI.h
  45. 53 45
      BansheeCore/Include/BsSamplerStateRTTI.h
  46. 52 65
      BansheeCore/Include/BsSavedResourceDataRTTI.h
  47. 163 255
      BansheeCore/Include/BsSceneObject.h
  48. 179 173
      BansheeCore/Include/BsSceneObjectRTTI.h
  49. 43 35
      BansheeCore/Include/BsShaderIncludeRTTI.h
  50. 343 335
      BansheeCore/Include/BsShaderRTTI.h
  51. 195 199
      BansheeCore/Include/BsStringTableRTTI.h
  52. 62 68
      BansheeCore/Include/BsTechniqueRTTI.h
  53. 378 451
      BansheeCore/Include/BsTextData.h
  54. 60 52
      BansheeCore/Include/BsTextureImportOptionsRTTI.h
  55. 189 181
      BansheeCore/Include/BsTextureRTTI.h
  56. 23 19
      BansheeCore/Include/BsUUID.h
  57. 53 52
      BansheeCore/Include/BsUtility.h
  58. 48 54
      BansheeCore/Include/BsVertexDataDescRTTI.h
  59. 80 72
      BansheeCore/Include/BsVertexDeclarationRTTI.h
  60. 75 67
      BansheeCore/Include/BsViewportRTTI.h
  61. 26 59
      BansheeCore/Include/Win32/BsWin32Window.h
  62. 78 70
      BansheeCore/Source/BsMeshRTTI.h
  63. 323 263
      BansheeEditor/BansheeEditor.vcxproj.filters
  64. 190 160
      BansheeEngine/BansheeEngine.vcxproj.filters
  65. 3 5
      BansheeEngine/Include/BsEnums.h
  66. 4 0
      BansheeUtility/Include/BsPrerequisitesUtil.h
  67. 20 16
      BansheeUtility/Include/BsSerializedObjectRTTI.h

+ 92 - 84
BansheeCore/Include/BsBlendStateRTTI.h

@@ -1,85 +1,93 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsBlendState.h"
-#include "BsRenderStateManager.h"
-
-namespace BansheeEngine
-{
-	template<> struct RTTIPlainType<BLEND_STATE_DESC>
-	{	
-		enum { id = TID_BLEND_STATE_DESC }; enum { hasDynamicSize = 1 };
-
-		static void toMemory(const BLEND_STATE_DESC& data, char* memory)
-		{ 
-			UINT32 size = getDynamicSize(data);
-
-			memcpy(memory, &size, sizeof(UINT32));
-			memory += sizeof(UINT32);
-			size -= sizeof(UINT32);
-			memcpy(memory, &data, size); 
-		}
-
-		static UINT32 fromMemory(BLEND_STATE_DESC& data, char* memory)
-		{ 
-			UINT32 size;
-			memcpy(&size, memory, sizeof(UINT32)); 
-			memory += sizeof(UINT32);
-
-			UINT32 dataSize = size - sizeof(UINT32);
-			memcpy((void*)&data, memory, dataSize); 
-
-			return size;
-		}
-
-		static UINT32 getDynamicSize(const BLEND_STATE_DESC& data)	
-		{ 
-			UINT64 dataSize = sizeof(data) + sizeof(UINT32);
-
-#if BS_DEBUG_MODE
-			if(dataSize > std::numeric_limits<UINT32>::max())
-			{
-				BS_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
-			}
-#endif
-
-			return (UINT32)dataSize;
-		}	
-	}; 
-
-	class BS_CORE_EXPORT BlendStateRTTI : public RTTIType<BlendState, IReflectable, BlendStateRTTI>
-	{
-	private:
-		BLEND_STATE_DESC& getData(BlendState* obj) { return obj->mProperties.mData; }
-		void setData(BlendState* obj, BLEND_STATE_DESC& val) { obj->mProperties.mData = val; } 
-
-	public:
-		BlendStateRTTI()
-		{
-			addPlainField("mData", 0, &BlendStateRTTI::getData, &BlendStateRTTI::setData);
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj) override
-		{
-			BlendState* blendState = static_cast<BlendState*>(obj);
-			blendState->initialize();
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "BlendState";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_BlendState;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return RenderStateManager::instance()._createBlendStatePtr(BLEND_STATE_DESC());
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsBlendState.h"
+#include "BsRenderStateManager.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	template<> struct RTTIPlainType<BLEND_STATE_DESC>
+	{	
+		enum { id = TID_BLEND_STATE_DESC }; enum { hasDynamicSize = 1 };
+
+		static void toMemory(const BLEND_STATE_DESC& data, char* memory)
+		{ 
+			UINT32 size = getDynamicSize(data);
+
+			memcpy(memory, &size, sizeof(UINT32));
+			memory += sizeof(UINT32);
+			size -= sizeof(UINT32);
+			memcpy(memory, &data, size); 
+		}
+
+		static UINT32 fromMemory(BLEND_STATE_DESC& data, char* memory)
+		{ 
+			UINT32 size;
+			memcpy(&size, memory, sizeof(UINT32)); 
+			memory += sizeof(UINT32);
+
+			UINT32 dataSize = size - sizeof(UINT32);
+			memcpy((void*)&data, memory, dataSize); 
+
+			return size;
+		}
+
+		static UINT32 getDynamicSize(const BLEND_STATE_DESC& data)	
+		{ 
+			UINT64 dataSize = sizeof(data) + sizeof(UINT32);
+
+#if BS_DEBUG_MODE
+			if(dataSize > std::numeric_limits<UINT32>::max())
+			{
+				BS_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
+			}
+#endif
+
+			return (UINT32)dataSize;
+		}	
+	}; 
+
+	class BS_CORE_EXPORT BlendStateRTTI : public RTTIType<BlendState, IReflectable, BlendStateRTTI>
+	{
+	private:
+		BLEND_STATE_DESC& getData(BlendState* obj) { return obj->mProperties.mData; }
+		void setData(BlendState* obj, BLEND_STATE_DESC& val) { obj->mProperties.mData = val; } 
+
+	public:
+		BlendStateRTTI()
+		{
+			addPlainField("mData", 0, &BlendStateRTTI::getData, &BlendStateRTTI::setData);
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			BlendState* blendState = static_cast<BlendState*>(obj);
+			blendState->initialize();
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "BlendState";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_BlendState;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return RenderStateManager::instance()._createBlendStatePtr(BLEND_STATE_DESC());
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 95 - 143
BansheeCore/Include/BsCommonTypes.h

@@ -2,9 +2,11 @@
 
 namespace BansheeEngine 
 {
-	/**
-	 * @brief	Factors used when blending new pixels with existing pixels.
+	/** @addtogroup Utility-Core
+	 *  @{
 	 */
+
+	/**	Factors used when blending new pixels with existing pixels. */
     enum BlendFactor
     {
 		BF_ONE, /**< Use a value of one for all pixel components. */
@@ -19,9 +21,7 @@ namespace BansheeEngine
 		BF_INV_SOURCE_ALPHA /**< Use the inverse of the newly generated alpha value. */
     };
 
-	/**
-	 * @brief	Operations that determines how are blending factors combined.
-	 */
+	/**	Operations that determines how are blending factors combined. */
 	enum BlendOperation
 	{
 		BO_ADD, /**< Blend factors are added together. */
@@ -31,9 +31,7 @@ namespace BansheeEngine
 		BO_MAX /**< Maximum of the two factors is chosen. */
 	};
 
-	/**
-	 * @brief	Comparison functions used for the depth/stencil buffer.
-	 */
+	/**	Comparison functions used for the depth/stencil buffer. */
     enum CompareFunction
     {
 		CMPF_ALWAYS_FAIL, /**< Operation will always fail. */
@@ -47,8 +45,7 @@ namespace BansheeEngine
     };
 
 	/**
-	 * @brief	Types of texture addressing modes that determine what happens when texture
-	 *			coordinates are outside of the valid range.
+	 * Types of texture addressing modes that determine what happens when texture coordinates are outside of the valid range.
 	 */
     enum TextureAddressingMode
     {
@@ -58,9 +55,7 @@ namespace BansheeEngine
 		TAM_BORDER /**< Coordinates outside of the valid range will return a separately set border color. */
     };
 
-	/**
-	 * @brief	Types of available filtering situations.
-	 */
+	/**	Types of available filtering situations. */
     enum FilterType
     {
 		FT_MIN, /**< The filter used when shrinking a texture. */
@@ -68,9 +63,7 @@ namespace BansheeEngine
         FT_MIP /**< The filter used when filtering between mipmaps. */
     };
 
-	/**
-	 * @brief	Filtering options for textures.
-	 */
+	/**	Filtering options for textures. */
     enum FilterOptions
     {
 		FO_NONE = 0, /**< Use no filtering. Only relevant for mipmap filtering. */
@@ -80,9 +73,7 @@ namespace BansheeEngine
 		FO_USE_COMPARISON = 4 /**< Specifies that the sampled values will be compared against existing sampled data. Should be OR-ed with other filtering options. */
     };
 
-	/**
-	 * @brief	Types of frame buffers.
-	 */
+	/**	Types of frame buffers. */
 	enum FrameBufferType
 	{
 		FBT_COLOR = 0x1,
@@ -91,9 +82,9 @@ namespace BansheeEngine
 	};
 
 	/**
-	 * @brief	Types of culling that determine how (and if) hardware discards faces with certain
-	 *			winding order. Winding order can be used for determining front or back facing polygons by
-	 *			checking the order of its vertices from the render perspective.
+	 * Types of culling that determine how (and if) hardware discards faces with certain winding order. Winding order can
+	 * be used for determining front or back facing polygons by checking the order of its vertices from the render 
+	 * perspective.
 	 */
     enum CullingMode
     {
@@ -102,18 +93,14 @@ namespace BansheeEngine
         CULL_COUNTERCLOCKWISE = 2 /**< Hardware culls faces that have a counter-clockwise vertex ordering. */
     };
 
-	/**
-	 * @brief	Polygon mode to use when rasterizing.
-	 */
+	/**	Polygon mode to use when rasterizing. */
     enum PolygonMode
     {
 		PM_WIREFRAME = 1, /**< Render as wireframe showing only polygon outlines. */
         PM_SOLID = 2 /**< Render as solid showing whole polygons. */
     };
 
-	/**
-	 * @brief	Types of action that can happen on the stencil buffer.
-	 */
+	/**	Types of action that can happen on the stencil buffer. */
 	enum StencilOperation
 	{
 		SOP_KEEP, /**< Leave the stencil buffer unchanged. */
@@ -126,108 +113,96 @@ namespace BansheeEngine
 		SOP_INVERT /**< Invert the bits of the stencil buffer. */
 	};
 
-	/**
-	* @brief	These values represent a hint to the driver when locking a hardware buffer.
-	*
-	*			GBL_WRITE_ONLY - Allows you to write to the buffer. Can cause a CPU-GPU sync point
-	*			so avoid using it often (i.e. every frame) as that might limit your performance significantly.
-	*			GBL_WRITE_ONLY_DISCARD - Allows you to write to the buffer. Tells the driver to completely discard the contents of the 
-	*			buffer you are writing to. The driver will (most likely) internally allocate another buffer with same specifications 
-	*			(which is fairly fast) and you will avoid CPU-GPU stalls.
-	*			GBL_WRITE_ONLY_NO_OVERWRITE - Allows you to write to the buffer. Guarantees the driver that you will not be updating any part of 
-	*			the buffer that is currently used. This will also avoid CPU-GPU stalls, without requiring you to discard the entire buffer. However 
-	*			it is hard to guarantee when GPU has finished using a buffer.
-	*			GBL_READ_ONLY - Allows you to read from a buffer. Be aware that reading is usually a very slow operation.
-	*			GBL_READ_WRITE - Allows you to both read and write to a buffer. 
-	*/
+	/** These values represent a hint to the driver when locking a hardware buffer. */
 	enum GpuLockOptions
 	{
+		/**
+		 * Allows you to write to the buffer. Can cause a CPU-GPU sync point so avoid using it often (i.e. every frame) as 
+		 * that might limit your performance significantly.
+		 */
         GBL_READ_WRITE,
+		/**
+		 * Allows you to write to the buffer. Tells the driver to completely discard the contents of the buffer you are 
+		 * writing to. The driver will (most likely) internally allocate another buffer with same specifications (which is
+		 * fairly fast) and you will avoid CPU-GPU stalls.
+		 */
 		GBL_WRITE_ONLY_DISCARD,
+		/**  Allows you to read from a buffer. Be aware that reading is usually a very slow operation. */
 		GBL_READ_ONLY,
+		/**
+		 * Allows you to write to the buffer. Guarantees the driver that you will not be updating any part of the buffer 
+		 * that is currently used. This will also avoid CPU-GPU stalls, without requiring you to discard the entire buffer.
+		 * However it is hard to guarantee when GPU has finished using a buffer.
+		 */
         GBL_WRITE_ONLY_NO_OVERWRITE,
+		/** Allows you to both read and write to a buffer. */
 		GBL_WRITE_ONLY	
 	};
 
 	/**
-	 * @brief	Values that represent hardware buffer usage. These usually determine in what
-	 *			type of memory is buffer placed in, however that depends on rendering API.
-	 * 
-	 *			GBU_STATIC - Signifies that you don't plan on modifying the buffer often (or at all)
-	 *			after creation. Modifying such buffer will involve a larger performance hit.
-	 *			GBU_DYNAMIC - Signifies that you will modify this buffer fairly often.
+	 * Values that represent hardware buffer usage. These usually determine in what type of memory is buffer placed in,
+	 * however that depends on rendering API.
 	 */
 	enum GpuBufferUsage 
 	{
+		/** 
+		 * Signifies that you don't plan on modifying the buffer often (or at all)	after creation. Modifying such buffer 
+		 * will involve a larger performance hit.
+		 */
         GBU_STATIC = 1,
+		/** Signifies that you will modify this buffer fairly often. */
 		GBU_DYNAMIC = 2
 	};
 
-	/**
-	 * @brief	Types of generic GPU buffers that may be attached to GPU programs.
-	 *
-	 *			GBT_STRUCTURED - Buffer containing an array of structures. Structure parameters
-	 *			can usually be easily accessed from within the GPU program.
-	 *			GBT_RAW - Buffer containing raw bytes. It is up to the user to interpret the data.
-	 *			GBT_INDIRECTARGUMENT - Special type of buffer allowing you to specify arguments for
-	 *			draw operations inside the buffer instead of providing them directly. Useful when you want
-	 *			to control drawing directly from GPU.
-	 *			GBT_APPENDCONSUME - A stack-like buffer that allows you to add or remove elements to/from the buffer
-	 *			from within the GPU program.
-	 */
+	/** Types of generic GPU buffers that may be attached to GPU programs. */
 	enum GpuBufferType
 	{
+		/** 
+		 * Buffer containing an array of structures. Structure parameters can usually be easily accessed from within the
+		 * GPU program.
+		 */
 		GBT_STRUCTURED,
+		/** Buffer containing raw bytes. It is up to the user to interpret the data. */
 		GBT_RAW,
+		/**
+		 * Special type of buffer allowing you to specify arguments for draw operations inside the buffer instead of 
+		 * providing them directly. Useful when you want to control drawing directly from GPU.
+		 */
 		GBT_INDIRECTARGUMENT,
+		/** A stack-like buffer that allows you to add or remove elements to/from the buffer from within the GPU program. */
 		GBT_APPENDCONSUME
 	};
 
-	/**
-	 * @brief	Different types of GPU views that control how GPU sees a hardware buffer.
-	 *
-	 *			GVU_DEFAULT - Buffer is seen as a default shader resource, used primarily for reading. (e.g. a texture for sampling)
-	 *			GVU_RENDERTARGET - Buffer is seen as a render target that color pixels will be written to after pixel shader stage.
-	 *			GVU_DEPTHSTENCIL - Buffer is seen as a depth stencil target that depth and stencil information is written to.
-	 *			GVU_RANDOMWRITE - Buffer that allows you to write to any part of it from within a GPU program.
-	 */
+	/** Different types of GPU views that control how GPU sees a hardware buffer. */
 	enum GpuViewUsage
 	{
+		/** Buffer is seen as a default shader resource, used primarily for reading. (e.g. a texture for sampling) */
 		GVU_DEFAULT = 0x01,
+		/** Buffer is seen as a render target that color pixels will be written to after pixel shader stage. */
 		GVU_RENDERTARGET = 0x02,
+		/** Buffer is seen as a depth stencil target that depth and stencil information is written to. */
 		GVU_DEPTHSTENCIL = 0x04,
+		/** Buffer that allows you to write to any part of it from within a GPU program. */
 		GVU_RANDOMWRITE = 0x08
 	};
 
-	/**
-	 * @brief	Type of parameter block usages. Signifies how often will parameter blocks be changed.
-	 *
-	 *			GPBU_STATIC - Buffer will be rarely, if ever, updated.
-	 *			GPBU_DYNAMIC - Buffer will be updated often (e.g. every frame).
-	 */
+	/** Type of parameter block usages. Signifies how often will parameter blocks be changed. */
 	enum GpuParamBlockUsage
 	{
-		GPBU_STATIC,
-		GPBU_DYNAMIC
+		GPBU_STATIC, /**< Buffer will be rarely, if ever, updated. */
+		GPBU_DYNAMIC /**< Buffer will be updated often (e.g. every frame). */
 	};
 
-	/**
-	 * @brief	Type of GPU parameter.
-	 *
-	 *			GPT_DATA - Raw data type like float, Vector3, Color, etc.
-	 *			GPT_OBJECT - Reference to some GPU object like Texture, Sampler, etc.
-	 */
+	/** Type of a parameter in a GPU program. */
 	enum GpuParamType
 	{
-		GPT_DATA,
-		GPT_TEXTURE,
-		GPT_BUFFER,
-		GPT_SAMPLER
+		GPT_DATA, /**< Raw data type like float, Vector3, Color, etc. */
+		GPT_TEXTURE, /**< Texture type (2D, 3D, cube, etc.) */
+		GPT_BUFFER, /**< Data buffer (raw, structured, etc.) */
+		GPT_SAMPLER /**< Sampler type (2D, 3D, cube, etc.) */
 	};
 
-	/**
-	 * @brief	Type of GPU data parameters that can be used as inputs to a GPU program.
-	 */
+	/**	Type of GPU data parameters that can be used as inputs to a GPU program. */
 	enum GpuParamDataType
 	{
 		GPDT_FLOAT1 = 1,
@@ -254,9 +229,7 @@ namespace BansheeEngine
 		GPDT_UNKNOWN = 0xffff
 	};
 
-	/**
-	 * @brief	Contains data about a type used for GPU data parameters.
-	 */
+	/**	Contains data about a type used for GPU data parameters. */
 	struct GpuParamDataTypeInfo
 	{
 		UINT32 baseTypeSize;
@@ -266,9 +239,7 @@ namespace BansheeEngine
 		UINT32 numColumns;
 	};
 
-	/**
-	 * @brief	Contains a lookup table for various information of all types used for data GPU parameters. Sizes are in bytes.
-	 */
+	/**	Contains a lookup table for various information of all types used for data GPU parameters. Sizes are in bytes. */
 	struct GpuDataParamInfos
 	{
 		GpuDataParamInfos()
@@ -298,9 +269,7 @@ namespace BansheeEngine
 		GpuParamDataTypeInfo lookup[GPDT_COUNT];
 	};
 
-	/**
-	 * @brief	Type of GPU object parameters that can be used as inputs to a GPU program.
-	 */
+	/**	Type of GPU object parameters that can be used as inputs to a GPU program. */
 	enum GpuParamObjectType
 	{
 		GPOT_SAMPLER1D = 1,
@@ -324,29 +293,31 @@ namespace BansheeEngine
 		GPOT_UNKNOWN = 0xffff
 	};
 
-	/**
-	 * @brief	These values represent a hint to the driver when writing
-	 * 			to a GPU buffer.
-	 * 			
-	 *			Normal - Default flag with least restrictions. Can cause a CPU-GPU sync point
-	 *			so avoid using it often (i.e. every frame) as that might limit your performance significantly.
-	 *			Discard - Tells the driver to completely discard the contents of the buffer you are writing
-	 *			to. The driver will (most likely) internally allocate another buffer with same specifications (which is fairly fast)
-	 *			and you will avoid CPU-GPU stalls. 
-	 *			NoOverwrite - Guarantees the driver that you will not be updating any part of the buffer that is currently used.
-	 *			This will also avoid CPU-GPU stalls, without requiring you to discard the entire buffer. However it is hard to
-	 *			guarantee when GPU has finished using a buffer.
-	 */
+	/** These values represent a hint to the driver when writing to a GPU buffer. */
 	enum class BufferWriteType
 	{
+		/**
+		 * Default flag with least restrictions. Can cause a CPU-GPU sync point so avoid using it often (i.e. every frame)
+		 * as that might limit your performance significantly.
+		 */
 		Normal,
+		/**
+		 * Tells the driver to completely discard the contents of the buffer you are writing to. The driver will (most
+		 * likely) internally allocate another buffer with same specifications (which is fairly fast) and you will avoid 
+		 * CPU-GPU stalls. 
+		 */
 		Discard,
+		/**
+		 * Guarantees the driver that you will not be updating any part of the buffer that is currently used. This will 
+		 * also avoid CPU-GPU stalls, without requiring you to discard the entire buffer. However it is hard to guarantee 
+		 * when GPU has finished using a buffer.
+		 */
 		NoOverwrite
 	};
 
 	/**
-	 * @brief	Suggested queue priority numbers used for sorting objects in
-	 *			the render queue. Objects with higher priority will be renderer sooner.
+	 * Suggested queue priority numbers used for sorting objects in the render queue. Objects with higher priority will
+	 * be renderer sooner.
 	 */
 	enum class QueuePriority
 	{
@@ -356,9 +327,7 @@ namespace BansheeEngine
 		Overlay = 70000
 	};
 
-	/**
-	 * @brief	Type of sorting to perform on an object when added to a render queue.
-	 */
+	/** Type of sorting to perform on an object when added to a render queue. */
 	enum class QueueSortType
 	{
 		FrontToBack, /**< All objects with the same priority will be rendered front to back based on their center. */
@@ -366,18 +335,13 @@ namespace BansheeEngine
 		None /**< Objects will not be sorted and will be processed in the order they were added to the queue. */
 	};
 
-	/**
-	 * @brief	Flags that may be assigned to a shader that let the renderer know how to interpret
-	 *			the shader.
-	 */
+	/**	Flags that may be assigned to a shader that let the renderer know how to interpret the shader. */
 	enum class ShaderFlags
 	{
 		Transparent = 0x1 /**< Signifies that the shader is rendering a transparent object. */
 	};
 
-	/**
-	 * @brief	Enum that defines possible window border styles.
-	 */
+	/**	Enum that defines possible window border styles. */
 	enum class WindowBorder
 	{
 		Normal,
@@ -385,9 +349,7 @@ namespace BansheeEngine
 		Fixed
 	};
 
-	/**
-	 * @brief	Texture addressing mode, per component.
-	 */
+	/**	Texture addressing mode, per component. */
 	struct UVWAddressingMode
 	{
 		UVWAddressingMode()
@@ -402,9 +364,7 @@ namespace BansheeEngine
 		TextureAddressingMode u, v, w;
 	};
     
-	/**
-	 * @brief	References a subset of surfaces within a texture.
-	 */
+	/**	References a subset of surfaces within a texture. */
 	struct TextureSurface
 	{
 		TextureSurface(UINT32 mipLevel = 0, UINT32 numMipLevels = 1, 
@@ -419,10 +379,7 @@ namespace BansheeEngine
 		UINT32 numArraySlices;
 	};
 
-	/**
-	 * @brief	Helper class for syncing dirty data from sim CoreObject to
-	 *			core CoreObject and other way around.
-	 */
+	/** Helper class for syncing dirty data from sim CoreObject to core CoreObject and other way around. */
 	class CoreSyncData
 	{
 	public:
@@ -434,10 +391,7 @@ namespace BansheeEngine
 			:data(data), size(size)
 		{ }
 
-		/**
-		 * @brief	Gets the internal data and checks the data is of
-		 *			valid size.
-		 */
+		/** Gets the internal data and checks the data is of valid size. */
 		template<class T>
 		const T& getData() const
 		{
@@ -446,14 +400,10 @@ namespace BansheeEngine
 			return *(T*)data;
 		}
 
-		/**
-		 * @brief	Returns a pointer to internal data buffer.
-		 */
+		/**	Returns a pointer to internal data buffer. */
 		UINT8* getBuffer() const { return data; }
 
-		/**
-		 * @brief	Returns the size of the internal data buffer.
-		 */
+		/**	Returns the size of the internal data buffer. */
 		UINT32 getBufferSize() const { return size; }
 
 	private:
@@ -466,4 +416,6 @@ namespace BansheeEngine
 	/** @cond SPECIALIZATIONS */
 	BS_ALLOW_MEMCPY_SERIALIZATION(TextureSurface);
 	/** @endcond */
+
+	/** @} */
 }

+ 109 - 121
BansheeCore/Include/BsComponent.h

@@ -1,122 +1,110 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsGameObject.h"
-#include "BsBounds.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Components represent primary logic elements in the scene. 
-	 *			They are attached to scene objects.
-	 */
-	class BS_CORE_EXPORT Component : public GameObject
-	{
-	public:
-		/**
-		 * @brief	Returns the SceneObject this Component is assigned to.
-		 */
-		HSceneObject sceneObject() const { return mParent; }
-
-		/**
-		 * @copydoc	sceneObject
-		 */
-		HSceneObject SO() const { return sceneObject(); }
-
-		/**
-		 * @brief	Called once per frame on all components.
-		 * 			
-		 * @note	Internal method.
-		 */
-		virtual void update() { }
-
-		/**
-		 * @brief	Calculates bounds of the visible contents represented by this component (e.g. a mesh for Renderable).
-		 * 
-		 * @param	bounds	Bounds of the contents in world space coordinates.
-		 * 					
-		 * @returns	True if the component has bounds with non-zero volume, otherwise false.
-		 */
-		virtual bool calculateBounds(Bounds& bounds);
-
-		/**
-		 * @brief	Checks if this and the provided component represent the same type.
-		 * 			
-		 * @note	RTTI type cannot be checked directly since components can be further specialized internally 
-		 * 			for scripting purposes.
-		 */
-		virtual bool typeEquals(const Component& other);
-
-		/**
-		 * @brief	Removes the component from parent SceneObject and deletes it. All
-		 * 			the references to this component will be marked as destroyed and you
-		 * 			will get an exception if you try to use them.
-		 *
-		 * @param	[in] immediate	If true the destruction will be performed immediately, otherwise
-		 *							it will be delayed until the end of the current frame (preferred option).
-		 */
-		void destroy(bool immediate = false);
-
-	protected:
-		friend class SceneObject;
-		friend class SceneObjectRTTI;
-
-		Component(const HSceneObject& parent);
-		virtual ~Component();
-
-		/**
-		 * @brief	Construct any resources the component needs before use. Called when the parent
-		 *			scene object is instantiated. A non-instantiated component shouldn't be used for
-		 *			any other purpose than serialization.
-		 */
-		virtual void instantiate() {}
-
-		/**
-		 * @brief	Called when the component is ready to be initialized.
-		 */
-		virtual void onInitialized() {}
-
-		/**
-		 * @brief	Called just before the component is destroyed.
-		 */
-		virtual void onDestroyed() {}
-
-		/**
-		 * @brief	Called just before the component is deactivated or destroyed.
-		 */
-		virtual void onDisabled() {}
-
-		/**
-		 * @brief	Called when the component is activated or created.
-		 */
-		virtual void onEnabled() {}
-
-		/**
-		 * @brief	Destroys this component.
-		 *
-		 * @param [in]	handle		Game object handle this this object.
-		 * @param [in]	immediate	If true, the object will be deallocated and become unusable
-		 *							right away. Otherwise the deallocation will be delayed to the end of
-		 *							frame (preferred method).
-		 *
-		 * @note	Unlike "destroy", does not remove the component from its parent.
-		 */
-		void destroyInternal(GameObjectHandleBase& handle, bool immediate = false) override;
-	private:
-		Component(const Component& other) { }
-
-	protected:
-		HSceneObject mParent;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-	public:
-		friend class ComponentRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const;
-
-	protected:
-		Component() {} // Serialization only
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsGameObject.h"
+#include "BsBounds.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup Scene
+	 *  @{
+	 */
+
+	/** Components represent primary logic elements in the scene. They are attached to scene objects. */
+	class BS_CORE_EXPORT Component : public GameObject
+	{
+	public:
+		/**	Returns the SceneObject this Component is assigned to. */
+		HSceneObject sceneObject() const { return mParent; }
+
+		/** @copydoc sceneObject */
+		HSceneObject SO() const { return sceneObject(); }
+
+		/**
+		 * Called once per frame on all components.
+		 * 			
+		 * @note	Internal method.
+		 */
+		virtual void update() { }
+
+		/**
+		 * Calculates bounds of the visible contents represented by this component (e.g. a mesh for Renderable).
+		 * 
+		 * @param[in]	bounds	Bounds of the contents in world space coordinates.	
+		 * @return				True if the component has bounds with non-zero volume, otherwise false.
+		 */
+		virtual bool calculateBounds(Bounds& bounds);
+
+		/**
+		 * Checks if this and the provided component represent the same type.
+		 * 			
+		 * @note	
+		 * RTTI type cannot be checked directly since components can be further specialized internally for scripting 
+		 * purposes.
+		 */
+		virtual bool typeEquals(const Component& other);
+
+		/**
+		 * Removes the component from parent SceneObject and deletes it. All the references to this component will be 
+		 * marked as destroyed and you will get an exception if you try to use them.
+		 *
+		 * @param[in]	immediate	If true the destruction will be performed immediately, otherwise it will be delayed 
+		 *							until the end of the current frame (preferred option).
+		 */
+		void destroy(bool immediate = false);
+
+	protected:
+		friend class SceneObject;
+		friend class SceneObjectRTTI;
+
+		Component(const HSceneObject& parent);
+		virtual ~Component();
+
+		/**
+		 * Construct any resources the component needs before use. Called when the parent scene object is instantiated. 
+		 * A non-instantiated component shouldn't be used for any other purpose than serialization.
+		 */
+		virtual void instantiate() {}
+
+		/**	Called when the component is ready to be initialized. */
+		virtual void onInitialized() {}
+
+		/**	Called just before the component is destroyed. */
+		virtual void onDestroyed() {}
+
+		/**	Called just before the component is deactivated or destroyed. */
+		virtual void onDisabled() {}
+
+		/**	Called when the component is activated or created. */
+		virtual void onEnabled() {}
+
+		/**
+		 * Destroys this component.
+		 *
+		 * @param[in]	handle		Game object handle this this object.
+		 * @param[in]	immediate	If true, the object will be deallocated and become unusable right away. Otherwise the 
+		 *							deallocation will be delayed to the end of frame (preferred method).
+		 *
+		 * @note	Unlike destroy(), does not remove the component from its parent.
+		 */
+		void destroyInternal(GameObjectHandleBase& handle, bool immediate = false) override;
+	private:
+		Component(const Component& other) { }
+
+	protected:
+		HSceneObject mParent;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+	public:
+		friend class ComponentRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		RTTITypeBase* getRTTI() const override;
+
+	protected:
+		Component() {} // Serialization only
+	};
+
+	/** @} */
 }

+ 58 - 54
BansheeCore/Include/BsComponentRTTI.h

@@ -1,55 +1,59 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsComponent.h"
-#include "BsGameObjectRTTI.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT ComponentRTTI : public RTTIType<Component, GameObject, ComponentRTTI>
-	{
-	private:
-
-	public:
-		ComponentRTTI()
-		{
-
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj) override
-		{
-			Component* comp = static_cast<Component*>(obj);
-			GODeserializationData& deserializationData = any_cast_ref<GODeserializationData>(comp->mRTTIData);
-
-			// This shouldn't be null during normal deserialization but could be during some other operations, like applying
-			// a binary diff.
-			if (deserializationData.ptr != nullptr)
-			{
-				// Register the newly created SO with the GameObjectManager and provide it with the original ID so that
-				// deserialized handles pointing to this object can be resolved.
-				ComponentPtr compPtr = std::static_pointer_cast<Component>(deserializationData.ptr);
-
-				GameObjectManager::instance().registerObject(compPtr, deserializationData.originalId);
-			}
-			
-			comp->mRTTIData = nullptr;
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "Component";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_Component;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsComponent.h"
+#include "BsGameObjectRTTI.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT ComponentRTTI : public RTTIType<Component, GameObject, ComponentRTTI>
+	{
+	public:
+		ComponentRTTI()
+		{ }
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			Component* comp = static_cast<Component*>(obj);
+			GODeserializationData& deserializationData = any_cast_ref<GODeserializationData>(comp->mRTTIData);
+
+			// This shouldn't be null during normal deserialization but could be during some other operations, like applying
+			// a binary diff.
+			if (deserializationData.ptr != nullptr)
+			{
+				// Register the newly created SO with the GameObjectManager and provide it with the original ID so that
+				// deserialized handles pointing to this object can be resolved.
+				ComponentPtr compPtr = std::static_pointer_cast<Component>(deserializationData.ptr);
+
+				GameObjectManager::instance().registerObject(compPtr, deserializationData.originalId);
+			}
+			
+			comp->mRTTIData = nullptr;
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "Component";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_Component;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 127 - 150
BansheeCore/Include/BsCoreApplication.h

@@ -1,151 +1,128 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsModule.h"
-#include "BsCoreThreadAccessor.h"
-#include "BsRenderWindow.h"
-#include "BsEvent.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Structure containing parameters for starting the application.
-	 */
-	struct START_UP_DESC
-	{
-		String renderAPI; /**< Name of the render system plugin to use. */
-		String renderer; /**< Name of the renderer plugin to use. */
-
-		String input; /**< Name of the input plugin to use. */
-
-		RENDER_WINDOW_DESC primaryWindowDesc; /**< Describes the window to create during start-up. */
-
-		Vector<String> importers; /**< A list of importer plugins to load. */
-	};
-
-	/**
-	 * @brief	Represents the primary entry point for the core systems. Handles
-	 *			start-up, shutdown, primary loop and allows you to load and unload
-	 *			plugins.
-	 *
-	 * @note	Sim thread only.
-	 */
-	class BS_CORE_EXPORT CoreApplication : public Module<CoreApplication>
-	{
-		public:
-			CoreApplication(START_UP_DESC desc);
-			virtual ~CoreApplication();
-
-			/**
-			 * @brief	Executes the main loop. This will update your components and modules, queue objects 
-			 *			for rendering and run the simulation. Usually called immediately after startUp().
-			 * 			
-			 *			This will run infinitely until stopMainLoop is called (usually from another thread or internally).
-			 */
-			void runMainLoop();
-
-			/**
-			 * @brief	Stops a (infinite) main loop from running. The loop will complete its current cycle before stopping.
-			 */
-			void stopMainLoop();
-
-			/**
-			 * @brief	Issues a request for the application to close. Application may choose to ignore the request
-			 * 			depending on the circumstances and the implementation.
-			 */
-			virtual void quitRequested();
-
-			/**
-			 * @brief	Returns the main window that was created on application start-up.
-			 */
-			RenderWindowPtr getPrimaryWindow() const { return mPrimaryWindow; }
-
-			/**
-			 * @brief	Returns the id of the simulation thread.
-			 *
-			 * @note	Thread safe.
-			 */
-			BS_THREAD_ID_TYPE getSimThreadId() { return mSimThreadId; }
-
-			/**
-			 * @brief	Loads a plugin.
-			 *
-			 * @param	pluginName		Name of the plugin to load, without extension.
-			 * @param	[out] library	Specify as not null to receive a reference to 
-			 *							the loaded library.
-			 * @param	passThrough		Optional parameter that will be passed to the loadPlugin function.
-			 * 
-			 * @returns	Value returned from the plugin start-up method.
-			 */
-			void* loadPlugin(const String& pluginName, DynLib** library = nullptr, void* passThrough = nullptr);
-
-			/**
-			 * @brief	Unloads a previously loaded plugin. 
-			 */
-			void unloadPlugin(DynLib* library);
-
-	protected:
-		/**
-		 * @copydoc	Module::onStartUp
-		 */
-		virtual void onStartUp() override;
-
-		/**
-		 * @brief	Called for each iteration of the main loop. Called before any game objects or plugins are updated.
-		 */
-		virtual void preUpdate();
-
-		/**
-		 * @brief	Called for each iteration of the main loop. Called after all game objects and plugins are updated.
-		 */
-		virtual void postUpdate();
-
-		/**
-		 * @brief	Initializes the renderer specified during construction. Called during initialization.
-		 */
-		virtual void startUpRenderer();
-
-		/**
-		 * @brief	Returns a handler that is used for resolving shader include file paths.
-		 */
-		virtual ShaderIncludeHandlerPtr getShaderIncludeHandler() const;
-
-	private:
-		/**
-		 * @brief	Called when the frame finishes rendering.
-		 */
-		void frameRenderingFinishedCallback();
-
-		/**
-		 * @brief	Called by the core thread to begin profiling.
-		 */
-		void beginCoreProfiling();
-
-		/**
-		 * @brief	Called by the core thread to end profiling.
-		 */
-		void endCoreProfiling();
-
-	private:
-		typedef void(*UpdatePluginFunc)();
-
-		RenderWindowPtr mPrimaryWindow;
-		START_UP_DESC mStartUpDesc;
-
-		DynLib* mRendererPlugin;
-
-		Map<DynLib*, UpdatePluginFunc> mPluginUpdateFunctions;
-
-		bool mIsFrameRenderingFinished;
-		BS_MUTEX(mFrameRenderingFinishedMutex);
-		BS_THREAD_SYNCHRONISER(mFrameRenderingFinishedCondition);
-		BS_THREAD_ID_TYPE mSimThreadId;
-
-		volatile bool mRunMainLoop;
-	};
-
-	/**
-	 * @brief	Provides easy access to primary entry point for the engine.
-	 */
-	BS_CORE_EXPORT CoreApplication& gCoreApplication();
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsModule.h"
+#include "BsCoreThreadAccessor.h"
+#include "BsRenderWindow.h"
+#include "BsEvent.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup Application-Core
+	 *  @{
+	 */
+
+	/**	Structure containing parameters for starting the application. */
+	struct START_UP_DESC
+	{
+		String renderAPI; /**< Name of the render system plugin to use. */
+		String renderer; /**< Name of the renderer plugin to use. */
+
+		String input; /**< Name of the input plugin to use. */
+
+		RENDER_WINDOW_DESC primaryWindowDesc; /**< Describes the window to create during start-up. */
+
+		Vector<String> importers; /**< A list of importer plugins to load. */
+	};
+
+	/**
+	 * Represents the primary entry point for the core systems. Handles start-up, shutdown, primary loop and allows you to
+	 * load and unload plugins.
+	 *
+	 * @note	Sim thread only.
+	 */
+	class BS_CORE_EXPORT CoreApplication : public Module<CoreApplication>
+	{
+		public:
+			CoreApplication(START_UP_DESC desc);
+			virtual ~CoreApplication();
+
+			/**
+			 * Executes the main loop. This will update your components and modules, queue objects for rendering and run 
+			 * the simulation. Usually called immediately after startUp().
+			 * 			
+			 * This will run infinitely until stopMainLoop is called (usually from another thread or internally).
+			 */
+			void runMainLoop();
+
+			/**	Stops a (infinite) main loop from running. The loop will complete its current cycle before stopping. */
+			void stopMainLoop();
+
+			/**
+			 * Issues a request for the application to close. Application may choose to ignore the request depending on the
+			 * circumstances and the implementation.
+			 */
+			virtual void quitRequested();
+
+			/**	Returns the main window that was created on application start-up. */
+			RenderWindowPtr getPrimaryWindow() const { return mPrimaryWindow; }
+
+			/**
+			 * Returns the id of the simulation thread.
+			 *
+			 * @note	Thread safe.
+			 */
+			BS_THREAD_ID_TYPE getSimThreadId() { return mSimThreadId; }
+
+			/**
+			 * Loads a plugin.
+			 *
+			 * @param[in]	pluginName	Name of the plugin to load, without extension.
+			 * @param[out]	library		Specify as not null to receive a reference to the loaded library.
+			 * @param[in]	passThrough	Optional parameter that will be passed to the loadPlugin function.
+			 * @return					Value returned from the plugin start-up method.
+			 */
+			void* loadPlugin(const String& pluginName, DynLib** library = nullptr, void* passThrough = nullptr);
+
+			/**	Unloads a previously loaded plugin. */
+			void unloadPlugin(DynLib* library);
+
+	protected:
+		/** @copydoc Module::onStartUp */
+		virtual void onStartUp() override;
+
+		/**	Called for each iteration of the main loop. Called before any game objects or plugins are updated. */
+		virtual void preUpdate();
+
+		/**	Called for each iteration of the main loop. Called after all game objects and plugins are updated. */
+		virtual void postUpdate();
+
+		/**	Initializes the renderer specified during construction. Called during initialization. */
+		virtual void startUpRenderer();
+
+		/**	Returns a handler that is used for resolving shader include file paths. */
+		virtual ShaderIncludeHandlerPtr getShaderIncludeHandler() const;
+
+	private:
+		/**	Called when the frame finishes rendering. */
+		void frameRenderingFinishedCallback();
+
+		/**	Called by the core thread to begin profiling. */
+		void beginCoreProfiling();
+
+		/**	Called by the core thread to end profiling. */
+		void endCoreProfiling();
+
+	private:
+		typedef void(*UpdatePluginFunc)();
+
+		RenderWindowPtr mPrimaryWindow;
+		START_UP_DESC mStartUpDesc;
+
+		DynLib* mRendererPlugin;
+
+		Map<DynLib*, UpdatePluginFunc> mPluginUpdateFunctions;
+
+		bool mIsFrameRenderingFinished;
+		BS_MUTEX(mFrameRenderingFinishedMutex);
+		BS_THREAD_SYNCHRONISER(mFrameRenderingFinishedCondition);
+		BS_THREAD_ID_TYPE mSimThreadId;
+
+		volatile bool mRunMainLoop;
+	};
+
+	/**	Provides easy access to CoreApplication. */
+	BS_CORE_EXPORT CoreApplication& gCoreApplication();
+
+	/** @} */
 }

+ 24 - 0
BansheeCore/Include/BsCorePrerequisites.h

@@ -48,6 +48,30 @@
   *	Contains core resource types and resource management functionality (loading, saving, etc.).
   */
 
+/** @defgroup RTTI-Impl-Core RTTI types
+ *  Types containing RTTI for specific classes.
+ */
+
+/** @defgroup Scene Scene
+ *  Functionality for managing scene objects and their hierarchy.
+ */
+
+/** @defgroup Text Text
+ *  Functionality for rendering text.
+ */
+
+/** @defgroup Utility-Core Utility
+ *  Various utility methods and types used by the core layer.
+ */
+
+/** @defgroup Platform-Core Platform
+ *  Platform specific functionality.
+ */
+
+/** @defgroup Application-Core Application
+ *  Entry point into the application.
+ */
+
 /** @} */
 
 #define BS_MAX_MULTIPLE_RENDER_TARGETS 8

+ 91 - 101
BansheeCore/Include/BsCoreSceneManager.h

@@ -1,102 +1,92 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsModule.h"
-#include "BsGameObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Manages all objects in the scene and provides various query methods
-	 * 			for finding objects. This is just the base class with basic query 
-	 *			functionality. You should override it with your own version.
-	 */
-	class BS_CORE_EXPORT CoreSceneManager : public Module<CoreSceneManager>
-	{
-	public:
-		CoreSceneManager();
-		virtual ~CoreSceneManager();
-
-		/**
-		 * @brief	Returns the root scene object.
-		 */
-		HSceneObject getRootNode() const { return mRootNode; }
-
-		/**
-		 * @brief	Destroys all scene objects in the scene.
-		 *
-		 * @param	forceAll	If true, then even the persistent objects will be unloaded.
-		 */
-		void clearScene(bool forceAll = false);
-
-		/**
-		 * @brief	Changes the root scene object. Any persistent objects will remain in the scene, now parented
-		 * 			to the new root.
-		 * 			
-		 * @note	Internal method.
-		 */
-		void _setRootNode(const HSceneObject& root);
-
-		/**
-		 * @brief	Called every frame. Calls update methods on all 
-		 *			scene objects and their components.
-		 *
-		 * @note	Internal method.
-		 */
-		virtual void _update();
-
-		/**
-		 * @brief	Updates dirty transforms on any core objects that may be tied with
-		 *			scene objects.
-		 */
-		virtual void _updateCoreObjectTransforms() { }
-
-	protected:
-		friend class SceneObject;
-
-		/**
-		 * @brief	Register a new node in the scene manager, on the top-most level of the hierarchy.
-		 * 			
-		 * @note	After you add a node in the scene manager, it takes ownership of its memory and is responsible for releasing it.
-		 * 			Do NOT add nodes that have already been added (i.e. if you just want to change their parent). Normally this method will only be called by SceneObject.
-		 *
-		 * @param [in]	node	Node you wish to add. It's your responsibility not to add duplicate or null nodes. This method won't check.
-		 */
-		void registerNewSO(const HSceneObject& node);
-
-	protected:
-		HSceneObject mRootNode;
-	};
-
-	/**
-	 * @brief	Handles creation of a scene manager.
-	 *
-	 * @note	Since scene manager implementations may vary it is expected that a concrete implementation
-	 *			of a scene manager will register its creation method using "setFactoryMethod" which will then
-	 *			later be used for creating the scene manager during application start up.
-	 */
-	class BS_CORE_EXPORT SceneManagerFactory
-	{
-	public:
-		/**
-		 * @brief	Creates a concrete scene manager, depending on the currently set factory method.
-		 */
-		static void create();
-
-		/**
-		 * @brief	Sets method that will be used for creating the scene manager when "create" gets called.
-		 */
-		static void setFactoryMethod(const std::function<void()>& method)
-		{
-			mFactoryMethod = method;
-		}
-
-	private:
-		static std::function<void()> mFactoryMethod;
-	};
-
-	/**
-	 * @brief	Provides easy access to the scene manager.
-	 */
-	BS_CORE_EXPORT CoreSceneManager& gCoreSceneManager();
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsModule.h"
+#include "BsGameObject.h"
+
+namespace BansheeEngine
+{
+	/** @cond INTERNAL */
+	/** @addtogroup Scene
+	 *  @{
+	 */
+
+	/**
+	 * Manages all objects in the scene and provides various query methods for finding objects. This is just the base class
+	 * with basic query functionality. You should override it with your own version.
+	 */
+	class BS_CORE_EXPORT CoreSceneManager : public Module<CoreSceneManager>
+	{
+	public:
+		CoreSceneManager();
+		virtual ~CoreSceneManager();
+
+		/**	Returns the root scene object. */
+		HSceneObject getRootNode() const { return mRootNode; }
+
+		/**
+		 * Destroys all scene objects in the scene.
+		 *
+		 * @param[in]	forceAll	If true, then even the persistent objects will be unloaded.
+		 */
+		void clearScene(bool forceAll = false);
+
+		/** Changes the root scene object. Any persistent objects will remain in the scene, now parented to the new root. */
+		void _setRootNode(const HSceneObject& root);
+
+		/** Called every frame. Calls update methods on all scene objects and their components. */
+		virtual void _update();
+
+		/** Updates dirty transforms on any core objects that may be tied with scene objects. */
+		virtual void _updateCoreObjectTransforms() { }
+
+	protected:
+		friend class SceneObject;
+
+		/**
+		 * Register a new node in the scene manager, on the top-most level of the hierarchy.
+		 * 			
+		 * @param [in]	node	Node you wish to add. It's your responsibility not to add duplicate or null nodes. This 
+		 *						method won't check.
+		 *
+		 * @note	
+		 * After you add a node in the scene manager, it takes ownership of its memory and is responsible for releasing it.
+		 * Do NOT add nodes that have already been added (i.e. if you just want to change their parent). Normally this 
+		 * method will only be called by SceneObject.
+		 */
+		void registerNewSO(const HSceneObject& node);
+
+	protected:
+		HSceneObject mRootNode;
+	};
+
+	/**
+	 * Handles creation of a scene manager.
+	 *
+	 * @note	
+	 * Since scene manager implementations may vary it is expected that a concrete implementation of a scene manager will 
+	 * register its creation method using setFactoryMethod() which will then later be used for creating the scene manager
+	 * during application start up.
+	 */
+	class BS_CORE_EXPORT SceneManagerFactory
+	{
+	public:
+		/**	Creates a concrete scene manager, depending on the currently set factory method. */
+		static void create();
+
+		/**	Sets method that will be used for creating the scene manager when create() gets called. */
+		static void setFactoryMethod(const std::function<void()>& method)
+		{
+			mFactoryMethod = method;
+		}
+
+	private:
+		static std::function<void()> mFactoryMethod;
+	};
+
+	/**	Provides easy access to the CoreSceneManager. */
+	BS_CORE_EXPORT CoreSceneManager& gCoreSceneManager();
+
+	/** @} */
+	/** @endcond */
 }

+ 40 - 36
BansheeCore/Include/BsDeferredCallManager.h

@@ -1,37 +1,41 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsModule.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Allows you to queue calls that can get executed later.
-	 * 			
-	 * @note	Sim thread only.
-	 */
-	class BS_CORE_EXPORT DeferredCallManager : public Module<DeferredCallManager>
-	{
-	public:
-		DeferredCallManager();
-
-		/**
-		 * @brief	Register a deferred call that will be executed once at the start of next frame.
-		 *
-		 * @param	func		The function to execute.
-		 */
-		void queueDeferredCall(std::function<void()> func);
-
-		/**
-		 * @brief	Executes all the scheduled calls. To be called once per frame.
-		 *
-		 * @note	Internal method.
-		 */
-		void _update();
-
-	private:
-		friend class DeferredCall;
-
-		Vector<std::function<void()>> mCallbacks;
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsModule.h"
+
+namespace BansheeEngine
+{
+	/** @cond INTERNAL */
+	/** @addtogroup Utility-Core
+	 *  @{
+	 */
+
+	/**
+	 * Allows you to queue calls that can get executed later.
+	 * 			
+	 * @note	Sim thread only.
+	 */
+	class BS_CORE_EXPORT DeferredCallManager : public Module<DeferredCallManager>
+	{
+	public:
+		DeferredCallManager();
+
+		/**
+		 * Register a deferred call that will be executed once at the start of next frame.
+		 *
+		 * @param[in]	func	The function to execute.
+		 */
+		void queueDeferredCall(std::function<void()> func);
+
+		/** Executes all the scheduled calls. To be called once per frame. */
+		void _update();
+
+	private:
+		friend class DeferredCall;
+
+		Vector<std::function<void()>> mCallbacks;
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 51 - 43
BansheeCore/Include/BsDepthStencilStateRTTI.h

@@ -1,44 +1,52 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsDepthStencilState.h"
-#include "BsRenderStateManager.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT DepthStencilStateRTTI : public RTTIType<DepthStencilState, IReflectable, DepthStencilStateRTTI>
-	{
-	private:
-		DEPTH_STENCIL_STATE_DESC& getData(DepthStencilState* obj) { return obj->mProperties.mData; }
-		void setData(DepthStencilState* obj, DEPTH_STENCIL_STATE_DESC& val) { obj->mProperties.mData = val; } 
-
-	public:
-		DepthStencilStateRTTI()
-		{
-			addPlainField("mData", 0, &DepthStencilStateRTTI::getData, &DepthStencilStateRTTI::setData);
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj) override
-		{
-			DepthStencilState* depthStencilState = static_cast<DepthStencilState*>(obj);
-			depthStencilState->initialize();
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "DepthStencilState";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_DepthStencilState;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return RenderStateManager::instance()._createDepthStencilStatePtr(DEPTH_STENCIL_STATE_DESC());
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsDepthStencilState.h"
+#include "BsRenderStateManager.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT DepthStencilStateRTTI : public RTTIType<DepthStencilState, IReflectable, DepthStencilStateRTTI>
+	{
+	private:
+		DEPTH_STENCIL_STATE_DESC& getData(DepthStencilState* obj) { return obj->mProperties.mData; }
+		void setData(DepthStencilState* obj, DEPTH_STENCIL_STATE_DESC& val) { obj->mProperties.mData = val; } 
+
+	public:
+		DepthStencilStateRTTI()
+		{
+			addPlainField("mData", 0, &DepthStencilStateRTTI::getData, &DepthStencilStateRTTI::setData);
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			DepthStencilState* depthStencilState = static_cast<DepthStencilState*>(obj);
+			depthStencilState->initialize();
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "DepthStencilState";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_DepthStencilState;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return RenderStateManager::instance()._createDepthStencilStatePtr(DEPTH_STENCIL_STATE_DESC());
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 98 - 107
BansheeCore/Include/BsFont.h

@@ -1,108 +1,99 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsResource.h"
-#include "BsFontDesc.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Contains textures and data about every character for a bitmap font of a specific size.
-	 */
-	struct BS_CORE_EXPORT FontBitmap : public IReflectable
-	{
-		/**
-		 * @brief	Returns a character description for the character with the specified Unicode key.
-		 */
-		const CHAR_DESC& getCharDesc(UINT32 charId) const;
-
-		UINT32 size; /**< Font size for which the data is contained. */
-		FONT_DESC fontDesc; /**< Font description containing per-character and general font data. */
-		Vector<HTexture> texturePages; /**< Textures in which the character's pixels are stored. */
-
-		/************************************************************************/
-		/* 								SERIALIZATION                      		*/
-		/************************************************************************/
-	public:
-		friend class FontBitmapRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const override;
-	};
-
-	// TODO - When saved on disk font currently stores a copy of the texture pages. This should be acceptable
-	// if you import a new TrueType or OpenType font since the texture will be generated on the spot
-	// but if you use a bitmap texture to initialize the font manually, then you will potentially have duplicate textures.
-	// Also, changing the source texture will not automatically update the font because there is no direct link between them.
-	// -- This is probably not a large problem, but it is something to keep an eye out.
-
-	/**
-	 * @brief	Font resource containing data about textual characters
-	 *			and how to render text.
-	 */
-	class BS_CORE_EXPORT Font : public Resource
-	{
-	public:
-		virtual ~Font();
-
-		/**
-		 * @brief	Initializes the font with specified per-size font data.
-		 *
-		 * @note	Internal method. Factory methods will call this automatically for you.
-		 */
-		void initialize(const Vector<SPtr<FontBitmap>>& fontData);
-
-		/**
-		 * @brief	Returns font bitmap for a specific size if it exists, null otherwise.
-		 *
-		 * @param	size	Size of the bitmap in points.
-		 */
-		SPtr<const FontBitmap> getBitmap(UINT32 size) const;
-
-		/**
-		 * @brief	Finds the available font bitmap size closest to the provided size.
-		 */
-		INT32 getClosestSize(UINT32 size) const;
-
-		/************************************************************************/
-		/* 								STATICS		                     		*/
-		/************************************************************************/
-
-		/**
-		 * @brief	Creates a new font from the provided per-size font data.
-		 */
-		static HFont create(const Vector<SPtr<FontBitmap>>& fontInitData);
-
-		/**
-		 * @brief	Creates a new font as a pointer instead of a resource handle.
-		 *
-		 * @note	Internal method.
-		 */
-		static FontPtr _createPtr(const Vector<SPtr<FontBitmap>>& fontInitData);
-
-	protected:
-		friend class FontManager;
-
-		Font();
-
-		/**
-		 * @copydoc	Resource::getResourceDependencies
-		 */
-		void getResourceDependencies(FrameVector<HResource>& dependencies) const override;
-
-		/**
-		 * @copydoc	CoreObject::getCoreDependencies
-		 */
-		void getCoreDependencies(Vector<CoreObject*>& dependencies) override;
-
-	private:
-		Map<UINT32, SPtr<FontBitmap>> mFontDataPerSize;
-
-		/************************************************************************/
-		/* 								SERIALIZATION                      		*/
-		/************************************************************************/
-	public:
-		friend class FontRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const override;
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsResource.h"
+#include "BsFontDesc.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup Text
+	 *  @{
+	 */
+
+	/**	Contains textures and data about every character for a bitmap font of a specific size. */
+	struct BS_CORE_EXPORT FontBitmap : public IReflectable
+	{
+		/**	Returns a character description for the character with the specified Unicode key. */
+		const CHAR_DESC& getCharDesc(UINT32 charId) const;
+
+		UINT32 size; /**< Font size for which the data is contained. */
+		FONT_DESC fontDesc; /**< Font description containing per-character and general font data. */
+		Vector<HTexture> texturePages; /**< Textures in which the character's pixels are stored. */
+
+		/************************************************************************/
+		/* 								SERIALIZATION                      		*/
+		/************************************************************************/
+	public:
+		friend class FontBitmapRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		virtual RTTITypeBase* getRTTI() const override;
+	};
+
+	// TODO - When saved on disk font currently stores a copy of the texture pages. This should be acceptable
+	// if you import a new TrueType or OpenType font since the texture will be generated on the spot
+	// but if you use a bitmap texture to initialize the font manually, then you will potentially have duplicate textures.
+	// Also, changing the source texture will not automatically update the font because there is no direct link between them.
+	// -- This is probably not a large problem, but it is something to keep an eye out.
+
+	/**	Font resource containing data about textual characters and how to render text. */
+	class BS_CORE_EXPORT Font : public Resource
+	{
+	public:
+		virtual ~Font();
+
+		/** @cond INTERNAL */
+
+		/**
+		 * Initializes the font with specified per-size font data.
+		 *
+		 * @note	Internal method. Factory methods will call this automatically for you.
+		 */
+		void initialize(const Vector<SPtr<FontBitmap>>& fontData);
+
+		/** @endcond */
+
+		/**
+		 * Returns font bitmap for a specific size if it exists, null otherwise.
+		 *
+		 * @param[in]	size	Size of the bitmap in points.
+		 */
+		SPtr<const FontBitmap> getBitmap(UINT32 size) const;
+
+		/**	Finds the available font bitmap size closest to the provided size. */
+		INT32 getClosestSize(UINT32 size) const;
+
+		/**	Creates a new font from the provided per-size font data. */
+		static HFont create(const Vector<SPtr<FontBitmap>>& fontInitData);
+
+		/** @cond INTERNAL */
+
+		/** Creates a new font as a pointer instead of a resource handle. */
+		static FontPtr _createPtr(const Vector<SPtr<FontBitmap>>& fontInitData);
+
+		/** @endcond */
+
+	protected:
+		friend class FontManager;
+
+		Font();
+
+		/** @copydoc Resource::getResourceDependencies */
+		void getResourceDependencies(FrameVector<HResource>& dependencies) const override;
+
+		/** @copydoc CoreObject::getCoreDependencies */
+		void getCoreDependencies(Vector<CoreObject*>& dependencies) override;
+
+	private:
+		Map<UINT32, SPtr<FontBitmap>> mFontDataPerSize;
+
+		/************************************************************************/
+		/* 								SERIALIZATION                      		*/
+		/************************************************************************/
+	public:
+		friend class FontRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		virtual RTTITypeBase* getRTTI() const override;
+	};
+
+	/** @} */
 }

+ 165 - 163
BansheeCore/Include/BsFontDesc.h

@@ -1,164 +1,166 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Kerning pair representing larger or smaller offset between
-	 *			a specific pair of characters.
-	 */
-	struct KerningPair
-	{
-		UINT32 otherCharId;
-		INT32 amount;
-	};
-
-	/**
-	 * @brief	Describes a single character in a font of a specific size.
-	 */
-	struct CHAR_DESC
-	{
-		UINT32 charId; /**< Character ID, corresponding to a Unicode key. */
-		UINT32 page; /**< Index of the texture the character is located on. */
-		float uvX, uvY; /**< Texture coordinates of the character in the page texture. */
-		float uvWidth, uvHeight; /**< Width/height of the character in texture coordinates. */
-		UINT32 width, height; /**< Width/height of the character in pixels. */
-		INT32 xOffset, yOffset; /**< Offset for the visible portion of the character in pixels. */
-		INT32 xAdvance, yAdvance; /**< Determines how much to advance the pen after writing this character, in pixels. */
-
-		Vector<KerningPair> kerningPairs; /**< Pairs that determine if certain character pairs should be closer or father together. e.g. "AV" combination. */
-	};
-
-	/**
-	 * @brief	Describes a font.
-	 */
-	struct FONT_DESC
-	{
-		Map<UINT32, CHAR_DESC> characters; /**< All characters in the font referenced by character ID. */
-		INT32 baselineOffset; /**< Y offset to the baseline on which the characters are placed, in pixels. */
-		UINT32 lineHeight; /**< Height of a single line of the font, in pixels. */
-		CHAR_DESC missingGlyph; /**< Character to use when data for a character is missing. */
-		UINT32 spaceWidth; /**< Width of a space in pixels. */
-	};
-
-	// Make CHAR_DESC serializable
-	template<> struct RTTIPlainType<CHAR_DESC>
-	{	
-		enum { id = TID_CHAR_DESC }; enum { hasDynamicSize = 1 };
-
-		static void toMemory(const CHAR_DESC& data, char* memory)
-		{ 
-			UINT32 size = getDynamicSize(data);
-
-			memcpy(memory, &size, sizeof(UINT32));
-			memory += sizeof(UINT32);
-
-			memory = rttiWriteElem(data.charId, memory);
-			memory = rttiWriteElem(data.page, memory);
-			memory = rttiWriteElem(data.uvX, memory);
-			memory = rttiWriteElem(data.uvY, memory);
-			memory = rttiWriteElem(data.uvWidth, memory);
-			memory = rttiWriteElem(data.uvHeight, memory);
-			memory = rttiWriteElem(data.width, memory);
-			memory = rttiWriteElem(data.height, memory);
-			memory = rttiWriteElem(data.xOffset, memory);
-			memory = rttiWriteElem(data.yOffset, memory);
-			memory = rttiWriteElem(data.xAdvance, memory);
-			memory = rttiWriteElem(data.yAdvance, memory);
-			memory = rttiWriteElem(data.kerningPairs, memory);
-		}
-
-		static UINT32 fromMemory(CHAR_DESC& data, char* memory)
-		{ 
-			UINT32 size;
-			memcpy(&size, memory, sizeof(UINT32)); 
-			memory += sizeof(UINT32);
-
-			memory = rttiReadElem(data.charId, memory);
-			memory = rttiReadElem(data.page, memory);
-			memory = rttiReadElem(data.uvX, memory);
-			memory = rttiReadElem(data.uvY, memory);
-			memory = rttiReadElem(data.uvWidth, memory);
-			memory = rttiReadElem(data.uvHeight, memory);
-			memory = rttiReadElem(data.width, memory);
-			memory = rttiReadElem(data.height, memory);
-			memory = rttiReadElem(data.xOffset, memory);
-			memory = rttiReadElem(data.yOffset, memory);
-			memory = rttiReadElem(data.xAdvance, memory);
-			memory = rttiReadElem(data.yAdvance, memory);
-			memory = rttiReadElem(data.kerningPairs, memory);
-
-			return size;
-		}
-
-		static UINT32 getDynamicSize(const CHAR_DESC& data)	
-		{ 
-			UINT64 dataSize = sizeof(data.charId)
-				+ sizeof(data.page)
-				+ sizeof(data.uvX)
-				+ sizeof(data.uvY)
-				+ sizeof(data.uvWidth)
-				+ sizeof(data.uvHeight)
-				+ sizeof(data.width)
-				+ sizeof(data.height)
-				+ sizeof(data.xOffset)
-				+ sizeof(data.yOffset)
-				+ sizeof(data.xAdvance)
-				+ sizeof(data.yAdvance)
-				+ RTTIPlainType<Vector<KerningPair>>::getDynamicSize(data.kerningPairs);
-
-			dataSize += sizeof(UINT32);
-
-			return (UINT32)dataSize;
-		}	
-	}; 
-
-	// Make FONT_DESC serializable
-	template<> struct RTTIPlainType<FONT_DESC>
-	{	
-		enum { id = TID_FONT_DESC }; enum { hasDynamicSize = 1 };
-
-		static void toMemory(const FONT_DESC& data, char* memory)
-		{ 
-			UINT32 size = sizeof(UINT32);
-			char* memoryStart = memory;
-			memory += sizeof(UINT32);
-			
-			memory = rttiWriteElem(data.characters, memory, size);
-			memory = rttiWriteElem(data.baselineOffset, memory, size);
-			memory = rttiWriteElem(data.lineHeight, memory, size);
-			memory = rttiWriteElem(data.missingGlyph, memory, size);
-			memory = rttiWriteElem(data.spaceWidth, memory, size);
-
-			memcpy(memoryStart, &size, sizeof(UINT32));
-		}
-
-		static UINT32 fromMemory(FONT_DESC& data, char* memory)
-		{ 
-			UINT32 size;
-			memcpy(&size, memory, sizeof(UINT32)); 
-			memory += sizeof(UINT32);
-
-			memory = rttiReadElem(data.characters, memory);
-			memory = rttiReadElem(data.baselineOffset, memory);
-			memory = rttiReadElem(data.lineHeight, memory);
-			memory = rttiReadElem(data.missingGlyph, memory);
-			memory = rttiReadElem(data.spaceWidth, memory);
-
-			return size;
-		}
-
-		static UINT32 getDynamicSize(const FONT_DESC& data)	
-		{ 
-			UINT64 dataSize = sizeof(UINT32);
-			dataSize += rttiGetElemSize(data.characters);
-			dataSize += rttiGetElemSize(data.baselineOffset);
-			dataSize += rttiGetElemSize(data.lineHeight);
-			dataSize += rttiGetElemSize(data.missingGlyph);
-			dataSize += rttiGetElemSize(data.spaceWidth);
-
-			return (UINT32)dataSize;
-		}	
-	}; 
+#pragma once
+
+#include "BsCorePrerequisites.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup Text
+	 *  @{
+	 */
+
+	/**	Kerning pair representing larger or smaller offset between a specific pair of characters. */
+	struct KerningPair
+	{
+		UINT32 otherCharId;
+		INT32 amount;
+	};
+
+	/**	Describes a single character in a font of a specific size. */
+	struct CHAR_DESC
+	{
+		UINT32 charId; /**< Character ID, corresponding to a Unicode key. */
+		UINT32 page; /**< Index of the texture the character is located on. */
+		float uvX, uvY; /**< Texture coordinates of the character in the page texture. */
+		float uvWidth, uvHeight; /**< Width/height of the character in texture coordinates. */
+		UINT32 width, height; /**< Width/height of the character in pixels. */
+		INT32 xOffset, yOffset; /**< Offset for the visible portion of the character in pixels. */
+		INT32 xAdvance, yAdvance; /**< Determines how much to advance the pen after writing this character, in pixels. */
+
+		Vector<KerningPair> kerningPairs; /**< Pairs that determine if certain character pairs should be closer or father together. e.g. "AV" combination. */
+	};
+
+	/**	Describes a font. */
+	struct FONT_DESC
+	{
+		Map<UINT32, CHAR_DESC> characters; /**< All characters in the font referenced by character ID. */
+		INT32 baselineOffset; /**< Y offset to the baseline on which the characters are placed, in pixels. */
+		UINT32 lineHeight; /**< Height of a single line of the font, in pixels. */
+		CHAR_DESC missingGlyph; /**< Character to use when data for a character is missing. */
+		UINT32 spaceWidth; /**< Width of a space in pixels. */
+	};
+
+	/** @cond SPECIALIZATIONS */
+
+	// Make CHAR_DESC serializable
+	template<> struct RTTIPlainType<CHAR_DESC>
+	{	
+		enum { id = TID_CHAR_DESC }; enum { hasDynamicSize = 1 };
+
+		static void toMemory(const CHAR_DESC& data, char* memory)
+		{ 
+			UINT32 size = getDynamicSize(data);
+
+			memcpy(memory, &size, sizeof(UINT32));
+			memory += sizeof(UINT32);
+
+			memory = rttiWriteElem(data.charId, memory);
+			memory = rttiWriteElem(data.page, memory);
+			memory = rttiWriteElem(data.uvX, memory);
+			memory = rttiWriteElem(data.uvY, memory);
+			memory = rttiWriteElem(data.uvWidth, memory);
+			memory = rttiWriteElem(data.uvHeight, memory);
+			memory = rttiWriteElem(data.width, memory);
+			memory = rttiWriteElem(data.height, memory);
+			memory = rttiWriteElem(data.xOffset, memory);
+			memory = rttiWriteElem(data.yOffset, memory);
+			memory = rttiWriteElem(data.xAdvance, memory);
+			memory = rttiWriteElem(data.yAdvance, memory);
+			memory = rttiWriteElem(data.kerningPairs, memory);
+		}
+
+		static UINT32 fromMemory(CHAR_DESC& data, char* memory)
+		{ 
+			UINT32 size;
+			memcpy(&size, memory, sizeof(UINT32)); 
+			memory += sizeof(UINT32);
+
+			memory = rttiReadElem(data.charId, memory);
+			memory = rttiReadElem(data.page, memory);
+			memory = rttiReadElem(data.uvX, memory);
+			memory = rttiReadElem(data.uvY, memory);
+			memory = rttiReadElem(data.uvWidth, memory);
+			memory = rttiReadElem(data.uvHeight, memory);
+			memory = rttiReadElem(data.width, memory);
+			memory = rttiReadElem(data.height, memory);
+			memory = rttiReadElem(data.xOffset, memory);
+			memory = rttiReadElem(data.yOffset, memory);
+			memory = rttiReadElem(data.xAdvance, memory);
+			memory = rttiReadElem(data.yAdvance, memory);
+			memory = rttiReadElem(data.kerningPairs, memory);
+
+			return size;
+		}
+
+		static UINT32 getDynamicSize(const CHAR_DESC& data)	
+		{ 
+			UINT64 dataSize = sizeof(data.charId)
+				+ sizeof(data.page)
+				+ sizeof(data.uvX)
+				+ sizeof(data.uvY)
+				+ sizeof(data.uvWidth)
+				+ sizeof(data.uvHeight)
+				+ sizeof(data.width)
+				+ sizeof(data.height)
+				+ sizeof(data.xOffset)
+				+ sizeof(data.yOffset)
+				+ sizeof(data.xAdvance)
+				+ sizeof(data.yAdvance)
+				+ RTTIPlainType<Vector<KerningPair>>::getDynamicSize(data.kerningPairs);
+
+			dataSize += sizeof(UINT32);
+
+			return (UINT32)dataSize;
+		}	
+	}; 
+
+	// Make FONT_DESC serializable
+	template<> struct RTTIPlainType<FONT_DESC>
+	{	
+		enum { id = TID_FONT_DESC }; enum { hasDynamicSize = 1 };
+
+		static void toMemory(const FONT_DESC& data, char* memory)
+		{ 
+			UINT32 size = sizeof(UINT32);
+			char* memoryStart = memory;
+			memory += sizeof(UINT32);
+			
+			memory = rttiWriteElem(data.characters, memory, size);
+			memory = rttiWriteElem(data.baselineOffset, memory, size);
+			memory = rttiWriteElem(data.lineHeight, memory, size);
+			memory = rttiWriteElem(data.missingGlyph, memory, size);
+			memory = rttiWriteElem(data.spaceWidth, memory, size);
+
+			memcpy(memoryStart, &size, sizeof(UINT32));
+		}
+
+		static UINT32 fromMemory(FONT_DESC& data, char* memory)
+		{ 
+			UINT32 size;
+			memcpy(&size, memory, sizeof(UINT32)); 
+			memory += sizeof(UINT32);
+
+			memory = rttiReadElem(data.characters, memory);
+			memory = rttiReadElem(data.baselineOffset, memory);
+			memory = rttiReadElem(data.lineHeight, memory);
+			memory = rttiReadElem(data.missingGlyph, memory);
+			memory = rttiReadElem(data.spaceWidth, memory);
+
+			return size;
+		}
+
+		static UINT32 getDynamicSize(const FONT_DESC& data)	
+		{ 
+			UINT64 dataSize = sizeof(UINT32);
+			dataSize += rttiGetElemSize(data.characters);
+			dataSize += rttiGetElemSize(data.baselineOffset);
+			dataSize += rttiGetElemSize(data.lineHeight);
+			dataSize += rttiGetElemSize(data.missingGlyph);
+			dataSize += rttiGetElemSize(data.spaceWidth);
+
+			return (UINT32)dataSize;
+		}	
+	}; 
+
+	/** @endcond */
+	/** @} */
 }

+ 84 - 109
BansheeCore/Include/BsFontImportOptions.h

@@ -1,110 +1,85 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsImportOptions.h"
-#include "BsFont.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Determines how is a font rendered into the bitmap texture.
-	 */
-	enum class FontRenderMode
-	{
-		Smooth, /*< Render antialiased fonts without hinting (slightly more blurry). */
-		Raster, /*< Render non-antialiased fonts without hinting (slightly more blurry). */
-		HintedSmooth, /*< Render antialiased fonts with hinting. */
-		HintedRaster /*< Render non-antialiased fonts with hinting. */
-	};
-
-	/**
-	 * @brief	Import options that allow you to control how is a font
-	 *			imported.
-	 */
-	class BS_CORE_EXPORT FontImportOptions : public ImportOptions
-	{
-	public:
-		FontImportOptions();
-
-		/**
-		 * @brief	Sets font sizes that are to be imported. Sizes are in points.
-		 */
-		void setFontSizes(const Vector<UINT32>& fontSizes) { mFontSizes = fontSizes; }
-
-		/**
-		 * @brief	Adds an index range of characters to import. 
-		 */
-		void addCharIndexRange(UINT32 from, UINT32 to);
-
-		/**
-		 * @brief	Clears all character indexes, so no character are imported.
-		 */
-		void clearCharIndexRanges();
-
-		/**
-		 * @brief	Sets dots per inch resolution to use when rendering the characters into the texture.
-		 */
-		void setDPI(UINT32 dpi) { mDPI = dpi; }
-
-		/**
-		 * @brief	Set the render mode used for rendering the characters into a bitmap.
-		 */
-		void setRenderMode(FontRenderMode renderMode) { mRenderMode = renderMode; }
-
-		/**
-		 * @brief	Sets whether the bold font style should be used when rendering.
-		 */
-		void setBold(bool bold) { mBold = bold; }
-
-		/**
-		 * @brief	Sets whether the italic font style should be used when rendering.
-		 */
-		void setItalic(bool italic) { mItalic = italic; }
-
-		/**
-		 * @brief	Gets the sizes that are to be imported. Ranges are defined as unicode numbers.
-		 */
-		Vector<UINT32> getFontSizes() const { return mFontSizes; }
-
-		/**
-		 * @brief	Gets character index ranges to import. Ranges are defined as unicode numbers.
-		 */
-		Vector<std::pair<UINT32, UINT32>> getCharIndexRanges() const { return mCharIndexRanges; }
-
-		/**
-		 * @brief	Returns dots per inch scale that will be used when rendering the characters.
-		 */
-		UINT32 getDPI() const { return mDPI; }
-
-		/**
-		 * @brief	Get the render mode used for rendering the characters into a bitmap.
-		 */
-		FontRenderMode getRenderMode() const { return mRenderMode; }
-
-		/**
-		 * @brief	Sets whether the bold font style should be used when rendering.
-		 */
-		bool getBold() const { return mBold; }
-
-		/**
-		 * @brief	Sets whether the italic font style should be used when rendering.
-		 */
-		bool getItalic() const { return mItalic; }
-
-		/************************************************************************/
-		/* 								SERIALIZATION                      		*/
-		/************************************************************************/
-	public:
-		friend class FontImportOptionsRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const override;
-
-	private:
-		Vector<UINT32> mFontSizes;
-		Vector<std::pair<UINT32, UINT32>> mCharIndexRanges;
-		UINT32 mDPI;
-		FontRenderMode mRenderMode;
-		bool mBold;
-		bool mItalic;
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsImportOptions.h"
+#include "BsFont.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup Text
+	 *  @{
+	 */
+
+	/**	Determines how is a font rendered into the bitmap texture. */
+	enum class FontRenderMode
+	{
+		Smooth, /*< Render antialiased fonts without hinting (slightly more blurry). */
+		Raster, /*< Render non-antialiased fonts without hinting (slightly more blurry). */
+		HintedSmooth, /*< Render antialiased fonts with hinting. */
+		HintedRaster /*< Render non-antialiased fonts with hinting. */
+	};
+
+	/**	Import options that allow you to control how is a font imported. */
+	class BS_CORE_EXPORT FontImportOptions : public ImportOptions
+	{
+	public:
+		FontImportOptions();
+
+		/**	Sets font sizes that are to be imported. Sizes are in points. */
+		void setFontSizes(const Vector<UINT32>& fontSizes) { mFontSizes = fontSizes; }
+
+		/**	Adds an index range of characters to import.  */
+		void addCharIndexRange(UINT32 from, UINT32 to);
+
+		/**	Clears all character indexes, so no character are imported. */
+		void clearCharIndexRanges();
+
+		/**	Sets dots per inch resolution to use when rendering the characters into the texture. */
+		void setDPI(UINT32 dpi) { mDPI = dpi; }
+
+		/**	Set the render mode used for rendering the characters into a bitmap. */
+		void setRenderMode(FontRenderMode renderMode) { mRenderMode = renderMode; }
+
+		/**	Sets whether the bold font style should be used when rendering. */
+		void setBold(bool bold) { mBold = bold; }
+
+		/**	Sets whether the italic font style should be used when rendering. */
+		void setItalic(bool italic) { mItalic = italic; }
+
+		/**	Gets the sizes that are to be imported. Ranges are defined as unicode numbers. */
+		Vector<UINT32> getFontSizes() const { return mFontSizes; }
+
+		/**	Gets character index ranges to import. Ranges are defined as unicode numbers. */
+		Vector<std::pair<UINT32, UINT32>> getCharIndexRanges() const { return mCharIndexRanges; }
+
+		/**	Returns dots per inch scale that will be used when rendering the characters. */
+		UINT32 getDPI() const { return mDPI; }
+
+		/**	Get the render mode used for rendering the characters into a bitmap. */
+		FontRenderMode getRenderMode() const { return mRenderMode; }
+
+		/**	Sets whether the bold font style should be used when rendering. */
+		bool getBold() const { return mBold; }
+
+		/**	Sets whether the italic font style should be used when rendering. */
+		bool getItalic() const { return mItalic; }
+
+	private:
+		Vector<UINT32> mFontSizes;
+		Vector<std::pair<UINT32, UINT32>> mCharIndexRanges;
+		UINT32 mDPI;
+		FontRenderMode mRenderMode;
+		bool mBold;
+		bool mItalic;
+
+		/************************************************************************/
+		/* 								SERIALIZATION                      		*/
+		/************************************************************************/
+	public:
+		friend class FontImportOptionsRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		RTTITypeBase* getRTTI() const override;
+	};
+
+	/** @} */
 }

+ 64 - 56
BansheeCore/Include/BsFontImportOptionsRTTI.h

@@ -1,57 +1,65 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsFontImportOptions.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT FontImportOptionsRTTI : public RTTIType<FontImportOptions, ImportOptions, FontImportOptionsRTTI>
-	{
-	private:
-		Vector<UINT32>& getFontSizes(FontImportOptions* obj) { return obj->mFontSizes; }
-		void setFontSizes(FontImportOptions* obj, Vector<UINT32>& value) { obj->mFontSizes = value; }
-
-		Vector<std::pair<UINT32, UINT32>>& getCharIndexRanges(FontImportOptions* obj) { return obj->mCharIndexRanges; }
-		void setCharIndexRanges(FontImportOptions* obj, Vector<std::pair<UINT32, UINT32>>& value) { obj->mCharIndexRanges = value; }
-
-		UINT32& getDPI(FontImportOptions* obj) { return obj->mDPI; }
-		void setDPI(FontImportOptions* obj, UINT32& value) { obj->mDPI = value; }
-
-		FontRenderMode& getRenderMode(FontImportOptions* obj) { return obj->mRenderMode; }
-		void setRenderMode(FontImportOptions* obj, FontRenderMode& value) { obj->mRenderMode = value; }
-
-		bool& getBold(FontImportOptions* obj) { return obj->mBold; }
-		void setBold(FontImportOptions* obj, bool& value) { obj->mBold = value; }
-
-		bool& getItalic(FontImportOptions* obj) { return obj->mItalic; }
-		void setItalic(FontImportOptions* obj, bool& value) { obj->mItalic = value; }
-
-	public:
-		FontImportOptionsRTTI()
-		{
-			addPlainField("mFontSizes", 0, &FontImportOptionsRTTI::getFontSizes, &FontImportOptionsRTTI::setFontSizes);
-			addPlainField("mCharIndexRanges", 1, &FontImportOptionsRTTI::getCharIndexRanges, &FontImportOptionsRTTI::setCharIndexRanges);
-			addPlainField("mDPI", 2, &FontImportOptionsRTTI::getDPI, &FontImportOptionsRTTI::setDPI);
-			addPlainField("mRenderMode", 3, &FontImportOptionsRTTI::getRenderMode, &FontImportOptionsRTTI::setRenderMode);
-			addPlainField("mBold", 4, &FontImportOptionsRTTI::getBold, &FontImportOptionsRTTI::setBold);
-			addPlainField("mItalic", 5, &FontImportOptionsRTTI::getItalic, &FontImportOptionsRTTI::setItalic);
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "FontImportOptions";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_FontImportOptions;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<FontImportOptions>();
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsFontImportOptions.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT FontImportOptionsRTTI : public RTTIType<FontImportOptions, ImportOptions, FontImportOptionsRTTI>
+	{
+	private:
+		Vector<UINT32>& getFontSizes(FontImportOptions* obj) { return obj->mFontSizes; }
+		void setFontSizes(FontImportOptions* obj, Vector<UINT32>& value) { obj->mFontSizes = value; }
+
+		Vector<std::pair<UINT32, UINT32>>& getCharIndexRanges(FontImportOptions* obj) { return obj->mCharIndexRanges; }
+		void setCharIndexRanges(FontImportOptions* obj, Vector<std::pair<UINT32, UINT32>>& value) { obj->mCharIndexRanges = value; }
+
+		UINT32& getDPI(FontImportOptions* obj) { return obj->mDPI; }
+		void setDPI(FontImportOptions* obj, UINT32& value) { obj->mDPI = value; }
+
+		FontRenderMode& getRenderMode(FontImportOptions* obj) { return obj->mRenderMode; }
+		void setRenderMode(FontImportOptions* obj, FontRenderMode& value) { obj->mRenderMode = value; }
+
+		bool& getBold(FontImportOptions* obj) { return obj->mBold; }
+		void setBold(FontImportOptions* obj, bool& value) { obj->mBold = value; }
+
+		bool& getItalic(FontImportOptions* obj) { return obj->mItalic; }
+		void setItalic(FontImportOptions* obj, bool& value) { obj->mItalic = value; }
+
+	public:
+		FontImportOptionsRTTI()
+		{
+			addPlainField("mFontSizes", 0, &FontImportOptionsRTTI::getFontSizes, &FontImportOptionsRTTI::setFontSizes);
+			addPlainField("mCharIndexRanges", 1, &FontImportOptionsRTTI::getCharIndexRanges, &FontImportOptionsRTTI::setCharIndexRanges);
+			addPlainField("mDPI", 2, &FontImportOptionsRTTI::getDPI, &FontImportOptionsRTTI::setDPI);
+			addPlainField("mRenderMode", 3, &FontImportOptionsRTTI::getRenderMode, &FontImportOptionsRTTI::setRenderMode);
+			addPlainField("mBold", 4, &FontImportOptionsRTTI::getBold, &FontImportOptionsRTTI::setBold);
+			addPlainField("mItalic", 5, &FontImportOptionsRTTI::getItalic, &FontImportOptionsRTTI::setItalic);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "FontImportOptions";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_FontImportOptions;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<FontImportOptions>();
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 29 - 25
BansheeCore/Include/BsFontManager.h

@@ -1,26 +1,30 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsModule.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Handles creation of fonts.
-	 */
-	class BS_CORE_EXPORT FontManager : public Module<FontManager>
-	{
-	public:
-		/**
-		 * @brief	Creates a new font from the provided populated font data structure.
-		 */
-		FontPtr create(const Vector<SPtr<FontBitmap>>& fontData) const;
-
-		/**
-		 * @brief	Creates an empty font.
-		 *
-		 * @note	Internal method. Used by factory methods.
-		 */
-		FontPtr _createEmpty() const;
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsModule.h"
+
+namespace BansheeEngine
+{
+	/** @cond INTERNAL */
+	/** @addtogroup Text
+	 *  @{
+	 */
+
+	/**	Handles creation of fonts. */
+	class BS_CORE_EXPORT FontManager : public Module<FontManager>
+	{
+	public:
+		/**	Creates a new font from the provided populated font data structure. */
+		FontPtr create(const Vector<SPtr<FontBitmap>>& fontData) const;
+
+		/**
+		 * Creates an empty font.
+		 *
+		 * @note	Internal method. Used by factory methods.
+		 */
+		FontPtr _createEmpty() const;
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 139 - 159
BansheeCore/Include/BsFontRTTI.h

@@ -1,160 +1,140 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsFont.h"
-#include "BsFontManager.h"
-#include "BsTexture.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT FontBitmapRTTI : public RTTIType<FontBitmap, IReflectable, FontBitmapRTTI>
-	{
-	private:
-		UINT32& getSize(FontBitmap* obj)
-		{
-			return obj->size;
-		}
-
-		void setSize(FontBitmap* obj, UINT32& size)
-		{
-			obj->size = size;
-		}
-
-		FONT_DESC& getFontDesc(FontBitmap* obj)
-		{
-			return obj->fontDesc;
-		}
-
-		void setFontDesc(FontBitmap* obj, FONT_DESC& val)
-		{
-			obj->fontDesc = val;
-		}
-
-		HTexture& getTexture(FontBitmap* obj, UINT32 idx)
-		{
-			return obj->texturePages.at(idx);
-		}
-
-		void setTexture(FontBitmap* obj, UINT32 idx, HTexture& value)
-		{
-			obj->texturePages[idx] = value;
-		}
-
-		UINT32 getTextureArraySize(FontBitmap* obj)
-		{
-			return (UINT32)obj->texturePages.size();
-		}
-
-		void setTextureArraySize(FontBitmap* obj, UINT32 size)
-		{
-			obj->texturePages.resize(size);
-		}
-
-	public:
-		FontBitmapRTTI()
-		{
-			addPlainField("size", 0, &FontBitmapRTTI::getSize, &FontBitmapRTTI::setSize);
-			addPlainField("fontDesc", 1, &FontBitmapRTTI::getFontDesc, &FontBitmapRTTI::setFontDesc);
-			addReflectableArrayField("texturePages", 2, &FontBitmapRTTI::getTexture, &FontBitmapRTTI::getTextureArraySize, &FontBitmapRTTI::setTexture, &FontBitmapRTTI::setTextureArraySize);
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "FontData";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_FontBitmap;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<FontBitmap>();
-		}
-	};
-
-	class BS_CORE_EXPORT FontRTTI : public RTTIType<Font, Resource, FontRTTI>
-	{
-		struct FontInitData
-		{
-			Vector<SPtr<FontBitmap>> fontDataPerSize;
-		};
-
-	private:
-		FontBitmap& getBitmap(Font* obj, UINT32 idx)
-		{
-			if(idx >= obj->mFontDataPerSize.size())
-				BS_EXCEPT(InternalErrorException, "Index out of range: " + toString(idx) + ". Valid range: 0 .. " + toString((int)obj->mFontDataPerSize.size()));
-
-			auto iter = obj->mFontDataPerSize.begin();
-			for(UINT32 i = 0; i < idx; i++, ++iter)
-			{ }
-
-			return *iter->second;
-		}
-
-		void setBitmap(Font* obj, UINT32 idx, FontBitmap& value)
-		{
-			FontInitData* initData = any_cast<FontInitData*>(obj->mRTTIData);
-
-			initData->fontDataPerSize[idx] = bs_shared_ptr_new<FontBitmap>();
-			*initData->fontDataPerSize[idx] = value;
-		}
-
-		UINT32 getNumBitmaps(Font* obj)
-		{
-			return (UINT32)obj->mFontDataPerSize.size();
-		}
-
-		void setNumBitmaps(Font* obj, UINT32 size)
-		{
-			FontInitData* initData = any_cast<FontInitData*>(obj->mRTTIData);
-
-			initData->fontDataPerSize.resize(size);
-		}
-
-	public:
-		FontRTTI()
-		{
-			addReflectableArrayField("mBitmaps", 0, &FontRTTI::getBitmap, &FontRTTI::getNumBitmaps, &FontRTTI::setBitmap, &FontRTTI::setNumBitmaps);
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "Font";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_Font;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return FontManager::instance()._createEmpty();
-		}
-
-	protected:
-		virtual void onDeserializationStarted(IReflectable* obj) override
-		{
-			FontInitData* initData = bs_new<FontInitData>();
-
-			Font* font = static_cast<Font*>(obj);
-			font->mRTTIData = initData;
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj) override
-		{
-			Font* font = static_cast<Font*>(obj);
-			FontInitData* initData = any_cast<FontInitData*>(font->mRTTIData);
-
-			font->initialize(initData->fontDataPerSize);
-
-			bs_delete(initData);
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsFont.h"
+#include "BsFontManager.h"
+#include "BsTexture.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT FontBitmapRTTI : public RTTIType<FontBitmap, IReflectable, FontBitmapRTTI>
+	{
+	private:
+		UINT32& getSize(FontBitmap* obj) { return obj->size; }
+		void setSize(FontBitmap* obj, UINT32& size) { obj->size = size; }
+
+		FONT_DESC& getFontDesc(FontBitmap* obj) { return obj->fontDesc; }
+		void setFontDesc(FontBitmap* obj, FONT_DESC& val) { obj->fontDesc = val; }
+
+		HTexture& getTexture(FontBitmap* obj, UINT32 idx) { return obj->texturePages.at(idx); }
+		void setTexture(FontBitmap* obj, UINT32 idx, HTexture& value) { obj->texturePages[idx] = value; }
+
+		UINT32 getTextureArraySize(FontBitmap* obj) { return (UINT32)obj->texturePages.size(); }
+		void setTextureArraySize(FontBitmap* obj, UINT32 size) { obj->texturePages.resize(size); }
+
+	public:
+		FontBitmapRTTI()
+		{
+			addPlainField("size", 0, &FontBitmapRTTI::getSize, &FontBitmapRTTI::setSize);
+			addPlainField("fontDesc", 1, &FontBitmapRTTI::getFontDesc, &FontBitmapRTTI::setFontDesc);
+			addReflectableArrayField("texturePages", 2, &FontBitmapRTTI::getTexture, &FontBitmapRTTI::getTextureArraySize, &FontBitmapRTTI::setTexture, &FontBitmapRTTI::setTextureArraySize);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "FontData";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_FontBitmap;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<FontBitmap>();
+		}
+	};
+
+	class BS_CORE_EXPORT FontRTTI : public RTTIType<Font, Resource, FontRTTI>
+	{
+		struct FontInitData
+		{
+			Vector<SPtr<FontBitmap>> fontDataPerSize;
+		};
+
+	private:
+		FontBitmap& getBitmap(Font* obj, UINT32 idx)
+		{
+			if(idx >= obj->mFontDataPerSize.size())
+				BS_EXCEPT(InternalErrorException, "Index out of range: " + toString(idx) + ". Valid range: 0 .. " + toString((int)obj->mFontDataPerSize.size()));
+
+			auto iter = obj->mFontDataPerSize.begin();
+			for(UINT32 i = 0; i < idx; i++, ++iter)
+			{ }
+
+			return *iter->second;
+		}
+
+		void setBitmap(Font* obj, UINT32 idx, FontBitmap& value)
+		{
+			FontInitData* initData = any_cast<FontInitData*>(obj->mRTTIData);
+
+			initData->fontDataPerSize[idx] = bs_shared_ptr_new<FontBitmap>();
+			*initData->fontDataPerSize[idx] = value;
+		}
+
+		UINT32 getNumBitmaps(Font* obj)
+		{
+			return (UINT32)obj->mFontDataPerSize.size();
+		}
+
+		void setNumBitmaps(Font* obj, UINT32 size)
+		{
+			FontInitData* initData = any_cast<FontInitData*>(obj->mRTTIData);
+
+			initData->fontDataPerSize.resize(size);
+		}
+
+	public:
+		FontRTTI()
+		{
+			addReflectableArrayField("mBitmaps", 0, &FontRTTI::getBitmap, &FontRTTI::getNumBitmaps, &FontRTTI::setBitmap, &FontRTTI::setNumBitmaps);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "Font";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_Font;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return FontManager::instance()._createEmpty();
+		}
+
+	protected:
+		void onDeserializationStarted(IReflectable* obj) override
+		{
+			FontInitData* initData = bs_new<FontInitData>();
+
+			Font* font = static_cast<Font*>(obj);
+			font->mRTTIData = initData;
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			Font* font = static_cast<Font*>(obj);
+			FontInitData* initData = any_cast<FontInitData*>(font->mRTTIData);
+
+			font->initialize(initData->fontDataPerSize);
+
+			bs_delete(initData);
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 41 - 48
BansheeCore/Include/BsGameObject.h

@@ -5,9 +5,13 @@
 
 namespace BansheeEngine
 {
-	/**
-	 * @brief	Contains instance data that is held by all GameObject handles.
+	/** @addtogroup Scene
+	 *  @{
 	 */
+
+	/** @cond INTERNAL */
+
+	/**	Contains instance data that is held by all GameObject handles. */
 	struct GameObjectInstanceData
 	{
 		GameObjectInstanceData()
@@ -20,9 +24,11 @@ namespace BansheeEngine
 
 	typedef std::shared_ptr<GameObjectInstanceData> GameObjectInstanceDataPtr;
 
+	/** @endcond */
+
 	/**
-	 * @brief	Type of object that can be referenced by a GameObject handle.
-	 *			Each object has an unique ID and is registered with the GameObjectManager.
+	 * Type of object that can be referenced by a GameObject handle. Each object has an unique ID and is registered with 
+	 * the GameObjectManager.
 	 */
 	class BS_CORE_EXPORT GameObject : public IReflectable
 	{
@@ -30,85 +36,64 @@ namespace BansheeEngine
 		GameObject();
 		virtual ~GameObject();
 
-		/**
-		 * @brief	Returns the unique instance ID of the GameObject.
-		 */
+		/**	Returns the unique instance ID of the GameObject. */
 		UINT64 getInstanceId() const { return mInstanceData->mInstanceId; }
 
 		/**
-		 * @brief	Returns an ID that identifies a link between this object and its equivalent
-		 *			in the linked prefab. This will be -1 if the object has no prefab link, or if
-		 *			the object is specific to the instance and has no prefab equivalent.
+		 * Returns an ID that identifies a link between this object and its equivalent in the linked prefab. This will be
+		 * -1 if the object has no prefab link, or if the object is specific to the instance and has no prefab equivalent.
 		 */
 		UINT32 getLinkId() const { return mLinkId; }
 
-		/**
-		 * @brief	Gets the name of the object.
-		 */
+		/**	Gets the name of the object. */
 		const String& getName() const { return mName; }
 
-		/**
-		 * @brief	Sets the name of the object.
-		 */
+		/**	Sets the name of the object. */
 		void setName(const String& name) { mName = name; }
 
+		/** @cond INTERNAL */
+
 		/**
-		 * @brief	Marks the object as destroyed. Generally this means the object
-		 *			has been queued for destruction but it hasn't occurred yet.
-		 *
-		 * @note	Internal method.
+		 * Marks the object as destroyed. Generally this means the object has been queued for destruction but it hasn't 
+		 * occurred yet.
 		 */
 		void _setIsDestroyed() { mIsDestroyed = true; }
 
-		/**
-		 * @brief	Checks if the object has been destroyed.
-		 */
+		/**	Checks if the object has been destroyed. */
 		bool _getIsDestroyed() const { return mIsDestroyed; }
 
-		/**
-		 * @brief	Changes the prefab link ID for this object. See ::getLinkId.
-		 *
-		 * @note	Internal method.
-		 */
+		/** Changes the prefab link ID for this object. See getLinkId(). */
 		void _setLinkId(UINT32 id) { mLinkId = id; }
 
 		/**
-		 * @brief	Replaces the instance data with another objects instance data.
-		 *			This object will basically become the original owner of the provided
-		 *			instance data as far as all game object handles referencing it are concerned.
+		 * Replaces the instance data with another objects instance data. This object will basically become the original 
+		 * owner of the provided instance data as far as all game object handles referencing it are concerned.
 		 *
-		 * @note	Internal method. 
-		 *			No alive objects should ever be sharing the same instance data. This can be used
-		 *			for restoring dead handles.
+		 * @note
+		 * No alive objects should ever be sharing the same instance data. This can be used for restoring dead handles.
 		 */
 		virtual void _setInstanceData(GameObjectInstanceDataPtr& other);
 
-		/**
-		 * @brief	Returns instance data that identifies this GameObject and is used for referencing
-		 *			by game object handles.
-		 *
-		 * @note	Internal method.
-		 */
+		/** Returns instance data that identifies this GameObject and is used for referencing by game object handles. */
 		virtual GameObjectInstanceDataPtr _getInstanceData() const { return mInstanceData; }
 
+		/** @endcond */
+
 	protected:
 		friend class GameObjectHandleBase;
 		friend class GameObjectManager;
 		friend class PrefabDiff;
 		friend class PrefabUtility;
 
-		/**
-		 * @brief	Initializes the GameObject after construction.
-		 */
+		/**	Initializes the GameObject after construction. */
 		void initialize(const std::shared_ptr<GameObject>& object, UINT64 instanceId);
 
 		/**
-		 * @brief	Destroys this object.
+		 * Destroys this object.
 		 *
-		 * @param [in]	handle		Game object handle to this object.
-		 * @param [in]	immediate	If true, the object will be deallocated and become unusable
-		 *							right away. Otherwise the deallocation will be delayed to the end of
-		 *							frame (preferred method).
+		 * @param[in]	handle		Game object handle to this object.
+		 * @param[in]	immediate	If true, the object will be deallocated and become unusable right away. Otherwise the 
+		 *							deallocation will be delayed to the end of frame (preferred method).
 		 */
 		virtual void destroyInternal(GameObjectHandleBase& handle, bool immediate = false) = 0;
 
@@ -131,14 +116,22 @@ namespace BansheeEngine
 		static RTTITypeBase* getRTTIStatic();
 		virtual RTTITypeBase* getRTTI() const override;
 	};
+
+	/** @} */
 }
 
 #include "BsGameObjectHandle.h"
 
 namespace BansheeEngine
 {
+	/** @addtogroup Scene
+	 *  @{
+	 */
+
 	// Game object handles
 	typedef GameObjectHandle<GameObject> HGameObject;
 	typedef GameObjectHandle<SceneObject> HSceneObject;
 	typedef GameObjectHandle<Component> HComponent;
+
+	/** @} */
 }

+ 288 - 295
BansheeCore/Include/BsGameObjectHandle.h

@@ -1,296 +1,289 @@
-#pragma once
-
-namespace BansheeEngine
-{
-	class GameObjectManager;
-
-	template <typename T>
-	class GameObjectHandle;
-
-	/**
-	 * @brief	Internal data shared between GameObject handles.
-	 */
-	struct BS_CORE_EXPORT GameObjectHandleData
-	{
-		GameObjectHandleData()
-			:mPtr(nullptr)
-		{ }
-
-		GameObjectHandleData(const std::shared_ptr<GameObjectInstanceData>& ptr)
-		{
-			mPtr = ptr;
-		}
-
-		std::shared_ptr<GameObjectInstanceData> mPtr;
-	};
-
-	/**
-	 * @brief	A handle that can point to various types of game objects.
-	 * 			It primarily keeps track if the object is still alive, so anything
-	 * 			still referencing it doesn't accidentally use it.
-	 * 			
-	 * @note	This class exists because references between game objects should be quite loose.
-	 * 			For example one game object should be able to reference another one without the other
-	 * 			one knowing. But if that is the case I also need to handle the case when the other
-	 * 			object we're referencing has been deleted, and that is the main purpose of this class.
-	 * 			
-	 */
-	class BS_CORE_EXPORT GameObjectHandleBase : public IReflectable
-	{
-	public:
-		GameObjectHandleBase();
-
-		/**
-		 * @brief	Returns true if the object the handle is pointing to has been destroyed.
-		 *
-		 * @param checkQueued	Game objects can be queued for destruction but not actually destroyed yet, and still accessible. 
-		 *						If this is false this method will return true only if the object is completely inaccessible (fully destroyed).
-		 *						If this is true this method will return true if object is completely inaccessible or if it is just queued for destruction.
-		 */
-		bool isDestroyed(bool checkQueued = false) const 
-		{ return mData->mPtr == nullptr || mData->mPtr->object == nullptr || (checkQueued && mData->mPtr->object->_getIsDestroyed()); }
-
-		/**
-		 * @brief	Returns the instance ID of the object the handle is referencing.
-		 */
-		UINT64 getInstanceId() const { return mData->mPtr != nullptr ? mData->mPtr->mInstanceId : 0; }
-
-		/**
-		 * @brief	Returns pointer to the referenced GameObject.
-		 *
-		 * @note	Throws exception if the GameObject was destroyed.
-		 */
-		GameObject* get() const 
-		{ 
-			throwIfDestroyed();
-
-			return mData->mPtr->object.get(); 
-		}
-
-		/**
-		 * @brief	Returns a smart pointer to the referenced GameObject.
-		 *
-		 * @note	Throws exception if the GameObject was destroyed.
-		 */
-		std::shared_ptr<GameObject> getInternalPtr() const
-		{
-			throwIfDestroyed();
-
-			return mData->mPtr->object;
-		}
-
-		/**
-		 * @brief	Returns pointer to the referenced GameObject.
-		 *
-		 * @note	Throws exception if the GameObject was destroyed.
-		 */
-		GameObject* operator->() const { return get(); }
-
-		/**
-		 * @brief	Returns reference to the referenced GameObject.
-		 *
-		 * @note	Throws exception if the GameObject was destroyed.
-		 */
-		GameObject& operator*() const { return *get(); }
-
-		/**
-		 * @brief	Returns internal handle data.
-		 *
-		 * @note	Internal method.
-		 */
-		std::shared_ptr<GameObjectHandleData> _getHandleData() const { return mData; }
-
-		/**
-		 * @brief	Resolves a handle to a proper GameObject in case it was created uninitialized.
-		 *
-		 * @note	Internal method.
-		 */
-		void _resolve(const GameObjectHandleBase& object);
-
-		/**
-		 * @brief	Changes the GameObject instance the handle is pointing to.
-		 *
-		 * @note	Internal method.
-		 */
-		void _setHandleData(const GameObjectPtr& object);
-
-	protected:
-		friend class GameObjectManager;
-
-		template<class _Ty1, class _Ty2>
-		friend bool operator==(const GameObjectHandle<_Ty1>& _Left, const GameObjectHandle<_Ty2>& _Right);
-
-		GameObjectHandleBase(const std::shared_ptr<GameObject> ptr);
-		GameObjectHandleBase(const std::shared_ptr<GameObjectHandleData>& data);
-		GameObjectHandleBase(std::nullptr_t ptr);
-
-		/**
-		 * @brief	Throws an exception if the referenced GameObject has been destroyed.
-		 */
-		inline void throwIfDestroyed() const;
-		
-		/**
-		 * @brief	Invalidates the handle signifying the referenced object was destroyed.
-		 */
-		void destroy()
-		{
-			// It's important not to clear mData->mPtr as some code might rely
-			// on it. (e.g. for restoring lost handles)
-
-			if (mData->mPtr != nullptr)
-				mData->mPtr->object = nullptr;
-		}
-
-		std::shared_ptr<GameObjectHandleData> mData;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-	public:
-		friend class GameObjectHandleRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const override;
-	};
-
-	/**
-	 * @copydoc	GameObjectHandleBase
-	 *
-	 * @note	It is important this class contains no data since we often 
-	 *			value cast it to its base.
-	 */
-	template <typename T>
-	class GameObjectHandle : public GameObjectHandleBase
-	{
-	public:
-		/**
-		 * @brief	Constructs a new empty handle.
-		 */
-		GameObjectHandle()
-			:GameObjectHandleBase()
-		{	
-			mData = bs_shared_ptr_new<GameObjectHandleData>();
-		}
-
-		/**
-		 * @brief	Copy constructor from another handle of the same type.
-		 */
-		template <typename T1>
-		GameObjectHandle(const GameObjectHandle<T1>& ptr)
-			:GameObjectHandleBase()
-		{ 	
-			mData = ptr._getHandleData();
-		}
-
-		/**
-		 * @brief	Copy constructor from another handle of the base type.
-		 */
-		GameObjectHandle(const GameObjectHandleBase& ptr)
-			:GameObjectHandleBase()
-		{ 	
-			mData = ptr._getHandleData();
-		}
-
-		/**
-		 * @brief	Invalidates the handle.
-		 */
-		inline GameObjectHandle<T>& operator=(std::nullptr_t ptr)
-		{ 	
-			mData = bs_shared_ptr_new<GameObjectHandleData>();
-
-			return *this;
-		}
-
-		/**
-		 * @brief	Casts a specific handle to the base handle.
-		 */
-		inline operator GameObjectHandleBase()
-		{
-			GameObjectHandleBase base(mData);
-
-			return base;
-		}
-
-		/**
-		 * @brief	Returns a pointer to the referenced GameObject.
-		 *
-		 * @note	Throws exception if the GameObject was destroyed.
-		 */
-		T* get() const 
-		{ 
-			throwIfDestroyed();
-
-			return reinterpret_cast<T*>(mData->mPtr->object.get()); 
-		}
-
-		/**
-		 * @brief	Returns a smart pointer to the referenced GameObject.
-		 *
-		 * @note	Throws exception if the GameObject was destroyed.
-		 */
-		std::shared_ptr<T> getInternalPtr() const
-		{
-			throwIfDestroyed();
-
-			return std::static_pointer_cast<T>(mData->mPtr->object);
-		}
-
-		/**
-		 * @brief	Returns pointer to the referenced GameObject.
-		 *
-		 * @note	Throws exception if the GameObject was destroyed.
-		 */
-		T* operator->() const { return get(); }
-
-		/**
-		 * @brief	Returns reference to the referenced GameObject.
-		 *
-		 * @note	Throws exception if the GameObject was destroyed.
-		 */
-		T& operator*() const { return *get(); }
-
-		template<class _Ty>
-		struct Bool_struct
-		{
-			int _Member;
-		};
-
-		/**
-		 * @brief	Allows direct conversion of handle to bool.
-		 *
-		 * @note	This is needed because we can't directly convert to bool
-		 *			since then we can assign pointer to bool and that's weird.
-		 */
-		operator int Bool_struct<T>::*() const
-		{
-			return (((mData->mPtr != nullptr) && (mData->mPtr->object != nullptr)) ? &Bool_struct<T>::_Member : 0);
-		}
-	};
-
-	/**
-	 * @brief	Casts one GameObject handle type to another.
-	 */
-	template<class _Ty1, class _Ty2>
-		GameObjectHandle<_Ty1> static_object_cast(const GameObjectHandle<_Ty2>& other)
-	{	
-		return GameObjectHandle<_Ty1>(other);
-	}
-
-	/**
-	 * @brief	Compares if two handles point to the same GameObject.
-	 */
-	template<class _Ty1, class _Ty2>
-	bool operator==(const GameObjectHandle<_Ty1>& _Left, const GameObjectHandle<_Ty2>& _Right)
-	{	
-		return (_Left.mData == nullptr && _Right.mData == nullptr) || 
-			(_Left.mData != nullptr && _Right.mData != nullptr && _Left.getInstanceId() == _Right.getInstanceId());
-	}
-
-	/**
-	 * @brief	Compares if two handles point to different GameObjects.
-	 */
-	template<class _Ty1, class _Ty2>
-	bool operator!=(const GameObjectHandle<_Ty1>& _Left, const GameObjectHandle<_Ty2>& _Right)
-	{	
-		return (!(_Left == _Right));
-	}
+#pragma once
+
+namespace BansheeEngine
+{
+	/** @addtogroup Implementation
+	 *  @{
+	 */
+
+	class GameObjectManager;
+
+	template <typename T>
+	class GameObjectHandle;
+
+	/** @cond INTERNAL */
+
+	/**	Internal data shared between GameObject handles. */
+	struct BS_CORE_EXPORT GameObjectHandleData
+	{
+		GameObjectHandleData()
+			:mPtr(nullptr)
+		{ }
+
+		GameObjectHandleData(const std::shared_ptr<GameObjectInstanceData>& ptr)
+		{
+			mPtr = ptr;
+		}
+
+		std::shared_ptr<GameObjectInstanceData> mPtr;
+	};
+
+	/** @endcond */
+
+	/**
+	 * A handle that can point to various types of game objects. It primarily keeps track if the object is still alive, 
+	 * so anything still referencing it doesn't accidentally use it.
+	 * 			
+	 * @note	
+	 * This class exists because references between game objects should be quite loose. For example one game object should
+	 * be able to reference another one without the other one knowing. But if that is the case I also need to handle the
+	 * case when the other object we're referencing has been deleted, and that is the main purpose of this class.	
+	 */
+	class BS_CORE_EXPORT GameObjectHandleBase : public IReflectable
+	{
+	public:
+		GameObjectHandleBase();
+
+		/**
+		 * Returns true if the object the handle is pointing to has been destroyed.
+		 *
+		 * @param[in] checkQueued	Game objects can be queued for destruction but not actually destroyed yet, and still
+		 *							accessible. If this is false this method will return true only if the object is 
+		 *							completely inaccessible (fully destroyed). If this is true this method will return true
+		 *							if object is completely inaccessible or if it is just queued for destruction.
+		 */
+		bool isDestroyed(bool checkQueued = false) const
+		{
+			return mData->mPtr == nullptr || mData->mPtr->object == nullptr 
+				|| (checkQueued && mData->mPtr->object->_getIsDestroyed());
+		}
+
+		/**	Returns the instance ID of the object the handle is referencing. */
+		UINT64 getInstanceId() const { return mData->mPtr != nullptr ? mData->mPtr->mInstanceId : 0; }
+
+		/**
+		 * Returns pointer to the referenced GameObject.
+		 *
+		 * @note	Throws exception if the GameObject was destroyed.
+		 */
+		GameObject* get() const 
+		{ 
+			throwIfDestroyed();
+
+			return mData->mPtr->object.get(); 
+		}
+
+		/**
+		 * Returns a smart pointer to the referenced GameObject.
+		 *
+		 * @note	Throws exception if the GameObject was destroyed.
+		 */
+		std::shared_ptr<GameObject> getInternalPtr() const
+		{
+			throwIfDestroyed();
+
+			return mData->mPtr->object;
+		}
+
+		/**
+		 * Returns pointer to the referenced GameObject.
+		 *
+		 * @note	Throws exception if the GameObject was destroyed.
+		 */
+		GameObject* operator->() const { return get(); }
+
+		/**
+		 * Returns reference to the referenced GameObject.
+		 *
+		 * @note	Throws exception if the GameObject was destroyed.
+		 */
+		GameObject& operator*() const { return *get(); }
+
+		/** @cond INTERNAL */
+
+		/** Returns internal handle data. */
+		std::shared_ptr<GameObjectHandleData> _getHandleData() const { return mData; }
+
+		/** Resolves a handle to a proper GameObject in case it was created uninitialized. */
+		void _resolve(const GameObjectHandleBase& object);
+
+		/**	Changes the GameObject instance the handle is pointing to. */
+		void _setHandleData(const GameObjectPtr& object);
+
+		/** @endcond */
+
+	protected:
+		friend class GameObjectManager;
+
+		template<class _Ty1, class _Ty2>
+		friend bool operator==(const GameObjectHandle<_Ty1>& _Left, const GameObjectHandle<_Ty2>& _Right);
+
+		GameObjectHandleBase(const std::shared_ptr<GameObject> ptr);
+		GameObjectHandleBase(const std::shared_ptr<GameObjectHandleData>& data);
+		GameObjectHandleBase(std::nullptr_t ptr);
+
+		/**	Throws an exception if the referenced GameObject has been destroyed. */
+		inline void throwIfDestroyed() const;
+		
+		/**	Invalidates the handle signifying the referenced object was destroyed. */
+		void destroy()
+		{
+			// It's important not to clear mData->mPtr as some code might rely
+			// on it. (e.g. for restoring lost handles)
+
+			if (mData->mPtr != nullptr)
+				mData->mPtr->object = nullptr;
+		}
+
+		std::shared_ptr<GameObjectHandleData> mData;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+	public:
+		friend class GameObjectHandleRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		virtual RTTITypeBase* getRTTI() const override;
+	};
+
+	/** @} */
+
+	/** @addtogroup Scene
+	 *  @{
+	 */
+
+	/**
+	 * @copydoc	GameObjectHandleBase
+	 *
+	 * @note	It is important this class contains no data since we often value cast it to its base.
+	 */
+	template <typename T>
+	class GameObjectHandle : public GameObjectHandleBase
+	{
+	public:
+		/**	Constructs a new empty handle. */
+		GameObjectHandle()
+			:GameObjectHandleBase()
+		{	
+			mData = bs_shared_ptr_new<GameObjectHandleData>();
+		}
+
+		/**	Copy constructor from another handle of the same type. */
+		template <typename T1>
+		GameObjectHandle(const GameObjectHandle<T1>& ptr)
+			:GameObjectHandleBase()
+		{ 	
+			mData = ptr._getHandleData();
+		}
+
+		/**	Copy constructor from another handle of the base type. */
+		GameObjectHandle(const GameObjectHandleBase& ptr)
+			:GameObjectHandleBase()
+		{ 	
+			mData = ptr._getHandleData();
+		}
+
+		/**	Invalidates the handle. */
+		GameObjectHandle<T>& operator=(std::nullptr_t ptr)
+		{ 	
+			mData = bs_shared_ptr_new<GameObjectHandleData>();
+
+			return *this;
+		}
+
+		/**	Casts a specific handle to the base handle. */
+		operator GameObjectHandleBase()
+		{
+			GameObjectHandleBase base(mData);
+
+			return base;
+		}
+
+		/**
+		 * Returns a pointer to the referenced GameObject.
+		 *
+		 * @note	Throws exception if the GameObject was destroyed.
+		 */
+		T* get() const 
+		{ 
+			throwIfDestroyed();
+
+			return reinterpret_cast<T*>(mData->mPtr->object.get()); 
+		}
+
+		/**
+		 * Returns a smart pointer to the referenced GameObject.
+		 *
+		 * @note	Throws exception if the GameObject was destroyed.
+		 */
+		std::shared_ptr<T> getInternalPtr() const
+		{
+			throwIfDestroyed();
+
+			return std::static_pointer_cast<T>(mData->mPtr->object);
+		}
+
+		/**
+		 * Returns pointer to the referenced GameObject.
+		 *
+		 * @note	Throws exception if the GameObject was destroyed.
+		 */
+		T* operator->() const { return get(); }
+
+		/**
+		 * Returns reference to the referenced GameObject.
+		 *
+		 * @note	Throws exception if the GameObject was destroyed.
+		 */
+		T& operator*() const { return *get(); }
+
+		/** @cond INTERNAL */
+
+		template<class _Ty>
+		struct Bool_struct
+		{
+			int _Member;
+		};
+
+		/**
+		 * Allows direct conversion of handle to bool.
+		 *
+		 * @note	
+		 * This is needed because we can't directly convert to bool since then we can assign pointer to bool and that's 
+		 * weird.
+		 */
+		operator int Bool_struct<T>::*() const
+		{
+			return (((mData->mPtr != nullptr) && (mData->mPtr->object != nullptr)) ? &Bool_struct<T>::_Member : 0);
+		}
+
+		/** @endcond */
+	};
+
+	/**	Casts one GameObject handle type to another. */
+	template<class _Ty1, class _Ty2>
+		GameObjectHandle<_Ty1> static_object_cast(const GameObjectHandle<_Ty2>& other)
+	{	
+		return GameObjectHandle<_Ty1>(other);
+	}
+
+	/** @cond INTERNAL */
+
+	/**	Compares if two handles point to the same GameObject. */
+	template<class _Ty1, class _Ty2>
+	bool operator==(const GameObjectHandle<_Ty1>& _Left, const GameObjectHandle<_Ty2>& _Right)
+	{	
+		return (_Left.mData == nullptr && _Right.mData == nullptr) || 
+			(_Left.mData != nullptr && _Right.mData != nullptr && _Left.getInstanceId() == _Right.getInstanceId());
+	}
+
+	/**	Compares if two handles point to different GameObject%s. */
+	template<class _Ty1, class _Ty2>
+	bool operator!=(const GameObjectHandle<_Ty1>& _Left, const GameObjectHandle<_Ty2>& _Right)
+	{	
+		return (!(_Left == _Right));
+	}
+
+	/** @endcond */
+	/** @} */
 }

+ 65 - 57
BansheeCore/Include/BsGameObjectHandleRTTI.h

@@ -1,58 +1,66 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsGameObjectHandle.h"
-#include "BsGameObjectManager.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT GameObjectHandleRTTI : public RTTIType<GameObjectHandleBase, IReflectable, GameObjectHandleRTTI>
-	{
-	private:
-		UINT64& getInstanceId(GameObjectHandleBase* obj)
-		{
-			static UINT64 invalidId = 0;
-
-			if (obj->mData->mPtr != nullptr)
-				return obj->mData->mPtr->mInstanceId;
-
-			return invalidId;
-		}
-
-		void setInstanceId(GameObjectHandleBase* obj, UINT64& value) { obj->mRTTIData = value; } 
-
-	public:
-		GameObjectHandleRTTI()
-		{
-			addPlainField("mInstanceID", 0, &GameObjectHandleRTTI::getInstanceId, &GameObjectHandleRTTI::setInstanceId);
-		}
-
-		void onDeserializationEnded(IReflectable* obj) override
-		{
-			GameObjectHandleBase* gameObjectHandle = static_cast<GameObjectHandleBase*>(obj);
-
-			UINT64 originalInstanceId = any_cast<UINT64>(gameObjectHandle->mRTTIData);
-			GameObjectManager::instance().registerUnresolvedHandle(originalInstanceId, *gameObjectHandle);
-			gameObjectHandle->mRTTIData = nullptr;
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "GameObjectHandleBase";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_GameObjectHandleBase;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			std::shared_ptr<GameObjectHandleBase> obj = bs_shared_ptr<GameObjectHandleBase>(new (bs_alloc<GameObjectHandleBase>()) GameObjectHandleBase());
-
-			return obj;
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsGameObjectHandle.h"
+#include "BsGameObjectManager.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT GameObjectHandleRTTI : public RTTIType<GameObjectHandleBase, IReflectable, GameObjectHandleRTTI>
+	{
+	private:
+		UINT64& getInstanceId(GameObjectHandleBase* obj)
+		{
+			static UINT64 invalidId = 0;
+
+			if (obj->mData->mPtr != nullptr)
+				return obj->mData->mPtr->mInstanceId;
+
+			return invalidId;
+		}
+
+		void setInstanceId(GameObjectHandleBase* obj, UINT64& value) { obj->mRTTIData = value; } 
+
+	public:
+		GameObjectHandleRTTI()
+		{
+			addPlainField("mInstanceID", 0, &GameObjectHandleRTTI::getInstanceId, &GameObjectHandleRTTI::setInstanceId);
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			GameObjectHandleBase* gameObjectHandle = static_cast<GameObjectHandleBase*>(obj);
+
+			UINT64 originalInstanceId = any_cast<UINT64>(gameObjectHandle->mRTTIData);
+			GameObjectManager::instance().registerUnresolvedHandle(originalInstanceId, *gameObjectHandle);
+			gameObjectHandle->mRTTIData = nullptr;
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "GameObjectHandleBase";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_GameObjectHandleBase;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			std::shared_ptr<GameObjectHandleBase> obj = bs_shared_ptr<GameObjectHandleBase>(new (bs_alloc<GameObjectHandleBase>()) GameObjectHandleBase());
+
+			return obj;
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 153 - 173
BansheeCore/Include/BsGameObjectManager.h

@@ -1,174 +1,154 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsModule.h"
-#include "BsGameObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Possible modes to use when deserializing games objects.
-	 */
-	enum GameObjectHandleDeserializationMode
-	{
-		/** All handles will point to old ID that were restored from the deserialized file. */
-		GODM_UseOriginalIds = 0x01, 
-		/** All handles will point to new IDs that were given to the deserialized GameObjects. */
-		GODM_UseNewIds = 0x02,
-		/** Handles pointing to GameObjects outside of the currently deserialized set
-		will attempt to be restored in case those objects are still active. */
-		GODM_RestoreExternal = 0x04,
-		/** Handles pointing to GameObjects outside of the currently deserialized set
-		will be broken. */
-		GODM_BreakExternal = 0x08,
-		/** Handles pointing to GameObjects that cannot be found will not be set to null. */
-		GODM_KeepMissing = 0x10
-	};
-
-	/**
-	 * @brief	Tracks GameObject creation and destructions. Also resolves
-	 *			GameObject references from GameObject handles.
-	 *
-	 * @note	Sim thread only.
-	 */
-	class BS_CORE_EXPORT GameObjectManager : public Module<GameObjectManager>
-	{
-		/**
-		 * @brief	Contains data for an yet unresolved game object handle.
-		 */
-		struct UnresolvedHandle
-		{
-			UINT64 originalInstanceId;
-			GameObjectHandleBase handle;
-		};
-
-	public:
-		GameObjectManager();
-		~GameObjectManager();
-
-		/**
-		 * @brief	Registers a new GameObject and returns the handle to the object.
-		 * 			
-		 * @param	object			Constructed GameObject to wrap in the handle and initialize.
-		 * @param	originalId		If the object is being created due to deserialization you must provide the
-		 * 							original object's ID so that deserialized handles can map to it properly.
-		 * 							
-		 * @returns	Handle to the GameObject.
-		 */
-		GameObjectHandleBase registerObject(const std::shared_ptr<GameObject>& object, UINT64 originalId = 0);
-
-		/**
-		 * @brief	Unregisters a GameObject. Handles to this object will no longer be valid after this call.
-		 * 			This should be called whenever a GameObject is destroyed.
-		 */
-		void unregisterObject(GameObjectHandleBase& object);
-
-		/**
-		 * @brief	Attempts to find a GameObject handle based on the GameObject instance ID.
-		 *			Returns empty handle if ID cannot be found.
-		 */
-		GameObjectHandleBase getObject(UINT64 id) const;
-
-		/**
-		 * @brief	Attempts to find a GameObject handle based on the GameObject instance ID.
-		 *			Returns true if object with the specified ID is found, false otherwise.
-		 */
-		bool tryGetObject(UINT64 id, GameObjectHandleBase& object) const;
-
-		/**
-		 * @brief	Checks if the GameObject with the specified instance ID exists.
-		 */
-		bool objectExists(UINT64 id) const;
-
-		/**
-		 * @brief	Changes the instance ID by which an object can be retrieved by. 
-		 *
-		 * @note	Caller is required to update the object itself with the new ID.
-		 */
-		void remapId(UINT64 oldId, UINT64 newId);
-
-		/**
-		 * @brief	Queues the object to be destroyed at the end of a GameObject update cycle.
-		 */
-		void queueForDestroy(const GameObjectHandleBase& object);
-
-		/**
-		 * @brief	Destroys any GameObjects that were queued for destruction.
-		 */
-		void destroyQueuedObjects();
-
-		/**
-		 * @brief	Triggered when a game object is being destroyed.
-		 */
-		Event<void(const HGameObject&)> onDestroyed;
-
-		/************************************************************************/
-		/* 							DESERIALIZATION                      		*/
-		/************************************************************************/
-		// Note: GameObjects need a bit of special handling when it comes to deserialization,
-		// which is what this part of the code is used for. It performs two main actions:
-		//  - 1. Resolves all GameObjectHandles on deserialization
-		//    - We can't just resolve them as we go because during deserialization not all objects
-		//      have necessarily been created.
-		//  - 2. Maps serialized IDs to actual in-engine IDs. 
-
-		/**
-		 * @brief	Needs to be called whenever GameObject deserialization starts. Must be followed
-		 * 			by endDeserialization call.
-		 */
-		void startDeserialization();
-
-		/**
-		 * @brief	Needs to be called whenever GameObject deserialization ends. Must be preceded
-		 * 			by startDeserialization call.
-		 */
-		void endDeserialization();
-
-		/**
-		 * @brief	Returns true if GameObject deserialization is currently in progress.
-		 */
-		bool isGameObjectDeserializationActive() const { return mIsDeserializationActive; }
-
-		/**
-		 * @brief	Queues the specified handle and resolves it when deserialization ends.
-		 */
-		void registerUnresolvedHandle(UINT64 originalId, GameObjectHandleBase& object);
-
-		/**
-		 * @brief	Registers a callback that will be triggered when GameObject serialization ends.
-		 */
-		void registerOnDeserializationEndCallback(std::function<void()> callback);
-
-		/**
-		 * @brief	Changes the deserialization mode for any following GameObject handle.
-		 *
-		 * @param	gameObjectDeserializationMode		Mode that controls how are GameObjects handles resolved when being deserialized.
-		 */
-		void setDeserializationMode(UINT32 gameObjectDeserializationMode);
-
-		/**
-		 * @brief	Attempts to update the ID of the provided handle by mapping its old ID to
-		 *			the newly deserialized object and its new ID. Game object deserialization
-		 *			must be active.
-		 */
-		void resolveDeserializedHandle(UnresolvedHandle& data, UINT32 flags);
-
-		/**
-		 * @brief	Gets the currently active flags that control how are game object handles deserialized.
-		 */
-		UINT32 getDeserializationFlags() const { return mGODeserializationMode; }
-
-	private:
-		UINT64 mNextAvailableID; // 0 is not a valid ID
-		Map<UINT64, GameObjectHandleBase> mObjects;
-		Map<UINT64, GameObjectHandleBase> mQueuedForDestroy;
-
-		GameObject* mActiveDeserializedObject;
-		bool mIsDeserializationActive;
-		Map<UINT64, UINT64> mIdMapping;
-		Map<UINT64, SPtr<GameObjectHandleData>> mUnresolvedHandleData;
-		Vector<UnresolvedHandle> mUnresolvedHandles;
-		Vector<std::function<void()>> mEndCallbacks;
-		UINT32 mGODeserializationMode;
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsModule.h"
+#include "BsGameObject.h"
+
+namespace BansheeEngine
+{
+	/** @cond INTERNAL */
+	/** @addtogroup Scene
+	 *  @{
+	 */
+
+	/**	Possible modes to use when deserializing games objects. */
+	enum GameObjectHandleDeserializationMode
+	{
+		/** All handles will point to old ID that were restored from the deserialized file. */
+		GODM_UseOriginalIds = 0x01, 
+		/** All handles will point to new IDs that were given to the deserialized GameObjects. */
+		GODM_UseNewIds = 0x02,
+		/** Handles pointing to GameObjects outside of the currently deserialized set
+		will attempt to be restored in case those objects are still active. */
+		GODM_RestoreExternal = 0x04,
+		/** Handles pointing to GameObjects outside of the currently deserialized set
+		will be broken. */
+		GODM_BreakExternal = 0x08,
+		/** Handles pointing to GameObjects that cannot be found will not be set to null. */
+		GODM_KeepMissing = 0x10
+	};
+
+	/**
+	 * Tracks GameObject creation and destructions. Also resolves GameObject references from GameObject handles.
+	 *
+	 * @note	Sim thread only.
+	 */
+	class BS_CORE_EXPORT GameObjectManager : public Module<GameObjectManager>
+	{
+		/**	Contains data for an yet unresolved game object handle. */
+		struct UnresolvedHandle
+		{
+			UINT64 originalInstanceId;
+			GameObjectHandleBase handle;
+		};
+
+	public:
+		GameObjectManager();
+		~GameObjectManager();
+
+		/**
+		 * Registers a new GameObject and returns the handle to the object.
+		 * 			
+		 * @param[in]	object			Constructed GameObject to wrap in the handle and initialize.
+		 * @param[in]	originalId		If the object is being created due to deserialization you must provide the original
+		 *								object's ID so that deserialized handles can map to it properly.
+		 * @return						Handle to the GameObject.
+		 */
+		GameObjectHandleBase registerObject(const std::shared_ptr<GameObject>& object, UINT64 originalId = 0);
+
+		/**
+		 * Unregisters a GameObject. Handles to this object will no longer be valid after this call. This should be called
+		 * whenever a GameObject is destroyed.
+		 */
+		void unregisterObject(GameObjectHandleBase& object);
+
+		/**
+		 * Attempts to find a GameObject handle based on the GameObject instance ID. Returns empty handle if ID cannot be 
+		 * found.
+		 */
+		GameObjectHandleBase getObject(UINT64 id) const;
+
+		/**
+		 * Attempts to find a GameObject handle based on the GameObject instance ID. Returns true if object with the 
+		 * specified ID is found, false otherwise.
+		 */
+		bool tryGetObject(UINT64 id, GameObjectHandleBase& object) const;
+
+		/**	Checks if the GameObject with the specified instance ID exists. */
+		bool objectExists(UINT64 id) const;
+
+		/**
+		 * Changes the instance ID by which an object can be retrieved by. 
+		 *
+		 * @note	Caller is required to update the object itself with the new ID.
+		 */
+		void remapId(UINT64 oldId, UINT64 newId);
+
+		/**	Queues the object to be destroyed at the end of a GameObject update cycle. */
+		void queueForDestroy(const GameObjectHandleBase& object);
+
+		/**	Destroys any GameObjects that were queued for destruction. */
+		void destroyQueuedObjects();
+
+		/**	Triggered when a game object is being destroyed. */
+		Event<void(const HGameObject&)> onDestroyed;
+
+		/************************************************************************/
+		/* 							DESERIALIZATION                      		*/
+		/************************************************************************/
+		// Note: GameObjects need a bit of special handling when it comes to deserialization,
+		// which is what this part of the code is used for. It performs two main actions:
+		//  - 1. Resolves all GameObjectHandles on deserialization
+		//    - We can't just resolve them as we go because during deserialization not all objects
+		//      have necessarily been created.
+		//  - 2. Maps serialized IDs to actual in-engine IDs. 
+
+		/** Needs to be called whenever GameObject deserialization starts. Must be followed by endDeserialization() call. */
+		void startDeserialization();
+
+		/** Needs to be called whenever GameObject deserialization ends. Must be preceded by startDeserialization() call. */
+		void endDeserialization();
+
+		/**	Returns true if GameObject deserialization is currently in progress. */
+		bool isGameObjectDeserializationActive() const { return mIsDeserializationActive; }
+
+		/**	Queues the specified handle and resolves it when deserialization ends. */
+		void registerUnresolvedHandle(UINT64 originalId, GameObjectHandleBase& object);
+
+		/**	Registers a callback that will be triggered when GameObject serialization ends. */
+		void registerOnDeserializationEndCallback(std::function<void()> callback);
+
+		/**
+		 * Changes the deserialization mode for any following GameObject handle.
+		 *
+		 * @param[in]	gameObjectDeserializationMode	Mode that controls how are GameObjects handles resolved when being
+		 *												deserialized.
+		 */
+		void setDeserializationMode(UINT32 gameObjectDeserializationMode);
+
+		/**
+		 * Attempts to update the ID of the provided handle by mapping its old ID to the newly deserialized object and its
+		 * new ID. Game object deserialization must be active.
+		 */
+		void resolveDeserializedHandle(UnresolvedHandle& data, UINT32 flags);
+
+		/**	Gets the currently active flags that control how are game object handles deserialized. */
+		UINT32 getDeserializationFlags() const { return mGODeserializationMode; }
+
+	private:
+		UINT64 mNextAvailableID; // 0 is not a valid ID
+		Map<UINT64, GameObjectHandleBase> mObjects;
+		Map<UINT64, GameObjectHandleBase> mQueuedForDestroy;
+
+		GameObject* mActiveDeserializedObject;
+		bool mIsDeserializationActive;
+		Map<UINT64, UINT64> mIdMapping;
+		Map<UINT64, SPtr<GameObjectHandleData>> mUnresolvedHandleData;
+		Vector<UnresolvedHandle> mUnresolvedHandles;
+		Vector<std::function<void()>> mEndCallbacks;
+		UINT32 mGODeserializationMode;
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 95 - 89
BansheeCore/Include/BsGameObjectRTTI.h

@@ -1,90 +1,96 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsGameObject.h"
-#include "BsSceneObject.h"
-#include "BsGameObjectManager.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Provides temporary storage for data used during GameObject deserialization.
-	 */
-	struct GODeserializationData
-	{
-		GODeserializationData()
-			:isDeserializationParent(false), originalId(0)
-		{ }
-
-		GameObjectPtr ptr;
-		bool isDeserializationParent;
-		UINT64 originalId;
-		Any moreData;
-	};
-
-	class BS_CORE_EXPORT GameObjectRTTI : public RTTIType<GameObject, IReflectable, GameObjectRTTI>
-	{
-	private:
-		String& getName(GameObject* obj) { return obj->mName; }
-		void setName(GameObject* obj, String& name) { obj->mName = name; }
-
-		UINT64& getInstanceID(GameObject* obj) { return obj->mInstanceData->mInstanceId; }
-		void setInstanceID(GameObject* obj, UINT64& instanceId) 
-		{  
-			// We record the ID for later use. Any child RTTI of GameObject must call GameObjectManager::registerObject
-			// with this ID, so we know how to map deserialized GO handles to live objects, otherwise the handle
-			// references will get broken.
-			GameObject* go = static_cast<GameObject*>(obj);
-			GODeserializationData& deserializationData = any_cast_ref<GODeserializationData>(go->mRTTIData);
-
-			deserializationData.originalId = instanceId;
-		}
-
-		UINT32& getLinkId(GameObject* obj) { return obj->mLinkId; }
-		void setLinkId(GameObject* obj, UINT32& linkId) { obj->mLinkId = linkId; }
-
-	public:
-		/**
-		 * @brief	Helper method used for creating Component objects used during deserialization.
-		 */
-		template <typename T>
-		static std::shared_ptr<T> createGameObject()
-		{
-			SPtr<T> component = SceneObject::createEmptyComponent<T>();
-
-			// Every GameObject must store GODeserializationData in its RTTI data field during deserialization
-			component->mRTTIData = GODeserializationData();
-			GODeserializationData& deserializationData = any_cast_ref<GODeserializationData>(component->mRTTIData);
-
-			// Store shared pointer since the system only provides us with raw ones
-			deserializationData.ptr = component;
-
-			return component;
-		}
-
-	public:
-		GameObjectRTTI()
-		{
-			addPlainField("mInstanceID", 0, &GameObjectRTTI::getInstanceID, &GameObjectRTTI::setInstanceID);
-			addPlainField("mName", 1, &GameObjectRTTI::getName, &GameObjectRTTI::setName);
-			addPlainField("mLinkId", 2, &GameObjectRTTI::getLinkId, &GameObjectRTTI::setLinkId);
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "GameObject";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_GameObject;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsGameObject.h"
+#include "BsSceneObject.h"
+#include "BsGameObjectManager.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	/**	Provides temporary storage for data used during GameObject deserialization. */
+	struct GODeserializationData
+	{
+		GODeserializationData()
+			:isDeserializationParent(false), originalId(0)
+		{ }
+
+		GameObjectPtr ptr;
+		bool isDeserializationParent;
+		UINT64 originalId;
+		Any moreData;
+	};
+
+	class BS_CORE_EXPORT GameObjectRTTI : public RTTIType<GameObject, IReflectable, GameObjectRTTI>
+	{
+	private:
+		String& getName(GameObject* obj) { return obj->mName; }
+		void setName(GameObject* obj, String& name) { obj->mName = name; }
+
+		UINT64& getInstanceID(GameObject* obj) { return obj->mInstanceData->mInstanceId; }
+		void setInstanceID(GameObject* obj, UINT64& instanceId) 
+		{  
+			// We record the ID for later use. Any child RTTI of GameObject must call GameObjectManager::registerObject
+			// with this ID, so we know how to map deserialized GO handles to live objects, otherwise the handle
+			// references will get broken.
+			GameObject* go = static_cast<GameObject*>(obj);
+			GODeserializationData& deserializationData = any_cast_ref<GODeserializationData>(go->mRTTIData);
+
+			deserializationData.originalId = instanceId;
+		}
+
+		UINT32& getLinkId(GameObject* obj) { return obj->mLinkId; }
+		void setLinkId(GameObject* obj, UINT32& linkId) { obj->mLinkId = linkId; }
+
+	public:
+		/**
+		 * @brief	Helper method used for creating Component objects used during deserialization.
+		 */
+		template <typename T>
+		static std::shared_ptr<T> createGameObject()
+		{
+			SPtr<T> component = SceneObject::createEmptyComponent<T>();
+
+			// Every GameObject must store GODeserializationData in its RTTI data field during deserialization
+			component->mRTTIData = GODeserializationData();
+			GODeserializationData& deserializationData = any_cast_ref<GODeserializationData>(component->mRTTIData);
+
+			// Store shared pointer since the system only provides us with raw ones
+			deserializationData.ptr = component;
+
+			return component;
+		}
+
+	public:
+		GameObjectRTTI()
+		{
+			addPlainField("mInstanceID", 0, &GameObjectRTTI::getInstanceID, &GameObjectRTTI::setInstanceID);
+			addPlainField("mName", 1, &GameObjectRTTI::getName, &GameObjectRTTI::setName);
+			addPlainField("mLinkId", 2, &GameObjectRTTI::getLinkId, &GameObjectRTTI::setLinkId);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "GameObject";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_GameObject;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 70 - 62
BansheeCore/Include/BsGpuProgramRTTI.h

@@ -1,63 +1,71 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsGpuProgram.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT GpuProgramRTTI : public RTTIType<GpuProgram, IReflectable, GpuProgramRTTI>
-	{
-	private:
-		GpuProgramType& getType(GpuProgram* obj) { return obj->mProperties.mType; }
-		void setType(GpuProgram* obj, GpuProgramType& val) { obj->mProperties.mType = val; }
-
-		bool& getNeedsAjdInfo(GpuProgram* obj) { return obj->mNeedsAdjacencyInfo; }
-		void setNeedsAjdInfo(GpuProgram* obj, bool& val) { obj->mNeedsAdjacencyInfo = val; }
-
-		String& getEntryPoint(GpuProgram* obj) { return obj->mProperties.mEntryPoint; }
-		void setEntryPoint(GpuProgram* obj, String& val) { obj->mProperties.mEntryPoint = val; }
-
-		GpuProgramProfile& getProfile(GpuProgram* obj) { return obj->mProperties.mProfile; }
-		void setProfile(GpuProgram* obj, GpuProgramProfile& val) { obj->mProperties.mProfile = val; }
-
-		String& getSource(GpuProgram* obj) { return obj->mProperties.mSource; }
-		void setSource(GpuProgram* obj, String& val) { obj->mProperties.mSource = val; }
-
-		String& getLanguage(GpuProgram* obj) { return obj->mLanguage; }
-		void setLanguage(GpuProgram* obj, String& val) { obj->mLanguage = val; }
-
-	public:
-		GpuProgramRTTI()
-		{
-			addPlainField("mType", 2, &GpuProgramRTTI::getType, &GpuProgramRTTI::setType);
-			addPlainField("mNeedsAdjacencyInfo", 3, &GpuProgramRTTI::getNeedsAjdInfo, &GpuProgramRTTI::setNeedsAjdInfo);
-			addPlainField("mEntryPoint", 4, &GpuProgramRTTI::getEntryPoint, &GpuProgramRTTI::setEntryPoint);
-			addPlainField("mProfile", 5, &GpuProgramRTTI::getProfile, &GpuProgramRTTI::setProfile);
-			addPlainField("mSource", 6, &GpuProgramRTTI::getSource, &GpuProgramRTTI::setSource);
-			addPlainField("mLanguage", 7, &GpuProgramRTTI::getLanguage, &GpuProgramRTTI::setLanguage);
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj)
-		{
-			GpuProgram* gpuProgram = static_cast<GpuProgram*>(obj);
-			gpuProgram->initialize();
-		}
-
-		virtual const String& getRTTIName()
-		{
-			static String name = "GpuProgram";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId()
-		{
-			return TID_GpuProgram;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject()
-		{
-			return GpuProgramManager::instance().createEmpty("", GPT_VERTEX_PROGRAM); // Params don't matter, they'll get overwritten
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsGpuProgram.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT GpuProgramRTTI : public RTTIType<GpuProgram, IReflectable, GpuProgramRTTI>
+	{
+	private:
+		GpuProgramType& getType(GpuProgram* obj) { return obj->mProperties.mType; }
+		void setType(GpuProgram* obj, GpuProgramType& val) { obj->mProperties.mType = val; }
+
+		bool& getNeedsAjdInfo(GpuProgram* obj) { return obj->mNeedsAdjacencyInfo; }
+		void setNeedsAjdInfo(GpuProgram* obj, bool& val) { obj->mNeedsAdjacencyInfo = val; }
+
+		String& getEntryPoint(GpuProgram* obj) { return obj->mProperties.mEntryPoint; }
+		void setEntryPoint(GpuProgram* obj, String& val) { obj->mProperties.mEntryPoint = val; }
+
+		GpuProgramProfile& getProfile(GpuProgram* obj) { return obj->mProperties.mProfile; }
+		void setProfile(GpuProgram* obj, GpuProgramProfile& val) { obj->mProperties.mProfile = val; }
+
+		String& getSource(GpuProgram* obj) { return obj->mProperties.mSource; }
+		void setSource(GpuProgram* obj, String& val) { obj->mProperties.mSource = val; }
+
+		String& getLanguage(GpuProgram* obj) { return obj->mLanguage; }
+		void setLanguage(GpuProgram* obj, String& val) { obj->mLanguage = val; }
+
+	public:
+		GpuProgramRTTI()
+		{
+			addPlainField("mType", 2, &GpuProgramRTTI::getType, &GpuProgramRTTI::setType);
+			addPlainField("mNeedsAdjacencyInfo", 3, &GpuProgramRTTI::getNeedsAjdInfo, &GpuProgramRTTI::setNeedsAjdInfo);
+			addPlainField("mEntryPoint", 4, &GpuProgramRTTI::getEntryPoint, &GpuProgramRTTI::setEntryPoint);
+			addPlainField("mProfile", 5, &GpuProgramRTTI::getProfile, &GpuProgramRTTI::setProfile);
+			addPlainField("mSource", 6, &GpuProgramRTTI::getSource, &GpuProgramRTTI::setSource);
+			addPlainField("mLanguage", 7, &GpuProgramRTTI::getLanguage, &GpuProgramRTTI::setLanguage);
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			GpuProgram* gpuProgram = static_cast<GpuProgram*>(obj);
+			gpuProgram->initialize();
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "GpuProgram";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_GpuProgram;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return GpuProgramManager::instance().createEmpty("", GPT_VERTEX_PROGRAM); // Params don't matter, they'll get overwritten
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 38 - 32
BansheeCore/Include/BsGpuResourceDataRTTI.h

@@ -1,33 +1,39 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsGpuResourceData.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT GpuResourceDataRTTI : public RTTIType<GpuResourceData, IReflectable, GpuResourceDataRTTI>
-	{
-	public:
-		GpuResourceDataRTTI()
-		{
-
-		}
-
-		virtual const String& getRTTIName()
-		{
-			static String name = "GpuResourceData";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId()
-		{
-			return TID_GpuResourceData;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject()
-		{
-			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsGpuResourceData.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT GpuResourceDataRTTI : public RTTIType<GpuResourceData, IReflectable, GpuResourceDataRTTI>
+	{
+	public:
+		GpuResourceDataRTTI()
+		{ }
+
+		const String& getRTTIName() override
+		{
+			static String name = "GpuResourceData";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_GpuResourceData;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 38 - 32
BansheeCore/Include/BsIconUtility.h

@@ -1,33 +1,39 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Manipulates icons in executable files.
-	 */
-	class BS_CORE_EXPORT IconUtility
-	{
-	public:
-		/**
-		 * @brief	Updates icons in the provided executable. Only icons that already exist in the executable can be
-		 * 			updated, no new icons can be inserted. Icons must be square.
-		 *
-		 * @param	filePath	Path to the executable.
-		 * @param	icons   	Pixels of images to replace. Each entry maps an icon width (and height, since 
-		 * 						they're square) to its pixels.
-		 */
-		static void updateIconExe(const Path& filePath, const Map<UINT32, PixelDataPtr>& icons);
-
-	private:
-		/**
-		 * @brief	Updates data of an existing icon with new pixels.
-		 *
-		 * @param 	iconData	Existing icon bytes, in Windows ICO format.
-		 * @param	icons		Pixels of images to replace. Each entry maps an icon width (and height, since 
-		 * 						they're square) to its pixels.
-		 */
-		static void updateIconData(UINT8* iconData, const Map<UINT32, PixelDataPtr>& icons);
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+
+namespace BansheeEngine
+{
+	/** @cond INTERNAL */
+	/** @addtogroup Utility-Core
+	 *  @{
+	 */
+
+	/**	Manipulates icons in executable files. */
+	class BS_CORE_EXPORT IconUtility
+	{
+	public:
+		/**
+		 * Updates icons in the provided executable. Only icons that already exist in the executable can be updated, no new
+		 * icons can be inserted. Icons must be square.
+		 *
+		 * @param[in]	filePath	Path to the executable.
+		 * @param[in]	icons   	Pixels of images to replace. Each entry maps an icon width (and height, since they're 
+		 *							square) to its pixels.
+		 */
+		static void updateIconExe(const Path& filePath, const Map<UINT32, PixelDataPtr>& icons);
+
+	private:
+		/**
+		 * Updates data of an existing icon with new pixels.
+		 *
+		 * @param[in] 	iconData	Existing icon bytes, in Windows ICO format.
+		 * @param[in]	icons		Pixels of images to replace. Each entry maps an icon width (and height, since they're
+		 *							square) to its pixels.
+		 */
+		static void updateIconData(UINT8* iconData, const Map<UINT32, PixelDataPtr>& icons);
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 38 - 31
BansheeCore/Include/BsImportOptionsRTTI.h

@@ -1,32 +1,39 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsImportOptions.h"
-#include "BsRTTIType.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT ImportOptionsRTTI : public RTTIType<ImportOptions, IReflectable, ImportOptionsRTTI>
-	{
-	public:
-		ImportOptionsRTTI()
-		{
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "ImportOptions";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_ImportOptions;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<ImportOptions>();
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsImportOptions.h"
+#include "BsRTTIType.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT ImportOptionsRTTI : public RTTIType<ImportOptions, IReflectable, ImportOptionsRTTI>
+	{
+	public:
+		ImportOptionsRTTI()
+		{ }
+
+		const String& getRTTIName() override
+		{
+			static String name = "ImportOptions";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_ImportOptions;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<ImportOptions>();
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 8 - 0
BansheeCore/Include/BsMaterialParamsRTTI.h

@@ -7,6 +7,11 @@
 
 namespace BansheeEngine
 {
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
 	class BS_CORE_EXPORT TextureParamDataRTTI : public RTTIType<MaterialParams::TextureParamData, IReflectable, TextureParamDataRTTI>
 	{
 	public:
@@ -262,4 +267,7 @@ namespace BansheeEngine
 			return (UINT32)dataSize;
 		}	
 	}; 
+
+	/** @} */
+	/** @endcond */
 }

+ 16 - 22
BansheeCore/Include/BsMaterialRTTI.h

@@ -6,28 +6,19 @@
 
 namespace BansheeEngine
 {
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
 	class BS_CORE_EXPORT MaterialRTTI : public RTTIType<Material, Resource, MaterialRTTI>
 	{
 	private:
-		HShader& getShader(Material* obj)
-		{
-			return obj->mShader;
-		}
-
-		void setShader(Material* obj, HShader& val)
-		{
-			obj->mShader = val;
-		}
+		HShader& getShader(Material* obj) { return obj->mShader; }
+		void setShader(Material* obj, HShader& val) { obj->mShader = val; }
 
-		std::shared_ptr<MaterialParams> getMaterialParams(Material* obj)
-		{
-			return obj->mCachedParams;
-		}
-
-		void setMaterialParams(Material* obj, std::shared_ptr<MaterialParams> value)
-		{
-			obj->mRTTIData = value;
-		}
+		std::shared_ptr<MaterialParams> getMaterialParams(Material* obj) { return obj->mCachedParams; }
+		void setMaterialParams(Material* obj, std::shared_ptr<MaterialParams> value) { obj->mRTTIData = value; }
 
 	public:
 		MaterialRTTI()
@@ -36,19 +27,22 @@ namespace BansheeEngine
 			addReflectablePtrField("mMaterialParams", 2, &MaterialRTTI::getMaterialParams, &MaterialRTTI::setMaterialParams);
 		}
 
-		virtual void onDeserializationEnded(IReflectable* obj) override;
+		void onDeserializationEnded(IReflectable* obj) override;
 
-		virtual const String& getRTTIName() override
+		const String& getRTTIName() override
 		{
 			static String name = "Material";
 			return name;
 		}
 
-		virtual UINT32 getRTTIId() override
+		UINT32 getRTTIId() override
 		{
 			return TID_Material;
 		}
 
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override;
+		std::shared_ptr<IReflectable> newRTTIObject() override;
 	};
+
+	/** @} */
+	/** @endcond */
 }

+ 59 - 51
BansheeCore/Include/BsMeshBaseRTTI.h

@@ -1,52 +1,60 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsCoreApplication.h"
-#include "BsMeshBase.h"
-#include "BsException.h"
-
-namespace BansheeEngine
-{
-	BS_ALLOW_MEMCPY_SERIALIZATION(SubMesh);
-
-	class MeshBaseRTTI : public RTTIType<MeshBase, Resource, MeshBaseRTTI>
-	{
-		SubMesh& getSubMesh(MeshBase* obj, UINT32 arrayIdx) { return obj->mProperties.mSubMeshes[arrayIdx]; }
-		void setSubMesh(MeshBase* obj, UINT32 arrayIdx, SubMesh& value) { obj->mProperties.mSubMeshes[arrayIdx] = value; }
-		UINT32 getNumSubmeshes(MeshBase* obj) { return (UINT32)obj->mProperties.mSubMeshes.size(); }
-		void setNumSubmeshes(MeshBase* obj, UINT32 numElements) { obj->mProperties.mSubMeshes.resize(numElements); }
-
-		UINT32& getNumVertices(MeshBase* obj) { return obj->mProperties.mNumVertices; }
-		void setNumVertices(MeshBase* obj, UINT32& value) { obj->mProperties.mNumVertices = value; }
-
-		UINT32& getNumIndices(MeshBase* obj) { return obj->mProperties.mNumIndices; }
-		void setNumIndices(MeshBase* obj, UINT32& value) { obj->mProperties.mNumIndices = value; }
-
-	public:
-		MeshBaseRTTI()
-		{
-			addPlainField("mNumVertices", 0, &MeshBaseRTTI::getNumVertices, &MeshBaseRTTI::setNumVertices);
-			addPlainField("mNumIndices", 1, &MeshBaseRTTI::getNumIndices, &MeshBaseRTTI::setNumIndices);
-
-			addPlainArrayField("mSubMeshes", 2, &MeshBaseRTTI::getSubMesh, 
-				&MeshBaseRTTI::getNumSubmeshes, &MeshBaseRTTI::setSubMesh, &MeshBaseRTTI::setNumSubmeshes);
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() 
-		{
-			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
-		}
-
-		virtual const String& getRTTIName() 
-		{
-			static String name = "MeshBase";
-			throw name;
-		}
-
-		virtual UINT32 getRTTIId() 
-		{
-			return TID_MeshBase;
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsCoreApplication.h"
+#include "BsMeshBase.h"
+#include "BsException.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	BS_ALLOW_MEMCPY_SERIALIZATION(SubMesh);
+
+	class MeshBaseRTTI : public RTTIType<MeshBase, Resource, MeshBaseRTTI>
+	{
+		SubMesh& getSubMesh(MeshBase* obj, UINT32 arrayIdx) { return obj->mProperties.mSubMeshes[arrayIdx]; }
+		void setSubMesh(MeshBase* obj, UINT32 arrayIdx, SubMesh& value) { obj->mProperties.mSubMeshes[arrayIdx] = value; }
+		UINT32 getNumSubmeshes(MeshBase* obj) { return (UINT32)obj->mProperties.mSubMeshes.size(); }
+		void setNumSubmeshes(MeshBase* obj, UINT32 numElements) { obj->mProperties.mSubMeshes.resize(numElements); }
+
+		UINT32& getNumVertices(MeshBase* obj) { return obj->mProperties.mNumVertices; }
+		void setNumVertices(MeshBase* obj, UINT32& value) { obj->mProperties.mNumVertices = value; }
+
+		UINT32& getNumIndices(MeshBase* obj) { return obj->mProperties.mNumIndices; }
+		void setNumIndices(MeshBase* obj, UINT32& value) { obj->mProperties.mNumIndices = value; }
+
+	public:
+		MeshBaseRTTI()
+		{
+			addPlainField("mNumVertices", 0, &MeshBaseRTTI::getNumVertices, &MeshBaseRTTI::setNumVertices);
+			addPlainField("mNumIndices", 1, &MeshBaseRTTI::getNumIndices, &MeshBaseRTTI::setNumIndices);
+
+			addPlainArrayField("mSubMeshes", 2, &MeshBaseRTTI::getSubMesh, 
+				&MeshBaseRTTI::getNumSubmeshes, &MeshBaseRTTI::setSubMesh, &MeshBaseRTTI::setNumSubmeshes);
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "MeshBase";
+			throw name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_MeshBase;
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 82 - 74
BansheeCore/Include/BsMeshDataRTTI.h

@@ -1,75 +1,83 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsMeshData.h"
-#include "BsManagedDataBlock.h"
-#include "BsVertexDeclaration.h"
-
-namespace BansheeEngine
-{
-	BS_ALLOW_MEMCPY_SERIALIZATION(IndexType);
-
-	class BS_CORE_EXPORT MeshDataRTTI : public RTTIType<MeshData, GpuResourceData, MeshDataRTTI>
-	{
-	private:
-		VertexDataDescPtr getVertexData(MeshData* obj) { return obj->mVertexData; }
-		void setVertexData(MeshData* obj, VertexDataDescPtr value) { obj->mVertexData = value; }
-
-		IndexType& getIndexType(MeshData* obj) { return obj->mIndexType; }
-		void setIndexType(MeshData* obj, IndexType& value) { obj->mIndexType = value; }
-
-		UINT32& getNumVertices(MeshData* obj) { return obj->mNumVertices; }
-		void setNumVertices(MeshData* obj, UINT32& value) { obj->mNumVertices = value; }
-
-		UINT32& getNumIndices(MeshData* obj) { return obj->mNumIndices; }
-		void setNumIndices(MeshData* obj, UINT32& value) { obj->mNumIndices = value; }
-
-		ManagedDataBlock getData(MeshData* obj) 
-		{ 
-			ManagedDataBlock dataBlock((UINT8*)obj->getData(), obj->getInternalBufferSize());
-			return dataBlock; 
-		}
-
-		void setData(MeshData* obj, ManagedDataBlock val) 
-		{ 
-			// Nothing to do here, the pointer we provided already belongs to PixelData
-			// so the data is already written
-		}
-
-		static UINT8* allocateData(MeshData* obj, UINT32 numBytes)
-		{
-			obj->allocateInternalBuffer(numBytes);
-
-			return obj->getData();
-		}
-
-	public:
-		MeshDataRTTI()
-		{
-			addReflectablePtrField("mVertexData", 0, &MeshDataRTTI::getVertexData, &MeshDataRTTI::setVertexData);
-
-			addPlainField("mIndexType", 1, &MeshDataRTTI::getIndexType, &MeshDataRTTI::setIndexType);
-			addPlainField("mNumVertices", 2, &MeshDataRTTI::getNumVertices, &MeshDataRTTI::setNumVertices);
-			addPlainField("mNumIndices", 3, &MeshDataRTTI::getNumIndices, &MeshDataRTTI::setNumIndices);
-
-			addDataBlockField("data", 4, &MeshDataRTTI::getData, &MeshDataRTTI::setData, 0, &MeshDataRTTI::allocateData);
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr<MeshData>(new (bs_alloc<MeshData>()) MeshData());
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "MeshData";
-			throw name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_MeshData;
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsMeshData.h"
+#include "BsManagedDataBlock.h"
+#include "BsVertexDeclaration.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	BS_ALLOW_MEMCPY_SERIALIZATION(IndexType);
+
+	class BS_CORE_EXPORT MeshDataRTTI : public RTTIType<MeshData, GpuResourceData, MeshDataRTTI>
+	{
+	private:
+		VertexDataDescPtr getVertexData(MeshData* obj) { return obj->mVertexData; }
+		void setVertexData(MeshData* obj, VertexDataDescPtr value) { obj->mVertexData = value; }
+
+		IndexType& getIndexType(MeshData* obj) { return obj->mIndexType; }
+		void setIndexType(MeshData* obj, IndexType& value) { obj->mIndexType = value; }
+
+		UINT32& getNumVertices(MeshData* obj) { return obj->mNumVertices; }
+		void setNumVertices(MeshData* obj, UINT32& value) { obj->mNumVertices = value; }
+
+		UINT32& getNumIndices(MeshData* obj) { return obj->mNumIndices; }
+		void setNumIndices(MeshData* obj, UINT32& value) { obj->mNumIndices = value; }
+
+		ManagedDataBlock getData(MeshData* obj) 
+		{ 
+			ManagedDataBlock dataBlock((UINT8*)obj->getData(), obj->getInternalBufferSize());
+			return dataBlock; 
+		}
+
+		void setData(MeshData* obj, ManagedDataBlock val) 
+		{ 
+			// Nothing to do here, the pointer we provided already belongs to PixelData
+			// so the data is already written
+		}
+
+		static UINT8* allocateData(MeshData* obj, UINT32 numBytes)
+		{
+			obj->allocateInternalBuffer(numBytes);
+
+			return obj->getData();
+		}
+
+	public:
+		MeshDataRTTI()
+		{
+			addReflectablePtrField("mVertexData", 0, &MeshDataRTTI::getVertexData, &MeshDataRTTI::setVertexData);
+
+			addPlainField("mIndexType", 1, &MeshDataRTTI::getIndexType, &MeshDataRTTI::setIndexType);
+			addPlainField("mNumVertices", 2, &MeshDataRTTI::getNumVertices, &MeshDataRTTI::setNumVertices);
+			addPlainField("mNumIndices", 3, &MeshDataRTTI::getNumIndices, &MeshDataRTTI::setNumIndices);
+
+			addDataBlockField("data", 4, &MeshDataRTTI::getData, &MeshDataRTTI::setData, 0, &MeshDataRTTI::allocateData);
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr<MeshData>(new (bs_alloc<MeshData>()) MeshData());
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "MeshData";
+			throw name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_MeshData;
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 68 - 60
BansheeCore/Include/BsMeshImportOptionsRTTI.h

@@ -1,61 +1,69 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsMeshImportOptions.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT MeshImportOptionsRTTI : public RTTIType < MeshImportOptions, ImportOptions, MeshImportOptionsRTTI >
-	{
-	private:
-		bool& getCPUReadable(MeshImportOptions* obj) { return obj->mCPUReadable; }
-		void setCPUReadable(MeshImportOptions* obj, bool& value) { obj->mCPUReadable = value; }
-		
-		bool& getImportNormals(MeshImportOptions* obj) { return obj->mImportNormals; }
-		void setImportNormals(MeshImportOptions* obj, bool& value) { obj->mImportNormals = value; }
-		
-		bool& getImportTangents(MeshImportOptions* obj) { return obj->mImportTangents; }
-		void setImportTangents(MeshImportOptions* obj, bool& value) { obj->mImportTangents = value; }
-		
-		bool& getImportBlendShapes(MeshImportOptions* obj) { return obj->mImportBlendShapes; }
-		void setImportBlendShapes(MeshImportOptions* obj, bool& value) { obj->mImportBlendShapes = value; }
-		
-		bool& getImportSkin(MeshImportOptions* obj) { return obj->mImportSkin; }
-		void setImportSkin(MeshImportOptions* obj, bool& value) { obj->mImportSkin = value; }
-		
-		bool& getImportAnimation(MeshImportOptions* obj) { return obj->mImportAnimation; }
-		void setImportAnimation(MeshImportOptions* obj, bool& value) { obj->mImportAnimation = value; }
-
-		float& getImportScale(MeshImportOptions* obj) { return obj->mImportScale; }
-		void setImportScale(MeshImportOptions* obj, float& value) { obj->mImportScale = value; }
-
-	public:
-		MeshImportOptionsRTTI()
-		{
-			addPlainField("mCPUReadable", 0, &MeshImportOptionsRTTI::getCPUReadable, &MeshImportOptionsRTTI::setCPUReadable);
-			addPlainField("mImportNormals", 1, &MeshImportOptionsRTTI::getImportNormals, &MeshImportOptionsRTTI::setImportNormals);
-			addPlainField("mImportTangents", 2, &MeshImportOptionsRTTI::getImportTangents, &MeshImportOptionsRTTI::setImportTangents);
-			addPlainField("mImportBlendShapes", 3, &MeshImportOptionsRTTI::getImportBlendShapes, &MeshImportOptionsRTTI::setImportBlendShapes);
-			addPlainField("mImportSkin", 4, &MeshImportOptionsRTTI::getImportSkin, &MeshImportOptionsRTTI::setImportSkin);
-			addPlainField("mImportAnimation", 5, &MeshImportOptionsRTTI::getImportAnimation, &MeshImportOptionsRTTI::setImportAnimation);
-			addPlainField("mImportScale", 6, &MeshImportOptionsRTTI::getImportScale, &MeshImportOptionsRTTI::setImportScale);
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "MeshImportOptions";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_MeshImportOptions;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<MeshImportOptions>();
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsMeshImportOptions.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT MeshImportOptionsRTTI : public RTTIType < MeshImportOptions, ImportOptions, MeshImportOptionsRTTI >
+	{
+	private:
+		bool& getCPUReadable(MeshImportOptions* obj) { return obj->mCPUReadable; }
+		void setCPUReadable(MeshImportOptions* obj, bool& value) { obj->mCPUReadable = value; }
+		
+		bool& getImportNormals(MeshImportOptions* obj) { return obj->mImportNormals; }
+		void setImportNormals(MeshImportOptions* obj, bool& value) { obj->mImportNormals = value; }
+		
+		bool& getImportTangents(MeshImportOptions* obj) { return obj->mImportTangents; }
+		void setImportTangents(MeshImportOptions* obj, bool& value) { obj->mImportTangents = value; }
+		
+		bool& getImportBlendShapes(MeshImportOptions* obj) { return obj->mImportBlendShapes; }
+		void setImportBlendShapes(MeshImportOptions* obj, bool& value) { obj->mImportBlendShapes = value; }
+		
+		bool& getImportSkin(MeshImportOptions* obj) { return obj->mImportSkin; }
+		void setImportSkin(MeshImportOptions* obj, bool& value) { obj->mImportSkin = value; }
+		
+		bool& getImportAnimation(MeshImportOptions* obj) { return obj->mImportAnimation; }
+		void setImportAnimation(MeshImportOptions* obj, bool& value) { obj->mImportAnimation = value; }
+
+		float& getImportScale(MeshImportOptions* obj) { return obj->mImportScale; }
+		void setImportScale(MeshImportOptions* obj, float& value) { obj->mImportScale = value; }
+
+	public:
+		MeshImportOptionsRTTI()
+		{
+			addPlainField("mCPUReadable", 0, &MeshImportOptionsRTTI::getCPUReadable, &MeshImportOptionsRTTI::setCPUReadable);
+			addPlainField("mImportNormals", 1, &MeshImportOptionsRTTI::getImportNormals, &MeshImportOptionsRTTI::setImportNormals);
+			addPlainField("mImportTangents", 2, &MeshImportOptionsRTTI::getImportTangents, &MeshImportOptionsRTTI::setImportTangents);
+			addPlainField("mImportBlendShapes", 3, &MeshImportOptionsRTTI::getImportBlendShapes, &MeshImportOptionsRTTI::setImportBlendShapes);
+			addPlainField("mImportSkin", 4, &MeshImportOptionsRTTI::getImportSkin, &MeshImportOptionsRTTI::setImportSkin);
+			addPlainField("mImportAnimation", 5, &MeshImportOptionsRTTI::getImportAnimation, &MeshImportOptionsRTTI::setImportAnimation);
+			addPlainField("mImportScale", 6, &MeshImportOptionsRTTI::getImportScale, &MeshImportOptionsRTTI::setImportScale);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "MeshImportOptions";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_MeshImportOptions;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<MeshImportOptions>();
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 82 - 78
BansheeCore/Include/BsMeshUtility.h

@@ -1,79 +1,83 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Performs various operations on mesh geometry.
-	 */
-	class BS_CORE_EXPORT MeshUtility
-	{
-	public:
-		/**
-		 * @brief	Calculates per-vertex normals based on the provided vertices and indices.
-		 *
-		 * @param	vertices	Set of vertices containing vertex positions.
-		 * @param	indices		Set of indices containing indexes into vertex array for each triangle.
-		 * @param	numVertices	Number of vertices in the "vertices" array.
-		 * @param	numIndices	Number of indices in the "indices" array. Must be a multiple of three.
-		 * @param	normals		Pre-allocated buffer that will contain the calculated normals. Must be the same size
-		 *						as the vertex array.
-		 * @param	indexSize	Size of a single index in the indices array, in bytes.
-		 *
-		 * @note	Vertices should be split before calling this method if there are any discontinuities. (e.g. a vertex
-		 *			on a corner of a cube should be split into three vertices used by three triangles in order for the normals
-		 *			to be valid.)
-		 */
-		static void calculateNormals(Vector3* vertices, UINT8* indices, UINT32 numVertices, 
-			UINT32 numIndices, Vector3* normals, UINT32 indexSize = 4);
-
-		/**
-		 * @brief	Calculates per-vertex tangents and bitangents based on the provided vertices, uv coordinates and indices.
-		 *
-		 * @param	vertices	Set of vertices containing vertex positions.
-		 * @param	normals		Set of normals to use when calculating tangents. Must the the same length
-		 *						as the number of vertices.
-		 * @param	uv			Set of UV coordinates to use when calculating tangents. Must the the same length
-		 *						as the number of vertices.
-		 * @param	indices		Set of indices containing indexes into vertex array for each triangle.
-		 * @param	numVertices	Number of vertices in the "vertices", "normals" and "uv" arrays.
-		 * @param	numIndices	Number of indices in the "indices" array. Must be a multiple of three.
-		 * @param	tangents	Pre-allocated buffer that will contain the calculated tangents. Must be the same size
-		 *						as the vertex array.
-		 * @param	bitangents	Pre-allocated buffer that will contain the calculated bitangents. Must be the same size
-		 *						as the vertex array.
-		 * @param	indexSize	Size of a single index in the indices array, in bytes.
-		 *
-		 * @note	Vertices should be split before calling this method if there are any discontinuities. (e.g. a vertex
-		 *			on a corner of a cube should be split into three vertices used by three triangles in order for the normals
-		 *			to be valid.)
-		 */
-		static void calculateTangents(Vector3* vertices, Vector3* normals, Vector2* uv, UINT8* indices, UINT32 numVertices, 
-			UINT32 numIndices, Vector3* tangents, Vector3* bitangents, UINT32 indexSize = 4);
-
-		/**
-		 * @brief	Calculates per-vertex tangent space (normal, tangent, bitangent) based on the provided 
-		 *			vertices, uv coordinates and indices.
-		 *
-		 * @param	vertices	Set of vertices containing vertex positions.
-		 * @param	uv			Set of UV coordinates to use when calculating tangents.
-		 * @param	indices		Set of indices containing indexes into vertex array for each triangle.
-		 * @param	numVertices	Number of vertices in the "vertices" array.
-		 * @param	numIndices	Number of indices in the "indices" array. Must be a multiple of three.
-		 * @param	normals		Pre-allocated buffer that will contain the calculated normals. Must be the same size
-		 *						as the vertex array.
-		 * @param	tangents	Pre-allocated buffer that will contain the calculated tangents. Must be the same size
-		 *						as the vertex array.
-		 * @param	bitangents	Pre-allocated buffer that will contain the calculated bitangents. Must be the same size
-		 *						as the vertex array.
-		 * @param	indexSize	Size of a single index in the indices array, in bytes.
-		 *
-		 * @note	Vertices should be split before calling this method if there are any discontinuities. (e.g. a vertex
-		 *			on a corner of a cube should be split into three vertices used by three triangles in order for the normals
-		 *			to be valid.)
-		 */
-		static void calculateTangentSpace(Vector3* vertices, Vector2* uv, UINT8* indices, UINT32 numVertices, 
-			UINT32 numIndices, Vector3* normals, Vector3* tangents, Vector3* bitangents, UINT32 indexSize = 4);
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup Utility-Core
+	 *  @{
+	 */
+
+	/** Performs various operations on mesh geometry. */
+	class BS_CORE_EXPORT MeshUtility
+	{
+	public:
+		/**
+		 * Calculates per-vertex normals based on the provided vertices and indices.
+		 *
+		 * @param[in]	vertices	Set of vertices containing vertex positions.
+		 * @param[in]	indices		Set of indices containing indexes into vertex array for each triangle.
+		 * @param[in]	numVertices	Number of vertices in the @p vertices array.
+		 * @param[in]	numIndices	Number of indices in the @p indices array. Must be a multiple of three.
+		 * @param[out]	normals		Pre-allocated buffer that will contain the calculated normals. Must be the same size
+		 *							as the vertex array.
+		 * @param[in]	indexSize	Size of a single index in the indices array, in bytes.
+		 *
+		 * @note	
+		 * Vertices should be split before calling this method if there are any discontinuities. (e.g. a vertex on a corner
+		 * of a cube should be split into three vertices used by three triangles in order for the normals to be valid.)
+		 */
+		static void calculateNormals(Vector3* vertices, UINT8* indices, UINT32 numVertices, 
+			UINT32 numIndices, Vector3* normals, UINT32 indexSize = 4);
+
+		/**
+		 * Calculates per-vertex tangents and bitangents based on the provided vertices, uv coordinates and indices.
+		 *
+		 * @param[in]	vertices	Set of vertices containing vertex positions.
+		 * @param[in]	normals		Set of normals to use when calculating tangents. Must the the same length as the number
+		 *							of vertices.
+		 * @param[in]	uv			Set of UV coordinates to use when calculating tangents. Must the the same length as the
+		 *							number of vertices.
+		 * @param[in]	indices		Set of indices containing indexes into vertex array for each triangle.
+		 * @param[in]	numVertices	Number of vertices in the @p vertices, @p normals and @p uv arrays.
+		 * @param[in]	numIndices	Number of indices in the @p indices array. Must be a multiple of three.
+		 * @param[out]	tangents	Pre-allocated buffer that will contain the calculated tangents. Must be the same size
+		 *							as the vertex array.
+		 * @param[out]	bitangents	Pre-allocated buffer that will contain the calculated bitangents. Must be the same size
+		 *							as the vertex array.
+		 * @param[in]	indexSize	Size of a single index in the indices array, in bytes.
+		 *
+		 * @note	
+		 * Vertices should be split before calling this method if there are any discontinuities. (e.g. a vertex on a corner
+		 * of a cube should be split into three vertices used by three triangles in order for the normals to be valid.)
+		 */
+		static void calculateTangents(Vector3* vertices, Vector3* normals, Vector2* uv, UINT8* indices, UINT32 numVertices, 
+			UINT32 numIndices, Vector3* tangents, Vector3* bitangents, UINT32 indexSize = 4);
+
+		/**
+		 * Calculates per-vertex tangent space (normal, tangent, bitangent) based on the provided vertices, uv coordinates
+		 * and indices.
+		 *
+		 * @param[in]	vertices	Set of vertices containing vertex positions.
+		 * @param[in]	uv			Set of UV coordinates to use when calculating tangents.
+		 * @param[in]	indices		Set of indices containing indexes into vertex array for each triangle.
+		 * @param[in]	numVertices	Number of vertices in the "vertices" array.
+		 * @param[in]	numIndices	Number of indices in the "indices" array. Must be a multiple of three.
+		 * @param[out]	normals		Pre-allocated buffer that will contain the calculated normals. Must be the same size
+		 *							as the vertex array.
+		 * @param[out]	tangents	Pre-allocated buffer that will contain the calculated tangents. Must be the same size
+		 *							as the vertex array.
+		 * @param[out]	bitangents	Pre-allocated buffer that will contain the calculated bitangents. Must be the same size
+		 *							as the vertex array.
+		 * @param[in]	indexSize	Size of a single index in the indices array, in bytes.
+		 *
+		 * @note	
+		 * Vertices should be split before calling this method if there are any discontinuities. (e.g. a vertex on a corner
+		 * of a cube should be split into three vertices used by three triangles in order for the normals to be valid.)
+		 */
+		static void calculateTangentSpace(Vector3* vertices, Vector2* uv, UINT8* indices, UINT32 numVertices, 
+			UINT32 numIndices, Vector3* normals, Vector3* tangents, Vector3* bitangents, UINT32 indexSize = 4);
+	};
+
+	/** @} */
 }

+ 12 - 4
BansheeCore/Include/BsPassRTTI.h

@@ -6,6 +6,11 @@
 
 namespace BansheeEngine
 {
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
 	class BS_CORE_EXPORT PassRTTI : public RTTIType<Pass, IReflectable, PassRTTI>
 	{
 	private:
@@ -55,26 +60,29 @@ namespace BansheeEngine
 			addPlainField("mStencilRefValue", 9, &PassRTTI::getStencilRefValue, &PassRTTI::setStencilRefValue);
 		}
 
-		virtual void onDeserializationEnded(IReflectable* obj)
+		void onDeserializationEnded(IReflectable* obj) override
 		{
 			Pass* pass = static_cast<Pass*>(obj);
 			pass->initialize();
 		}
 
-		virtual const String& getRTTIName()
+		const String& getRTTIName() override
 		{
 			static String name = "Pass";
 			return name;
 		}
 
-		virtual UINT32 getRTTIId()
+		UINT32 getRTTIId() override
 		{
 			return TID_Pass;
 		}
 
-		virtual std::shared_ptr<IReflectable> newRTTIObject()
+		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			return Pass::createEmpty();
 		}
 	};
+
+	/** @} */
+	/** @endcond */
 }

+ 99 - 91
BansheeCore/Include/BsPixelDataRTTI.h

@@ -1,92 +1,100 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsPixelData.h"
-#include "BsRTTIType.h"
-#include "BsManagedDataBlock.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT PixelDataRTTI : public RTTIType<PixelData, GpuResourceData, PixelDataRTTI>
-	{
-		UINT32& getLeft(PixelData* obj) { return obj->mExtents.left; }
-		void setLeft(PixelData* obj, UINT32& val) { obj->mExtents.left = val; }
-
-		UINT32& getTop(PixelData* obj) { return obj->mExtents.top; }
-		void setTop(PixelData* obj, UINT32& val) { obj->mExtents.top = val; }
-
-		UINT32& getRight(PixelData* obj) { return obj->mExtents.right; }
-		void setRight(PixelData* obj, UINT32& val) { obj->mExtents.right = val; }
-
-		UINT32& getBottom(PixelData* obj) { return obj->mExtents.bottom; }
-		void setBottom(PixelData* obj, UINT32& val) { obj->mExtents.bottom = val; }
-
-		UINT32& getFront(PixelData* obj) { return obj->mExtents.front; }
-		void setFront(PixelData* obj, UINT32& val) { obj->mExtents.front = val; }
-
-		UINT32& getBack(PixelData* obj) { return obj->mExtents.back; }
-		void setBack(PixelData* obj, UINT32& val) { obj->mExtents.back = val; }
-
-		UINT32& getRowPitch(PixelData* obj) { return obj->mRowPitch; }
-		void setRowPitch(PixelData* obj, UINT32& val) { obj->mRowPitch = val; }
-
-		UINT32& getSlicePitch(PixelData* obj) { return obj->mSlicePitch; }
-		void setSlicePitch(PixelData* obj, UINT32& val) { obj->mSlicePitch = val; }
-
-		PixelFormat& getFormat(PixelData* obj) { return obj->mFormat; }
-		void setFormat(PixelData* obj, PixelFormat& val) { obj->mFormat = val; }
-
-		ManagedDataBlock getData(PixelData* obj) 
-		{ 
-			ManagedDataBlock dataBlock((UINT8*)obj->getData(), obj->getConsecutiveSize());
-			return dataBlock; 
-		}
-
-		void setData(PixelData* obj, ManagedDataBlock val) 
-		{ 
-			// Nothing to do here, the pointer we provided already belongs to PixelData
-			// so the data is already written
-		}
-
-		static UINT8* allocateData(PixelData* obj, UINT32 numBytes)
-		{
-			obj->allocateInternalBuffer(numBytes);
-
-			return obj->getData();
-		}
-
-	public:
-		PixelDataRTTI()
-		{
-			addPlainField("left", 0, &PixelDataRTTI::getLeft, &PixelDataRTTI::setLeft);
-			addPlainField("top", 1, &PixelDataRTTI::getTop, &PixelDataRTTI::setTop);
-			addPlainField("right", 2, &PixelDataRTTI::getRight, &PixelDataRTTI::setRight);
-			addPlainField("bottom", 3, &PixelDataRTTI::getBottom, &PixelDataRTTI::setBottom);
-			addPlainField("front", 4, &PixelDataRTTI::getFront, &PixelDataRTTI::setFront);
-			addPlainField("back", 5, &PixelDataRTTI::getBack, &PixelDataRTTI::setBack);
-			addPlainField("rowPitch", 6, &PixelDataRTTI::getRowPitch, &PixelDataRTTI::setRowPitch);
-			addPlainField("slicePitch", 7, &PixelDataRTTI::getSlicePitch, &PixelDataRTTI::setSlicePitch);
-			addPlainField("format", 8, &PixelDataRTTI::getFormat, &PixelDataRTTI::setFormat);
-
-			addDataBlockField("data", 9, &PixelDataRTTI::getData, &PixelDataRTTI::setData, 0, &PixelDataRTTI::allocateData);
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "PixelData";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_PixelData;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			PixelDataPtr newPixelData = bs_shared_ptr_new<PixelData>();
-
-			return newPixelData;
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsPixelData.h"
+#include "BsRTTIType.h"
+#include "BsManagedDataBlock.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT PixelDataRTTI : public RTTIType<PixelData, GpuResourceData, PixelDataRTTI>
+	{
+		UINT32& getLeft(PixelData* obj) { return obj->mExtents.left; }
+		void setLeft(PixelData* obj, UINT32& val) { obj->mExtents.left = val; }
+
+		UINT32& getTop(PixelData* obj) { return obj->mExtents.top; }
+		void setTop(PixelData* obj, UINT32& val) { obj->mExtents.top = val; }
+
+		UINT32& getRight(PixelData* obj) { return obj->mExtents.right; }
+		void setRight(PixelData* obj, UINT32& val) { obj->mExtents.right = val; }
+
+		UINT32& getBottom(PixelData* obj) { return obj->mExtents.bottom; }
+		void setBottom(PixelData* obj, UINT32& val) { obj->mExtents.bottom = val; }
+
+		UINT32& getFront(PixelData* obj) { return obj->mExtents.front; }
+		void setFront(PixelData* obj, UINT32& val) { obj->mExtents.front = val; }
+
+		UINT32& getBack(PixelData* obj) { return obj->mExtents.back; }
+		void setBack(PixelData* obj, UINT32& val) { obj->mExtents.back = val; }
+
+		UINT32& getRowPitch(PixelData* obj) { return obj->mRowPitch; }
+		void setRowPitch(PixelData* obj, UINT32& val) { obj->mRowPitch = val; }
+
+		UINT32& getSlicePitch(PixelData* obj) { return obj->mSlicePitch; }
+		void setSlicePitch(PixelData* obj, UINT32& val) { obj->mSlicePitch = val; }
+
+		PixelFormat& getFormat(PixelData* obj) { return obj->mFormat; }
+		void setFormat(PixelData* obj, PixelFormat& val) { obj->mFormat = val; }
+
+		ManagedDataBlock getData(PixelData* obj) 
+		{ 
+			ManagedDataBlock dataBlock((UINT8*)obj->getData(), obj->getConsecutiveSize());
+			return dataBlock; 
+		}
+
+		void setData(PixelData* obj, ManagedDataBlock val) 
+		{ 
+			// Nothing to do here, the pointer we provided already belongs to PixelData
+			// so the data is already written
+		}
+
+		static UINT8* allocateData(PixelData* obj, UINT32 numBytes)
+		{
+			obj->allocateInternalBuffer(numBytes);
+
+			return obj->getData();
+		}
+
+	public:
+		PixelDataRTTI()
+		{
+			addPlainField("left", 0, &PixelDataRTTI::getLeft, &PixelDataRTTI::setLeft);
+			addPlainField("top", 1, &PixelDataRTTI::getTop, &PixelDataRTTI::setTop);
+			addPlainField("right", 2, &PixelDataRTTI::getRight, &PixelDataRTTI::setRight);
+			addPlainField("bottom", 3, &PixelDataRTTI::getBottom, &PixelDataRTTI::setBottom);
+			addPlainField("front", 4, &PixelDataRTTI::getFront, &PixelDataRTTI::setFront);
+			addPlainField("back", 5, &PixelDataRTTI::getBack, &PixelDataRTTI::setBack);
+			addPlainField("rowPitch", 6, &PixelDataRTTI::getRowPitch, &PixelDataRTTI::setRowPitch);
+			addPlainField("slicePitch", 7, &PixelDataRTTI::getSlicePitch, &PixelDataRTTI::setSlicePitch);
+			addPlainField("format", 8, &PixelDataRTTI::getFormat, &PixelDataRTTI::setFormat);
+
+			addDataBlockField("data", 9, &PixelDataRTTI::getData, &PixelDataRTTI::setData, 0, &PixelDataRTTI::allocateData);
+		}
+
+		virtual const String& getRTTIName() override
+		{
+			static String name = "PixelData";
+			return name;
+		}
+
+		virtual UINT32 getRTTIId() override
+		{
+			return TID_PixelData;
+		}
+
+		virtual std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			PixelDataPtr newPixelData = bs_shared_ptr_new<PixelData>();
+
+			return newPixelData;
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 227 - 274
BansheeCore/Include/BsPixelUtil.h

@@ -1,275 +1,228 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsPixelData.h"
-
-namespace BansheeEngine 
-{
-	/**
-	 * @brief	Types of texture compression quality.
-	 */
-	enum class CompressionQuality
-	{
-		Fastest,
-		Normal,
-		Production,
-		Highest
-	};
-
-	/**
-	 * @brief	Mode of the alpha channel in a texture.
-	 */
-	enum class AlphaMode
-	{
-		None, /*< Texture has no alpha values. */
-		Transparency, /*< Alpha is in the separate transparency channel. */
-		Premultiplied /*< Alpha values have been pre-multiplied with the color values. */
-	};
-
-	/**
-	 * @brief	Wrap mode to use when generating mip maps.
-	 */
-	enum class MipMapWrapMode
-	{
-		Mirror,
-		Repeat,
-		Clamp
-	};
-
-	/**
-	 * @brief	Filter to use when generating mip maps.
-	 */
-	enum class MipMapFilter
-	{
-		Box,
-		Triangle,
-		Kaiser
-	};
-
-	/**
-	 * @brief	Options used to control texture compression.
-	 */
-	struct CompressionOptions
-	{
-		PixelFormat format = PF_BC1; /*< Format to compress to. Must be a format containing compressed data. */
-		AlphaMode alphaMode = AlphaMode::None; /*< Controls how to (and if) to compress the alpha channel. */
-		bool isNormalMap = false; /*< Determines does the input data represent a normal map. */
-		bool isSRGB = false; /*< Determines has the input data been gamma corrected. */
-		CompressionQuality quality = CompressionQuality::Normal; /*< Compressed image quality. Better compression might take longer to execute but will generate better results. */
-	};
-
-	/**
-	 * @brief	Options used to control texture mip map generation.
-	 */
-	struct MipMapGenOptions
-	{
-		MipMapFilter filter = MipMapFilter::Box; /*< Filter to use when downsamping input data. */
-		MipMapWrapMode wrapMode = MipMapWrapMode::Mirror; /*< Determines how to downsample pixels on borders. */
-		bool isNormalMap = false; /*< Determines does the input data represent a normal map. */
-		bool normalizeMipmaps = false; /*< Should the downsampled values be re-normalized. Only relevant for mip-maps representing normal maps. */
-	};
-
-	/**
-	 * @brief	Utility methods for converting and managing pixel data and formats.
-	 */
-    class BS_CORE_EXPORT PixelUtil 
-	{
-    public:
-		/**
-		 * @brief	Filtering types to use when scaling images.
-		 */
-		enum Filter
-		{
-			FILTER_NEAREST, /*< No filtering is performed and nearest existing value is used. */
-			FILTER_LINEAR /*< Box filter is applied, averaging nearby pixels. */
-		};
-
-		/**
-		 * @brief	Returns the size of a single pixel of the provided pixel format,
-		 *			in bytes.
-		 */
-        static UINT32 getNumElemBytes(PixelFormat format);
-
-		/**
-		 * @brief	Returns the size of a single pixel of the provided pixel format,
-		 *			in bits.
-		 */
-        static UINT32 getNumElemBits( PixelFormat format );
-
-		/**
-		 * @brief	Returns the size of the memory region required to hold pixels of the provided size ana format.
-		 */
-		static UINT32 getMemorySize(UINT32 width, UINT32 height, UINT32 depth, PixelFormat format);
-		
-		/**
-		 * @brief	Calculates the size of a mip level of a texture with the provided size.
-		 */
-		static void getSizeForMipLevel(UINT32 width, UINT32 height, UINT32 depth, UINT32 mipLevel, 
-			UINT32& mipWidth, UINT32& mipHeight, UINT32& mipDepth);
-
-		/**
-		 * @brief	Returns property flags for this pixel format.
-		 *
-		 * @see		PixelFormatFlags
-		 */
-        static UINT32 getFlags(PixelFormat format);
-
-		/**
-		 * @brief	Checks if the provided pixel format has an alpha channel.
-		 */
-        static bool hasAlpha(PixelFormat format);
-
-		/**
-		 * @brief	Checks is the provided pixel format a floating point format.
-		 */
-        static bool isFloatingPoint(PixelFormat format);
-
-		/**
-		 * @brief	Checks is the provided pixel format compressed.
-		 */
-        static bool isCompressed(PixelFormat format);
-
-		/**
-		 * @brief	Checks is the provided pixel format a depth/stencil buffer format.
-		 */
-        static bool isDepth(PixelFormat format);
-
-		/**
-		 * @brief	Checks is the provided format in native endian format.
-		 */
-        static bool isNativeEndian(PixelFormat format);
-		
-		/**
-		 * @brief	Checks are the provided dimensions valid for the specified pixel format.
-		 *			Some formats (like DXT) require width/height to be multiples of four and some
-		 *			formats dont allow depth larger than 1.
-		 */
-		static bool isValidExtent(UINT32 width, UINT32 height, UINT32 depth, PixelFormat format);
-
-		/**
-		 * @brief	Returns the number of bits per each element in the provided pixel format.
-		 *			This will return all zero for compressed and depth/stencil formats.
-		 */
-        static void getBitDepths(PixelFormat format, int rgba[4]);
-
-		/**
-		 * @brief	Returns bit masks that determine in what bit range is each channel stored.
-		 *
-		 * @note	e.g. if your color is stored in an UINT32 and you want to extract the red channel
-		 *			you should AND the color UINT32 with the bit-mask for the red channel and then
-		 *			right shift it by the red channel bit shift amount.
-		 */
-        static void getBitMasks(PixelFormat format, UINT32 rgba[4]);
-
-		/**
-		 * @brief	Returns number of bits you need to shift a pixel element in order
-		 *			to move it to the start of the data type.
-		 *
-		 * @note	e.g. if your color is stored in an UINT32 and you want to extract the red channel
-		 *			you should AND the color UINT32 with the bit-mask for the red channel and then
-		 *			right shift it by the red channel bit shift amount.
-		 */
-		static void getBitShifts(PixelFormat format, UINT8 rgba[4]);
-
-		/**
-		 * @brief	Returns the name of the pixel format.
-		 */
-        static String getFormatName(PixelFormat srcformat);
-
-		/**
-		 * @brief	Returns true if the pixel data in the format can be directly accessed and read.
-		 *			This is generally not true for compressed formats.
-		 */
-        static bool isAccessible(PixelFormat srcformat);
-        
-		/**
-		 * @brief	Returns the type of an individual pixel element in the provided format.
-		 */
-        static PixelComponentType getElementType(PixelFormat format);
-        
-		/**
-		 * @brief	Returns the number of pixel elements in the provided format.
-		 */
-		static UINT32 getNumElements(PixelFormat format);
-
-		/**
-		 * @brief	Returns the maximum number of mip maps that can be generated until we reach
-		 *			the minimum size possible. This does not count the base level.
-		 */
-		static UINT32 getMaxMipmaps(UINT32 width, UINT32 height, UINT32 depth, PixelFormat format);
-
-		/**
-		 * @brief	Writes the color to the provided memory location.
-		 */
-        static void packColor(const Color& color, PixelFormat format, void* dest);
-
-		/**
-		 * @brief	Writes the color to the provided memory location. If the destination
-		 *			format is floating point, the byte values will be converted into [0.0, 1.0] range.
-		 */
-		static void packColor(UINT8 r, UINT8 g, UINT8 b, UINT8 a, PixelFormat format, void* dest);
-
-		/**
-		 * @brief	Writes the color to the provided memory location. If the destination format
-		 *			in non-floating point, the float values will be assumed to be in [0.0, 1.0] which
-		 *			will be converted to integer range. ([0, 255] in the case of bytes)
-		 */
-		static void packColor(float r, float g, float b, float a, const PixelFormat format, void* dest);
-
-		/**
-		 * @brief	Reads the color from the provided memory location and stores it 
-		 *			into the provided color object.
-		 */
-		static void unpackColor(Color* color, PixelFormat format, const void* src);
-
-		/**
-		 * @brief	Reads the color from the provided memory location and stores it 
-		 *			into the provided color elements, as bytes clamped to [0, 255] range.
-		 */
-		static void unpackColor(UINT8* r, UINT8* g, UINT8* b, UINT8* a, PixelFormat format, const void* src);
-
-		/**
-		 * @brief	Reads the color from the provided memory location and stores it 
-		 *			into the provided color elements. If the format is not natively floating
-		 *			point a conversion is done in such a way that returned values range [0.0, 1.0].
-		 */
-        static void unpackColor(float* r, float* g, float* b, float* a, PixelFormat format, const void* src); 
-        
-		/**
-		 * @brief	Converts pixels from one format to another. Provided pixel data objects
-		 *			must have previously allocated buffers of adequate size and their sizes must match.
-		 */
-        static void bulkPixelConversion(const PixelData& src, PixelData& dst);
-
-		/**
-		 * @brief	Compresses the provided data using the specified compression options. 
-		 */
-		static void compress(const PixelData& src, PixelData& dst, const CompressionOptions& options);
-
-		/**
-		 * @brief	Generates mip-maps from the provided source data using the specified compression options.
-		 *			Returned list includes the base level.
-		 *
-		 * @returns	A list of calculated mip-map data. First entry is the largest mip and other follow in
-		 *			order from largest to smallest.
-		 */
-		static Vector<PixelDataPtr> genMipmaps(const PixelData& src, const MipMapGenOptions& options);
-
-		/**
-		 * @brief	Scales pixel data in the source buffer and stores the scaled data in the destination buffer.
-		 *			Provided pixel data objects must have previously allocated buffers of adequate size. You may
-		 *			also provided a filtering method to use when scaling.
-		 */
-		static void scale(const PixelData& src, PixelData& dst, Filter filter = FILTER_LINEAR);
-
-		/**
-		 * @brief	Applies gamma correction to the pixels in the provided buffer.
-		 *
-		 * @param	buffer	Pointer to the buffer containing the pixels.
-		 * @param	gamma	Gamma value to apply.
-		 * @param	size	Size of the buffer in bytes.
-		 * @param	bpp		Number of bits per pixel of the pixels in the buffer.
-		 */
-        static void applyGamma(UINT8* buffer, float gamma, UINT32 size, UINT8 bpp);
-    };
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsPixelData.h"
+
+namespace BansheeEngine 
+{
+	/** @addtogroup Utility-Core
+	 *  @{
+	 */
+
+	/**	Types of texture compression quality. */
+	enum class CompressionQuality
+	{
+		Fastest,
+		Normal,
+		Production,
+		Highest
+	};
+
+	/**	Mode of the alpha channel in a texture. */
+	enum class AlphaMode
+	{
+		None, /*< Texture has no alpha values. */
+		Transparency, /*< Alpha is in the separate transparency channel. */
+		Premultiplied /*< Alpha values have been pre-multiplied with the color values. */
+	};
+
+	/**	Wrap mode to use when generating mip maps. */
+	enum class MipMapWrapMode
+	{
+		Mirror,
+		Repeat,
+		Clamp
+	};
+
+	/**	Filter to use when generating mip maps. */
+	enum class MipMapFilter
+	{
+		Box,
+		Triangle,
+		Kaiser
+	};
+
+	/**	Options used to control texture compression. */
+	struct CompressionOptions
+	{
+		PixelFormat format = PF_BC1; /*< Format to compress to. Must be a format containing compressed data. */
+		AlphaMode alphaMode = AlphaMode::None; /*< Controls how to (and if) to compress the alpha channel. */
+		bool isNormalMap = false; /*< Determines does the input data represent a normal map. */
+		bool isSRGB = false; /*< Determines has the input data been gamma corrected. */
+		CompressionQuality quality = CompressionQuality::Normal; /*< Compressed image quality. Better compression might take longer to execute but will generate better results. */
+	};
+
+	/**	Options used to control texture mip map generation. */
+	struct MipMapGenOptions
+	{
+		MipMapFilter filter = MipMapFilter::Box; /*< Filter to use when downsamping input data. */
+		MipMapWrapMode wrapMode = MipMapWrapMode::Mirror; /*< Determines how to downsample pixels on borders. */
+		bool isNormalMap = false; /*< Determines does the input data represent a normal map. */
+		bool normalizeMipmaps = false; /*< Should the downsampled values be re-normalized. Only relevant for mip-maps representing normal maps. */
+	};
+
+	/**	Utility methods for converting and managing pixel data and formats. */
+    class BS_CORE_EXPORT PixelUtil 
+	{
+    public:
+		/**	Filtering types to use when scaling images. */
+		enum Filter
+		{
+			FILTER_NEAREST, /*< No filtering is performed and nearest existing value is used. */
+			FILTER_LINEAR /*< Box filter is applied, averaging nearby pixels. */
+		};
+
+		/**	Returns the size of a single pixel of the provided pixel format, in bytes. */
+        static UINT32 getNumElemBytes(PixelFormat format);
+
+		/**	Returns the size of a single pixel of the provided pixel format, in bits. */
+        static UINT32 getNumElemBits( PixelFormat format );
+
+		/**	Returns the size of the memory region required to hold pixels of the provided size ana format. */
+		static UINT32 getMemorySize(UINT32 width, UINT32 height, UINT32 depth, PixelFormat format);
+		
+		/**	Calculates the size of a mip level of a texture with the provided size. */
+		static void getSizeForMipLevel(UINT32 width, UINT32 height, UINT32 depth, UINT32 mipLevel, 
+			UINT32& mipWidth, UINT32& mipHeight, UINT32& mipDepth);
+
+		/**
+		 * Returns property flags for this pixel format.
+		 *
+		 * @see		PixelFormatFlags
+		 */
+        static UINT32 getFlags(PixelFormat format);
+
+		/**	Checks if the provided pixel format has an alpha channel. */
+        static bool hasAlpha(PixelFormat format);
+
+		/**	Checks is the provided pixel format a floating point format. */
+        static bool isFloatingPoint(PixelFormat format);
+
+		/**	Checks is the provided pixel format compressed. */
+        static bool isCompressed(PixelFormat format);
+
+		/**	Checks is the provided pixel format a depth/stencil buffer format. */
+        static bool isDepth(PixelFormat format);
+
+		/**	Checks is the provided format in native endian format. */
+        static bool isNativeEndian(PixelFormat format);
+		
+		/**
+		 * Checks are the provided dimensions valid for the specified pixel format. Some formats (like DXT) require 
+		 * width/height to be multiples of four and some formats dont allow depth larger than 1.
+		 */
+		static bool isValidExtent(UINT32 width, UINT32 height, UINT32 depth, PixelFormat format);
+
+		/**
+		 * Returns the number of bits per each element in the provided pixel format. This will return all zero for 
+		 * compressed and depth/stencil formats.
+		 */
+        static void getBitDepths(PixelFormat format, int rgba[4]);
+
+		/**
+		 * Returns bit masks that determine in what bit range is each channel stored.
+		 *
+		 * @note	
+		 * e.g. if your color is stored in an UINT32 and you want to extract the red channel you should AND the color
+		 * UINT32 with the bit-mask for the red channel and then right shift it by the red channel bit shift amount.
+		 */
+        static void getBitMasks(PixelFormat format, UINT32 rgba[4]);
+
+		/**
+		 * Returns number of bits you need to shift a pixel element in order to move it to the start of the data type.
+		 *
+		 * @note	
+		 * e.g. if your color is stored in an UINT32 and you want to extract the red channel you should AND the color 
+		 * UINT32 with the bit-mask for the red channel and then right shift it by the red channel bit shift amount.
+		 */
+		static void getBitShifts(PixelFormat format, UINT8 rgba[4]);
+
+		/**	Returns the name of the pixel format. */
+        static String getFormatName(PixelFormat srcformat);
+
+		/**
+		 * Returns true if the pixel data in the format can be directly accessed and read. This is generally not true 
+		 * for compressed formats.
+		 */
+        static bool isAccessible(PixelFormat srcformat);
+        
+		/**	Returns the type of an individual pixel element in the provided format. */
+        static PixelComponentType getElementType(PixelFormat format);
+        
+		/**	Returns the number of pixel elements in the provided format. */
+		static UINT32 getNumElements(PixelFormat format);
+
+		/**
+		 * Returns the maximum number of mip maps that can be generated until we reach the minimum size possible. This 
+		 * does not count the base level.
+		 */
+		static UINT32 getMaxMipmaps(UINT32 width, UINT32 height, UINT32 depth, PixelFormat format);
+
+		/**	Writes the color to the provided memory location. */
+        static void packColor(const Color& color, PixelFormat format, void* dest);
+
+		/**
+		 * Writes the color to the provided memory location. If the destination	format is floating point, the byte values
+		 * will be converted into [0.0, 1.0] range.
+		 */
+		static void packColor(UINT8 r, UINT8 g, UINT8 b, UINT8 a, PixelFormat format, void* dest);
+
+		/**
+		 * Writes the color to the provided memory location. If the destination format in non-floating point, the float
+		 * values will be assumed to be in [0.0, 1.0] which	will be converted to integer range. ([0, 255] in the case of bytes)
+		 */
+		static void packColor(float r, float g, float b, float a, const PixelFormat format, void* dest);
+
+		/** Reads the color from the provided memory location and stores it into the provided color object. */
+		static void unpackColor(Color* color, PixelFormat format, const void* src);
+
+		/**
+		 * Reads the color from the provided memory location and stores it into the provided color elements, as bytes 
+		 * clamped to [0, 255] range.
+		 */
+		static void unpackColor(UINT8* r, UINT8* g, UINT8* b, UINT8* a, PixelFormat format, const void* src);
+
+		/**
+		 * Reads the color from the provided memory location and stores it into the provided color elements. If the format 
+		 * is not natively floating point a conversion is done in such a way that returned values range [0.0, 1.0].
+		 */
+        static void unpackColor(float* r, float* g, float* b, float* a, PixelFormat format, const void* src); 
+        
+		/**
+		 * Converts pixels from one format to another. Provided pixel data objects must have previously allocated buffers
+		 * of adequate size and their sizes must match.
+		 */
+        static void bulkPixelConversion(const PixelData& src, PixelData& dst);
+
+		/** Compresses the provided data using the specified compression options.  */
+		static void compress(const PixelData& src, PixelData& dst, const CompressionOptions& options);
+
+		/**
+		 * Generates mip-maps from the provided source data using the specified compression options. Returned list includes
+		 * the base level.
+		 *
+		 * @return	A list of calculated mip-map data. First entry is the largest mip and other follow in order from 
+		 *			largest to smallest.
+		 */
+		static Vector<PixelDataPtr> genMipmaps(const PixelData& src, const MipMapGenOptions& options);
+
+		/**
+		 * Scales pixel data in the source buffer and stores the scaled data in the destination buffer. Provided pixel data
+		 * objects must have previously allocated buffers of adequate size. You may also provided a filtering method to use
+		 * when scaling.
+		 */
+		static void scale(const PixelData& src, PixelData& dst, Filter filter = FILTER_LINEAR);
+
+		/**
+		 * Applies gamma correction to the pixels in the provided buffer.
+		 *
+		 * @param[in]	buffer	Pointer to the buffer containing the pixels.
+		 * @param[in]	gamma	Gamma value to apply.
+		 * @param[in]	size	Size of the buffer in bytes.
+		 * @param[in]	bpp		Number of bits per pixel of the pixels in the buffer.
+		 */
+        static void applyGamma(UINT8* buffer, float gamma, UINT32 size, UINT8 bpp);
+    };
+
+	/** @} */
 }

+ 46 - 42
BansheeCore/Include/BsPixelVolume.h

@@ -1,43 +1,47 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Represents a 3D region of pixels used for referencing pixel data.
-	 */
-	struct BS_CORE_EXPORT PixelVolume
-	{
-		UINT32 left, top, right, bottom, front, back;
-
-		PixelVolume()
-			: left(0), top(0), right(1), bottom(1), front(0), back(1)
-		{ }
-
-		PixelVolume(UINT32 left, UINT32 top, UINT32 right, UINT32 bottom):
-			left(left), top(top), right(right), bottom(bottom), front(0), back(1)
-		{
-			assert(right >= left && bottom >= top && back >= front);
-		}
-
-		PixelVolume(UINT32 left, UINT32 top, UINT32 front, UINT32 right, UINT32 bottom, UINT32 back):
-			left(left), top(top), right(right), bottom(bottom), front(front), back(back)
-		{
-			assert(right >= left && bottom >= top && back >= front);
-		}
-            
-		/**
-		 * @brief	Return true if the other box is a part of this one.
-		 */
-		bool contains(const PixelVolume &volume) const
-		{
-			return (volume.left >= left && volume.top >= top && volume.front >= front &&
-				volume.right <= right && volume.bottom <= bottom && volume.back <= back);
-		}
-            
-		UINT32 getWidth() const { return right-left; }
-		UINT32 getHeight() const { return bottom-top; }
-		UINT32 getDepth() const { return back-front; }
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup Utility-Core
+	 *  @{
+	 */
+
+	/**	Represents a 3D region of pixels used for referencing pixel data. */
+	struct BS_CORE_EXPORT PixelVolume
+	{
+		UINT32 left, top, right, bottom, front, back;
+
+		PixelVolume()
+			: left(0), top(0), right(1), bottom(1), front(0), back(1)
+		{ }
+
+		PixelVolume(UINT32 left, UINT32 top, UINT32 right, UINT32 bottom):
+			left(left), top(top), right(right), bottom(bottom), front(0), back(1)
+		{
+			assert(right >= left && bottom >= top && back >= front);
+		}
+
+		PixelVolume(UINT32 left, UINT32 top, UINT32 front, UINT32 right, UINT32 bottom, UINT32 back):
+			left(left), top(top), right(right), bottom(bottom), front(front), back(back)
+		{
+			assert(right >= left && bottom >= top && back >= front);
+		}
+            
+		/**
+		 * @brief	Return true if the other box is a part of this one.
+		 */
+		bool contains(const PixelVolume &volume) const
+		{
+			return (volume.left >= left && volume.top >= top && volume.front >= front &&
+				volume.right <= right && volume.bottom <= bottom && volume.back <= back);
+		}
+            
+		UINT32 getWidth() const { return right-left; }
+		UINT32 getHeight() const { return bottom-top; }
+		UINT32 getDepth() const { return back-front; }
+	};
+
+	/** @} */
 }

+ 91 - 97
BansheeCore/Include/BsPrefab.h

@@ -1,98 +1,92 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsGameObject.h"
-#include "BsResource.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Prefab is a saveable hierarchy of scene objects. In general it
-	 *			can serve as any grouping of scene objects (e.g. a level) or be used
-	 *			as a form of a template instantiated and reused throughout the scene.
-	 */
-	class BS_CORE_EXPORT Prefab : public Resource
-	{
-	public:
-		Prefab();
-		~Prefab();
-
-		/**
-		 * @brief	Creates a new prefab from the provided scene object. If the scene object
-		 *			has an existing prefab link it will be broken. After the prefab is created the
-		 *			scene object will be automatically linked to it.
-		 */
-		static HPrefab create(const HSceneObject& sceneObject);
-
-		/**
-		 * @brief	Instantiates a prefab by creating an instance of the prefab's
-		 *			scene object hierarchy. The returned hierarchy will be parented
-		 *			to world root by default.
-		 *			
-		 * @returns	Instantiated clone of the prefab's scene object hierarchy.
-		 */
-		HSceneObject instantiate();
-
-		/**
-		 * @brief	Replaces the contents of this prefab with new contents
-		 *			from the provided object. Object will be automatically linked to
-		 *			this prefab, and its previous prefab link (if any) will be broken.
-		 */
-		void update(const HSceneObject& sceneObject);
-
-		/**
-		 * @brief	Updates any prefab child instances by loading their prefabs and making sure they are up to date.
-		 * 
-		 * @note	Internal method.
-		 */
-		void _updateChildInstances();
-
-		/**
-		 * @brief	Returns a reference to the internal prefab hierarchy. Returned hierarchy is not instantiated and cannot
-		 *			be interacted with in a manner you would with normal scene objects.
-		 *
-		 * @note	Internal method.
-		 */
-		HSceneObject _getRoot() const { return mRoot; }
-
-		/**
-		 * @brief	Creates the clone of the prefab's current hierarchy but doesn't instantiate it.
-		 *			
-		 * @returns	Clone of the prefab's scene object hierarchy.
-		 *
-		 * @note	Internal method.
-		 */
-		HSceneObject _clone();
-
-		/**
-		 * @brief	Returns a hash value that can be used for determining if a prefab changed
-		 *			by comparing it to a previously saved hash.
-		 */
-		UINT32 getHash() const { return mHash; }
-
-	private:
-		/**
-		 * @brief	Initializes the internal prefab hierarchy. Must be called druing creation.
-		 */
-		void initialize(const HSceneObject& sceneObject);
-
-		/**
-		 * @brief	Creates an empty and uninitialized prefab.
-		 */
-		static PrefabPtr createEmpty();
-
-		HSceneObject mRoot;
-		UINT32 mHash;
-		String mUUID;
-		UINT32 mNextLinkId;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-
-	public:
-		friend class PrefabRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const override;
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsGameObject.h"
+#include "BsResource.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup Scene
+	 *  @{
+	 */
+
+	/**
+	 * Prefab is a saveable hierarchy of scene objects. In general it can serve as any grouping of scene objects 
+	 * (e.g. a level) or be used as a form of a template instantiated and reused throughout the scene.
+	 */
+	class BS_CORE_EXPORT Prefab : public Resource
+	{
+	public:
+		Prefab();
+		~Prefab();
+
+		/**
+		 * Creates a new prefab from the provided scene object. If the scene object has an existing prefab link it will 
+		 * be broken. After the prefab is created the scene object will be automatically linked to it.
+		 */
+		static HPrefab create(const HSceneObject& sceneObject);
+
+		/**
+		 * Instantiates a prefab by creating an instance of the prefab's scene object hierarchy. The returned hierarchy 
+		 * will be parented to world root by default.
+		 *			
+		 * @return	Instantiated clone of the prefab's scene object hierarchy.
+		 */
+		HSceneObject instantiate();
+
+		/**
+		 * Replaces the contents of this prefab with new contents from the provided object. Object will be automatically
+		 * linked to this prefab, and its previous prefab link (if any) will be broken.
+		 */
+		void update(const HSceneObject& sceneObject);
+
+		/**
+		 * Returns a hash value that can be used for determining if a prefab changed by comparing it to a previously saved
+		 * hash.
+		 */
+		UINT32 getHash() const { return mHash; }
+
+		/** @cond INTERNAL */
+
+		/** Updates any prefab child instances by loading their prefabs and making sure they are up to date. */
+		void _updateChildInstances();
+
+		/**
+		 * Returns a reference to the internal prefab hierarchy. Returned hierarchy is not instantiated and cannot be 
+		 * interacted with in a manner you would with normal scene objects.
+		 */
+		HSceneObject _getRoot() const { return mRoot; }
+
+		/**
+		 * Creates the clone of the prefab's current hierarchy but doesn't instantiate it.
+		 *			
+		 * @return	Clone of the prefab's scene object hierarchy.
+		 */
+		HSceneObject _clone();
+
+		/** @endcond */
+
+	private:
+		/**	Initializes the internal prefab hierarchy. Must be called druing creation. */
+		void initialize(const HSceneObject& sceneObject);
+
+		/**	Creates an empty and uninitialized prefab. */
+		static PrefabPtr createEmpty();
+
+		HSceneObject mRoot;
+		UINT32 mHash;
+		String mUUID;
+		UINT32 mNextLinkId;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+
+	public:
+		friend class PrefabRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		virtual RTTITypeBase* getRTTI() const override;
+	};
+
+	/** @} */
 }

+ 155 - 152
BansheeCore/Include/BsPrefabDiff.h

@@ -1,153 +1,156 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsIReflectable.h"
-#include "BsGameObject.h"
-#include "BsVector3.h"
-#include "BsQuaternion.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Contains differences between two components of the same type.
-	 *
-	 * @see		PrefabDiff
-	 */
-	struct BS_CORE_EXPORT PrefabComponentDiff : public IReflectable
-	{
-		INT32 id;
-		SPtr<SerializedObject> data;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-
-	public:
-		friend class PrefabComponentDiffRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const override;
-	};
-
-	/**
-	 * @brief	Flags that mark which portion of a scene-object is modified.
-	 */
-	enum class SceneObjectDiffFlags
-	{
-		Name = 0x01,
-		Position = 0x02,
-		Rotation = 0x04,
-		Scale = 0x08,
-		Active = 0x10
-	};
-
-	/**
-	 * @brief	Contains a set of prefab differences for a single scene object.
-	 *
-	 * @see		PrefabDiff
-	 */
-	struct BS_CORE_EXPORT PrefabObjectDiff : public IReflectable
-	{
-		UINT32 id = 0;
-
-		String name;
-		Vector3 position;
-		Quaternion rotation;
-		Vector3 scale;
-		bool isActive = false;
-		UINT32 soFlags = 0;
-
-		Vector<SPtr<PrefabComponentDiff>> componentDiffs;
-		Vector<UINT32> removedComponents;
-		Vector<SPtr<SerializedObject>> addedComponents;
-
-		Vector<SPtr<PrefabObjectDiff>> childDiffs;
-		Vector<UINT32> removedChildren;
-		Vector<SPtr<SerializedObject>> addedChildren;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-
-	public:
-		friend class PrefabObjectDiffRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const override;
-	};
-
-	/**
-	 * @brief	Contains modifications between an prefab and its instance. The modifications are a set of
-	 *			added/removed children or components and per-field "diffs" of their components.
-	 */
-	class BS_CORE_EXPORT PrefabDiff : public IReflectable
-	{
-	public:
-		/**
-		 * @brief	Creates a new prefab diff by comparing the provided instanced scene object hierarchy
-		 *			with the prefab scene object hierarchy.
-		 */
-		static SPtr<PrefabDiff> create(const HSceneObject& prefab, const HSceneObject& instance);
-
-		/**
-		 * @brief	Applies the internal prefab diff to the provided object. The object should have
-		 *			similar hierarchy as the prefab the diff was created for, otherwise the results are
-		 *			undefined.
-		 */
-		void apply(const HSceneObject& object);
-
-	private:
-		/**
-		 * @brief	A reference to a renamed game object instance data, and its original ID
-		 *			so it may be restored later.
-		 */
-		struct RenamedGameObject
-		{
-			GameObjectInstanceDataPtr instanceData;
-			UINT64 originalId;
-		};
-
-		/**
-		 * @brief	Recurses over every scene object in the prefab a generates differences between itself
-		 *			and the instanced version.
-		 *
-		 * @see		create
-		 */
-		static SPtr<PrefabObjectDiff> generateDiff(const HSceneObject& prefab, const HSceneObject& instance);
-
-		/**
-		 * @brief	Recursively applies a per-object set of prefab differences to a specific object.
-		 *
-		 * @see		apply			
-		 */
-		static void applyDiff(const SPtr<PrefabObjectDiff>& diff, const HSceneObject& object);
-
-		/**
-		 * @brief	Renames all game objects in the provided instance so that IDs of the objects will match
-		 *			the IDs of their counterparts in the prefab. 
-		 *
-		 * @note	This is a temporary action and should be undone by calling "restoreInstanceIds" and providing 
-		 *			it with the output of this method. 
-		 * @par		By doing this before calling ::generateDiff we ensure that any game object handles pointing to objects 
-		 *			within the prefab instance hierarchy aren't recorded by the diff system, since we want those to 
-		 *			remain as they are after applying the diff.
-		 */
-		static void renameInstanceIds(const HSceneObject& prefab, const HSceneObject& instance, Vector<RenamedGameObject>& output);
-
-		/**
-		 * @brief	Restores any instance IDs that were modified by the "renameInstanceIds" method.
-		 *
-		 * @see		renameInstanceIds;
-		 */
-		static void restoreInstanceIds(const Vector<RenamedGameObject>& renamedObjects);
-
-		SPtr<PrefabObjectDiff> mRoot;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-
-	public:
-		friend class PrefabDiffRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const override;
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsIReflectable.h"
+#include "BsGameObject.h"
+#include "BsVector3.h"
+#include "BsQuaternion.h"
+
+namespace BansheeEngine
+{
+	/** @cond INTERNAL */
+	/** @addtogroup Scene
+	 *  @{
+	 */
+
+	/**
+	 * Contains differences between two components of the same type.
+	 *
+	 * @see		PrefabDiff
+	 */
+	struct BS_CORE_EXPORT PrefabComponentDiff : public IReflectable
+	{
+		INT32 id;
+		SPtr<SerializedObject> data;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+
+	public:
+		friend class PrefabComponentDiffRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		virtual RTTITypeBase* getRTTI() const override;
+	};
+
+	/** Flags that mark which portion of a scene-object is modified. */
+	enum class SceneObjectDiffFlags
+	{
+		Name = 0x01,
+		Position = 0x02,
+		Rotation = 0x04,
+		Scale = 0x08,
+		Active = 0x10
+	};
+
+	/**
+	 * Contains a set of prefab differences for a single scene object.
+	 *
+	 * @see		PrefabDiff
+	 */
+	struct BS_CORE_EXPORT PrefabObjectDiff : public IReflectable
+	{
+		UINT32 id = 0;
+
+		String name;
+		Vector3 position;
+		Quaternion rotation;
+		Vector3 scale;
+		bool isActive = false;
+		UINT32 soFlags = 0;
+
+		Vector<SPtr<PrefabComponentDiff>> componentDiffs;
+		Vector<UINT32> removedComponents;
+		Vector<SPtr<SerializedObject>> addedComponents;
+
+		Vector<SPtr<PrefabObjectDiff>> childDiffs;
+		Vector<UINT32> removedChildren;
+		Vector<SPtr<SerializedObject>> addedChildren;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+
+	public:
+		friend class PrefabObjectDiffRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		virtual RTTITypeBase* getRTTI() const override;
+	};
+
+	/**
+	 * Contains modifications between an prefab and its instance. The modifications are a set of added/removed children or
+	 * components and per-field "diffs" of their components.
+	 */
+	class BS_CORE_EXPORT PrefabDiff : public IReflectable
+	{
+	public:
+		/**
+		 * Creates a new prefab diff by comparing the provided instanced scene object hierarchy with the prefab scene 
+		 * object hierarchy.
+		 */
+		static SPtr<PrefabDiff> create(const HSceneObject& prefab, const HSceneObject& instance);
+
+		/**
+		 * Applies the internal prefab diff to the provided object. The object should have similar hierarchy as the prefab
+		 * the diff was created for, otherwise the results are undefined.
+		 */
+		void apply(const HSceneObject& object);
+
+	private:
+		/** A reference to a renamed game object instance data, and its original ID so it may be restored later. */
+		struct RenamedGameObject
+		{
+			GameObjectInstanceDataPtr instanceData;
+			UINT64 originalId;
+		};
+
+		/**
+		 * Recurses over every scene object in the prefab a generates differences between itself and the instanced version.
+		 *
+		 * @see		create
+		 */
+		static SPtr<PrefabObjectDiff> generateDiff(const HSceneObject& prefab, const HSceneObject& instance);
+
+		/**
+		 * Recursively applies a per-object set of prefab differences to a specific object.
+		 *
+		 * @see		apply			
+		 */
+		static void applyDiff(const SPtr<PrefabObjectDiff>& diff, const HSceneObject& object);
+
+		/**
+		 * Renames all game objects in the provided instance so that IDs of the objects will match the IDs of their 
+		 * counterparts in the prefab. 
+		 *
+		 * @note	
+		 * This is a temporary action and should be undone by calling restoreInstanceIds() and providing  it with the 
+		 * output of this method. 
+		 * @note
+		 * By doing this before calling generateDiff() we ensure that any game object handles pointing to objects within 
+		 * the prefab instance hierarchy aren't recorded by the diff system, since we want those to remain as they are 
+		 * after applying the diff.
+		 */
+		static void renameInstanceIds(const HSceneObject& prefab, const HSceneObject& instance, Vector<RenamedGameObject>& output);
+
+		/**
+		 * Restores any instance IDs that were modified by the renameInstanceIds() method.
+		 *
+		 * @see		renameInstanceIds
+		 */
+		static void restoreInstanceIds(const Vector<RenamedGameObject>& renamedObjects);
+
+		SPtr<PrefabObjectDiff> mRoot;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+
+	public:
+		friend class PrefabDiffRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		virtual RTTITypeBase* getRTTI() const override;
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 19 - 11
BansheeCore/Include/BsPrefabDiffRTTI.h

@@ -9,6 +9,11 @@
 
 namespace BansheeEngine
 {
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
 	class BS_CORE_EXPORT PrefabComponentDiffRTTI : public RTTIType < PrefabComponentDiff, IReflectable, PrefabComponentDiffRTTI >
 	{
 	private:
@@ -21,18 +26,18 @@ namespace BansheeEngine
 			BS_ADD_REFLPTR_FIELD(data, 1);
 		}
 
-		virtual const String& getRTTIName() override
+		const String& getRTTIName() override
 		{
 			static String name = "PrefabComponentDiff";
 			return name;
 		}
 
-		virtual UINT32 getRTTIId() override
+		UINT32 getRTTIId() override
 		{
 			return TID_PrefabComponentDiff;
 		}
 
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
+		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			return bs_shared_ptr_new<PrefabComponentDiff>();
 		}
@@ -80,18 +85,18 @@ namespace BansheeEngine
 			BS_ADD_PLAIN_FIELD(soFlags, 12);
 		}
 
-		virtual const String& getRTTIName() override
+		const String& getRTTIName() override
 		{
 			static String name = "PrefabObjectDiff";
 			return name;
 		}
 
-		virtual UINT32 getRTTIId() override
+		UINT32 getRTTIId() override
 		{
 			return TID_PrefabObjectDiff;
 		}
 
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
+		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			return bs_shared_ptr_new<PrefabObjectDiff>();
 		}
@@ -116,7 +121,7 @@ namespace BansheeEngine
 			BS_ADD_REFLPTR_FIELD(mRoot, 0);
 		}
 
-		virtual void onDeserializationStarted(IReflectable* obj) override
+		void onDeserializationStarted(IReflectable* obj) override
 		{
 			PrefabDiff* prefabDiff = static_cast<PrefabDiff*>(obj);
 
@@ -124,7 +129,7 @@ namespace BansheeEngine
 				GameObjectManager::instance().registerOnDeserializationEndCallback(std::bind(&PrefabDiffRTTI::delayedOnDeserializationEnded, prefabDiff));
 		}
 
-		virtual void onDeserializationEnded(IReflectable* obj) override
+		void onDeserializationEnded(IReflectable* obj) override
 		{
 			assert(GameObjectManager::instance().isGameObjectDeserializationActive());
 
@@ -243,20 +248,23 @@ namespace BansheeEngine
 			}
 		}
 
-		virtual const String& getRTTIName() override
+		const String& getRTTIName() override
 		{
 			static String name = "PrefabDiff";
 			return name;
 		}
 
-		virtual UINT32 getRTTIId() override
+		UINT32 getRTTIId() override
 		{
 			return TID_PrefabDiff;
 		}
 
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
+		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			return bs_shared_ptr_new<PrefabDiff>();
 		}
 	};
+
+	/** @} */
+	/** @endcond */
 }

+ 61 - 53
BansheeCore/Include/BsPrefabRTTI.h

@@ -1,54 +1,62 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsPrefab.h"
-#include "BsSceneObject.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT PrefabRTTI : public RTTIType < Prefab, Resource, PrefabRTTI >
-	{
-	private:
-		SceneObjectPtr getSceneObject(Prefab* obj) { return obj->mRoot.getInternalPtr(); }
-		void setSceneObject(Prefab* obj, SceneObjectPtr value) { obj->mRoot = value->getHandle(); }
-
-		UINT32& getHash(Prefab* obj) { return obj->mHash; }
-		void setHash(Prefab* obj, UINT32& val) { obj->mHash = val; }
-
-		UINT32& getNextLinkId(Prefab* obj) { return obj->mNextLinkId; }
-		void setNextLinkId(Prefab* obj, UINT32& val) { obj->mNextLinkId = val; }
-
-	public:
-		PrefabRTTI()
-		{
-			addReflectablePtrField("mRoot", 0, &PrefabRTTI::getSceneObject, &PrefabRTTI::setSceneObject);
-			addPlainField("mHash", 1, &PrefabRTTI::getHash, &PrefabRTTI::setHash);
-			addPlainField("mNextLinkId", 2, &PrefabRTTI::getNextLinkId, &PrefabRTTI::setNextLinkId);
-		}
-
-		virtual void onDeserializationStarted(IReflectable* ptr) override
-		{
-			// Make sure external IDs are broken because we do some ID matching when dealing with prefabs and keeping
-			// the invalid external references could cause it to match invalid objects in case they end up having the
-			// same ID.
-			GameObjectManager::instance().setDeserializationMode(GODM_UseNewIds | GODM_BreakExternal);
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "Prefab";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_Prefab;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return Prefab::createEmpty();
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsPrefab.h"
+#include "BsSceneObject.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT PrefabRTTI : public RTTIType < Prefab, Resource, PrefabRTTI >
+	{
+	private:
+		SceneObjectPtr getSceneObject(Prefab* obj) { return obj->mRoot.getInternalPtr(); }
+		void setSceneObject(Prefab* obj, SceneObjectPtr value) { obj->mRoot = value->getHandle(); }
+
+		UINT32& getHash(Prefab* obj) { return obj->mHash; }
+		void setHash(Prefab* obj, UINT32& val) { obj->mHash = val; }
+
+		UINT32& getNextLinkId(Prefab* obj) { return obj->mNextLinkId; }
+		void setNextLinkId(Prefab* obj, UINT32& val) { obj->mNextLinkId = val; }
+
+	public:
+		PrefabRTTI()
+		{
+			addReflectablePtrField("mRoot", 0, &PrefabRTTI::getSceneObject, &PrefabRTTI::setSceneObject);
+			addPlainField("mHash", 1, &PrefabRTTI::getHash, &PrefabRTTI::setHash);
+			addPlainField("mNextLinkId", 2, &PrefabRTTI::getNextLinkId, &PrefabRTTI::setNextLinkId);
+		}
+
+		void onDeserializationStarted(IReflectable* ptr) override
+		{
+			// Make sure external IDs are broken because we do some ID matching when dealing with prefabs and keeping
+			// the invalid external references could cause it to match invalid objects in case they end up having the
+			// same ID.
+			GameObjectManager::instance().setDeserializationMode(GODM_UseNewIds | GODM_BreakExternal);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "Prefab";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_Prefab;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return Prefab::createEmpty();
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 116 - 122
BansheeCore/Include/BsPrefabUtility.h

@@ -1,123 +1,117 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsGameObject.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Performs various prefab specific operations.
-	 */
-	class BS_CORE_EXPORT PrefabUtility
-	{
-	private:
-		/**
-		 * @brief	Contains saved Component instance data.
-		 */
-		struct ComponentProxy
-		{
-			GameObjectInstanceDataPtr instanceData;
-			UINT32 linkId;
-		};
-
-		/**
-		 * @brief	Contains saved SceneObject instance data, as well as
-		 *			saved instance data for all its children and components.
-		 */
-		struct SceneObjectProxy
-		{
-			GameObjectInstanceDataPtr instanceData;
-			UINT32 linkId;
-
-			Vector<ComponentProxy> components;
-			Vector<SceneObjectProxy> children;
-		};
-
-	public:
-		/**
-		 * @brief	Remove any instance specific changes to the object or its hierarchy from the 
-		 *			provided prefab instance and restore it to the exact copy of the linked prefab.
-		 *
-		 * @param[in]	so	Object to revert.
-		 */
-		static void revertToPrefab(const HSceneObject& so);
-
-		/**
-		 * @brief	Updates all of the objects belonging to the same prefab instance
-		 *			as the provided object (if any). The update will apply any changes
-		 *			from the linked prefab to the hierarchy (if any).
-		 *
-		 * @param[in]	so	Object to update.
-		 */
-		static void updateFromPrefab(const HSceneObject& so);
-
-		/**
-		 * @brief	Generates prefab "link" ID that can be used for tracking which game object
-		 *			in a prefab instance corresponds to an object in the prefab.
-		 *
-		 * @note	If any children of the provided object belong to another prefab they will 
-		 *			not have IDs generated.
-		 */
-		static UINT32 generatePrefabIds(const HSceneObject& sceneObject, UINT32 startingId);
-
-		/**
-		 * @brief	Clears all prefab "link" IDs in the provided object and its children.
-		 *
-		 * @note	If any of its children belong to another prefab they will not be cleared.
-		 */
-		static void clearPrefabIds(const HSceneObject& sceneObject, bool recursive = true);
-
-		/**
-		 * @brief	Updates the internal prefab diff data by recording the difference
-		 *			between the current values in the provided prefab instance and its prefab.
-		 *
-		 * @note	If the provided object contains any child prefab instances, this will be
-		 *			done recursively for them as well.
-		 */
-		static void recordPrefabDiff(const HSceneObject& sceneObject);
-
-	private:
-		/**
-	     * @brief	Traverses the object hierarchy, finds all child objects and components
-		 *			and records their instance data, as well as their original place in the hierarchy.
-		 *			Instance data essentially holds the object's "identity" and by restoring it we
-		 *			ensure any handles pointing to the object earlier will still point to the new version.
-		 *
-		 * @param[in]	so					Object to traverse and record.
-		 * @param[out]	output				Contains the output hierarchy of instance data.
-		 * @param[out]	linkedInstanceData	A map of link IDs to instance data. Objects without
-		 *									link IDs will not be included here.
-		 *
-		 * @note	Does not recurse into child prefab instances.
-		 */
-		static void recordInstanceData(const HSceneObject& so, SceneObjectProxy& output, 
-			UnorderedMap<UINT32, GameObjectInstanceDataPtr>& linkedInstanceData);
-
-		/**
-		 * @brief	Restores instance data in the provided hierarchy, using link ids to determine
-		 *			what data maps to which objects. 
-		 *
-		 * @param[in]	so		Object to traverse and restore the instance data.
-		 * @param[in]	proxy	Hierarchy containing instance data for all objects and components, returned by
-		 *						"recordInstanceData" method.				
-		 * @param[in]	linkedInstanceData	A map of link IDs to instance data, returned by "recordInstanceData" method.
-		 *
-		 * @note	Does not recurse into child prefab instances.
-		 */
-		static void restoreLinkedInstanceData(const HSceneObject& so, SceneObjectProxy& proxy, 
-			UnorderedMap<UINT32, GameObjectInstanceDataPtr>& linkedInstanceData);
-
-		/**
-		 * @brief	Restores instance data in the provided hierarchy, but only for objects without a link id.
-		 *			Since the objects do not have a link ID we rely on their sequential order to find out
-		 *			which instance data belongs to which object.
-		 *
-		 * @param[in]	so		Object to traverse and restore the instance data.
-		 * @param[in]	proxy	Hierarchy containing instance data for all objects and components, returned by
-		 *						"recordInstanceData" method.
-		 *
-		 * @note	Does not recurse into child prefab instances.
-		 */
-		static void restoreUnlinkedInstanceData(const HSceneObject& so, SceneObjectProxy& proxy);
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsGameObject.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup Scene
+	 *  @{
+	 */
+
+	/** Performs various prefab specific operations. */
+	class BS_CORE_EXPORT PrefabUtility
+	{
+	private:
+		/**	Contains saved Component instance data. */
+		struct ComponentProxy
+		{
+			GameObjectInstanceDataPtr instanceData;
+			UINT32 linkId;
+		};
+
+		/** Contains saved SceneObject instance data, as well as saved instance data for all its children and components. */
+		struct SceneObjectProxy
+		{
+			GameObjectInstanceDataPtr instanceData;
+			UINT32 linkId;
+
+			Vector<ComponentProxy> components;
+			Vector<SceneObjectProxy> children;
+		};
+
+	public:
+		/**
+		 * Remove any instance specific changes to the object or its hierarchy from the provided prefab instance and 
+		 * restore it to the exact copy of the linked prefab.
+		 *
+		 * @param[in]	so	Object to revert.
+		 */
+		static void revertToPrefab(const HSceneObject& so);
+
+		/**
+		 * Updates all of the objects belonging to the same prefab instance as the provided object (if any). The update
+		 * will apply any changes from the linked prefab to the hierarchy (if any).
+		 *
+		 * @param[in]	so	Object to update.
+		 */
+		static void updateFromPrefab(const HSceneObject& so);
+
+		/**
+		 * Generates prefab "link" ID that can be used for tracking which game object in a prefab instance corresponds to
+		 * an object in the prefab.
+		 *
+		 * @note	If any children of the provided object belong to another prefab they will not have IDs generated.
+		 */
+		static UINT32 generatePrefabIds(const HSceneObject& sceneObject, UINT32 startingId);
+
+		/**
+		 * Clears all prefab "link" IDs in the provided object and its children.
+		 *
+		 * @note	If any of its children belong to another prefab they will not be cleared.
+		 */
+		static void clearPrefabIds(const HSceneObject& sceneObject, bool recursive = true);
+
+		/**
+		 * Updates the internal prefab diff data by recording the difference between the current values in the provided
+		 * prefab instance and its prefab.
+		 *
+		 * @note	
+		 * If the provided object contains any child prefab instances, this will be done recursively for them as well.
+		 */
+		static void recordPrefabDiff(const HSceneObject& sceneObject);
+
+	private:
+		/**
+	     * Traverses the object hierarchy, finds all child objects and components and records their instance data, as well
+		 * as their original place in the hierarchy. Instance data essentially holds the object's "identity" and by 
+		 * restoring it we ensure any handles pointing to the object earlier will still point to the new version.
+		 *
+		 * @param[in]	so					Object to traverse and record.
+		 * @param[out]	output				Contains the output hierarchy of instance data.
+		 * @param[out]	linkedInstanceData	A map of link IDs to instance data. Objects without link IDs will not be 
+		 *									included here.
+		 *
+		 * @note	Does not recurse into child prefab instances.
+		 */
+		static void recordInstanceData(const HSceneObject& so, SceneObjectProxy& output, 
+			UnorderedMap<UINT32, GameObjectInstanceDataPtr>& linkedInstanceData);
+
+		/**
+		 * Restores instance data in the provided hierarchy, using link ids to determine what data maps to which objects. 
+		 *
+		 * @param[in]	so					Object to traverse and restore the instance data.
+		 * @param[in]	proxy				Hierarchy containing instance data for all objects and components, returned by
+		 *									recordInstanceData() method.				
+		 * @param[in]	linkedInstanceData	A map of link IDs to instance data, returned by recordInstanceData() method.
+		 *
+		 * @note	Does not recurse into child prefab instances.
+		 */
+		static void restoreLinkedInstanceData(const HSceneObject& so, SceneObjectProxy& proxy, 
+			UnorderedMap<UINT32, GameObjectInstanceDataPtr>& linkedInstanceData);
+
+		/**
+		 * Restores instance data in the provided hierarchy, but only for objects without a link id. Since the objects do
+		 * not have a link ID we rely on their sequential order to find out which instance data belongs to which object.
+		 *
+		 * @param[in]	so		Object to traverse and restore the instance data.
+		 * @param[in]	proxy	Hierarchy containing instance data for all objects and components, returned by
+		 *						recordInstanceData() method.
+		 *
+		 * @note	Does not recurse into child prefab instances.
+		 */
+		static void restoreUnlinkedInstanceData(const HSceneObject& so, SceneObjectProxy& proxy);
+	};
+
+	/** @} */
 }

+ 53 - 45
BansheeCore/Include/BsRasterizerStateRTTI.h

@@ -1,46 +1,54 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsRasterizerState.h"
-#include "BsRenderStateManager.h"
-
-namespace BansheeEngine
-{
-	BS_ALLOW_MEMCPY_SERIALIZATION(RASTERIZER_STATE_DESC);
-
-	class BS_CORE_EXPORT RasterizerStateRTTI : public RTTIType<RasterizerState, IReflectable, RasterizerStateRTTI>
-	{
-	private:
-		RASTERIZER_STATE_DESC& getData(RasterizerState* obj) { return obj->mProperties.mData; }
-		void setData(RasterizerState* obj, RASTERIZER_STATE_DESC& val) { obj->mProperties.mData = val; } 
-
-	public:
-		RasterizerStateRTTI()
-		{
-			addPlainField("mData", 0, &RasterizerStateRTTI::getData, &RasterizerStateRTTI::setData);
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj) override
-		{
-			RasterizerState* rasterizerState = static_cast<RasterizerState*>(obj);
-			rasterizerState->initialize();
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "RasterizerState";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_RasterizerState;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return RenderStateManager::instance()._createRasterizerStatePtr(RASTERIZER_STATE_DESC());
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsRasterizerState.h"
+#include "BsRenderStateManager.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	BS_ALLOW_MEMCPY_SERIALIZATION(RASTERIZER_STATE_DESC);
+
+	class BS_CORE_EXPORT RasterizerStateRTTI : public RTTIType<RasterizerState, IReflectable, RasterizerStateRTTI>
+	{
+	private:
+		RASTERIZER_STATE_DESC& getData(RasterizerState* obj) { return obj->mProperties.mData; }
+		void setData(RasterizerState* obj, RASTERIZER_STATE_DESC& val) { obj->mProperties.mData = val; } 
+
+	public:
+		RasterizerStateRTTI()
+		{
+			addPlainField("mData", 0, &RasterizerStateRTTI::getData, &RasterizerStateRTTI::setData);
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			RasterizerState* rasterizerState = static_cast<RasterizerState*>(obj);
+			rasterizerState->initialize();
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "RasterizerState";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_RasterizerState;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return RenderStateManager::instance()._createRasterizerStatePtr(RASTERIZER_STATE_DESC());
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 118 - 110
BansheeCore/Include/BsResourceHandleRTTI.h

@@ -1,111 +1,119 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsResourceHandle.h"
-#include "BsResources.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT ResourceHandleRTTI : public RTTIType<TResourceHandleBase<false>, IReflectable, ResourceHandleRTTI>
-	{
-	private:
-		String& getUUID(TResourceHandleBase<false>* obj)
-		{ 
-			static String Blank = "";
-
-			return obj->mData != nullptr ? obj->mData->mUUID : Blank; 
-		}
-
-		void setUUID(TResourceHandleBase<false>* obj, String& uuid) { obj->mData->mUUID = uuid; }
-	public:
-		ResourceHandleRTTI()
-		{
-			addPlainField("mUUID", 0, &ResourceHandleRTTI::getUUID, &ResourceHandleRTTI::setUUID);
-		}
-
-		void onDeserializationEnded(IReflectable* obj) override
-		{
-			TResourceHandleBase<false>* resourceHandle = static_cast<TResourceHandleBase<false>*>(obj);
-
-			if(resourceHandle->mData && resourceHandle->mData->mUUID != "")
-			{
-				HResource loadedResource = gResources()._getResourceHandle(resourceHandle->mData->mUUID);
-
-				resourceHandle->releaseRef();
-				resourceHandle->mData = loadedResource.mData;
-				resourceHandle->addRef();
-			}
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "ResourceHandleBase";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_ResourceHandle;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			SPtr<TResourceHandleBase<false>> obj = bs_shared_ptr<TResourceHandleBase<false>>
-				(new (bs_alloc<TResourceHandleBase<false>>()) TResourceHandleBase<false>());
-			obj->mData = bs_shared_ptr_new<ResourceHandleData>();
-			obj->mData->mRefCount++;
-
-			return obj;
-		}
-	};
-
-	class BS_CORE_EXPORT WeakResourceHandleRTTI : public RTTIType<TResourceHandleBase<true>, IReflectable, WeakResourceHandleRTTI>
-	{
-	private:
-		String& getUUID(TResourceHandleBase<true>* obj)
-		{
-			static String Blank = "";
-
-			return obj->mData != nullptr ? obj->mData->mUUID : Blank;
-		}
-
-		void setUUID(TResourceHandleBase<true>* obj, String& uuid) { obj->mData->mUUID = uuid; }
-	public:
-		WeakResourceHandleRTTI()
-		{
-			addPlainField("mUUID", 0, &WeakResourceHandleRTTI::getUUID, &WeakResourceHandleRTTI::setUUID);
-		}
-
-		void onDeserializationEnded(IReflectable* obj) override
-		{
-			TResourceHandleBase<true>* resourceHandle = static_cast<TResourceHandleBase<true>*>(obj);
-
-			if (resourceHandle->mData && resourceHandle->mData->mUUID != "")
-			{
-				HResource loadedResource = gResources()._getResourceHandle(resourceHandle->mData->mUUID);
-				resourceHandle->mData = loadedResource.mData;
-			}
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "WeakResourceHandleBase";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_WeakResourceHandle;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			SPtr<TResourceHandleBase<true>> obj = bs_shared_ptr<TResourceHandleBase<true>>
-				(new (bs_alloc<TResourceHandleBase<true>>()) TResourceHandleBase<true>());
-			obj->mData = bs_shared_ptr_new<ResourceHandleData>();
-
-			return obj;
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsResourceHandle.h"
+#include "BsResources.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT ResourceHandleRTTI : public RTTIType<TResourceHandleBase<false>, IReflectable, ResourceHandleRTTI>
+	{
+	private:
+		String& getUUID(TResourceHandleBase<false>* obj)
+		{ 
+			static String Blank = "";
+
+			return obj->mData != nullptr ? obj->mData->mUUID : Blank; 
+		}
+
+		void setUUID(TResourceHandleBase<false>* obj, String& uuid) { obj->mData->mUUID = uuid; }
+	public:
+		ResourceHandleRTTI()
+		{
+			addPlainField("mUUID", 0, &ResourceHandleRTTI::getUUID, &ResourceHandleRTTI::setUUID);
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			TResourceHandleBase<false>* resourceHandle = static_cast<TResourceHandleBase<false>*>(obj);
+
+			if(resourceHandle->mData && resourceHandle->mData->mUUID != "")
+			{
+				HResource loadedResource = gResources()._getResourceHandle(resourceHandle->mData->mUUID);
+
+				resourceHandle->releaseRef();
+				resourceHandle->mData = loadedResource.mData;
+				resourceHandle->addRef();
+			}
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "ResourceHandleBase";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_ResourceHandle;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			SPtr<TResourceHandleBase<false>> obj = bs_shared_ptr<TResourceHandleBase<false>>
+				(new (bs_alloc<TResourceHandleBase<false>>()) TResourceHandleBase<false>());
+			obj->mData = bs_shared_ptr_new<ResourceHandleData>();
+			obj->mData->mRefCount++;
+
+			return obj;
+		}
+	};
+
+	class BS_CORE_EXPORT WeakResourceHandleRTTI : public RTTIType<TResourceHandleBase<true>, IReflectable, WeakResourceHandleRTTI>
+	{
+	private:
+		String& getUUID(TResourceHandleBase<true>* obj)
+		{
+			static String Blank = "";
+
+			return obj->mData != nullptr ? obj->mData->mUUID : Blank;
+		}
+
+		void setUUID(TResourceHandleBase<true>* obj, String& uuid) { obj->mData->mUUID = uuid; }
+	public:
+		WeakResourceHandleRTTI()
+		{
+			addPlainField("mUUID", 0, &WeakResourceHandleRTTI::getUUID, &WeakResourceHandleRTTI::setUUID);
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			TResourceHandleBase<true>* resourceHandle = static_cast<TResourceHandleBase<true>*>(obj);
+
+			if (resourceHandle->mData && resourceHandle->mData->mUUID != "")
+			{
+				HResource loadedResource = gResources()._getResourceHandle(resourceHandle->mData->mUUID);
+				resourceHandle->mData = loadedResource.mData;
+			}
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "WeakResourceHandleBase";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_WeakResourceHandle;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			SPtr<TResourceHandleBase<true>> obj = bs_shared_ptr<TResourceHandleBase<true>>
+				(new (bs_alloc<TResourceHandleBase<true>>()) TResourceHandleBase<true>());
+			obj->mData = bs_shared_ptr_new<ResourceHandleData>();
+
+			return obj;
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 58 - 60
BansheeCore/Include/BsResourceManifestRTTI.h

@@ -1,61 +1,59 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsResourceManifest.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT ResourceManifestRTTI : public RTTIType<ResourceManifest, IReflectable, ResourceManifestRTTI>
-	{
-	private:
-		String& getName(ResourceManifest* obj)
-		{
-			return obj->mName;
-		}
-
-		void setName(ResourceManifest* obj, String& val)
-		{
-			obj->mName = val;
-		}
-
-		UnorderedMap<String, Path>& getUUIDMap(ResourceManifest* obj)
-		{ 
-			return obj->mUUIDToFilePath;
-		}
-
-		void setUUIDMap(ResourceManifest* obj, UnorderedMap<String, Path>& val)
-		{ 
-			obj->mUUIDToFilePath = val; 
-
-			obj->mFilePathToUUID.clear();
-
-			for(auto& entry : obj->mUUIDToFilePath)
-			{
-				obj->mFilePathToUUID[entry.second] = entry.first;
-			}
-		} 
-	public:
-		ResourceManifestRTTI()
-		{
-			addPlainField("mName", 0, &ResourceManifestRTTI::getName, &ResourceManifestRTTI::setName);
-			addPlainField("mUUIDToFilePath", 1, &ResourceManifestRTTI::getUUIDMap, &ResourceManifestRTTI::setUUIDMap);
-		}
-
-		virtual const String& getRTTIName()
-		{
-			static String name = "ResourceManifest";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId()
-		{
-			return TID_ResourceManifest;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject()
-		{
-			return ResourceManifest::createEmpty();
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsResourceManifest.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT ResourceManifestRTTI : public RTTIType<ResourceManifest, IReflectable, ResourceManifestRTTI>
+	{
+	private:
+		String& getName(ResourceManifest* obj) { return obj->mName; }
+		void setName(ResourceManifest* obj, String& val) { obj->mName = val; }
+
+		UnorderedMap<String, Path>& getUUIDMap(ResourceManifest* obj) { return obj->mUUIDToFilePath; }
+
+		void setUUIDMap(ResourceManifest* obj, UnorderedMap<String, Path>& val)
+		{ 
+			obj->mUUIDToFilePath = val; 
+
+			obj->mFilePathToUUID.clear();
+
+			for(auto& entry : obj->mUUIDToFilePath)
+			{
+				obj->mFilePathToUUID[entry.second] = entry.first;
+			}
+		} 
+	public:
+		ResourceManifestRTTI()
+		{
+			addPlainField("mName", 0, &ResourceManifestRTTI::getName, &ResourceManifestRTTI::setName);
+			addPlainField("mUUIDToFilePath", 1, &ResourceManifestRTTI::getUUIDMap, &ResourceManifestRTTI::setUUIDMap);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "ResourceManifest";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_ResourceManifest;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return ResourceManifest::createEmpty();
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 44 - 36
BansheeCore/Include/BsResourceMetaDataRTTI.h

@@ -1,37 +1,45 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsResourceMetaData.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT ResourceMetaDataRTTI : public RTTIType<ResourceMetaData, IReflectable, ResourceMetaDataRTTI>
-	{
-	private:
-		WString& getDisplayName(ResourceMetaData* obj) { return obj->displayName; }
-		void setDisplayName(ResourceMetaData* obj, WString& name) { obj->displayName = name; }
-
-	public:
-		ResourceMetaDataRTTI()
-		{
-			addPlainField("displayName", 0, &ResourceMetaDataRTTI::getDisplayName, &ResourceMetaDataRTTI::setDisplayName);
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "ResourceMetaData";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_ResourceMetaData;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<ResourceMetaData>();
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsResourceMetaData.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT ResourceMetaDataRTTI : public RTTIType<ResourceMetaData, IReflectable, ResourceMetaDataRTTI>
+	{
+	private:
+		WString& getDisplayName(ResourceMetaData* obj) { return obj->displayName; }
+		void setDisplayName(ResourceMetaData* obj, WString& name) { obj->displayName = name; }
+
+	public:
+		ResourceMetaDataRTTI()
+		{
+			addPlainField("displayName", 0, &ResourceMetaDataRTTI::getDisplayName, &ResourceMetaDataRTTI::setDisplayName);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "ResourceMetaData";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_ResourceMetaData;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<ResourceMetaData>();
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 49 - 41
BansheeCore/Include/BsResourceRTTI.h

@@ -1,42 +1,50 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsResource.h"
-#include "BsResourceMetaData.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT ResourceRTTI : public RTTIType<Resource, IReflectable, ResourceRTTI>
-	{
-	private:
-		UINT32& getSize(Resource* obj) { return obj->mSize; }
-		void setSize(Resource* obj, UINT32& size) { obj->mSize = size; } 
-
-		ResourceMetaDataPtr getMetaData(Resource* obj) { return obj->mMetaData; }
-		void setMetaData(Resource* obj, ResourceMetaDataPtr value) { obj->mMetaData = value; }
-
-	public:
-		ResourceRTTI()
-		{
-			addPlainField("mSize", 0, &ResourceRTTI::getSize, &ResourceRTTI::setSize);
-			addReflectablePtrField("mMetaData", 1, &ResourceRTTI::getMetaData, &ResourceRTTI::setMetaData);
-		}
-
-		virtual const String& getRTTIName()
-		{
-			static String name = "Resource";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId()
-		{
-			return 100;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject()
-		{
-			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsResource.h"
+#include "BsResourceMetaData.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT ResourceRTTI : public RTTIType<Resource, IReflectable, ResourceRTTI>
+	{
+	private:
+		UINT32& getSize(Resource* obj) { return obj->mSize; }
+		void setSize(Resource* obj, UINT32& size) { obj->mSize = size; } 
+
+		ResourceMetaDataPtr getMetaData(Resource* obj) { return obj->mMetaData; }
+		void setMetaData(Resource* obj, ResourceMetaDataPtr value) { obj->mMetaData = value; }
+
+	public:
+		ResourceRTTI()
+		{
+			addPlainField("mSize", 0, &ResourceRTTI::getSize, &ResourceRTTI::setSize);
+			addReflectablePtrField("mMetaData", 1, &ResourceRTTI::getMetaData, &ResourceRTTI::setMetaData);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "Resource";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return 100;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 53 - 45
BansheeCore/Include/BsSamplerStateRTTI.h

@@ -1,46 +1,54 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsSamplerState.h"
-#include "BsRenderStateManager.h"
-
-namespace BansheeEngine
-{
-	BS_ALLOW_MEMCPY_SERIALIZATION(SAMPLER_STATE_DESC);
-
-	class BS_CORE_EXPORT SamplerStateRTTI : public RTTIType<SamplerState, IReflectable, SamplerStateRTTI>
-	{
-	private:
-		SAMPLER_STATE_DESC& getData(SamplerState* obj) { return obj->mProperties.mData; }
-		void setData(SamplerState* obj, SAMPLER_STATE_DESC& val) { obj->mProperties.mData = val; } 
-
-	public:
-		SamplerStateRTTI()
-		{
-			addPlainField("mData", 0, &SamplerStateRTTI::getData, &SamplerStateRTTI::setData);
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj) override
-		{
-			SamplerState* samplerState = static_cast<SamplerState*>(obj);
-			samplerState->initialize();
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "SamplerState";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_SamplerState;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return RenderStateManager::instance()._createSamplerStatePtr(SAMPLER_STATE_DESC());
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsSamplerState.h"
+#include "BsRenderStateManager.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	BS_ALLOW_MEMCPY_SERIALIZATION(SAMPLER_STATE_DESC);
+
+	class BS_CORE_EXPORT SamplerStateRTTI : public RTTIType<SamplerState, IReflectable, SamplerStateRTTI>
+	{
+	private:
+		SAMPLER_STATE_DESC& getData(SamplerState* obj) { return obj->mProperties.mData; }
+		void setData(SamplerState* obj, SAMPLER_STATE_DESC& val) { obj->mProperties.mData = val; } 
+
+	public:
+		SamplerStateRTTI()
+		{
+			addPlainField("mData", 0, &SamplerStateRTTI::getData, &SamplerStateRTTI::setData);
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			SamplerState* samplerState = static_cast<SamplerState*>(obj);
+			samplerState->initialize();
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "SamplerState";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_SamplerState;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return RenderStateManager::instance()._createSamplerStatePtr(SAMPLER_STATE_DESC());
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 52 - 65
BansheeCore/Include/BsSavedResourceDataRTTI.h

@@ -1,66 +1,53 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsSavedResourceData.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT SavedResourceDataRTTI : public RTTIType <SavedResourceData, IReflectable, SavedResourceDataRTTI>
-	{
-	private:
-		String& getDependency(SavedResourceData* obj, UINT32 arrayIdx)
-		{
-			return obj->mDependencies[arrayIdx];
-		}
-
-		void setDependency(SavedResourceData* obj, UINT32 arrayIdx, String& val)
-		{
-			obj->mDependencies[arrayIdx] = val;
-		}
-
-		UINT32 getNumDependencies(SavedResourceData* obj)
-		{
-			return (UINT32)obj->mDependencies.size();
-		}
-
-		void setNumDependencies(SavedResourceData* obj, UINT32 numEntries)
-		{
-			obj->mDependencies = Vector<String>(numEntries);
-		}
-
-		bool& getAllowAsyncLoading(SavedResourceData* obj)
-		{
-			return obj->mAllowAsync;
-		}
-
-		void setAllowAsyncLoading(SavedResourceData* obj, bool& value)
-		{
-			obj->mAllowAsync = value;
-		}
-
-	public:
-		SavedResourceDataRTTI()
-		{
-			addPlainArrayField("mDependencies", 0, &SavedResourceDataRTTI::getDependency, &SavedResourceDataRTTI::getNumDependencies,
-				&SavedResourceDataRTTI::setDependency, &SavedResourceDataRTTI::setNumDependencies);
-			addPlainField("mAllowAsync", 1, &SavedResourceDataRTTI::getAllowAsyncLoading, &SavedResourceDataRTTI::setAllowAsyncLoading);
-		}
-
-		virtual const String& getRTTIName()
-		{
-			static String name = "ResourceDependencies";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId()
-		{
-			return TID_ResourceDependencies;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject()
-		{
-			return bs_shared_ptr_new<SavedResourceData>();
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsSavedResourceData.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT SavedResourceDataRTTI : public RTTIType <SavedResourceData, IReflectable, SavedResourceDataRTTI>
+	{
+	private:
+		String& getDependency(SavedResourceData* obj, UINT32 arrayIdx) { return obj->mDependencies[arrayIdx]; }
+		void setDependency(SavedResourceData* obj, UINT32 arrayIdx, String& val) { obj->mDependencies[arrayIdx] = val; }
+
+		UINT32 getNumDependencies(SavedResourceData* obj) { return (UINT32)obj->mDependencies.size(); }
+		void setNumDependencies(SavedResourceData* obj, UINT32 numEntries) { obj->mDependencies = Vector<String>(numEntries); }
+
+		bool& getAllowAsyncLoading(SavedResourceData* obj) { return obj->mAllowAsync; }
+		void setAllowAsyncLoading(SavedResourceData* obj, bool& value) { obj->mAllowAsync = value; }
+
+	public:
+		SavedResourceDataRTTI()
+		{
+			addPlainArrayField("mDependencies", 0, &SavedResourceDataRTTI::getDependency, &SavedResourceDataRTTI::getNumDependencies,
+				&SavedResourceDataRTTI::setDependency, &SavedResourceDataRTTI::setNumDependencies);
+			addPlainField("mAllowAsync", 1, &SavedResourceDataRTTI::getAllowAsyncLoading, &SavedResourceDataRTTI::setAllowAsyncLoading);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "ResourceDependencies";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_ResourceDependencies;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<SavedResourceData>();
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 163 - 255
BansheeCore/Include/BsSceneObject.h

@@ -11,9 +11,11 @@
 
 namespace BansheeEngine
 {
-	/**
-	 * @brief	Possible modifiers that can be applied to a SceneObject
+	/** @addtogroup Scene
+	 *  @{
 	 */
+
+	/** Possible modifiers that can be applied to a SceneObject. */
 	enum SceneObjectFlags
 	{
 		SOF_DontInstantiate = 0x01, /**< Object wont be in the main scene and its components won't receive updates. */
@@ -26,14 +28,12 @@ namespace BansheeEngine
 	};
 
 	/**
-	 * @brief	An object in the scene graph. It has a world position, place in the hierarchy and 
-	 * 			optionally a number of attached components.
+	 * An object in the scene graph. It has a world position, place in the hierarchy and optionally a number of attached 
+	 * components.
 	 */
 	class BS_CORE_EXPORT SceneObject : public GameObject
 	{
-		/**
-		 * @brief	Flags that signify which part of the SceneObject needs updating.
-		 */
+		/**	Flags that signify which part of the SceneObject needs updating. */
 		enum DirtyFlags
 		{
 			LocalTfrmDirty = 0x01,
@@ -48,20 +48,18 @@ namespace BansheeEngine
 		~SceneObject();
 
 		/**
-		 * @brief	Creates a new SceneObject with the specified name. Object will be placed in the top
-		 *			of the scene hierarchy.
+		 * Creates a new SceneObject with the specified name. Object will be placed in the top of the scene hierarchy.
 		 *
-		 * @param	name	Name of the scene object.
-		 * @param	flags	Optional flags that control object behavior. See SceneObjectFlags.
+		 * @param[in]	name	Name of the scene object.
+		 * @param[in]	flags	Optional flags that control object behavior. See SceneObjectFlags.
 		 */
 		static HSceneObject create(const String& name, UINT32 flags = 0);
 
 		/**
-		 * @brief	Destroys this object and any of its held components.
+		 * Destroys this object and any of its held components.
 		 *
-		 * @param [in]	immediate	If true, the object will be deallocated and become unusable
-		 *							right away. Otherwise the deallocation will be delayed to the end of
-		 *							frame (preferred method).
+		 * @param [in]	immediate	If true, the object will be deallocated and become unusable right away. Otherwise the
+		 *							deallocation will be delayed to the end of frame (preferred method).
 		 */
 		void destroy(bool immediate = false);
 
@@ -70,125 +68,100 @@ namespace BansheeEngine
 		 */
 		void _setInstanceData(GameObjectInstanceDataPtr& other) override;
 
-		/**
-		 * @brief	Returns a handle to this object.
-		 */
+		/**	Returns a handle to this object. */
 		HSceneObject getHandle() const { return mThisHandle; }
 
 		/**
-		 * @brief	Returns the UUID of the prefab this object is linked to, if any. 
+		 * Returns the UUID of the prefab this object is linked to, if any. 
 		 *
 		 * @note	Requires a search of all parents potentially.
 		 */
 		String getPrefabLink() const;
 
 		/**
-		 * @brief	Breaks the link between this prefab instance and its prefab. Object will retain 
-		 *			all current values but will no longer be influenced by modifications to its parent prefab.
+		 * Breaks the link between this prefab instance and its prefab. Object will retain all current values but will no
+		 * longer be influenced by modifications to its parent prefab.
 		 */
 		void breakPrefabLink();
 
-		/**
-		 * @brief	Checks if the scene object has a specific bit flag set.
-		 */
+		/**	Checks if the scene object has a specific bit flag set. */
 		bool hasFlag(UINT32 flag) const;
 
-		/**
-		 * @brief	Register the scene object with the scene and activate all of its components.
-		 * 		
-		 * @note	Internal method.
-		 */
+		/** @cond INTERNAL */
+
+		/** Register the scene object with the scene and activate all of its components. */
 		void _instantiate();
 
 		/**
-		 * @brief	Clears the internally stored prefab diff. If this object is updated from prefab its instance specific
-		 * 			changes will be lost.
-		 * 			
-		 * @note	Internal method.
+		 * Clears the internally stored prefab diff. If this object is updated from prefab its instance specific changes 
+		 * will be lost.
 		 */
 		void _clearPrefabDiff() { mPrefabDiff = nullptr; }
 
 		/**
-		 * @brief	Returns the UUID of the prefab this object is linked to, if any. Unlike ::getPrefabLink method this
-		 *			will not search parents, but instead return only the value assigned to this object.
-		 *
-		 * @note	Internal method.
+		 * Returns the UUID of the prefab this object is linked to, if any. Unlike getPrefabLink() method this will not
+		 * search parents, but instead return only the value assigned to this object.
 		 */
 		const String& _getPrefabLinkUUID() const { return mPrefabLinkUUID; }
 
 		/**
-		 * @brief	Allows you to change the prefab link UUID of this object. Normally this should be accompanied by
-		 *			reassigning the link IDs.
-		 *
-		 * @note	Internal method.
+		 * Allows you to change the prefab link UUID of this object. Normally this should be accompanied by reassigning the
+		 * link IDs.
 		 */
 		void _setPrefabLinkUUID(const String& UUID) { mPrefabLinkUUID = UUID; }
 
 		/**
-		 * @brief	Returns a prefab diff object containing instance specific modifications of this object compared to its
-		 *			prefab reference, if any.
-		 *
-		 * @note	Internal method.
+		 * Returns a prefab diff object containing instance specific modifications of this object compared to its prefab
+		 * reference, if any.
 		 */
 		const PrefabDiffPtr& _getPrefabDiff() const { return mPrefabDiff; }
 
-		/**
-		 * @brief	Assigns a new prefab diff object. Caller must ensure the prefab diff was generated for this object.
-		 *			See ::PrefabDiff.
-		 *
-		 * @note	Internal method.
-		 */
+		/** Assigns a new prefab diff object. Caller must ensure the prefab diff was generated for this object. */
 		void _setPrefabDiff(const PrefabDiffPtr& diff) { mPrefabDiff = diff; }
 
+		/** @endcond */
+
 	private:
 		SceneObject(const String& name, UINT32 flags);
 
 		/**
-		 * @brief	Creates a new SceneObject instance, registers it with the game object manager,
-		 *			creates and returns a handle to the new object.
+		 * Creates a new SceneObject instance, registers it with the game object manager, creates and returns a handle to
+		 * the new object.
 		 *
-		 * @note	When creating objects with DontInstantiate flag it is the callers responsibility
-		 *			to manually destroy the object, otherwise it will leak.
+		 * @note	
+		 * When creating objects with DontInstantiate flag it is the callers responsibility to manually destroy the object,
+		 * otherwise it will leak.
 		 */
 		static HSceneObject createInternal(const String& name, UINT32 flags = 0);
 
 		/**
-		 * @brief	Creates a new SceneObject instance from an existing pointer, registers it with the game object manager,
-		 *			creates and returns a handle to the object.
+		 * Creates a new SceneObject instance from an existing pointer, registers it with the game object manager, creates 
+		 * and returns a handle to the object.
 		 *			
-		 * @param	soPtr		Pointer to the scene object register and return a handle to.
-		 * @param	originalId	If the provided pointer was deserialized, this is the original object's ID at the time
-		 * 						of serialization. Used for resolving handles pointing to the object.
+		 * @param[in]	soPtr		Pointer to the scene object register and return a handle to.
+		 * @param[in]	originalId	If the provided pointer was deserialized, this is the original object's ID at the time
+		 * 							of serialization. Used for resolving handles pointing to the object.
 		 */
 		static HSceneObject createInternal(const SPtr<SceneObject>& soPtr, UINT64 originalId = 0);
 
 		/**
-		 * @brief	Destroys this object and any of its held components.
+		 * Destroys this object and any of its held components.
 		 *
-		 * @param [in]	handle		Game object handle to this object.
-		 * @param [in]	immediate	If true, the object will be deallocated and become unusable
-		 *							right away. Otherwise the deallocation will be delayed to the end of
-		 *							frame (preferred method).
+		 * @param[in]	handle		Game object handle to this object.
+		 * @param[in]	immediate	If true, the object will be deallocated and become unusable right away. Otherwise the 
+		 *							deallocation will be delayed to the end of frame (preferred method).
 		 *
-		 * @note	Unlike "destroy", does not remove the object from its parent.
+		 * @note	Unlike destroy(), does not remove the object from its parent.
 		 */
 		void destroyInternal(GameObjectHandleBase& handle, bool immediate = false) override;
 
-		/**
-		 * @brief	Recursively enables the provided set of flags on
-		 *			this object and all children.
-		 */
+		/** Recursively enables the provided set of flags on this object and all children. */
 		void setFlags(UINT32 flags);
 
-		/**
-		 * @brief	Recursively disables the provided set of flags on
-		 *			this object and all children.
-		 */
+		/** Recursively disables the provided set of flags on this object and all children. */
 		void unsetFlags(UINT32 flags);
 
-		/**
-		 * @brief	Checks is the scene object instantiated and visible in the scene.
-		 */
+		/**	Checks is the scene object instantiated and visible in the scene. */
 		bool isInstantiated() const { return (mFlags & SOF_DontInstantiate) == 0; }
 
 	private:
@@ -202,179 +175,149 @@ namespace BansheeEngine
 		/* 								Transform	                     		*/
 		/************************************************************************/
 	public:
-		/**
-		 * @brief	Sets the local position of the object.
-		 */
+		/**	Sets the local position of the object. */
 		void setPosition(const Vector3& position);
 
-		/**
-		 * @brief	Gets the local position of the object.
-		 */
+		/**	Gets the local position of the object. */
 		const Vector3& getPosition() const { return mPosition; }
 
-		/**
-		 * @brief	Sets the world position of the object.
-		 */
+		/**	Sets the world position of the object. */
 		void setWorldPosition(const Vector3& position);
 
 		/**
-		 * @brief	Gets the world position of the object.
+		 * Gets the world position of the object.
 		 *
 		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
 		 */
 		const Vector3& getWorldPosition() const;
 
-		/**
-		 * @brief	Sets the local rotation of the object.
-		 */
+		/**	Sets the local rotation of the object. */
 		void setRotation(const Quaternion& rotation);
 
-		/**
-		 * @brief	Gets the local rotation of the object.
-		 */
+		/**	Gets the local rotation of the object. */
 		const Quaternion& getRotation() const { return mRotation; }
 
-		/**
-		 * @brief	Sets the world rotation of the object.
-		 */
+		/**	Sets the world rotation of the object. */
 		void setWorldRotation(const Quaternion& rotation);
 
 		/**
-		 * @brief	Gets world rotation of the object.
+		 * Gets world rotation of the object.
 		 *
 		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
 		 */
 		const Quaternion& getWorldRotation() const;
 
-		/**
-		 * @brief	Sets the local scale of the object.
-		 */
+		/**	Sets the local scale of the object. */
 		void setScale(const Vector3& scale);
 
-		/**
-		 * @brief	Gets the local scale of the object.
-		 */
+		/**	Gets the local scale of the object. */
 		const Vector3& getScale() const { return mScale; }
 
 		/**
-		 * @brief	Sets the world scale of the object.
+		 * Sets the world scale of the object.
 		 *
-		 * @note	This will not work properly if this object or any of its parents
-		 *			have non-affine transform matrices.
+		 * @note	This will not work properly if this object or any of its parents have non-affine transform matrices.
 		 */
 		void setWorldScale(const Vector3& scale);
 
 		/**
-		 * @brief	Gets world scale of the object.
+		 * Gets world scale of the object.
 		 *
 		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
 		 */
 		const Vector3& getWorldScale() const;
 
 		/**
-		 * @brief	Orients the object so it is looking at the provided \p location (world space)
-		 *			where \p up is used for determining the location of the object's Y axis.
-		 *
+		 * Orients the object so it is looking at the provided @p location (world space) where @p up is used for 
+		 * determining the location of the object's Y axis.
 		 */
 		void lookAt(const Vector3& location, const Vector3& up = Vector3::UNIT_Y);
 
 		/**
-		 * @brief	Gets the objects world transform matrix.
+		 * Gets the objects world transform matrix.
 		 *
 		 * @note	Performance warning: This might involve updating the transforms if the transform is dirty.
 		 */
 		const Matrix4& getWorldTfrm() const;
 
-		/**
-		 * @brief	Gets the objects local transform matrix.
-		 */
+		/** Gets the objects local transform matrix. */
 		const Matrix4& getLocalTfrm() const;
 
-		/**
-		 * @brief	Moves the object's position by the vector offset provided along world axes.
-		 */
+		/**	Moves the object's position by the vector offset provided along world axes. */
         void move(const Vector3& vec);
 
-		/**
-		 * @brief	Moves the object's position by the vector offset provided along it's own axes (relative to orientation).
-		 */
+		/**	Moves the object's position by the vector offset provided along it's own axes (relative to orientation). */
         void moveRelative(const Vector3& vec);
 
 		/**
-		 * @brief	Gets the Z (forward) axis of the object, in world space.
+		 * Gets the Z (forward) axis of the object, in world space.
 		 *
 		 * @return	Forward axis of the object.
 		 */
 		Vector3 getForward() const { return getWorldRotation().rotate(-Vector3::UNIT_Z); }
 
 		/**
-		 * @brief	Gets the Y (up) axis of the object, in world space.
+		 * Gets the Y (up) axis of the object, in world space.
 		 *
 		 * @return	Up axis of the object.
 		 */
 		Vector3 getUp() const { return getWorldRotation().rotate(Vector3::UNIT_Y); }
 
 		/**
-		 * @brief	Gets the X (right) axis of the object, in world space.
+		 * Gets the X (right) axis of the object, in world space.
 		 *
 		 * @return	Right axis of the object.
 		 */
 		Vector3 getRight() const { return getWorldRotation().rotate(Vector3::UNIT_X); }
 
 		/**
-		 * @brief	Rotates the game object so it's forward axis faces the provided
-		 * 			direction.
-		 * 			
-		 * @note	Local forward axis is considered to be negative Z.
+		 * Rotates the game object so it's forward axis faces the provided direction.
+		 *
+		 * @param[in]	forwardDir	The forward direction to face, in world space.
 		 *
-		 * @param	forwardDir	The forward direction to face, in world space.
+		 * @note	Local forward axis is considered to be negative Z.
 		 */
 		void setForward(const Vector3& forwardDir);
 
-		/**
-		 * @brief	Rotate the object around an arbitrary axis.
-		 */
+		/**	Rotate the object around an arbitrary axis. */
         void rotate(const Vector3& axis, const Radian& angle);
 
-		/**
-		 * @brief	Rotate the object around an arbitrary axis using a Quaternion.
-		 */
+		/**	Rotate the object around an arbitrary axis using a Quaternion. */
         void rotate(const Quaternion& q);
 
 		/**
-		 * @brief	Rotates around local Z axis.
+		 * Rotates around local Z axis.
 		 *
-		 * @param	angle	Angle to rotate by.
+		 * @param[in]	angle	Angle to rotate by.
 		 */
 		void roll(const Radian& angle);
 
 		/**
-		 * @brief	Rotates around Y axis.
+		 * Rotates around Y axis.
 		 *
-		 * @param	angle	Angle to rotate by.
+		 * @param[in]	angle	Angle to rotate by.
 		 */
 		void yaw(const Radian& angle);
 
 		/**
-		 * @brief	Rotates around X axis
+		 * Rotates around X axis
 		 *
-		 * @param	angle	Angle to rotate by.
+		 * @param[in]	angle	Angle to rotate by.
 		 */
 		void pitch(const Radian& angle);
 
 		/**
-		 * @brief	Forces any dirty transform matrices on this object to be updated.
+		 * Forces any dirty transform matrices on this object to be updated.
 		 *
-		 * @note	Normally this is done internally when retrieving a transform, but sometimes
-		 *			it is useful to update transforms manually.
+		 * @note	
+		 * Normally this is done internally when retrieving a transform, but sometimes it is useful to update transforms
+		 * manually.
 		 */
 		void updateTransformsIfDirty();
 
 		/**
-		 * @brief	Returns a hash value that changes whenever a scene objects
-		 *			transform gets updated. It allows you to detect changes with
-		 *			the local or world transforms without directly comparing their
-		 *			values with some older state.
+		 * Returns a hash value that changes whenever a scene objects transform gets updated. It allows you to detect 
+		 * changes with the local or world transforms without directly comparing their values with some older state.
 		 */
 		UINT32 getTransformHash() const { return mDirtyHash; }
 
@@ -393,34 +336,23 @@ namespace BansheeEngine
 		mutable UINT32 mDirtyFlags;
 		mutable UINT32 mDirtyHash;
 
-		/**
-		 * @brief	Marks the transform as dirty so that we know to update
-		 *			it when the transform is requested.
-		 */
+		/** Marks the transform as dirty so that we know to update it when the transform is requested. */
 		void markTfrmDirty() const;
 
-		/**
-		 * @brief	Updates the local transform. Normally just reconstructs the 
-		 *			transform matrix from the position/rotation/scale.
-		 */
+		/** Updates the local transform. Normally just reconstructs the transform matrix from the position/rotation/scale. */
 		void updateLocalTfrm() const;
 
 		/**
-		 * @brief	Updates the world transform. Reconstructs the local transform
-		 *			matrix and multiplies it with any parent transforms.
+		 * Updates the world transform. Reconstructs the local transform matrix and multiplies it with any parent transforms.
 		 *
 		 * @note	If parent transforms are dirty they will be updated.
 		 */
 		void updateWorldTfrm() const;
 
-		/**
-		 * @brief	Checks if cached local transform needs updating.
-		 */
+		/**	Checks if cached local transform needs updating. */
 		bool isCachedLocalTfrmUpToDate() const { return (mDirtyFlags & DirtyFlags::LocalTfrmDirty) == 0; }
 
-		/**
-		 * @brief	Checks if cached world transform needs updating.
-		 */
+		/**	Checks if cached world transform needs updating. */
 		bool isCachedWorldTfrmUpToDate() const { return (mDirtyFlags & DirtyFlags::WorldTfrmDirty) == 0; }
 
 		/************************************************************************/
@@ -428,88 +360,80 @@ namespace BansheeEngine
 		/************************************************************************/
 	public:
 		/**
-		 * @brief	Changes the parent of this object. Also removes the object from the current parent,
-		 * 			and assigns it to the new parent.
+		 * Changes the parent of this object. Also removes the object from the current parent, and assigns it to the new 
+		 * parent.
 		 *
-		 * @param [in]	parent			New parent.
-		 * @param [in]	keepWorldPos	Determines should the current transform be maintained even after the parent is changed
-		 * 								(this means the local transform will be modified accordingly).
+		 * @param[in]	parent			New parent.
+		 * @param[in]	keepWorldPos	Determines should the current transform be maintained even after the parent is 
+		 *								changed (this means the local transform will be modified accordingly).
 		 */
 		void setParent(const HSceneObject& parent, bool keepWorldTransform = true);
 
 		/**
-		 * @brief	Gets the parent of this object.
+		 * Gets the parent of this object.
 		 *
 		 * @return	Parent object, or nullptr if this SceneObject is at root level.
 		 */
 		HSceneObject getParent() const { return mParent; }
 
 		/**
-		 * @brief	Gets a child of this item.
-		 *
-		 * @param	idx	The zero based index of the child.
+		 * Gets a child of this item.
 		 *
-		 * @return	SceneObject of the child.
+		 * @param[in]	idx	The zero based index of the child.
+		 * @return		SceneObject of the child.
 		 */
 		HSceneObject getChild(UINT32 idx) const;
 
 		/**
-		 * @brief	Find the index of the specified child. Don't persist this value as
-		 * 			it may change whenever you add/remove children.
-		 *
-		 * @param	child	The child to look for.
+		 * Find the index of the specified child. Don't persist this value as it may change whenever you add/remove children.
 		 *
-		 * @return	The zero-based index of the found child, or -1 if no match was found.
+		 * @param[in]	child	The child to look for.
+		 * @return				The zero-based index of the found child, or -1 if no match was found.
 		 */
 		int indexOfChild(const HSceneObject& child) const;
 
-		/**
-		 * @brief	Gets the number of all child GameObjects.
-		 */
+		/**	Gets the number of all child GameObjects. */
 		UINT32 getNumChildren() const { return (UINT32)mChildren.size(); }
 
 		/**
-		 * @brief	Searches the child objects for an object matching the specified name.
-		 *
-		 * @param	name		Name of the object to locate.
-		 * @param	recursive	If true all descendants of the scene object will be searched, 
-		 *						otherwise only immediate children.
+		 * Searches the child objects for an object matching the specified name.
 		 *
-		 * @returns	First found scene object, or empty handle if none found.
+		 * @param[in]	name		Name of the object to locate.
+		 * @param[in]	recursive	If true all descendants of the scene object will be searched, otherwise only immediate
+		 *							children.
+		 * @return					First found scene object, or empty handle if none found.
 		 */
 		HSceneObject findChild(const String& name, bool recursive = true);
 
 		/**
-		 * @brief	Searches the child objects for objects matching the specified name.
+		 * Searches the child objects for objects matching the specified name.
 		 *
-		 * @param	name		Name of the objects to locate.
-		 * @param	recursive	If true all descendants of the scene object will be searched, 
-		 *						otherwise only immediate children.
-		 *
-		 * @returns	All scene objects matching the specified name.
+		 * @param[in]	name		Name of the objects to locate.
+		 * @param[in]	recursive	If true all descendants of the scene object will be searched, otherwise only immediate
+		 *							children.
+		 * @return					All scene objects matching the specified name.
 		 */
 		Vector<HSceneObject> findChildren(const String& name, bool recursive = true);
 
 		/**
-		 * @brief	Enables or disables this object. Disabled objects also implicitly disable
-		 *			all their child objects. No components on the disabled object are updated.
+		 * Enables or disables this object. Disabled objects also implicitly disable all their child objects. No components
+		 * on the disabled object are updated.
 		 */
 		void setActive(bool active);
 
 		/**
-		 * @brief	Returns whether or not an object is active.
+		 * Returns whether or not an object is active.
 		 *
-		 * @param	self	If true, the method will only check if this particular object was activated
-		 *					or deactivated directly via setActive. If false we we also check if any of
-		 *					the objects parents are inactive.
+		 * @param[in]	self	If true, the method will only check if this particular object was activated or deactivated
+		 *						directly via setActive. If false we we also check if any of the objects parents are inactive.
 		 */
 		bool getActive(bool self = false);
 
 		/**
-		 * @brief	Makes a deep copy of this object.
+		 * Makes a deep copy of this object.
 		 * 			
-		 * @param	instantiate	If false, the cloned hierarchy will just be a memory copy, but will not be present in the
-		 * 						scene or otherwise active until ::instantiate() is called.
+		 * @param[in]	instantiate	If false, the cloned hierarchy will just be a memory copy, but will not be present in the
+		 * 							scene or otherwise active until ::instantiate() is called.
 		 */
 		HSceneObject clone(bool instantiate = true);
 
@@ -520,43 +444,36 @@ namespace BansheeEngine
 		bool mActiveHierarchy;
 
 		/**
-		 * @brief	Internal version of ::setParent that allows you to set a null parent.
+		 * Internal version of setParent() that allows you to set a null parent.
 		 *
-		 * @param [in]	parent			New parent.
-		 * @param [in]	keepWorldPos	Determines should the current transform be maintained even after the parent is changed
-		 * 								(this means the local transform will be modified accordingly).
+		 * @param[in]	parent			New parent.
+		 * @param[in]	keepWorldPos	Determines should the current transform be maintained even after the parent is 
+		 *								changed (this means the local transform will be modified accordingly).
 		 */
 		void _setParent(const HSceneObject& parent, bool keepWorldTransform = true);
 
 		/**
-		 * @brief	Adds a child to the child array. This method doesn't check for null or duplicate values.
+		 * Adds a child to the child array. This method doesn't check for null or duplicate values.
 		 *
-		 * @param [in]	object	New child.
+		 * @param[in]	object	New child.
 		 */
 		void addChild(const HSceneObject& object);
 		
 		/**
-		 * @brief	Removes the child from the object. 
+		 * Removes the child from the object. 
 		 *
-		 * @param [in]	object	Child to remove.
-		 * 					
-		 * @throws INTERNAL_ERROR If the provided child isn't a child of the current object.
+		 * @param[in]	object	Child to remove.
 		 */
 		void removeChild(const HSceneObject& object);
 
-		/**
-		 * @brief	Changes the object active in hierarchy state.
-		 */
+		/** Changes the object active in hierarchy state. */
 		void setActiveHierarchy(bool active);
 
 		/************************************************************************/
 		/* 								Component	                     		*/
 		/************************************************************************/
 	public:
-		/**
-		 * @brief	Constructs a new component of the specified type and adds it to 
-		 *			the internal component list.
-		 */
+		/** Constructs a new component of the specified type and adds it to the internal component list. */
 		template<class T, class... Args>
 		GameObjectHandle<T> addComponent(Args &&... args)
 		{
@@ -591,15 +508,14 @@ namespace BansheeEngine
 		}
 
 		/**
-		 * @brief	Searches for a component with the specific type and returns the first one
-		 * 			it finds. 
+		 * Searches for a component with the specific type and returns the first one it finds. 
 		 * 			
-		 * @note	Don't call this too often as it is relatively slow. It is more efficient 
-		 * 			to call it once and store the result for further use.
-		 *
 		 * @tparam	typename T	Type of the component.
+		 * @return				Component if found, nullptr otherwise.
 		 *
-		 * @return	Component if found, nullptr otherwise.
+		 * @note	
+		 * Don't call this too often as it is relatively slow. It is more efficient to call it once and store the result 
+		 * for further use.
 		 */
 		template <typename T>
 		GameObjectHandle<T> getComponent()
@@ -611,13 +527,12 @@ namespace BansheeEngine
 		}
 
 		/**
-		 * @brief	Checks if the current object contains the specified component
+		 * Checks if the current object contains the specified component
 		 * 			 			
-		 * @note	Don't call this too often as it is relatively slow. 
-		 *
 		 * @tparam	typename T	Type of the component.
+		 * @return				True if component exists on the object.
 		 *
-		 * @return	True if component exists on the object.
+		 * @note	Don't call this too often as it is relatively slow.
 		 */
 		template <typename T>
 		bool hasComponent()
@@ -635,47 +550,40 @@ namespace BansheeEngine
 		}
 
 		/**
-		 * @brief	Searches for a component with the specified type id and returns the first one it
-		 * 			finds.
+		 * Searches for a component with the specified type id and returns the first one it finds.
 		 * 			
-		 * 			@note	Don't call this too often as it is relatively slow. It is more efficient to
-		 * 			call it once and store the result for further use.
-		 *
-		 * @param	typeId	Identifier for the type.
+		 * @param[in]	typeId	Identifier for the type.
+		 * @return				Component if found, nullptr otherwise.
 		 *
-		 * @return	Component if found, nullptr otherwise.
+		 * @note	
+		 * Don't call this too often as it is relatively slow. It is more efficient to call it once and store the result
+		 * for further use.
 		 */
 		HComponent getComponent(UINT32 typeId) const;
 
 		/**
-		 * @brief	Removes the component from this object, and deallocates it.
+		 * Removes the component from this object, and deallocates it.
 		 *
-		 * @param [in]	component	The component to destroy.
-		 * @param [in]	immediate	If true, the component will be deallocated and become unusable
-		 *							right away. Otherwise the deallocation will be delayed to the end of
-		 *							frame (preferred method).
+		 * @param[in]	component	The component to destroy.
+		 * @param[in]	immediate	If true, the component will be deallocated and become unusable right away. Otherwise 
+		 *							the deallocation will be delayed to the end of frame (preferred method).
 		 */
 		void destroyComponent(const HComponent component, bool immediate = false);
 
 		/**
-		 * @brief	Removes the component from this object, and deallocates it.
+		 * Removes the component from this object, and deallocates it.
 		 *
-		 * @param [in]	component	The component to destroy.
-		 * @param [in]	immediate	If true, the component will be deallocated and become unusable
-		 *							right away. Otherwise the deallocation will be delayed to the end of
-		 *							frame (preferred method).
+		 * @param[in]	component	The component to destroy.
+		 * @param[in]	immediate	If true, the component will be deallocated and become unusable right away. Otherwise 
+		 *							the deallocation will be delayed to the end of frame (preferred method).
 		 */
 		void destroyComponent(Component* component, bool immediate = false);
 
-		/**
-		 * @brief	Returns all components on this object.
-		 */
+		/**	Returns all components on this object. */
 		const Vector<HComponent>& getComponents() const { return mComponents; }
 
 	private:
-		/**
-		 * @brief	Creates an empty component with the default constructor.
-		 */
+		/**	Creates an empty component with the default constructor. */
 		template <typename T>
 		static std::shared_ptr<T> createEmptyComponent()
 		{
@@ -687,9 +595,7 @@ namespace BansheeEngine
 			return gameObject;
 		}
 
-		/**
-		 * @brief	Adds the component to the internal component array.
-		 */
+		/**	Adds the component to the internal component array. */
 		void addComponentInternal(const std::shared_ptr<Component> component);
 
 		Vector<HComponent> mComponents;
@@ -703,4 +609,6 @@ namespace BansheeEngine
 		static RTTITypeBase* getRTTIStatic();
 		virtual RTTITypeBase* getRTTI() const override;
 	};
+
+	/** @} */
 }

+ 179 - 173
BansheeCore/Include/BsSceneObjectRTTI.h

@@ -1,174 +1,180 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsSceneObject.h"
-#include "BsGameObjectHandle.h"
-#include "BsGameObjectManager.h"
-#include "BsComponent.h"
-#include "BsGameObjectRTTI.h"
-#include "BsPrefabDiff.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Provides temporary storage for data used during SceneObject deserialization.
-	 */
-	struct SODeserializationData
-	{
-		Vector<SPtr<SceneObject>> children;
-		Vector<SPtr<Component>> components;
-	};
-
-	class BS_CORE_EXPORT SceneObjectRTTI : public RTTIType<SceneObject, GameObject, SceneObjectRTTI>
-	{
-	private:
-		Vector3& getPosition(SceneObject* obj) { return obj->mPosition; }
-		void setPosition(SceneObject* obj, Vector3& value) { obj->mPosition = value; }
-
-		Quaternion& getRotation(SceneObject* obj) { return obj->mRotation; }
-		void setRotation(SceneObject* obj, Quaternion& value) { obj->mRotation = value; }
-
-		Vector3& getScale(SceneObject* obj) { return obj->mScale; }
-		void setScale(SceneObject* obj, Vector3& value) { obj->mScale = value; }
-
-		bool& getActive(SceneObject* obj) { return obj->mActiveSelf; }
-		void setActive(SceneObject* obj, bool& value) { obj->mActiveSelf = value; }
-
-		// NOTE - These can only be set sequentially, specific array index is ignored
-		std::shared_ptr<SceneObject> getChild(SceneObject* obj, UINT32 idx) { return obj->mChildren[idx].getInternalPtr(); }
-		void setChild(SceneObject* obj, UINT32 idx, SPtr<SceneObject> param)
-		{
-			SceneObject* so = static_cast<SceneObject*>(obj);
-			GODeserializationData& goDeserializationData = any_cast_ref<GODeserializationData>(so->mRTTIData);
-			SODeserializationData& soDeserializationData = any_cast_ref<SODeserializationData>(goDeserializationData.moreData);
-
-			soDeserializationData.children.push_back(param);
-		} 
-
-		UINT32 getNumChildren(SceneObject* obj) { return (UINT32)obj->mChildren.size(); }
-		void setNumChildren(SceneObject* obj, UINT32 size) { /* DO NOTHING */ }
-
-		// NOTE - These can only be set sequentially, specific array index is ignored
-		std::shared_ptr<Component> getComponent(SceneObject* obj, UINT32 idx) { return obj->mComponents[idx].getInternalPtr(); }
-		void setComponent(SceneObject* obj, UINT32 idx, SPtr<Component> param)
-		{
-			SceneObject* so = static_cast<SceneObject*>(obj);
-			GODeserializationData& goDeserializationData = any_cast_ref<GODeserializationData>(so->mRTTIData);
-			SODeserializationData& soDeserializationData = any_cast_ref<SODeserializationData>(goDeserializationData.moreData);
-
-			soDeserializationData.components.push_back(param);
-		}
-		UINT32 getNumComponents(SceneObject* obj) { return (UINT32)obj->mComponents.size(); }
-		void setNumComponents(SceneObject* obj, UINT32 size) { /* DO NOTHING */ }
-
-		String& getPrefabLink(SceneObject* obj) { return obj->mPrefabLinkUUID; }
-		void setPrefabLink(SceneObject* obj, String& value) { obj->mPrefabLinkUUID = value; }
-
-		PrefabDiffPtr getPrefabDiff(SceneObject* obj) { return obj->mPrefabDiff; }
-		void setPrefabDiff(SceneObject* obj, PrefabDiffPtr value) { obj->mPrefabDiff = value; }
-
-		UINT32& getFlags(SceneObject* obj) { return obj->mFlags; }
-		void setFlags(SceneObject* obj, UINT32& value) { obj->mFlags = value; }
-
-		UINT32& getPrefabHash(SceneObject* obj) { return obj->mPrefabHash; }
-		void setPrefabHash(SceneObject* obj, UINT32& value) { obj->mPrefabHash = value; }
-	public:
-		SceneObjectRTTI()
-		{
-			addReflectablePtrArrayField("mChildren", 0, &SceneObjectRTTI::getChild, 
-				&SceneObjectRTTI::getNumChildren, &SceneObjectRTTI::setChild, &SceneObjectRTTI::setNumChildren);
-			addReflectablePtrArrayField("mComponents", 1, &SceneObjectRTTI::getComponent, 
-				&SceneObjectRTTI::getNumComponents, &SceneObjectRTTI::setComponent, &SceneObjectRTTI::setNumComponents);
-			addPlainField("mPrefabLink", 2, &SceneObjectRTTI::getPrefabLink, &SceneObjectRTTI::setPrefabLink);
-			addPlainField("mFlags", 3, &SceneObjectRTTI::getFlags, &SceneObjectRTTI::setFlags);
-			addReflectablePtrField("mPrefabDiff", 4, &SceneObjectRTTI::getPrefabDiff, &SceneObjectRTTI::setPrefabDiff);
-			addPlainField("mPrefabHash", 5, &SceneObjectRTTI::getPrefabHash, &SceneObjectRTTI::setPrefabHash);
-			addPlainField("mPosition", 6, &SceneObjectRTTI::getPosition, &SceneObjectRTTI::setPosition);
-			addPlainField("mRotation", 7, &SceneObjectRTTI::getRotation, &SceneObjectRTTI::setRotation);
-			addPlainField("mScale", 8, &SceneObjectRTTI::getScale, &SceneObjectRTTI::setScale);
-			addPlainField("mActiveSelf", 9, &SceneObjectRTTI::getActive, &SceneObjectRTTI::setActive);
-		}
-
-		virtual void onDeserializationStarted(IReflectable* obj) override
-		{
-			// If this is the root scene object we're deserializing, activate game object deserialization so the system
-			// can resolve deserialized handles to the newly created objects
-			SceneObject* so = static_cast<SceneObject*>(obj);
-			GODeserializationData& deserializationData = any_cast_ref<GODeserializationData>(so->mRTTIData);
-
-			if (!GameObjectManager::instance().isGameObjectDeserializationActive())
-			{
-				GameObjectManager::instance().startDeserialization();
-				
-				// Mark it as the object that started the GO deserialization so it knows to end it
-				deserializationData.isDeserializationParent = true;
-			}
-			else
-				deserializationData.isDeserializationParent = false;
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj) override
-		{
-			SceneObject* so = static_cast<SceneObject*>(obj);
-			GODeserializationData& goDeserializationData = any_cast_ref<GODeserializationData>(so->mRTTIData);
-
-			// Register the newly created SO with the GameObjectManager and provide it with the original ID so that
-			// deserialized handles pointing to this object can be resolved.
-			SceneObjectPtr soPtr = std::static_pointer_cast<SceneObject>(goDeserializationData.ptr);
-			SceneObject::createInternal(soPtr, goDeserializationData.originalId);
-
-			// We stored all components and children in a temporary structure because they rely on the SceneObject being
-			// initialized with the GameObjectManager. Now that it is, we add them.
-			SODeserializationData& soDeserializationData = any_cast_ref<SODeserializationData>(goDeserializationData.moreData);
-
-			for (auto& component : soDeserializationData.components)
-				so->addComponentInternal(component);
-
-			for (auto& child : soDeserializationData.children)
-				child->_setParent(so->mThisHandle);
-
-			// If this is the deserialization parent, end deserialization (which resolves all game object handles, if we 
-			// provided valid IDs), and instantiate (i.e. activate) the deserialized hierarchy.
-			if (goDeserializationData.isDeserializationParent)
-			{
-				GameObjectManager::instance().endDeserialization();
-
-				if ((so->mFlags & SOF_DontInstantiate) == 0)
-					so->_instantiate();
-			}
-
-			so->mRTTIData = nullptr;
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "SceneObject";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_SceneObject;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			SPtr<SceneObject> sceneObjectPtr = 
-				SPtr<SceneObject>(new (bs_alloc<SceneObject>()) SceneObject("", SOF_DontInstantiate),
-				&bs_delete<SceneObject>, StdAlloc<SceneObject>());
-
-			// Every GameObject must store GODeserializationData in its RTTI data field during deserialization
-			sceneObjectPtr->mRTTIData = GODeserializationData();
-			GODeserializationData& deserializationData = any_cast_ref<GODeserializationData>(sceneObjectPtr->mRTTIData);
-
-			// Store shared pointer since the system only provides us with raw ones
-			deserializationData.ptr = sceneObjectPtr;
-
-			// We delay adding children/components and instead store them here
-			deserializationData.moreData = SODeserializationData();
-
-			return sceneObjectPtr;
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsSceneObject.h"
+#include "BsGameObjectHandle.h"
+#include "BsGameObjectManager.h"
+#include "BsComponent.h"
+#include "BsGameObjectRTTI.h"
+#include "BsPrefabDiff.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	/** Provides temporary storage for data used during SceneObject deserialization. */
+	struct SODeserializationData
+	{
+		Vector<SPtr<SceneObject>> children;
+		Vector<SPtr<Component>> components;
+	};
+
+	class BS_CORE_EXPORT SceneObjectRTTI : public RTTIType<SceneObject, GameObject, SceneObjectRTTI>
+	{
+	private:
+		Vector3& getPosition(SceneObject* obj) { return obj->mPosition; }
+		void setPosition(SceneObject* obj, Vector3& value) { obj->mPosition = value; }
+
+		Quaternion& getRotation(SceneObject* obj) { return obj->mRotation; }
+		void setRotation(SceneObject* obj, Quaternion& value) { obj->mRotation = value; }
+
+		Vector3& getScale(SceneObject* obj) { return obj->mScale; }
+		void setScale(SceneObject* obj, Vector3& value) { obj->mScale = value; }
+
+		bool& getActive(SceneObject* obj) { return obj->mActiveSelf; }
+		void setActive(SceneObject* obj, bool& value) { obj->mActiveSelf = value; }
+
+		// NOTE - These can only be set sequentially, specific array index is ignored
+		std::shared_ptr<SceneObject> getChild(SceneObject* obj, UINT32 idx) { return obj->mChildren[idx].getInternalPtr(); }
+		void setChild(SceneObject* obj, UINT32 idx, SPtr<SceneObject> param)
+		{
+			SceneObject* so = static_cast<SceneObject*>(obj);
+			GODeserializationData& goDeserializationData = any_cast_ref<GODeserializationData>(so->mRTTIData);
+			SODeserializationData& soDeserializationData = any_cast_ref<SODeserializationData>(goDeserializationData.moreData);
+
+			soDeserializationData.children.push_back(param);
+		} 
+
+		UINT32 getNumChildren(SceneObject* obj) { return (UINT32)obj->mChildren.size(); }
+		void setNumChildren(SceneObject* obj, UINT32 size) { /* DO NOTHING */ }
+
+		// NOTE - These can only be set sequentially, specific array index is ignored
+		std::shared_ptr<Component> getComponent(SceneObject* obj, UINT32 idx) { return obj->mComponents[idx].getInternalPtr(); }
+		void setComponent(SceneObject* obj, UINT32 idx, SPtr<Component> param)
+		{
+			SceneObject* so = static_cast<SceneObject*>(obj);
+			GODeserializationData& goDeserializationData = any_cast_ref<GODeserializationData>(so->mRTTIData);
+			SODeserializationData& soDeserializationData = any_cast_ref<SODeserializationData>(goDeserializationData.moreData);
+
+			soDeserializationData.components.push_back(param);
+		}
+		UINT32 getNumComponents(SceneObject* obj) { return (UINT32)obj->mComponents.size(); }
+		void setNumComponents(SceneObject* obj, UINT32 size) { /* DO NOTHING */ }
+
+		String& getPrefabLink(SceneObject* obj) { return obj->mPrefabLinkUUID; }
+		void setPrefabLink(SceneObject* obj, String& value) { obj->mPrefabLinkUUID = value; }
+
+		PrefabDiffPtr getPrefabDiff(SceneObject* obj) { return obj->mPrefabDiff; }
+		void setPrefabDiff(SceneObject* obj, PrefabDiffPtr value) { obj->mPrefabDiff = value; }
+
+		UINT32& getFlags(SceneObject* obj) { return obj->mFlags; }
+		void setFlags(SceneObject* obj, UINT32& value) { obj->mFlags = value; }
+
+		UINT32& getPrefabHash(SceneObject* obj) { return obj->mPrefabHash; }
+		void setPrefabHash(SceneObject* obj, UINT32& value) { obj->mPrefabHash = value; }
+	public:
+		SceneObjectRTTI()
+		{
+			addReflectablePtrArrayField("mChildren", 0, &SceneObjectRTTI::getChild, 
+				&SceneObjectRTTI::getNumChildren, &SceneObjectRTTI::setChild, &SceneObjectRTTI::setNumChildren);
+			addReflectablePtrArrayField("mComponents", 1, &SceneObjectRTTI::getComponent, 
+				&SceneObjectRTTI::getNumComponents, &SceneObjectRTTI::setComponent, &SceneObjectRTTI::setNumComponents);
+			addPlainField("mPrefabLink", 2, &SceneObjectRTTI::getPrefabLink, &SceneObjectRTTI::setPrefabLink);
+			addPlainField("mFlags", 3, &SceneObjectRTTI::getFlags, &SceneObjectRTTI::setFlags);
+			addReflectablePtrField("mPrefabDiff", 4, &SceneObjectRTTI::getPrefabDiff, &SceneObjectRTTI::setPrefabDiff);
+			addPlainField("mPrefabHash", 5, &SceneObjectRTTI::getPrefabHash, &SceneObjectRTTI::setPrefabHash);
+			addPlainField("mPosition", 6, &SceneObjectRTTI::getPosition, &SceneObjectRTTI::setPosition);
+			addPlainField("mRotation", 7, &SceneObjectRTTI::getRotation, &SceneObjectRTTI::setRotation);
+			addPlainField("mScale", 8, &SceneObjectRTTI::getScale, &SceneObjectRTTI::setScale);
+			addPlainField("mActiveSelf", 9, &SceneObjectRTTI::getActive, &SceneObjectRTTI::setActive);
+		}
+
+		void onDeserializationStarted(IReflectable* obj) override
+		{
+			// If this is the root scene object we're deserializing, activate game object deserialization so the system
+			// can resolve deserialized handles to the newly created objects
+			SceneObject* so = static_cast<SceneObject*>(obj);
+			GODeserializationData& deserializationData = any_cast_ref<GODeserializationData>(so->mRTTIData);
+
+			if (!GameObjectManager::instance().isGameObjectDeserializationActive())
+			{
+				GameObjectManager::instance().startDeserialization();
+				
+				// Mark it as the object that started the GO deserialization so it knows to end it
+				deserializationData.isDeserializationParent = true;
+			}
+			else
+				deserializationData.isDeserializationParent = false;
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			SceneObject* so = static_cast<SceneObject*>(obj);
+			GODeserializationData& goDeserializationData = any_cast_ref<GODeserializationData>(so->mRTTIData);
+
+			// Register the newly created SO with the GameObjectManager and provide it with the original ID so that
+			// deserialized handles pointing to this object can be resolved.
+			SceneObjectPtr soPtr = std::static_pointer_cast<SceneObject>(goDeserializationData.ptr);
+			SceneObject::createInternal(soPtr, goDeserializationData.originalId);
+
+			// We stored all components and children in a temporary structure because they rely on the SceneObject being
+			// initialized with the GameObjectManager. Now that it is, we add them.
+			SODeserializationData& soDeserializationData = any_cast_ref<SODeserializationData>(goDeserializationData.moreData);
+
+			for (auto& component : soDeserializationData.components)
+				so->addComponentInternal(component);
+
+			for (auto& child : soDeserializationData.children)
+				child->_setParent(so->mThisHandle);
+
+			// If this is the deserialization parent, end deserialization (which resolves all game object handles, if we 
+			// provided valid IDs), and instantiate (i.e. activate) the deserialized hierarchy.
+			if (goDeserializationData.isDeserializationParent)
+			{
+				GameObjectManager::instance().endDeserialization();
+
+				if ((so->mFlags & SOF_DontInstantiate) == 0)
+					so->_instantiate();
+			}
+
+			so->mRTTIData = nullptr;
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "SceneObject";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_SceneObject;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			SPtr<SceneObject> sceneObjectPtr = 
+				SPtr<SceneObject>(new (bs_alloc<SceneObject>()) SceneObject("", SOF_DontInstantiate),
+				&bs_delete<SceneObject>, StdAlloc<SceneObject>());
+
+			// Every GameObject must store GODeserializationData in its RTTI data field during deserialization
+			sceneObjectPtr->mRTTIData = GODeserializationData();
+			GODeserializationData& deserializationData = any_cast_ref<GODeserializationData>(sceneObjectPtr->mRTTIData);
+
+			// Store shared pointer since the system only provides us with raw ones
+			deserializationData.ptr = sceneObjectPtr;
+
+			// We delay adding children/components and instead store them here
+			deserializationData.moreData = SODeserializationData();
+
+			return sceneObjectPtr;
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 43 - 35
BansheeCore/Include/BsShaderIncludeRTTI.h

@@ -1,36 +1,44 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsShaderInclude.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT ShaderIncludeRTTI : public RTTIType <ShaderInclude, Resource, ShaderIncludeRTTI>
-	{
-	private:
-		String& getString(ShaderInclude* obj) { return obj->mString; }
-		void setString(ShaderInclude* obj, String& val) { obj->mString = val; }
-	public:
-		ShaderIncludeRTTI()
-		{
-			addPlainField("mString", 0, &ShaderIncludeRTTI::getString, &ShaderIncludeRTTI::setString);
-		}
-
-		virtual const String& getRTTIName()
-		{
-			static String name = "ShaderInclude";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId()
-		{
-			return TID_ShaderInclude;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject()
-		{
-			return ShaderInclude::_createPtr(""); // Initial string doesn't matter, it'll get overwritten
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsShaderInclude.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT ShaderIncludeRTTI : public RTTIType <ShaderInclude, Resource, ShaderIncludeRTTI>
+	{
+	private:
+		String& getString(ShaderInclude* obj) { return obj->mString; }
+		void setString(ShaderInclude* obj, String& val) { obj->mString = val; }
+	public:
+		ShaderIncludeRTTI()
+		{
+			addPlainField("mString", 0, &ShaderIncludeRTTI::getString, &ShaderIncludeRTTI::setString);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "ShaderInclude";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_ShaderInclude;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return ShaderInclude::_createPtr(""); // Initial string doesn't matter, it'll get overwritten
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 343 - 335
BansheeCore/Include/BsShaderRTTI.h

@@ -1,336 +1,344 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsShader.h"
-#include "BsMaterial.h"
-
-namespace BansheeEngine
-{
-	template<> struct RTTIPlainType<SHADER_DATA_PARAM_DESC>
-	{	
-		enum { id = TID_SHADER_DATA_PARAM_DESC }; enum { hasDynamicSize = 1 };
-
-		static void toMemory(const SHADER_DATA_PARAM_DESC& data, char* memory)
-		{ 
-			UINT32 size = getDynamicSize(data);
-
-			UINT32 curSize = sizeof(UINT32);
-			memcpy(memory, &size, curSize);
-			memory += curSize;
-
-			memory = rttiWriteElem(data.arraySize, memory);
-			memory = rttiWriteElem(data.rendererSemantic, memory);
-			memory = rttiWriteElem(data.type, memory);
-			memory = rttiWriteElem(data.name, memory);
-			memory = rttiWriteElem(data.gpuVariableName, memory);
-			memory = rttiWriteElem(data.elementSize, memory);
-		}
-
-		static UINT32 fromMemory(SHADER_DATA_PARAM_DESC& data, char* memory)
-		{ 
-			UINT32 size;
-			memcpy(&size, memory, sizeof(UINT32)); 
-			memory += sizeof(UINT32);
-
-			memory = rttiReadElem(data.arraySize, memory);
-			memory = rttiReadElem(data.rendererSemantic, memory);
-			memory = rttiReadElem(data.type, memory);
-			memory = rttiReadElem(data.name, memory);
-			memory = rttiReadElem(data.gpuVariableName, memory);
-			memory = rttiReadElem(data.elementSize, memory);
-
-			return size;
-		}
-
-		static UINT32 getDynamicSize(const SHADER_DATA_PARAM_DESC& data)	
-		{ 
-			UINT64 dataSize = rttiGetElemSize(data.arraySize) + rttiGetElemSize(data.rendererSemantic) + rttiGetElemSize(data.type) +
-				rttiGetElemSize(data.name) + rttiGetElemSize(data.gpuVariableName) + rttiGetElemSize(data.elementSize) + sizeof(UINT32);
-
-#if BS_DEBUG_MODE
-			if(dataSize > std::numeric_limits<UINT32>::max())
-			{
-				BS_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
-			}
-#endif
-
-			return (UINT32)dataSize;
-		}	
-	}; 
-
-	template<> struct RTTIPlainType<SHADER_OBJECT_PARAM_DESC>
-	{	
-		enum { id = TID_SHADER_OBJECT_PARAM_DESC }; enum { hasDynamicSize = 1 };
-
-		static void toMemory(const SHADER_OBJECT_PARAM_DESC& data, char* memory)
-		{ 
-			UINT32 size = getDynamicSize(data);
-
-			UINT32 curSize = sizeof(UINT32);
-			memcpy(memory, &size, curSize);
-			memory += curSize;
-
-			memory = rttiWriteElem(data.rendererSemantic, memory);
-			memory = rttiWriteElem(data.type, memory);
-			memory = rttiWriteElem(data.name, memory);
-			memory = rttiWriteElem(data.gpuVariableNames, memory);
-		}
-
-		static UINT32 fromMemory(SHADER_OBJECT_PARAM_DESC& data, char* memory)
-		{ 
-			UINT32 size;
-			memcpy(&size, memory, sizeof(UINT32)); 
-			memory += sizeof(UINT32);
-
-			memory = rttiReadElem(data.rendererSemantic, memory);
-			memory = rttiReadElem(data.type, memory);
-			memory = rttiReadElem(data.name, memory);
-			memory = rttiReadElem(data.gpuVariableNames, memory);
-
-			return size;
-		}
-
-		static UINT32 getDynamicSize(const SHADER_OBJECT_PARAM_DESC& data)	
-		{ 
-			UINT64 dataSize = rttiGetElemSize(data.rendererSemantic) + rttiGetElemSize(data.type) +
-				rttiGetElemSize(data.name) + rttiGetElemSize(data.gpuVariableNames) + sizeof(UINT32);
-
-#if BS_DEBUG_MODE
-			if(dataSize > std::numeric_limits<UINT32>::max())
-			{
-				BS_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
-			}
-#endif
-
-			return (UINT32)dataSize;
-		}	
-	}; 
-
-	template<> struct RTTIPlainType<SHADER_PARAM_BLOCK_DESC>
-	{	
-		enum { id = TID_SHADER_PARAM_BLOCK_DESC }; enum { hasDynamicSize = 1 };
-
-		static void toMemory(const SHADER_PARAM_BLOCK_DESC& data, char* memory)
-		{ 
-			UINT32 size = getDynamicSize(data);
-
-			UINT32 curSize = sizeof(UINT32);
-			memcpy(memory, &size, curSize);
-			memory += curSize;
-
-			memory = rttiWriteElem(data.shared, memory);
-			memory = rttiWriteElem(data.usage, memory);
-			memory = rttiWriteElem(data.name, memory);
-			memory = rttiWriteElem(data.rendererSemantic, memory);
-		}
-
-		static UINT32 fromMemory(SHADER_PARAM_BLOCK_DESC& data, char* memory)
-		{ 
-			UINT32 size;
-			memcpy(&size, memory, sizeof(UINT32)); 
-			memory += sizeof(UINT32);
-
-			memory = rttiReadElem(data.shared, memory);
-			memory = rttiReadElem(data.usage, memory);
-			memory = rttiReadElem(data.name, memory);
-			memory = rttiReadElem(data.rendererSemantic, memory);
-
-			return size;
-		}
-
-		static UINT32 getDynamicSize(const SHADER_PARAM_BLOCK_DESC& data)	
-		{ 
-			UINT64 dataSize = rttiGetElemSize(data.shared) + rttiGetElemSize(data.usage) + 
-				rttiGetElemSize(data.name) + rttiGetElemSize(data.rendererSemantic) + sizeof(UINT32);
-
-#if BS_DEBUG_MODE
-			if(dataSize > std::numeric_limits<UINT32>::max())
-			{
-				BS_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
-			}
-#endif
-
-			return (UINT32)dataSize;
-		}	
-	}; 
-
-	class BS_CORE_EXPORT ShaderRTTI : public RTTIType<Shader, Resource, ShaderRTTI>
-	{
-	private:
-		TechniquePtr getTechnique(Shader* obj, UINT32 idx) { return obj->mTechniques[idx]; }
-		void setTechnique(Shader* obj, UINT32 idx, TechniquePtr val) { obj->mTechniques[idx] = val; }
-		UINT32 getTechniqueArraySize(Shader* obj) { return (UINT32)obj->mTechniques.size(); }
-		void setTechniqueArraySize(Shader* obj, UINT32 size) { obj->mTechniques.resize(size); }
-
-		String& getName(Shader* obj) { return obj->mName; }
-		void setName(Shader* obj, String& name) { obj->mName = name; }
-
-		SHADER_DATA_PARAM_DESC& getDataParam(Shader* obj, UINT32 idx) 
-		{ 
-			auto iter = obj->mDesc.dataParams.begin();
-			for(UINT32 i = 0; i < idx; i++) ++iter;
-
-			return iter->second; 
-		}
-
-		void setDataParam(Shader* obj, UINT32 idx, SHADER_DATA_PARAM_DESC& val) { obj->mDesc.dataParams[val.name] = val; }
-		UINT32 getDataParamsArraySize(Shader* obj) { return (UINT32)obj->mDesc.dataParams.size(); }
-		void setDataParamsArraySize(Shader* obj, UINT32 size) {  } // Do nothing
-
-		SHADER_OBJECT_PARAM_DESC& getTextureParam(Shader* obj, UINT32 idx) 
-		{ 
-			auto iter = obj->mDesc.textureParams.begin();
-			for(UINT32 i = 0; i < idx; i++) ++iter;
-
-			return iter->second; 
-		}
-
-		void setTextureParam(Shader* obj, UINT32 idx, SHADER_OBJECT_PARAM_DESC& val) { obj->mDesc.textureParams[val.name] = val; }
-		UINT32 getTextureParamsArraySize(Shader* obj) { return (UINT32)obj->mDesc.textureParams.size(); }
-		void setTextureParamsArraySize(Shader* obj, UINT32 size) {  } // Do nothing
-
-		SHADER_OBJECT_PARAM_DESC& getSamplerParam(Shader* obj, UINT32 idx)
-		{
-			auto iter = obj->mDesc.samplerParams.begin();
-			for (UINT32 i = 0; i < idx; i++) ++iter;
-
-			return iter->second;
-		}
-
-		void setSamplerParam(Shader* obj, UINT32 idx, SHADER_OBJECT_PARAM_DESC& val) { obj->mDesc.samplerParams[val.name] = val; }
-		UINT32 getSamplerParamsArraySize(Shader* obj) { return (UINT32)obj->mDesc.samplerParams.size(); }
-		void setSamplerParamsArraySize(Shader* obj, UINT32 size) {  } // Do nothing
-
-		SHADER_OBJECT_PARAM_DESC& getBufferParam(Shader* obj, UINT32 idx)
-		{
-			auto iter = obj->mDesc.bufferParams.begin();
-			for (UINT32 i = 0; i < idx; i++) ++iter;
-
-			return iter->second;
-		}
-
-		void setBufferParam(Shader* obj, UINT32 idx, SHADER_OBJECT_PARAM_DESC& val) { obj->mDesc.bufferParams[val.name] = val; }
-		UINT32 getBufferParamsArraySize(Shader* obj) { return (UINT32)obj->mDesc.bufferParams.size(); }
-		void setBufferParamsArraySize(Shader* obj, UINT32 size) {  } // Do nothing
-
-		SHADER_PARAM_BLOCK_DESC& getParamBlock(Shader* obj, UINT32 idx)
-		{
-			auto iter = obj->mDesc.paramBlocks.begin();
-			for (UINT32 i = 0; i < idx; i++) ++iter;
-
-			return iter->second;
-		}
-
-		void setParamBlock(Shader* obj, UINT32 idx, SHADER_PARAM_BLOCK_DESC& val) { obj->mDesc.paramBlocks[val.name] = val; }
-		UINT32 getParamBlocksArraySize(Shader* obj) { return (UINT32)obj->mDesc.paramBlocks.size(); }
-		void setParamBlocksArraySize(Shader* obj, UINT32 size) {  } // Do nothing
-
-		UINT32& getQueueSortType(Shader* obj) { return (UINT32&)obj->mDesc.queueSortType; }
-		void setQueueSortType(Shader* obj, UINT32& value) { obj->mDesc.queueSortType = (QueueSortType)value; }
-
-		INT32& getQueuePriority(Shader* obj) { return obj->mDesc.queuePriority; }
-		void setQueuePriority(Shader* obj, INT32& value) { obj->mDesc.queuePriority = value; }
-
-		bool& getAllowSeparablePasses(Shader* obj) { return obj->mDesc.separablePasses; }
-		void setAllowSeparablePasses(Shader* obj, bool& value) { obj->mDesc.separablePasses = value; }
-
-		UINT32& getFlags(Shader* obj) { return obj->mDesc.flags; }
-		void setFlags(Shader* obj, UINT32& value) { obj->mDesc.flags = value; }
-
-		Vector<UINT8>& getDataDefaultValues(Shader* obj) { return obj->mDesc.dataDefaultValues; }
-		void setDataDefaultValues(Shader* obj, Vector<UINT8>& value) { obj->mDesc.dataDefaultValues = value; }
-
-		HTexture& getDefaultTexture(Shader* obj, UINT32 idx) { return obj->mDesc.textureDefaultValues[idx]; }
-		void setDefaultTexture(Shader* obj, UINT32 idx, HTexture& val) { obj->mDesc.textureDefaultValues[idx] = val; }
-		UINT32 getDefaultTextureArraySize(Shader* obj) { return (UINT32)obj->mDesc.textureDefaultValues.size(); }
-		void setDefaultTextureArraySize(Shader* obj, UINT32 size) { obj->mDesc.textureDefaultValues.resize(size); }
-
-		SamplerStatePtr getDefaultSampler(Shader* obj, UINT32 idx) { return obj->mDesc.samplerDefaultValues[idx]; }
-		void setDefaultSampler(Shader* obj, UINT32 idx, SamplerStatePtr val) { obj->mDesc.samplerDefaultValues[idx] = val; }
-		UINT32 getDefaultSamplerArraySize(Shader* obj) { return (UINT32)obj->mDesc.samplerDefaultValues.size(); }
-		void setDefaultSamplerArraySize(Shader* obj, UINT32 size) { obj->mDesc.samplerDefaultValues.resize(size); }
-
-	public:
-		ShaderRTTI()
-		{
-			addReflectablePtrArrayField("mTechniques", 0, &ShaderRTTI::getTechnique, &ShaderRTTI::getTechniqueArraySize, 
-				&ShaderRTTI::setTechnique, &ShaderRTTI::setTechniqueArraySize);
-			addPlainField("mName", 1, &ShaderRTTI::getName, &ShaderRTTI::setName);
-
-			addPlainArrayField("mDataParams", 2, &ShaderRTTI::getDataParam, &ShaderRTTI::getDataParamsArraySize, 
-				&ShaderRTTI::setDataParam, &ShaderRTTI::setDataParamsArraySize);
-			addPlainArrayField("mTextureParams", 3, &ShaderRTTI::getTextureParam, &ShaderRTTI::getTextureParamsArraySize,
-				&ShaderRTTI::setTextureParam, &ShaderRTTI::setTextureParamsArraySize);
-			addPlainArrayField("mSamplerParams", 4, &ShaderRTTI::getSamplerParam, &ShaderRTTI::getSamplerParamsArraySize,
-				&ShaderRTTI::setSamplerParam, &ShaderRTTI::setSamplerParamsArraySize);
-			addPlainArrayField("mBufferParams", 5, &ShaderRTTI::getBufferParam, &ShaderRTTI::getBufferParamsArraySize,
-				&ShaderRTTI::setBufferParam, &ShaderRTTI::setBufferParamsArraySize);
-			addPlainArrayField("mParamBlocks", 6, &ShaderRTTI::getParamBlock, &ShaderRTTI::getParamBlocksArraySize, 
-				&ShaderRTTI::setParamBlock, &ShaderRTTI::setParamBlocksArraySize);
-
-			addPlainField("mQueueSortType", 7, &ShaderRTTI::getQueueSortType, &ShaderRTTI::setQueueSortType);
-			addPlainField("mQueuePriority", 8, &ShaderRTTI::getQueuePriority, &ShaderRTTI::setQueuePriority);
-			addPlainField("mSeparablePasses", 9, &ShaderRTTI::getAllowSeparablePasses, &ShaderRTTI::setAllowSeparablePasses);
-
-			addPlainField("mDataDefaultValues", 10, &ShaderRTTI::getDataDefaultValues, &ShaderRTTI::setDataDefaultValues);
-			addReflectableArrayField("mTextureDefaultValues", 11, &ShaderRTTI::getDefaultTexture, &ShaderRTTI::getDefaultTextureArraySize,
-				&ShaderRTTI::setDefaultTexture, &ShaderRTTI::setDefaultTextureArraySize);
-			addReflectablePtrArrayField("mSamplerDefaultValues", 12, &ShaderRTTI::getDefaultSampler, &ShaderRTTI::getDefaultSamplerArraySize,
-				&ShaderRTTI::setDefaultSampler, &ShaderRTTI::setDefaultSamplerArraySize);
-
-			addPlainField("mFlags", 13, &ShaderRTTI::getFlags, &ShaderRTTI::setFlags);
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj) override
-		{
-			Shader* shader = static_cast<Shader*>(obj);
-			shader->initialize();
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "Shader";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_Shader;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject()
-		{
-			return Shader::createEmpty();
-		}
-	};
-
-	class BS_CORE_EXPORT ShaderMetaDataRTTI : public RTTIType < ShaderMetaData, ResourceMetaData, ShaderMetaDataRTTI >
-	{
-	private:
-		Vector<String>& getIncludes(ShaderMetaData* obj) { return obj->includes; }
-		void setIncludes(ShaderMetaData* obj, Vector<String>& includes) { obj->includes = includes; }
-
-	public:
-		ShaderMetaDataRTTI()
-		{
-			addPlainField("includes", 0, &ShaderMetaDataRTTI::getIncludes, &ShaderMetaDataRTTI::setIncludes);
-		}
-
-		virtual const String& getRTTIName()
-		{
-			static String name = "ShaderMetaData";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId()
-		{
-			return TID_ShaderMetaData;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject()
-		{
-			return bs_shared_ptr_new<ShaderMetaData>();
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsShader.h"
+#include "BsMaterial.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	template<> struct RTTIPlainType<SHADER_DATA_PARAM_DESC>
+	{	
+		enum { id = TID_SHADER_DATA_PARAM_DESC }; enum { hasDynamicSize = 1 };
+
+		static void toMemory(const SHADER_DATA_PARAM_DESC& data, char* memory)
+		{ 
+			UINT32 size = getDynamicSize(data);
+
+			UINT32 curSize = sizeof(UINT32);
+			memcpy(memory, &size, curSize);
+			memory += curSize;
+
+			memory = rttiWriteElem(data.arraySize, memory);
+			memory = rttiWriteElem(data.rendererSemantic, memory);
+			memory = rttiWriteElem(data.type, memory);
+			memory = rttiWriteElem(data.name, memory);
+			memory = rttiWriteElem(data.gpuVariableName, memory);
+			memory = rttiWriteElem(data.elementSize, memory);
+		}
+
+		static UINT32 fromMemory(SHADER_DATA_PARAM_DESC& data, char* memory)
+		{ 
+			UINT32 size;
+			memcpy(&size, memory, sizeof(UINT32)); 
+			memory += sizeof(UINT32);
+
+			memory = rttiReadElem(data.arraySize, memory);
+			memory = rttiReadElem(data.rendererSemantic, memory);
+			memory = rttiReadElem(data.type, memory);
+			memory = rttiReadElem(data.name, memory);
+			memory = rttiReadElem(data.gpuVariableName, memory);
+			memory = rttiReadElem(data.elementSize, memory);
+
+			return size;
+		}
+
+		static UINT32 getDynamicSize(const SHADER_DATA_PARAM_DESC& data)	
+		{ 
+			UINT64 dataSize = rttiGetElemSize(data.arraySize) + rttiGetElemSize(data.rendererSemantic) + rttiGetElemSize(data.type) +
+				rttiGetElemSize(data.name) + rttiGetElemSize(data.gpuVariableName) + rttiGetElemSize(data.elementSize) + sizeof(UINT32);
+
+#if BS_DEBUG_MODE
+			if(dataSize > std::numeric_limits<UINT32>::max())
+			{
+				BS_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
+			}
+#endif
+
+			return (UINT32)dataSize;
+		}	
+	}; 
+
+	template<> struct RTTIPlainType<SHADER_OBJECT_PARAM_DESC>
+	{	
+		enum { id = TID_SHADER_OBJECT_PARAM_DESC }; enum { hasDynamicSize = 1 };
+
+		static void toMemory(const SHADER_OBJECT_PARAM_DESC& data, char* memory)
+		{ 
+			UINT32 size = getDynamicSize(data);
+
+			UINT32 curSize = sizeof(UINT32);
+			memcpy(memory, &size, curSize);
+			memory += curSize;
+
+			memory = rttiWriteElem(data.rendererSemantic, memory);
+			memory = rttiWriteElem(data.type, memory);
+			memory = rttiWriteElem(data.name, memory);
+			memory = rttiWriteElem(data.gpuVariableNames, memory);
+		}
+
+		static UINT32 fromMemory(SHADER_OBJECT_PARAM_DESC& data, char* memory)
+		{ 
+			UINT32 size;
+			memcpy(&size, memory, sizeof(UINT32)); 
+			memory += sizeof(UINT32);
+
+			memory = rttiReadElem(data.rendererSemantic, memory);
+			memory = rttiReadElem(data.type, memory);
+			memory = rttiReadElem(data.name, memory);
+			memory = rttiReadElem(data.gpuVariableNames, memory);
+
+			return size;
+		}
+
+		static UINT32 getDynamicSize(const SHADER_OBJECT_PARAM_DESC& data)	
+		{ 
+			UINT64 dataSize = rttiGetElemSize(data.rendererSemantic) + rttiGetElemSize(data.type) +
+				rttiGetElemSize(data.name) + rttiGetElemSize(data.gpuVariableNames) + sizeof(UINT32);
+
+#if BS_DEBUG_MODE
+			if(dataSize > std::numeric_limits<UINT32>::max())
+			{
+				BS_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
+			}
+#endif
+
+			return (UINT32)dataSize;
+		}	
+	}; 
+
+	template<> struct RTTIPlainType<SHADER_PARAM_BLOCK_DESC>
+	{	
+		enum { id = TID_SHADER_PARAM_BLOCK_DESC }; enum { hasDynamicSize = 1 };
+
+		static void toMemory(const SHADER_PARAM_BLOCK_DESC& data, char* memory)
+		{ 
+			UINT32 size = getDynamicSize(data);
+
+			UINT32 curSize = sizeof(UINT32);
+			memcpy(memory, &size, curSize);
+			memory += curSize;
+
+			memory = rttiWriteElem(data.shared, memory);
+			memory = rttiWriteElem(data.usage, memory);
+			memory = rttiWriteElem(data.name, memory);
+			memory = rttiWriteElem(data.rendererSemantic, memory);
+		}
+
+		static UINT32 fromMemory(SHADER_PARAM_BLOCK_DESC& data, char* memory)
+		{ 
+			UINT32 size;
+			memcpy(&size, memory, sizeof(UINT32)); 
+			memory += sizeof(UINT32);
+
+			memory = rttiReadElem(data.shared, memory);
+			memory = rttiReadElem(data.usage, memory);
+			memory = rttiReadElem(data.name, memory);
+			memory = rttiReadElem(data.rendererSemantic, memory);
+
+			return size;
+		}
+
+		static UINT32 getDynamicSize(const SHADER_PARAM_BLOCK_DESC& data)	
+		{ 
+			UINT64 dataSize = rttiGetElemSize(data.shared) + rttiGetElemSize(data.usage) + 
+				rttiGetElemSize(data.name) + rttiGetElemSize(data.rendererSemantic) + sizeof(UINT32);
+
+#if BS_DEBUG_MODE
+			if(dataSize > std::numeric_limits<UINT32>::max())
+			{
+				BS_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
+			}
+#endif
+
+			return (UINT32)dataSize;
+		}	
+	}; 
+
+	class BS_CORE_EXPORT ShaderRTTI : public RTTIType<Shader, Resource, ShaderRTTI>
+	{
+	private:
+		TechniquePtr getTechnique(Shader* obj, UINT32 idx) { return obj->mTechniques[idx]; }
+		void setTechnique(Shader* obj, UINT32 idx, TechniquePtr val) { obj->mTechniques[idx] = val; }
+		UINT32 getTechniqueArraySize(Shader* obj) { return (UINT32)obj->mTechniques.size(); }
+		void setTechniqueArraySize(Shader* obj, UINT32 size) { obj->mTechniques.resize(size); }
+
+		String& getName(Shader* obj) { return obj->mName; }
+		void setName(Shader* obj, String& name) { obj->mName = name; }
+
+		SHADER_DATA_PARAM_DESC& getDataParam(Shader* obj, UINT32 idx) 
+		{ 
+			auto iter = obj->mDesc.dataParams.begin();
+			for(UINT32 i = 0; i < idx; i++) ++iter;
+
+			return iter->second; 
+		}
+
+		void setDataParam(Shader* obj, UINT32 idx, SHADER_DATA_PARAM_DESC& val) { obj->mDesc.dataParams[val.name] = val; }
+		UINT32 getDataParamsArraySize(Shader* obj) { return (UINT32)obj->mDesc.dataParams.size(); }
+		void setDataParamsArraySize(Shader* obj, UINT32 size) {  } // Do nothing
+
+		SHADER_OBJECT_PARAM_DESC& getTextureParam(Shader* obj, UINT32 idx) 
+		{ 
+			auto iter = obj->mDesc.textureParams.begin();
+			for(UINT32 i = 0; i < idx; i++) ++iter;
+
+			return iter->second; 
+		}
+
+		void setTextureParam(Shader* obj, UINT32 idx, SHADER_OBJECT_PARAM_DESC& val) { obj->mDesc.textureParams[val.name] = val; }
+		UINT32 getTextureParamsArraySize(Shader* obj) { return (UINT32)obj->mDesc.textureParams.size(); }
+		void setTextureParamsArraySize(Shader* obj, UINT32 size) {  } // Do nothing
+
+		SHADER_OBJECT_PARAM_DESC& getSamplerParam(Shader* obj, UINT32 idx)
+		{
+			auto iter = obj->mDesc.samplerParams.begin();
+			for (UINT32 i = 0; i < idx; i++) ++iter;
+
+			return iter->second;
+		}
+
+		void setSamplerParam(Shader* obj, UINT32 idx, SHADER_OBJECT_PARAM_DESC& val) { obj->mDesc.samplerParams[val.name] = val; }
+		UINT32 getSamplerParamsArraySize(Shader* obj) { return (UINT32)obj->mDesc.samplerParams.size(); }
+		void setSamplerParamsArraySize(Shader* obj, UINT32 size) {  } // Do nothing
+
+		SHADER_OBJECT_PARAM_DESC& getBufferParam(Shader* obj, UINT32 idx)
+		{
+			auto iter = obj->mDesc.bufferParams.begin();
+			for (UINT32 i = 0; i < idx; i++) ++iter;
+
+			return iter->second;
+		}
+
+		void setBufferParam(Shader* obj, UINT32 idx, SHADER_OBJECT_PARAM_DESC& val) { obj->mDesc.bufferParams[val.name] = val; }
+		UINT32 getBufferParamsArraySize(Shader* obj) { return (UINT32)obj->mDesc.bufferParams.size(); }
+		void setBufferParamsArraySize(Shader* obj, UINT32 size) {  } // Do nothing
+
+		SHADER_PARAM_BLOCK_DESC& getParamBlock(Shader* obj, UINT32 idx)
+		{
+			auto iter = obj->mDesc.paramBlocks.begin();
+			for (UINT32 i = 0; i < idx; i++) ++iter;
+
+			return iter->second;
+		}
+
+		void setParamBlock(Shader* obj, UINT32 idx, SHADER_PARAM_BLOCK_DESC& val) { obj->mDesc.paramBlocks[val.name] = val; }
+		UINT32 getParamBlocksArraySize(Shader* obj) { return (UINT32)obj->mDesc.paramBlocks.size(); }
+		void setParamBlocksArraySize(Shader* obj, UINT32 size) {  } // Do nothing
+
+		UINT32& getQueueSortType(Shader* obj) { return (UINT32&)obj->mDesc.queueSortType; }
+		void setQueueSortType(Shader* obj, UINT32& value) { obj->mDesc.queueSortType = (QueueSortType)value; }
+
+		INT32& getQueuePriority(Shader* obj) { return obj->mDesc.queuePriority; }
+		void setQueuePriority(Shader* obj, INT32& value) { obj->mDesc.queuePriority = value; }
+
+		bool& getAllowSeparablePasses(Shader* obj) { return obj->mDesc.separablePasses; }
+		void setAllowSeparablePasses(Shader* obj, bool& value) { obj->mDesc.separablePasses = value; }
+
+		UINT32& getFlags(Shader* obj) { return obj->mDesc.flags; }
+		void setFlags(Shader* obj, UINT32& value) { obj->mDesc.flags = value; }
+
+		Vector<UINT8>& getDataDefaultValues(Shader* obj) { return obj->mDesc.dataDefaultValues; }
+		void setDataDefaultValues(Shader* obj, Vector<UINT8>& value) { obj->mDesc.dataDefaultValues = value; }
+
+		HTexture& getDefaultTexture(Shader* obj, UINT32 idx) { return obj->mDesc.textureDefaultValues[idx]; }
+		void setDefaultTexture(Shader* obj, UINT32 idx, HTexture& val) { obj->mDesc.textureDefaultValues[idx] = val; }
+		UINT32 getDefaultTextureArraySize(Shader* obj) { return (UINT32)obj->mDesc.textureDefaultValues.size(); }
+		void setDefaultTextureArraySize(Shader* obj, UINT32 size) { obj->mDesc.textureDefaultValues.resize(size); }
+
+		SamplerStatePtr getDefaultSampler(Shader* obj, UINT32 idx) { return obj->mDesc.samplerDefaultValues[idx]; }
+		void setDefaultSampler(Shader* obj, UINT32 idx, SamplerStatePtr val) { obj->mDesc.samplerDefaultValues[idx] = val; }
+		UINT32 getDefaultSamplerArraySize(Shader* obj) { return (UINT32)obj->mDesc.samplerDefaultValues.size(); }
+		void setDefaultSamplerArraySize(Shader* obj, UINT32 size) { obj->mDesc.samplerDefaultValues.resize(size); }
+
+	public:
+		ShaderRTTI()
+		{
+			addReflectablePtrArrayField("mTechniques", 0, &ShaderRTTI::getTechnique, &ShaderRTTI::getTechniqueArraySize, 
+				&ShaderRTTI::setTechnique, &ShaderRTTI::setTechniqueArraySize);
+			addPlainField("mName", 1, &ShaderRTTI::getName, &ShaderRTTI::setName);
+
+			addPlainArrayField("mDataParams", 2, &ShaderRTTI::getDataParam, &ShaderRTTI::getDataParamsArraySize, 
+				&ShaderRTTI::setDataParam, &ShaderRTTI::setDataParamsArraySize);
+			addPlainArrayField("mTextureParams", 3, &ShaderRTTI::getTextureParam, &ShaderRTTI::getTextureParamsArraySize,
+				&ShaderRTTI::setTextureParam, &ShaderRTTI::setTextureParamsArraySize);
+			addPlainArrayField("mSamplerParams", 4, &ShaderRTTI::getSamplerParam, &ShaderRTTI::getSamplerParamsArraySize,
+				&ShaderRTTI::setSamplerParam, &ShaderRTTI::setSamplerParamsArraySize);
+			addPlainArrayField("mBufferParams", 5, &ShaderRTTI::getBufferParam, &ShaderRTTI::getBufferParamsArraySize,
+				&ShaderRTTI::setBufferParam, &ShaderRTTI::setBufferParamsArraySize);
+			addPlainArrayField("mParamBlocks", 6, &ShaderRTTI::getParamBlock, &ShaderRTTI::getParamBlocksArraySize, 
+				&ShaderRTTI::setParamBlock, &ShaderRTTI::setParamBlocksArraySize);
+
+			addPlainField("mQueueSortType", 7, &ShaderRTTI::getQueueSortType, &ShaderRTTI::setQueueSortType);
+			addPlainField("mQueuePriority", 8, &ShaderRTTI::getQueuePriority, &ShaderRTTI::setQueuePriority);
+			addPlainField("mSeparablePasses", 9, &ShaderRTTI::getAllowSeparablePasses, &ShaderRTTI::setAllowSeparablePasses);
+
+			addPlainField("mDataDefaultValues", 10, &ShaderRTTI::getDataDefaultValues, &ShaderRTTI::setDataDefaultValues);
+			addReflectableArrayField("mTextureDefaultValues", 11, &ShaderRTTI::getDefaultTexture, &ShaderRTTI::getDefaultTextureArraySize,
+				&ShaderRTTI::setDefaultTexture, &ShaderRTTI::setDefaultTextureArraySize);
+			addReflectablePtrArrayField("mSamplerDefaultValues", 12, &ShaderRTTI::getDefaultSampler, &ShaderRTTI::getDefaultSamplerArraySize,
+				&ShaderRTTI::setDefaultSampler, &ShaderRTTI::setDefaultSamplerArraySize);
+
+			addPlainField("mFlags", 13, &ShaderRTTI::getFlags, &ShaderRTTI::setFlags);
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			Shader* shader = static_cast<Shader*>(obj);
+			shader->initialize();
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "Shader";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_Shader;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject()
+		{
+			return Shader::createEmpty();
+		}
+	};
+
+	class BS_CORE_EXPORT ShaderMetaDataRTTI : public RTTIType < ShaderMetaData, ResourceMetaData, ShaderMetaDataRTTI >
+	{
+	private:
+		Vector<String>& getIncludes(ShaderMetaData* obj) { return obj->includes; }
+		void setIncludes(ShaderMetaData* obj, Vector<String>& includes) { obj->includes = includes; }
+
+	public:
+		ShaderMetaDataRTTI()
+		{
+			addPlainField("includes", 0, &ShaderMetaDataRTTI::getIncludes, &ShaderMetaDataRTTI::setIncludes);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "ShaderMetaData";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_ShaderMetaData;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<ShaderMetaData>();
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 195 - 199
BansheeCore/Include/BsStringTableRTTI.h

@@ -1,200 +1,196 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsStringTable.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT StringTableRTTI : public RTTIType<StringTable, Resource, StringTableRTTI>
-	{
-	private:
-		Language& getActiveLanguage(StringTable* obj) { return obj->mActiveLanguage; }
-		void setActiveLanguage(StringTable* obj, Language& val) { obj->mActiveLanguage = val; }
-
-		LanguageData& getLanguageData(StringTable* obj, UINT32 idx) { return obj->mAllLanguages[idx]; }
-		void setLanguageData(StringTable* obj, UINT32 idx, LanguageData& val) { obj->mAllLanguages[idx] = val; }
-		UINT32 getNumLanguages(StringTable* obj) { return (UINT32)Language::Count; }
-		void setNumLanguages(StringTable* obj, UINT32 val) { /* Do nothing */ }
-
-		UnorderedSet<WString>& getIdentifiers(StringTable* obj) { return obj->mIdentifiers; }
-		void setIdentifiers(StringTable* obj, UnorderedSet<WString>& val) { obj->mIdentifiers = val; }
-
-	public:
-		StringTableRTTI()
-		{
-			addPlainField("mActiveLanguage", 0, &StringTableRTTI::getActiveLanguage, &StringTableRTTI::setActiveLanguage);
-			addPlainArrayField("mLanguageData", 1, &StringTableRTTI::getLanguageData, &StringTableRTTI::getNumLanguages, 
-				&StringTableRTTI::setLanguageData, &StringTableRTTI::setNumLanguages);
-			addPlainField("mIdentifiers", 2, &StringTableRTTI::getIdentifiers, &StringTableRTTI::setIdentifiers);
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj) override
-		{
-			StringTable* stringTable = static_cast<StringTable*>(obj);
-			stringTable->setActiveLanguage(stringTable->mActiveLanguage);
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "StringTable";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_StringTable;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return StringTable::_createPtr();
-		}
-	};
-
-	/**
-	 * @brief	RTTIPlainType for LanguageData.
-	 * 			
-	 * @see		RTTIPlainType
-	 */
-	template<>
-	struct RTTIPlainType<LanguageData>
-	{	
-		enum { id = TID_LanguageData }; enum { hasDynamicSize = 1 };
-
-		/**
-		 * @copydoc		RTTIPlainType::toMemory
-		 */
-		static void toMemory(const LanguageData& data, char* memory)
-		{ 
-			UINT32 size = sizeof(UINT32);
-			char* memoryStart = memory;
-			memory += sizeof(UINT32);
-
-			UINT32 numElements = (UINT32)data.strings.size();
-			memory = rttiWriteElem(numElements, memory, size);
-
-			for (auto& entry : data.strings)
-			{
-				memory = rttiWriteElem(entry.first, memory, size);
-				memory = rttiWriteElem(*entry.second, memory, size);
-			}
-			
-			memcpy(memoryStart, &size, sizeof(UINT32));
-		}
-
-		/**
-		 * @copydoc		RTTIPlainType::fromMemory
-		 */
-		static UINT32 fromMemory(LanguageData& data, char* memory)
-		{ 
-			UINT32 size = 0;
-			memory = rttiReadElem(size, memory);
-
-			UINT32 numElements = 0;
-			memory = rttiReadElem(numElements, memory);
-
-			data.strings.clear();
-			for (UINT32 i = 0; i < numElements; i++)
-			{
-				WString identifier;
-				memory = rttiReadElem(identifier, memory);
-
-				SPtr<LocalizedStringData> entryData = bs_shared_ptr_new<LocalizedStringData>();
-				memory = rttiReadElem(*entryData, memory);
-
-				data.strings[identifier] = entryData;
-			}
-
-			return size;
-		}
-
-		/**
-		 * @copydoc		RTTIPlainType::getDynamicSize
-		 */
-		static UINT32 getDynamicSize(const LanguageData& data)
-		{ 
-			UINT64 dataSize = sizeof(UINT32) * 2;
-
-			for (auto& entry : data.strings)
-			{
-				dataSize += rttiGetElemSize(entry.first);
-				dataSize += rttiGetElemSize(*entry.second);
-			}
-
-			assert(dataSize <= std::numeric_limits<UINT32>::max());
-
-			return (UINT32)dataSize;
-		}	
-	}; 
-
-	/**
-	 * @brief	RTTIPlainType for LocalizedStringData.
-	 * 			
-	 * @see		RTTIPlainType
-	 */
-	template<>
-	struct RTTIPlainType<LocalizedStringData>
-	{	
-		enum { id = TID_LocalizedStringData }; enum { hasDynamicSize = 1 };
-
-		/**
-		 * @copydoc		RTTIPlainType::toMemory
-		 */
-		static void toMemory(const LocalizedStringData& data, char* memory)
-		{ 
-			UINT32 size = sizeof(UINT32);
-			char* memoryStart = memory;
-			memory += sizeof(UINT32);
-
-			memory = rttiWriteElem(data.string, memory, size);
-			memory = rttiWriteElem(data.numParameters, memory, size);
-
-			for (UINT32 i = 0; i < data.numParameters; i++)
-				memory = rttiWriteElem(data.parameterOffsets[i], memory, size);
-
-			memcpy(memoryStart, &size, sizeof(UINT32));
-		}
-
-		/**
-		 * @copydoc		RTTIPlainType::fromMemory
-		 */
-		static UINT32 fromMemory(LocalizedStringData& data, char* memory)
-		{ 
-			if (data.parameterOffsets != nullptr)
-				bs_deleteN(data.parameterOffsets, data.numParameters);
-
-			UINT32 size = 0;
-			memory = rttiReadElem(size, memory);
-
-			memory = rttiReadElem(data.string, memory);
-			memory = rttiReadElem(data.numParameters, memory);
-
-			data.parameterOffsets = bs_newN<LocalizedStringData::ParamOffset>(data.numParameters);
-			for (UINT32 i = 0; i < data.numParameters; i++)
-				memory = rttiReadElem(data.parameterOffsets[i], memory);
-
-			return size;
-		}
-
-		/**
-		 * @copydoc		RTTIPlainType::getDynamicSize
-		 */
-		static UINT32 getDynamicSize(const LocalizedStringData& data)
-		{ 
-			UINT64 dataSize = sizeof(UINT32);
-
-			dataSize += rttiGetElemSize(data.string);
-			dataSize += rttiGetElemSize(data.numParameters);
-
-			for (UINT32 i = 0; i < data.numParameters; i++)
-				dataSize = rttiGetElemSize(data.parameterOffsets[i]);
-
-			assert(dataSize <= std::numeric_limits<UINT32>::max());
-
-			return (UINT32)dataSize;
-		}	
-	}; 
-
-	BS_ALLOW_MEMCPY_SERIALIZATION(LocalizedStringData::ParamOffset);
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsStringTable.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT StringTableRTTI : public RTTIType<StringTable, Resource, StringTableRTTI>
+	{
+	private:
+		Language& getActiveLanguage(StringTable* obj) { return obj->mActiveLanguage; }
+		void setActiveLanguage(StringTable* obj, Language& val) { obj->mActiveLanguage = val; }
+
+		LanguageData& getLanguageData(StringTable* obj, UINT32 idx) { return obj->mAllLanguages[idx]; }
+		void setLanguageData(StringTable* obj, UINT32 idx, LanguageData& val) { obj->mAllLanguages[idx] = val; }
+		UINT32 getNumLanguages(StringTable* obj) { return (UINT32)Language::Count; }
+		void setNumLanguages(StringTable* obj, UINT32 val) { /* Do nothing */ }
+
+		UnorderedSet<WString>& getIdentifiers(StringTable* obj) { return obj->mIdentifiers; }
+		void setIdentifiers(StringTable* obj, UnorderedSet<WString>& val) { obj->mIdentifiers = val; }
+
+	public:
+		StringTableRTTI()
+		{
+			addPlainField("mActiveLanguage", 0, &StringTableRTTI::getActiveLanguage, &StringTableRTTI::setActiveLanguage);
+			addPlainArrayField("mLanguageData", 1, &StringTableRTTI::getLanguageData, &StringTableRTTI::getNumLanguages, 
+				&StringTableRTTI::setLanguageData, &StringTableRTTI::setNumLanguages);
+			addPlainField("mIdentifiers", 2, &StringTableRTTI::getIdentifiers, &StringTableRTTI::setIdentifiers);
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			StringTable* stringTable = static_cast<StringTable*>(obj);
+			stringTable->setActiveLanguage(stringTable->mActiveLanguage);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "StringTable";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_StringTable;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return StringTable::_createPtr();
+		}
+	};
+
+	/**
+	 * RTTIPlainType for LanguageData.
+	 * 			
+	 * @see		RTTIPlainType
+	 */
+	template<>
+	struct RTTIPlainType<LanguageData>
+	{	
+		enum { id = TID_LanguageData }; enum { hasDynamicSize = 1 };
+
+		/** @copydoc RTTIPlainType::toMemory */
+		static void toMemory(const LanguageData& data, char* memory)
+		{ 
+			UINT32 size = sizeof(UINT32);
+			char* memoryStart = memory;
+			memory += sizeof(UINT32);
+
+			UINT32 numElements = (UINT32)data.strings.size();
+			memory = rttiWriteElem(numElements, memory, size);
+
+			for (auto& entry : data.strings)
+			{
+				memory = rttiWriteElem(entry.first, memory, size);
+				memory = rttiWriteElem(*entry.second, memory, size);
+			}
+			
+			memcpy(memoryStart, &size, sizeof(UINT32));
+		}
+
+		/** @copydoc RTTIPlainType::fromMemory */
+		static UINT32 fromMemory(LanguageData& data, char* memory)
+		{ 
+			UINT32 size = 0;
+			memory = rttiReadElem(size, memory);
+
+			UINT32 numElements = 0;
+			memory = rttiReadElem(numElements, memory);
+
+			data.strings.clear();
+			for (UINT32 i = 0; i < numElements; i++)
+			{
+				WString identifier;
+				memory = rttiReadElem(identifier, memory);
+
+				SPtr<LocalizedStringData> entryData = bs_shared_ptr_new<LocalizedStringData>();
+				memory = rttiReadElem(*entryData, memory);
+
+				data.strings[identifier] = entryData;
+			}
+
+			return size;
+		}
+
+		/** @copydoc RTTIPlainType::getDynamicSize */
+		static UINT32 getDynamicSize(const LanguageData& data)
+		{ 
+			UINT64 dataSize = sizeof(UINT32) * 2;
+
+			for (auto& entry : data.strings)
+			{
+				dataSize += rttiGetElemSize(entry.first);
+				dataSize += rttiGetElemSize(*entry.second);
+			}
+
+			assert(dataSize <= std::numeric_limits<UINT32>::max());
+
+			return (UINT32)dataSize;
+		}	
+	}; 
+
+	/**
+	 * RTTIPlainType for LocalizedStringData.
+	 * 			
+	 * @see		RTTIPlainType
+	 */
+	template<>
+	struct RTTIPlainType<LocalizedStringData>
+	{	
+		enum { id = TID_LocalizedStringData }; enum { hasDynamicSize = 1 };
+
+		/** @copydoc RTTIPlainType::toMemory */
+		static void toMemory(const LocalizedStringData& data, char* memory)
+		{ 
+			UINT32 size = sizeof(UINT32);
+			char* memoryStart = memory;
+			memory += sizeof(UINT32);
+
+			memory = rttiWriteElem(data.string, memory, size);
+			memory = rttiWriteElem(data.numParameters, memory, size);
+
+			for (UINT32 i = 0; i < data.numParameters; i++)
+				memory = rttiWriteElem(data.parameterOffsets[i], memory, size);
+
+			memcpy(memoryStart, &size, sizeof(UINT32));
+		}
+
+		/** @copydoc RTTIPlainType::fromMemory */
+		static UINT32 fromMemory(LocalizedStringData& data, char* memory)
+		{ 
+			if (data.parameterOffsets != nullptr)
+				bs_deleteN(data.parameterOffsets, data.numParameters);
+
+			UINT32 size = 0;
+			memory = rttiReadElem(size, memory);
+
+			memory = rttiReadElem(data.string, memory);
+			memory = rttiReadElem(data.numParameters, memory);
+
+			data.parameterOffsets = bs_newN<LocalizedStringData::ParamOffset>(data.numParameters);
+			for (UINT32 i = 0; i < data.numParameters; i++)
+				memory = rttiReadElem(data.parameterOffsets[i], memory);
+
+			return size;
+		}
+
+		/** @copydoc RTTIPlainType::getDynamicSize */
+		static UINT32 getDynamicSize(const LocalizedStringData& data)
+		{ 
+			UINT64 dataSize = sizeof(UINT32);
+
+			dataSize += rttiGetElemSize(data.string);
+			dataSize += rttiGetElemSize(data.numParameters);
+
+			for (UINT32 i = 0; i < data.numParameters; i++)
+				dataSize = rttiGetElemSize(data.parameterOffsets[i]);
+
+			assert(dataSize <= std::numeric_limits<UINT32>::max());
+
+			return (UINT32)dataSize;
+		}	
+	}; 
+
+	BS_ALLOW_MEMCPY_SERIALIZATION(LocalizedStringData::ParamOffset);
+
+	/** @} */
+	/** @endcond */
 }

+ 62 - 68
BansheeCore/Include/BsTechniqueRTTI.h

@@ -1,69 +1,63 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsTechnique.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT TechniqueRTTI : public RTTIType<Technique, IReflectable, TechniqueRTTI>
-	{
-	private:
-		StringID& getRenderAPI(Technique* obj) { return obj->mRenderAPI; }
-		void setRenderAPI(Technique* obj, StringID& val) { obj->mRenderAPI = val; }
-
-		StringID& getRenderer(Technique* obj) { return obj->mRenderer; }
-		void setRenderer(Technique* obj, StringID& val) { obj->mRenderer = val; }
-
-		PassPtr getPass(Technique* obj, UINT32 idx)
-		{
-			return obj->mPasses[idx];
-		}
-
-		void setPass(Technique* obj, UINT32 idx, PassPtr val)
-		{
-			obj->mPasses[idx] = val;
-		}
-
-		UINT32 getPassArraySize(Technique* obj)
-		{
-			return (UINT32)obj->mPasses.size();
-		}
-
-		void setPassArraySize(Technique* obj, UINT32 size)
-		{
-			obj->mPasses.resize(size);
-		}
-
-	public:
-		TechniqueRTTI()
-		{
-			addPlainField("mRenderAPI", 0, &TechniqueRTTI::getRenderAPI, &TechniqueRTTI::setRenderAPI);
-			addPlainField("mRenderer", 1, &TechniqueRTTI::getRenderer, &TechniqueRTTI::setRenderer);
-
-			addReflectablePtrArrayField("mPasses", 2, &TechniqueRTTI::getPass, &TechniqueRTTI::getPassArraySize, &TechniqueRTTI::setPass, &TechniqueRTTI::setPassArraySize);
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj)
-		{
-			Technique* technique = static_cast<Technique*>(obj);
-			technique->initialize();
-		}
-
-		virtual const String& getRTTIName()
-		{
-			static String name = "Technique";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId()
-		{
-			return TID_Technique;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject()
-		{
-			return Technique::createEmpty();
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsTechnique.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT TechniqueRTTI : public RTTIType<Technique, IReflectable, TechniqueRTTI>
+	{
+	private:
+		StringID& getRenderAPI(Technique* obj) { return obj->mRenderAPI; }
+		void setRenderAPI(Technique* obj, StringID& val) { obj->mRenderAPI = val; }
+
+		StringID& getRenderer(Technique* obj) { return obj->mRenderer; }
+		void setRenderer(Technique* obj, StringID& val) { obj->mRenderer = val; }
+
+		PassPtr getPass(Technique* obj, UINT32 idx) { return obj->mPasses[idx]; }
+		void setPass(Technique* obj, UINT32 idx, PassPtr val) { obj->mPasses[idx] = val; }
+
+		UINT32 getPassArraySize(Technique* obj) { return (UINT32)obj->mPasses.size(); }
+		void setPassArraySize(Technique* obj, UINT32 size) { obj->mPasses.resize(size); }
+
+	public:
+		TechniqueRTTI()
+		{
+			addPlainField("mRenderAPI", 0, &TechniqueRTTI::getRenderAPI, &TechniqueRTTI::setRenderAPI);
+			addPlainField("mRenderer", 1, &TechniqueRTTI::getRenderer, &TechniqueRTTI::setRenderer);
+
+			addReflectablePtrArrayField("mPasses", 2, &TechniqueRTTI::getPass, &TechniqueRTTI::getPassArraySize, &TechniqueRTTI::setPass, &TechniqueRTTI::setPassArraySize);
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			Technique* technique = static_cast<Technique*>(obj);
+			technique->initialize();
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "Technique";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_Technique;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return Technique::createEmpty();
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 378 - 451
BansheeCore/Include/BsTextData.h

@@ -1,452 +1,379 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsFontDesc.h"
-#include "BsVector2I.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	This object takes as input a string, a font and optionally some constraints (like word wrap)
-	 *			and outputs a set of character data you may use for rendering or metrics.
-	 */
-	class TextDataBase
-	{
-	protected:
-		/**
-		 * @brief	Represents a single word as a set of characters, or optionally just a blank space
-		 *			of a certain length.
-		 *
-		 * @note	Due to the way allocation is handled, this class is not allowed to have a destructor.
-		 */
-		class TextWord
-		{
-		public:
-			/**
-			 * @brief	Initializes the word and signals if it just a space (or multiple spaces), or 
-			 *			an actual word with letters.
-			 */
-			void init(bool spacer);
-
-			/**
-			 * @brief	Appends a new character to the word.
-			 *
-			 * @param	charIdx		Sequential index of the character in the original string.
-			 * @param	desc		Character description from the font.
-			 *
-			 * @returns		How many pixels did the added character expand the word by.
-			 */
-			UINT32 addChar(UINT32 charIdx, const CHAR_DESC& desc);
-
-			/**
-			 * @brief	Adds a space to the word. Word must have previously have been declared as
-			 *			a "spacer".
-			 */
-			void addSpace(UINT32 spaceWidth);
-
-			/**
-			 * @brief	Returns the width of the word in pixels.
-			 */
-			UINT32 getWidth() const { return mWidth; }
-
-			/**
-			 * @brief	Returns height of the word in pixels.
-			 */
-			UINT32 getHeight() const { return mHeight; }
-
-			/**
-			 * @brief	Calculates new width of the word if we were to add the provided character, 
-			 *			without actually adding it.
-			 *
-			 * @param	desc	Character description from the font.
-			 *
-			 * @returns	Width of the word in pixels with the character appended to it.
-			 */
-			UINT32 calcWidthWithChar(const CHAR_DESC& desc);
-
-			/**
-			 * @brief	Returns true if word is a spacer. Spacers contain just a space 
-			 *			of a certain length with no actual characters.
-			 */
-			bool isSpacer() const { return mSpacer; }
-
-			/**
-			 * @brief	Returns the number of characters in the word.
-			 */
-			UINT32 getNumChars() const { return mLastChar == nullptr ? 0 : (mCharsEnd - mCharsStart + 1); }
-
-			/**
-			 * @brief	Returns the index of the starting character in the word.
-			 */
-			UINT32 getCharsStart() const { return mCharsStart; }
-
-			/**
-			 * @brief	Returns the index of the last character in the word.
-			 */
-			UINT32 getCharsEnd() const { return mCharsEnd; }
-
-			/**
-			 * @brief	Calculates width of the character by which it would expand the width of the word
-			 *			if it was added to it.
-			 *
-			 * @param	prevDesc	Descriptor of the character preceding the one we need the width for. Can be null.
-			 * @param	desc		Character description from the font.
-			 *
-			 * @returns	How many pixels would the added character expand the word by.
-			 */
-			static UINT32 calcCharWidth(const CHAR_DESC* prevDesc, const CHAR_DESC& desc);
-
-		private:
-			UINT32 mCharsStart, mCharsEnd;
-			UINT32 mWidth;
-			UINT32 mHeight;
-
-			const CHAR_DESC* mLastChar;
-
-			bool mSpacer;
-			UINT32 mSpaceWidth;
-		};
-
-		/**
-		 * @brief	Contains information about a single texture page that contains rendered
-		 *			character data.
-		 *
-		 * @note	Due to the way allocation is handled, this class is not allowed to have a destructor.
-		 */
-		struct PageInfo
-		{
-			UINT32 numQuads;
-			HTexture texture;
-		};
-
-	public:
-		/**
-		 * @brief	Represents a single line as a set of words.
-		 *
-		 * @note	Due to the way allocation is handled, this class is not allowed to have a destructor.
-		 */
-		class BS_CORE_EXPORT TextLine
-		{
-		public:
-			/**
-			 * @brief	Returns width of the line in pixels.
-			 */
-			UINT32 getWidth() const { return mWidth; }
-
-			/**
-			 * @brief	Returns height of the line in pixels.
-			 */
-			UINT32 getHeight() const { return mHeight; }
-
-			/**
-			 * @brief	Returns an offset used to separate two lines.
-			 */
-			UINT32 getYOffset() const { return mTextData->getLineHeight(); }
-
-			/**
-			 * @brief	Calculates new width of the line if we were to add the provided character, 
-			 *			without actually adding it.
-			 *
-			 * @param	desc		Character description from the font.
-			 *
-			 * @returns	Width of the line in pixels with the character appended to it.
-			 */
-			UINT32 calcWidthWithChar(const CHAR_DESC& desc);
-
-			/**
-			 * @brief	Fills the vertex/uv/index buffers for the specified page, with all the character data
-			 * 			needed for rendering.
-			 *
-			 * @param	page			The page.
-			 * @param [out]	vertices	Pre-allocated array where character vertices will be written.
-			 * @param [out]	uvs			Pre-allocated array where character uv coordinates will be written.
-			 * @param [out]	indexes 	Pre-allocated array where character indices will be written.
-			 * @param	offset			Offsets the location at which the method writes to the buffers.
-			 * 							Counted as number of quads.
-			 * @param	size			Total number of quads that can fit into the specified buffers.
-			 *
-			 * @return	Number of quads that were written.
-			 */
-			UINT32 fillBuffer(UINT32 page, Vector2* vertices, Vector2* uvs, UINT32* indexes, UINT32 offset, UINT32 size) const;
-
-			/**
-			 * @brief	Checks are we at a word boundary (i.e. next added character will start a new word).
-			 */
-			bool isAtWordBoundary() const;
-
-			/**
-			 * @brief	Returns the total number of characters on this line.
-			 */
-			UINT32 getNumChars() const;
-
-			/**
-			 * @brief	Query if this line was created explicitly due to a newline character.
-			 * 			As opposed to a line that was created because a word couldn't fit on the previous line.
-			 */
-			bool hasNewlineChar() const { return mHasNewline; }
-		private:
-			friend class TextDataBase;
-
-			/**
-			 * @brief	Appends a new character to the line.
-			 *
-			 * @param	charIdx		Sequential index of the character in the original string.
-			 * @param	desc		Character description from the font.
-			 */
-			void add(UINT32 charIdx, const CHAR_DESC& charDesc);
-
-			/**
-			 * @brief	Appends a space to the line.
-			 */
-			void addSpace(UINT32 spaceWidth);
-
-			/**
-			 * @brief	Adds a new word to the line.
-			 *
-			 * @param	wordIdx		Sequential index of the word in the original string. 
-			 *						Spaces are counted as words as well.
-			 * @param	word		Description of the word.
-			 */
-			void addWord(UINT32 wordIdx, const TextWord& word);
-
-			/**
-			 * @brief	Initializes the line. Must be called after construction.
-			 */
-			void init(TextDataBase* textData);
-
-			/**
-			 * @brief	Finalizes the line. Do not add new characters/words after a line has
-			 *			been finalized.
-			 *
-			 * @param	hasNewlineChar	Set to true if line was create due to an explicit newline char.
-			 *							As opposed to a line that was created because a word couldn't fit 
-			 *							on the previous line.
-			 */
-			void finalize(bool hasNewlineChar);
-
-			/**
-			 * @brief	Returns true if the line contains no words.
-			 */
-			bool isEmpty() const { return mIsEmpty; }
-
-			/**
-			 * @brief	Removes last word from the line and returns its sequential index.
-			 */
-			UINT32 removeLastWord();
-
-			/**
-			 * @brief	Calculates the line width and height in pixels.
-			 */
-			void calculateBounds();
-
-		private:
-			TextDataBase* mTextData;
-			UINT32 mWordsStart, mWordsEnd;
-
-			UINT32 mWidth;
-			UINT32 mHeight;
-
-			bool mIsEmpty;
-			bool mHasNewline;
-		};
-
-	public:
-		/**
-		 * @brief	Initializes a new text data using the specified string and font. Text will attempt to fit into
-		 *			the provided area. If enabled it will wrap words to new line when they don't fit. Individual words
-		 *			will be broken into multiple pieces if they don't fit on a single line when word break
-		 *			is enabled, otherwise they will be clipped. If the specified area is zero size then the text
-		 *			will not be clipped or word wrapped in any way.
-		 *
-		 *			After this object is constructed you may call various getter methods to get needed information.
-		 */
-		BS_CORE_EXPORT TextDataBase(const WString& text, const HFont& font, UINT32 fontSize,
-			UINT32 width = 0, UINT32 height = 0, bool wordWrap = false, bool wordBreak = true);
-		BS_CORE_EXPORT virtual ~TextDataBase() { }
-
-		/**
-		 * @brief	Returns the number of lines that were generated.
-		 */
-		BS_CORE_EXPORT UINT32 getNumLines() const { return mNumLines; }
-
-		/**
-		 * @brief	Returns the number of font pages references by the used characters.
-		 */
-		BS_CORE_EXPORT UINT32 getNumPages() const { return mNumPageInfos; }
-
-		/**
-		 * @brief	Returns the height of a line in pixels.
-		 */
-		BS_CORE_EXPORT UINT32 getLineHeight() const;
-
-		/**
-		 * @brief	Gets information describing a single line at the specified index.
-		 */
-		BS_CORE_EXPORT const TextLine& getLine(UINT32 idx) const { return mLines[idx]; }
-
-		/**
-		 * @brief	Returns font texture for the provided page index. 
-		 */
-		BS_CORE_EXPORT const HTexture& getTextureForPage(UINT32 page) const;
-
-		/**
-		 * @brief	Returns the number of quads used by all the characters in the provided page.
-		 */
-		BS_CORE_EXPORT UINT32 getNumQuadsForPage(UINT32 page) const { return mPageInfos[page].numQuads; }
-
-		/**
-		 * @brief	Returns the width of the actual text in pixels.
-		 */
-		BS_CORE_EXPORT UINT32 getWidth() const;
-
-		/**
-		 * @brief	Returns the height of the actual text in pixels.
-		 */
-		BS_CORE_EXPORT UINT32 getHeight() const;
-
-	protected:
-		/**
-		 * @brief	Copies internally stored data in temporary buffers to a persistent buffer.
-		 *
-		 * @param	text			Text originally used for creating the internal temporary buffer data.
-		 * @param	buffer			Memory location to copy the data to. If null then no data will be copied
-		 *							and the parameter \p size will contain the required buffer size.
-		 * @param	size			Size of the provided memory buffer, or if the buffer is null, this will
-		 *							contain the required buffer size after method exists.
-		 * @param	freeTemporary	If true the internal temporary data will be freed after copying.
-		 *
-		 * @note	Must be called after text data has been constructed and is in the temporary buffers.
-		 */
-		BS_CORE_EXPORT void generatePersistentData(const WString& text, UINT8* buffer, UINT32& size, bool freeTemporary = true);
-	private:
-		friend class TextLine;
-
-		/**
-		 * @brief	Returns Y offset that determines the line on which the characters are placed.
-		 *			In pixels.
-		 */
-		INT32 getBaselineOffset() const;
-
-		/**
-		 * @brief	Returns the width of a single space in pixels.
-		 */
-		UINT32 getSpaceWidth() const;
-
-		/**
-		 * @brief	Gets a description of a single character referenced by its sequential index
-		 *			based on the original string.
-		 */
-		const CHAR_DESC& getChar(UINT32 idx) const { return *mChars[idx]; }
-
-		/**
-		 * @brief	Gets a description of a single word referenced by its sequential index
-		 *			based on the original string.
-		 */
-		const TextWord& getWord(UINT32 idx) const { return mWords[idx]; }
-
-	protected:
-		const CHAR_DESC** mChars;
-		UINT32 mNumChars;
-
-		TextWord* mWords;
-		UINT32 mNumWords;
-
-		TextLine* mLines;
-		UINT32 mNumLines;
-
-		PageInfo* mPageInfos;
-		UINT32 mNumPageInfos;
-
-		HFont mFont;
-		SPtr<const FontBitmap> mFontData;
-
-		// Static buffers used to reduce runtime memory allocation
-	protected:
-		/**
-		 * @brief	Stores per-thread memory buffers used to reduce memory allocation.
-		 */
-		// Note: I could replace this with the global frame allocator to avoid the extra logic
-		struct BufferData
-		{
-			BufferData();
-			~BufferData();
-
-			/**
-			 * @brief	Allocates a new word and adds it to the buffer. Returns index of the word
-			 *			in the word buffer.
-			 *
-			 * @param	spacer	Specify true if the word is only to contain spaces. (Spaces are considered
-			 *					a special type of word).
-			 */
-			UINT32 allocWord(bool spacer);
-
-			/**
-			 * @brief	Allocates a new line and adds it to the buffer. Returns index of the line
-			 *			in the line buffer.
-			 */
-			UINT32 allocLine(TextDataBase* textData);
-
-			/**
-			 * @brief	Increments the count of characters for the referenced page, and optionally
-			 *			creates page info if it doesn't already exist.
-			 */
-			void addCharToPage(UINT32 page, const FontBitmap& fontData);
-
-			/**
-			 * @brief	Resets all allocation counters, but doesn't actually release memory.
-			 */
-			void deallocAll();
-
-			TextWord* WordBuffer;
-			UINT32 WordBufferSize;
-			UINT32 NextFreeWord;
-
-			TextLine* LineBuffer;
-			UINT32 LineBufferSize;
-			UINT32 NextFreeLine;
-
-			PageInfo* PageBuffer;
-			UINT32 PageBufferSize;
-			UINT32 NextFreePageInfo;
-		};
-
-		static BS_THREADLOCAL BufferData* MemBuffer;
-
-		/**
-		 * @brief	Allocates an initial set of buffers that will be reused while parsing
-		 *			text data.
-		 */
-		static void initAlloc();
-	};
-
-	/**
-	 * @copydoc	TextDataBase
-	 */
-	template<class Alloc = GenAlloc>
-	class TextData : public TextDataBase
-	{
-	public:
-		/**
-		 * @copydoc	TextDataBase::TextDataBase
-		 */
-		TextData(const WString& text, const HFont& font, UINT32 fontSize,
-			UINT32 width = 0, UINT32 height = 0, bool wordWrap = false, bool wordBreak = true)
-			:TextDataBase(text, font, fontSize, width, height, wordWrap, wordBreak), mData(nullptr)
-		{
-			UINT32 totalBufferSize = 0;
-			generatePersistentData(text, nullptr, totalBufferSize);
-
-			mData = (UINT8*)bs_alloc<Alloc>(totalBufferSize);
-			generatePersistentData(text, (UINT8*)mData, totalBufferSize);
-		}
-
-		~TextData()
-		{
-			if (mData != nullptr)
-				bs_free<Alloc>(mData);
-		}
-
-	private:
-		UINT8* mData;
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsFontDesc.h"
+#include "BsVector2I.h"
+
+namespace BansheeEngine
+{
+	/** @cond INTERNAL */
+	/** @addtogroup Implementation
+	 *  @{
+	 */
+
+	/**
+	 * This object takes as input a string, a font and optionally some constraints (like word wrap) and outputs a set of 
+	 * character data you may use for rendering or metrics.
+	 */
+	class TextDataBase
+	{
+	protected:
+		/**
+		 * Represents a single word as a set of characters, or optionally just a blank space of a certain length.
+		 *
+		 * @note	Due to the way allocation is handled, this class is not allowed to have a destructor.
+		 */
+		class TextWord
+		{
+		public:
+			/**
+			 * @brief	Initializes the word and signals if it just a space (or multiple spaces), or 
+			 *			an actual word with letters.
+			 */
+			void init(bool spacer);
+
+			/**
+			 * Appends a new character to the word.
+			 *
+			 * @param[in]	charIdx		Sequential index of the character in the original string.
+			 * @param[in]	desc		Character description from the font.
+			 * @return					How many pixels did the added character expand the word by.
+			 */
+			UINT32 addChar(UINT32 charIdx, const CHAR_DESC& desc);
+
+			/** Adds a space to the word. Word must have previously have been declared as a "spacer". */
+			void addSpace(UINT32 spaceWidth);
+
+			/**	Returns the width of the word in pixels. */
+			UINT32 getWidth() const { return mWidth; }
+
+			/**
+			 * @brief	Returns height of the word in pixels.
+			 */
+			UINT32 getHeight() const { return mHeight; }
+
+			/**
+			 * Calculates new width of the word if we were to add the provided character, without actually adding it.
+			 *
+			 * @param[in]	desc	Character description from the font.
+			 * @return				Width of the word in pixels with the character appended to it.
+			 */
+			UINT32 calcWidthWithChar(const CHAR_DESC& desc);
+
+			/**
+			 * @brief	Returns true if word is a spacer. Spacers contain just a space 
+			 *			of a certain length with no actual characters.
+			 */
+			bool isSpacer() const { return mSpacer; }
+
+			/**	Returns the number of characters in the word. */
+			UINT32 getNumChars() const { return mLastChar == nullptr ? 0 : (mCharsEnd - mCharsStart + 1); }
+
+			/**	Returns the index of the starting character in the word. */
+			UINT32 getCharsStart() const { return mCharsStart; }
+
+			/**	Returns the index of the last character in the word. */
+			UINT32 getCharsEnd() const { return mCharsEnd; }
+
+			/**
+			 * Calculates width of the character by which it would expand the width of the word if it was added to it.
+			 *
+			 * @param[in]	prevDesc	Descriptor of the character preceding the one we need the width for. Can be null.
+			 * @param[in]	desc		Character description from the font.
+			 * @return 					How many pixels would the added character expand the word by.
+			 */
+			static UINT32 calcCharWidth(const CHAR_DESC* prevDesc, const CHAR_DESC& desc);
+
+		private:
+			UINT32 mCharsStart, mCharsEnd;
+			UINT32 mWidth;
+			UINT32 mHeight;
+
+			const CHAR_DESC* mLastChar;
+
+			bool mSpacer;
+			UINT32 mSpaceWidth;
+		};
+
+		/**
+		 * Contains information about a single texture page that contains rendered character data.
+		 *
+		 * @note	Due to the way allocation is handled, this class is not allowed to have a destructor.
+		 */
+		struct PageInfo
+		{
+			UINT32 numQuads;
+			HTexture texture;
+		};
+
+	public:
+		/**
+		 * Represents a single line as a set of words.
+		 *
+		 * @note	Due to the way allocation is handled, this class is not allowed to have a destructor.
+		 */
+		class BS_CORE_EXPORT TextLine
+		{
+		public:
+			/**	Returns width of the line in pixels. */
+			UINT32 getWidth() const { return mWidth; }
+
+			/**	Returns height of the line in pixels. */
+			UINT32 getHeight() const { return mHeight; }
+
+			/**	Returns an offset used to separate two lines. */
+			UINT32 getYOffset() const { return mTextData->getLineHeight(); }
+
+			/**
+			 * Calculates new width of the line if we were to add the provided character, without actually adding it.
+			 *
+			 * @param[in]	desc	Character description from the font.
+			 * @return				Width of the line in pixels with the character appended to it.
+			 */
+			UINT32 calcWidthWithChar(const CHAR_DESC& desc);
+
+			/**
+			 * Fills the vertex/uv/index buffers for the specified page, with all the character data needed for rendering.
+			 *
+			 * @param[in]	page		The page.
+			 * @param[out]	vertices	Pre-allocated array where character vertices will be written.
+			 * @param[out]	uvs			Pre-allocated array where character uv coordinates will be written.
+			 * @param[out]	indexes 	Pre-allocated array where character indices will be written.
+			 * @param[in]	offset		Offsets the location at which the method writes to the buffers. Counted as number 
+			 *							of quads.
+			 * @param[in]	size		Total number of quads that can fit into the specified buffers.
+			 * @return					Number of quads that were written.
+			 */
+			UINT32 fillBuffer(UINT32 page, Vector2* vertices, Vector2* uvs, UINT32* indexes, UINT32 offset, UINT32 size) const;
+
+			/**	Checks are we at a word boundary (i.e. next added character will start a new word). */
+			bool isAtWordBoundary() const;
+
+			/**	Returns the total number of characters on this line. */
+			UINT32 getNumChars() const;
+
+			/**
+			 * Query if this line was created explicitly due to a newline character. As opposed to a line that was created
+			 * because a word couldn't fit on the previous line.
+			 */
+			bool hasNewlineChar() const { return mHasNewline; }
+		private:
+			friend class TextDataBase;
+
+			/**
+			 * Appends a new character to the line.
+			 *
+			 * @param[in]	charIdx		Sequential index of the character in the original string.
+			 * @param[in]	desc		Character description from the font.
+			 */
+			void add(UINT32 charIdx, const CHAR_DESC& charDesc);
+
+			/**	Appends a space to the line. */
+			void addSpace(UINT32 spaceWidth);
+
+			/**
+			 * Adds a new word to the line.
+			 *
+			 * @param[in]	wordIdx		Sequential index of the word in the original string. Spaces are counted as words as
+			 *							well.
+			 * @param[in]	word		Description of the word.
+			 */
+			void addWord(UINT32 wordIdx, const TextWord& word);
+
+			/** Initializes the line. Must be called after construction. */
+			void init(TextDataBase* textData);
+
+			/**
+			 * Finalizes the line. Do not add new characters/words after a line has been finalized.
+			 *
+			 * @param[in]	hasNewlineChar	Set to true if line was create due to an explicit newline char. As opposed to a
+			 *								line that was created because a word couldn't fit on the previous line.
+			 */
+			void finalize(bool hasNewlineChar);
+
+			/**	Returns true if the line contains no words. */
+			bool isEmpty() const { return mIsEmpty; }
+
+			/**	Removes last word from the line and returns its sequential index. */
+			UINT32 removeLastWord();
+
+			/**	Calculates the line width and height in pixels. */
+			void calculateBounds();
+
+		private:
+			TextDataBase* mTextData;
+			UINT32 mWordsStart, mWordsEnd;
+
+			UINT32 mWidth;
+			UINT32 mHeight;
+
+			bool mIsEmpty;
+			bool mHasNewline;
+		};
+
+	public:
+		/**
+		 * Initializes a new text data using the specified string and font. Text will attempt to fit into the provided area.
+		 * If enabled it will wrap words to new line when they don't fit. Individual words will be broken into multiple 
+		 * pieces if they don't fit on a single line when word break is enabled, otherwise they will be clipped. If the 
+		 * specified area is zero size then the text will not be clipped or word wrapped in any way.
+		 *
+		 * After this object is constructed you may call various getter methods to get needed information.
+		 */
+		BS_CORE_EXPORT TextDataBase(const WString& text, const HFont& font, UINT32 fontSize,
+			UINT32 width = 0, UINT32 height = 0, bool wordWrap = false, bool wordBreak = true);
+		BS_CORE_EXPORT virtual ~TextDataBase() { }
+
+		/**	Returns the number of lines that were generated. */
+		BS_CORE_EXPORT UINT32 getNumLines() const { return mNumLines; }
+
+		/**	Returns the number of font pages references by the used characters. */
+		BS_CORE_EXPORT UINT32 getNumPages() const { return mNumPageInfos; }
+
+		/**	Returns the height of a line in pixels. */
+		BS_CORE_EXPORT UINT32 getLineHeight() const;
+
+		/**	Gets information describing a single line at the specified index. */
+		BS_CORE_EXPORT const TextLine& getLine(UINT32 idx) const { return mLines[idx]; }
+
+		/**	Returns font texture for the provided page index.  */
+		BS_CORE_EXPORT const HTexture& getTextureForPage(UINT32 page) const;
+
+		/**	Returns the number of quads used by all the characters in the provided page. */
+		BS_CORE_EXPORT UINT32 getNumQuadsForPage(UINT32 page) const { return mPageInfos[page].numQuads; }
+
+		/**	Returns the width of the actual text in pixels. */
+		BS_CORE_EXPORT UINT32 getWidth() const;
+
+		/**	Returns the height of the actual text in pixels. */
+		BS_CORE_EXPORT UINT32 getHeight() const;
+
+	protected:
+		/**
+		 * Copies internally stored data in temporary buffers to a persistent buffer.
+		 *
+		 * @param[in]	text			Text originally used for creating the internal temporary buffer data.
+		 * @param[in]	buffer			Memory location to copy the data to. If null then no data will be copied and the
+		 *								parameter @p size will contain the required buffer size.
+		 * @param[in]	size			Size of the provided memory buffer, or if the buffer is null, this will contain the 
+		 *								required buffer size after method exists.
+		 * @param[in]	freeTemporary	If true the internal temporary data will be freed after copying.
+		 *
+		 * @note	Must be called after text data has been constructed and is in the temporary buffers.
+		 */
+		BS_CORE_EXPORT void generatePersistentData(const WString& text, UINT8* buffer, UINT32& size, bool freeTemporary = true);
+	private:
+		friend class TextLine;
+
+		/**	Returns Y offset that determines the line on which the characters are placed. In pixels. */
+		INT32 getBaselineOffset() const;
+
+		/**	Returns the width of a single space in pixels. */
+		UINT32 getSpaceWidth() const;
+
+		/** Gets a description of a single character referenced by its sequential index based on the original string. */
+		const CHAR_DESC& getChar(UINT32 idx) const { return *mChars[idx]; }
+
+		/** Gets a description of a single word referenced by its sequential index based on the original string. */
+		const TextWord& getWord(UINT32 idx) const { return mWords[idx]; }
+
+	protected:
+		const CHAR_DESC** mChars;
+		UINT32 mNumChars;
+
+		TextWord* mWords;
+		UINT32 mNumWords;
+
+		TextLine* mLines;
+		UINT32 mNumLines;
+
+		PageInfo* mPageInfos;
+		UINT32 mNumPageInfos;
+
+		HFont mFont;
+		SPtr<const FontBitmap> mFontData;
+
+		// Static buffers used to reduce runtime memory allocation
+	protected:
+		/** Stores per-thread memory buffers used to reduce memory allocation. */
+		// Note: I could replace this with the global frame allocator to avoid the extra logic
+		struct BufferData
+		{
+			BufferData();
+			~BufferData();
+
+			/**
+			 * Allocates a new word and adds it to the buffer. Returns index of the word in the word buffer.
+			 *
+			 * @param[in]	spacer	Specify true if the word is only to contain spaces. (Spaces are considered a special 
+			 *						type of word).
+			 */
+			UINT32 allocWord(bool spacer);
+
+			/** Allocates a new line and adds it to the buffer. Returns index of the line in the line buffer. */
+			UINT32 allocLine(TextDataBase* textData);
+
+			/**
+			 * Increments the count of characters for the referenced page, and optionally creates page info if it doesn't
+			 * already exist.
+			 */
+			void addCharToPage(UINT32 page, const FontBitmap& fontData);
+
+			/**	Resets all allocation counters, but doesn't actually release memory. */
+			void deallocAll();
+
+			TextWord* WordBuffer;
+			UINT32 WordBufferSize;
+			UINT32 NextFreeWord;
+
+			TextLine* LineBuffer;
+			UINT32 LineBufferSize;
+			UINT32 NextFreeLine;
+
+			PageInfo* PageBuffer;
+			UINT32 PageBufferSize;
+			UINT32 NextFreePageInfo;
+		};
+
+		static BS_THREADLOCAL BufferData* MemBuffer;
+
+		/**	Allocates an initial set of buffers that will be reused while parsing text data. */
+		static void initAlloc();
+	};
+
+	/** @} */
+
+	/** @addtogroup Text
+	 *  @{
+	 */
+
+	/** @copydoc TextDataBase */
+	template<class Alloc = GenAlloc>
+	class TextData : public TextDataBase
+	{
+	public:
+		/** @copydoc TextDataBase::TextDataBase */
+		TextData(const WString& text, const HFont& font, UINT32 fontSize,
+			UINT32 width = 0, UINT32 height = 0, bool wordWrap = false, bool wordBreak = true)
+			:TextDataBase(text, font, fontSize, width, height, wordWrap, wordBreak), mData(nullptr)
+		{
+			UINT32 totalBufferSize = 0;
+			generatePersistentData(text, nullptr, totalBufferSize);
+
+			mData = (UINT8*)bs_alloc<Alloc>(totalBufferSize);
+			generatePersistentData(text, (UINT8*)mData, totalBufferSize);
+		}
+
+		~TextData()
+		{
+			if (mData != nullptr)
+				bs_free<Alloc>(mData);
+		}
+
+	private:
+		UINT8* mData;
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 60 - 52
BansheeCore/Include/BsTextureImportOptionsRTTI.h

@@ -1,53 +1,61 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsTextureImportOptions.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT TextureImportOptionsRTTI : public RTTIType<TextureImportOptions, ImportOptions, TextureImportOptionsRTTI>
-	{
-	private:
-		PixelFormat& getPixelFormat(TextureImportOptions* obj) { return obj->mFormat; }
-		void setPixelFormat(TextureImportOptions* obj, PixelFormat& value) { obj->mFormat = value; }
-
-		bool& getGenerateMips(TextureImportOptions* obj) { return obj->mGenerateMips; }
-		void setGenerateMips(TextureImportOptions* obj, bool& value) { obj->mGenerateMips = value; }
-
-		UINT32& getMaxMip(TextureImportOptions* obj) { return obj->mMaxMip; }
-		void setMaxMip(TextureImportOptions* obj, UINT32& value) { obj->mMaxMip = value; }
-
-		bool& getCPUReadable(TextureImportOptions* obj) { return obj->mCPUReadable; }
-		void setCPUReadable(TextureImportOptions* obj, bool& value) { obj->mCPUReadable = value; }
-
-		bool& getSRGB(TextureImportOptions* obj) { return obj->mSRGB; }
-		void setSRGB(TextureImportOptions* obj, bool& value) { obj->mSRGB = value; }
-
-	public:
-		TextureImportOptionsRTTI()
-		{
-			addPlainField("mPixelFormat", 0, &TextureImportOptionsRTTI::getPixelFormat, &TextureImportOptionsRTTI::setPixelFormat);
-			addPlainField("mGenerateMips", 1, &TextureImportOptionsRTTI::getGenerateMips, &TextureImportOptionsRTTI::setGenerateMips);
-			addPlainField("mMaxMip", 2, &TextureImportOptionsRTTI::getMaxMip, &TextureImportOptionsRTTI::setMaxMip);
-			addPlainField("mCPUReadable", 3, &TextureImportOptionsRTTI::getCPUReadable, &TextureImportOptionsRTTI::setCPUReadable);
-			addPlainField("mSRGB", 4, &TextureImportOptionsRTTI::getSRGB, &TextureImportOptionsRTTI::setSRGB);
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "TextureImportOptions";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_TextureImportOptions;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<TextureImportOptions>();
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsTextureImportOptions.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT TextureImportOptionsRTTI : public RTTIType<TextureImportOptions, ImportOptions, TextureImportOptionsRTTI>
+	{
+	private:
+		PixelFormat& getPixelFormat(TextureImportOptions* obj) { return obj->mFormat; }
+		void setPixelFormat(TextureImportOptions* obj, PixelFormat& value) { obj->mFormat = value; }
+
+		bool& getGenerateMips(TextureImportOptions* obj) { return obj->mGenerateMips; }
+		void setGenerateMips(TextureImportOptions* obj, bool& value) { obj->mGenerateMips = value; }
+
+		UINT32& getMaxMip(TextureImportOptions* obj) { return obj->mMaxMip; }
+		void setMaxMip(TextureImportOptions* obj, UINT32& value) { obj->mMaxMip = value; }
+
+		bool& getCPUReadable(TextureImportOptions* obj) { return obj->mCPUReadable; }
+		void setCPUReadable(TextureImportOptions* obj, bool& value) { obj->mCPUReadable = value; }
+
+		bool& getSRGB(TextureImportOptions* obj) { return obj->mSRGB; }
+		void setSRGB(TextureImportOptions* obj, bool& value) { obj->mSRGB = value; }
+
+	public:
+		TextureImportOptionsRTTI()
+		{
+			addPlainField("mPixelFormat", 0, &TextureImportOptionsRTTI::getPixelFormat, &TextureImportOptionsRTTI::setPixelFormat);
+			addPlainField("mGenerateMips", 1, &TextureImportOptionsRTTI::getGenerateMips, &TextureImportOptionsRTTI::setGenerateMips);
+			addPlainField("mMaxMip", 2, &TextureImportOptionsRTTI::getMaxMip, &TextureImportOptionsRTTI::setMaxMip);
+			addPlainField("mCPUReadable", 3, &TextureImportOptionsRTTI::getCPUReadable, &TextureImportOptionsRTTI::setCPUReadable);
+			addPlainField("mSRGB", 4, &TextureImportOptionsRTTI::getSRGB, &TextureImportOptionsRTTI::setSRGB);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "TextureImportOptions";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_TextureImportOptions;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<TextureImportOptions>();
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 189 - 181
BansheeCore/Include/BsTextureRTTI.h

@@ -1,182 +1,190 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsTexture.h"
-#include "BsManagedDataBlock.h"
-#include "BsMath.h"
-#include "BsCoreApplication.h"
-#include "BsCoreThread.h"
-#include "BsRenderAPI.h"
-#include "BsTextureManager.h"
-#include "BsPixelData.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT TextureRTTI : public RTTIType<Texture, Resource, TextureRTTI>
-	{
-	private:
-		UINT32& getSize(Texture* obj) { return obj->mSize; }
-		void setSize(Texture* obj, UINT32& val) { obj->mSize = val; }
-
-		UINT32& getWidth(Texture* obj) { return obj->mProperties.mWidth; }
-		void setWidth(Texture* obj, UINT32& val) { obj->mProperties.mWidth = val; }
-
-		UINT32& getHeight(Texture* obj) { return obj->mProperties.mHeight; }
-		void setHeight(Texture* obj, UINT32& val) { obj->mProperties.mHeight = val; }
-
-		UINT32& getDepth(Texture* obj) { return obj->mProperties.mDepth; }
-		void setDepth(Texture* obj, UINT32& val) { obj->mProperties.mDepth = val; }
-
-		UINT32& getNumMipmaps(Texture* obj) { return obj->mProperties.mNumMipmaps; }
-		void setNumMipmaps(Texture* obj, UINT32& val) { obj->mProperties.mNumMipmaps = val; }
-
-		bool& getHwGamma(Texture* obj) { return obj->mProperties.mHwGamma; }
-		void setHwGamma(Texture* obj, bool& val) { obj->mProperties.mHwGamma = val; }
-
-		UINT32& getMultisampleCount(Texture* obj) { return obj->mProperties.mMultisampleCount; }
-		void setMultisampleCount(Texture* obj, UINT32& val) { obj->mProperties.mMultisampleCount = val; }
-
-		TextureType& getTextureType(Texture* obj) { return obj->mProperties.mTextureType; }
-		void setTextureType(Texture* obj, TextureType& val) { obj->mProperties.mTextureType = val; }
-
-		PixelFormat& getFormat(Texture* obj) { return obj->mProperties.mFormat; }
-		void setFormat(Texture* obj, PixelFormat& val) { obj->mProperties.mFormat = val; }
-
-		INT32& getUsage(Texture* obj) { return obj->mProperties.mUsage; }
-		void setUsage(Texture* obj, INT32& val) 
-		{ 
-			// Render target and depth stencil texture formats are for in-memory use only
-			// and don't make sense when serialized
-			if (val == TU_DEPTHSTENCIL || val == TU_RENDERTARGET)
-				obj->mProperties.mUsage = TU_STATIC;
-			else
-				obj->mProperties.mUsage = val;
-		}
-
-#define BS_ADD_PLAINFIELD(name, id, parentType) \
-	addPlainField(#name, id##, &##parentType##::get##name, &##parentType##::Set##name);
-
-		PixelDataPtr getPixelData(Texture* obj, UINT32 idx)
-		{
-			UINT32 face = (size_t)Math::floor(idx / (float)(obj->mProperties.getNumMipmaps() + 1));
-			UINT32 mipmap = idx % (obj->mProperties.getNumMipmaps() + 1);
-
-			UINT32 subresourceIdx = obj->mProperties.mapToSubresourceIdx(face, mipmap);
-			PixelDataPtr pixelData = obj->mProperties.allocateSubresourceBuffer(subresourceIdx);
-
-			obj->readSubresource(gCoreAccessor(), subresourceIdx, pixelData);
-			gCoreAccessor().submitToCoreThread(true);
-
-			return pixelData;
-		}
-
-		void setPixelData(Texture* obj, UINT32 idx, PixelDataPtr data)
-		{
-			Vector<PixelDataPtr>* pixelData = any_cast<Vector<PixelDataPtr>*>(obj->mRTTIData);
-
-			(*pixelData)[idx] = data;
-		}
-
-		UINT32 getPixelDataArraySize(Texture* obj)
-		{
-			return obj->mProperties.getNumFaces() * (obj->mProperties.getNumMipmaps() + 1);
-		}
-
-		void setPixelDataArraySize(Texture* obj, UINT32 size)
-		{
-			Vector<PixelDataPtr>* pixelData = any_cast<Vector<PixelDataPtr>*>(obj->mRTTIData);
-
-			pixelData->resize(size);
-		}
-
-	public:
-		TextureRTTI()
-		{
-			addPlainField("mSize", 0, &TextureRTTI::getSize, &TextureRTTI::setSize);
-			addPlainField("mHeight", 2, &TextureRTTI::getHeight, &TextureRTTI::setHeight);
-			addPlainField("mWidth", 3, &TextureRTTI::getWidth, &TextureRTTI::setWidth);
-			addPlainField("mDepth", 4, &TextureRTTI::getDepth, &TextureRTTI::setDepth);
-			addPlainField("mNumMipmaps", 5, &TextureRTTI::getNumMipmaps, &TextureRTTI::setNumMipmaps);
-			addPlainField("mHwGamma", 6, &TextureRTTI::getHwGamma, &TextureRTTI::setHwGamma);
-			addPlainField("mMultisampleCount", 7, &TextureRTTI::getMultisampleCount, &TextureRTTI::setMultisampleCount);
-			addPlainField("mTextureType", 9, &TextureRTTI::getTextureType, &TextureRTTI::setTextureType);
-			addPlainField("mFormat", 10, &TextureRTTI::getFormat, &TextureRTTI::setFormat);
-			addPlainField("mUsage", 11, &TextureRTTI::getUsage, &TextureRTTI::setUsage);
-
-			addReflectablePtrArrayField("mPixelData", 12, &TextureRTTI::getPixelData, &TextureRTTI::getPixelDataArraySize, 
-				&TextureRTTI::setPixelData, &TextureRTTI::setPixelDataArraySize, RTTI_Flag_SkipInReferenceSearch);
-		}
-
-		virtual void onDeserializationStarted(IReflectable* obj) override
-		{
-			Texture* texture = static_cast<Texture*>(obj);
-
-			texture->mRTTIData = bs_new<Vector<PixelDataPtr>>();
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj) override
-		{
-			Texture* texture = static_cast<Texture*>(obj);
-
-			if(texture->mRTTIData.empty())
-				return;
-
-			TextureProperties& texProps = texture->mProperties;
-
-			// Update pixel format if needed as it's possible the original texture was saved using some other render API
-			// that has an unsupported format.
-			PixelFormat originalFormat = texProps.mFormat;
-			PixelFormat validFormat = TextureManager::instance().getNativeFormat(
-				texProps.mTextureType, texProps.mFormat, texProps.mUsage, texProps.mHwGamma);
-
-			Vector<PixelDataPtr>* pixelData = any_cast<Vector<PixelDataPtr>*>(texture->mRTTIData);
-			if (originalFormat != validFormat)
-			{
-				texProps.mFormat = validFormat;
-
-				for (size_t i = 0; i < pixelData->size(); i++)
-				{
-					PixelDataPtr origData = pixelData->at(i);
-					PixelDataPtr newData = PixelData::create(origData->getWidth(), origData->getHeight(), origData->getDepth(), validFormat);
-
-					PixelUtil::bulkPixelConversion(*origData, *newData);
-					(*pixelData)[i] = newData;
-				}
-			}
-
-			// A bit clumsy initializing with already set values, but I feel its better than complicating things and storing the values
-			// in mRTTIData.
-			texture->initialize();
-
-			for(size_t i = 0; i < pixelData->size(); i++)
-			{
-				UINT32 face = (size_t)Math::floor(i / (float)(texProps.getNumMipmaps() + 1));
-				UINT32 mipmap = i % (texProps.getNumMipmaps() + 1);
-
-				UINT32 subresourceIdx = texProps.mapToSubresourceIdx(face, mipmap);
-
-				texture->writeSubresource(gCoreAccessor(), subresourceIdx, pixelData->at(i), false);
-			}
-
-			bs_delete(pixelData);
-			texture->mRTTIData = nullptr;	
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "Texture";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_Texture;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return TextureManager::instance()._createEmpty();
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsTexture.h"
+#include "BsManagedDataBlock.h"
+#include "BsMath.h"
+#include "BsCoreApplication.h"
+#include "BsCoreThread.h"
+#include "BsRenderAPI.h"
+#include "BsTextureManager.h"
+#include "BsPixelData.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT TextureRTTI : public RTTIType<Texture, Resource, TextureRTTI>
+	{
+	private:
+		UINT32& getSize(Texture* obj) { return obj->mSize; }
+		void setSize(Texture* obj, UINT32& val) { obj->mSize = val; }
+
+		UINT32& getWidth(Texture* obj) { return obj->mProperties.mWidth; }
+		void setWidth(Texture* obj, UINT32& val) { obj->mProperties.mWidth = val; }
+
+		UINT32& getHeight(Texture* obj) { return obj->mProperties.mHeight; }
+		void setHeight(Texture* obj, UINT32& val) { obj->mProperties.mHeight = val; }
+
+		UINT32& getDepth(Texture* obj) { return obj->mProperties.mDepth; }
+		void setDepth(Texture* obj, UINT32& val) { obj->mProperties.mDepth = val; }
+
+		UINT32& getNumMipmaps(Texture* obj) { return obj->mProperties.mNumMipmaps; }
+		void setNumMipmaps(Texture* obj, UINT32& val) { obj->mProperties.mNumMipmaps = val; }
+
+		bool& getHwGamma(Texture* obj) { return obj->mProperties.mHwGamma; }
+		void setHwGamma(Texture* obj, bool& val) { obj->mProperties.mHwGamma = val; }
+
+		UINT32& getMultisampleCount(Texture* obj) { return obj->mProperties.mMultisampleCount; }
+		void setMultisampleCount(Texture* obj, UINT32& val) { obj->mProperties.mMultisampleCount = val; }
+
+		TextureType& getTextureType(Texture* obj) { return obj->mProperties.mTextureType; }
+		void setTextureType(Texture* obj, TextureType& val) { obj->mProperties.mTextureType = val; }
+
+		PixelFormat& getFormat(Texture* obj) { return obj->mProperties.mFormat; }
+		void setFormat(Texture* obj, PixelFormat& val) { obj->mProperties.mFormat = val; }
+
+		INT32& getUsage(Texture* obj) { return obj->mProperties.mUsage; }
+		void setUsage(Texture* obj, INT32& val) 
+		{ 
+			// Render target and depth stencil texture formats are for in-memory use only
+			// and don't make sense when serialized
+			if (val == TU_DEPTHSTENCIL || val == TU_RENDERTARGET)
+				obj->mProperties.mUsage = TU_STATIC;
+			else
+				obj->mProperties.mUsage = val;
+		}
+
+#define BS_ADD_PLAINFIELD(name, id, parentType) \
+	addPlainField(#name, id##, &##parentType##::get##name, &##parentType##::Set##name);
+
+		PixelDataPtr getPixelData(Texture* obj, UINT32 idx)
+		{
+			UINT32 face = (size_t)Math::floor(idx / (float)(obj->mProperties.getNumMipmaps() + 1));
+			UINT32 mipmap = idx % (obj->mProperties.getNumMipmaps() + 1);
+
+			UINT32 subresourceIdx = obj->mProperties.mapToSubresourceIdx(face, mipmap);
+			PixelDataPtr pixelData = obj->mProperties.allocateSubresourceBuffer(subresourceIdx);
+
+			obj->readSubresource(gCoreAccessor(), subresourceIdx, pixelData);
+			gCoreAccessor().submitToCoreThread(true);
+
+			return pixelData;
+		}
+
+		void setPixelData(Texture* obj, UINT32 idx, PixelDataPtr data)
+		{
+			Vector<PixelDataPtr>* pixelData = any_cast<Vector<PixelDataPtr>*>(obj->mRTTIData);
+
+			(*pixelData)[idx] = data;
+		}
+
+		UINT32 getPixelDataArraySize(Texture* obj)
+		{
+			return obj->mProperties.getNumFaces() * (obj->mProperties.getNumMipmaps() + 1);
+		}
+
+		void setPixelDataArraySize(Texture* obj, UINT32 size)
+		{
+			Vector<PixelDataPtr>* pixelData = any_cast<Vector<PixelDataPtr>*>(obj->mRTTIData);
+
+			pixelData->resize(size);
+		}
+
+	public:
+		TextureRTTI()
+		{
+			addPlainField("mSize", 0, &TextureRTTI::getSize, &TextureRTTI::setSize);
+			addPlainField("mHeight", 2, &TextureRTTI::getHeight, &TextureRTTI::setHeight);
+			addPlainField("mWidth", 3, &TextureRTTI::getWidth, &TextureRTTI::setWidth);
+			addPlainField("mDepth", 4, &TextureRTTI::getDepth, &TextureRTTI::setDepth);
+			addPlainField("mNumMipmaps", 5, &TextureRTTI::getNumMipmaps, &TextureRTTI::setNumMipmaps);
+			addPlainField("mHwGamma", 6, &TextureRTTI::getHwGamma, &TextureRTTI::setHwGamma);
+			addPlainField("mMultisampleCount", 7, &TextureRTTI::getMultisampleCount, &TextureRTTI::setMultisampleCount);
+			addPlainField("mTextureType", 9, &TextureRTTI::getTextureType, &TextureRTTI::setTextureType);
+			addPlainField("mFormat", 10, &TextureRTTI::getFormat, &TextureRTTI::setFormat);
+			addPlainField("mUsage", 11, &TextureRTTI::getUsage, &TextureRTTI::setUsage);
+
+			addReflectablePtrArrayField("mPixelData", 12, &TextureRTTI::getPixelData, &TextureRTTI::getPixelDataArraySize, 
+				&TextureRTTI::setPixelData, &TextureRTTI::setPixelDataArraySize, RTTI_Flag_SkipInReferenceSearch);
+		}
+
+		void onDeserializationStarted(IReflectable* obj) override
+		{
+			Texture* texture = static_cast<Texture*>(obj);
+
+			texture->mRTTIData = bs_new<Vector<PixelDataPtr>>();
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			Texture* texture = static_cast<Texture*>(obj);
+
+			if(texture->mRTTIData.empty())
+				return;
+
+			TextureProperties& texProps = texture->mProperties;
+
+			// Update pixel format if needed as it's possible the original texture was saved using some other render API
+			// that has an unsupported format.
+			PixelFormat originalFormat = texProps.mFormat;
+			PixelFormat validFormat = TextureManager::instance().getNativeFormat(
+				texProps.mTextureType, texProps.mFormat, texProps.mUsage, texProps.mHwGamma);
+
+			Vector<PixelDataPtr>* pixelData = any_cast<Vector<PixelDataPtr>*>(texture->mRTTIData);
+			if (originalFormat != validFormat)
+			{
+				texProps.mFormat = validFormat;
+
+				for (size_t i = 0; i < pixelData->size(); i++)
+				{
+					PixelDataPtr origData = pixelData->at(i);
+					PixelDataPtr newData = PixelData::create(origData->getWidth(), origData->getHeight(), origData->getDepth(), validFormat);
+
+					PixelUtil::bulkPixelConversion(*origData, *newData);
+					(*pixelData)[i] = newData;
+				}
+			}
+
+			// A bit clumsy initializing with already set values, but I feel its better than complicating things and storing the values
+			// in mRTTIData.
+			texture->initialize();
+
+			for(size_t i = 0; i < pixelData->size(); i++)
+			{
+				UINT32 face = (size_t)Math::floor(i / (float)(texProps.getNumMipmaps() + 1));
+				UINT32 mipmap = i % (texProps.getNumMipmaps() + 1);
+
+				UINT32 subresourceIdx = texProps.mapToSubresourceIdx(face, mipmap);
+
+				texture->writeSubresource(gCoreAccessor(), subresourceIdx, pixelData->at(i), false);
+			}
+
+			bs_delete(pixelData);
+			texture->mRTTIData = nullptr;	
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "Texture";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_Texture;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return TextureManager::instance()._createEmpty();
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 23 - 19
BansheeCore/Include/BsUUID.h

@@ -1,20 +1,24 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Utility class for generating universally unique identifiers.
-	 *
-	 * @note	Thread safe.
-	 */
-	class BS_CORE_EXPORT UUIDGenerator
-	{
-	public:
-		/**
-		 * @brief	Generate a new random universally unique identifier.
-		 */
-		static String generateRandom();
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup Utility-Core
+	 *  @{
+	 */
+
+	/**
+	 * Utility class for generating universally unique identifiers.
+	 *
+	 * @note	Thread safe.
+	 */
+	class BS_CORE_EXPORT UUIDGenerator
+	{
+	public:
+		/**	Generate a new random universally unique identifier. */
+		static String generateRandom();
+	};
+
+	/** @} */
 }

+ 53 - 52
BansheeCore/Include/BsUtility.h

@@ -1,53 +1,54 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Contains information about a resource dependency, including
-	 *			the dependant resource and number of references to it.
-	 */
-	struct ResourceDependency
-	{
-		ResourceDependency()
-			:numReferences(0)
-		{ }
-
-		HResource resource;
-		UINT32 numReferences;
-	};
-
-	/**
-	 * @brief	Static class containing various utility methods that do not
-	 *			fit anywhere else.
-	 */
-	class BS_CORE_EXPORT Utility
-	{
-	public:
-		/**
-		 * @brief	Finds all resources referenced by the specified object.
-		 *
-		 * @param	object		Object to search for resource dependencies.
-		 * @param	recursive	Determines whether or not child objects will also be
-		 *						searched (if the object has any children).
-		 *
-		 * @returns	A list of unique, non-null resources.
-		 */
-		static Vector<ResourceDependency> findResourceDependencies(IReflectable& object, bool recursive = true);
-
-	private:
-		/**
-		 * @brief	Helper method for for recursion when finding resource dependencies.
-		 *
-		 * @see	findDependencies
-		 */
-		static void findResourceDependenciesInternal(IReflectable& object, bool recursive, Map<String, ResourceDependency>& dependencies);
-
-		/**
-		 * @brief	Checks if the specified type (or any of its derived classes) have any IReflectable pointer or value
-		 *			types as their fields.
-		 */
-		static bool hasReflectableChildren(RTTITypeBase* type);
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+
+namespace BansheeEngine
+{
+	/** @cond INTERNAL */
+	/** @addtogroup Utility-Core
+	 *  @{
+	 */
+
+	/** Contains information about a resource dependency, including the dependant resource and number of references to it. */
+	struct ResourceDependency
+	{
+		ResourceDependency()
+			:numReferences(0)
+		{ }
+
+		HResource resource;
+		UINT32 numReferences;
+	};
+
+	/** Static class containing various utility methods that do not fit anywhere else. */
+	class BS_CORE_EXPORT Utility
+	{
+	public:
+		/**
+		 * Finds all resources referenced by the specified object.
+		 *
+		 * @param[in]	object		Object to search for resource dependencies.
+		 * @param[in]	recursive	Determines whether or not child objects will also be searched (if the object has any
+		 *							children).
+		 * @return					A list of unique, non-null resources.
+		 */
+		static Vector<ResourceDependency> findResourceDependencies(IReflectable& object, bool recursive = true);
+
+	private:
+		/**
+		 * Helper method for for recursion when finding resource dependencies.
+		 *
+		 * @see	findDependencies
+		 */
+		static void findResourceDependenciesInternal(IReflectable& object, bool recursive, Map<String, ResourceDependency>& dependencies);
+
+		/**
+		 * Checks if the specified type (or any of its derived classes) have any IReflectable pointer or value types as 
+		 * their fields.
+		 */
+		static bool hasReflectableChildren(RTTITypeBase* type);
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 48 - 54
BansheeCore/Include/BsVertexDataDescRTTI.h

@@ -1,55 +1,49 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsVertexDataDesc.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT VertexDataDescRTTI : public RTTIType<VertexDataDesc, IReflectable, VertexDataDescRTTI>
-	{
-	private:
-		VertexElement& getVertexElementData(VertexDataDesc* obj, UINT32 arrayIdx)
-		{
-			return obj->mVertexElements[arrayIdx];
-		}
-
-		void setVertexElementData(VertexDataDesc* obj, UINT32 arrayIdx, VertexElement& value)
-		{
-			obj->mVertexElements[arrayIdx] = value;
-		}
-
-		UINT32 getNumVertexElementData(VertexDataDesc* obj)
-		{
-			return (UINT32)obj->mVertexElements.size();
-		}
-
-		void setNumVertexElementData(VertexDataDesc* obj, UINT32 numElements)
-		{
-			obj->mVertexElements.resize(numElements);
-		}
-
-	public:
-		VertexDataDescRTTI()
-		{
-			addPlainArrayField("mVertexData", 0, &VertexDataDescRTTI::getVertexElementData, 
-				&VertexDataDescRTTI::getNumVertexElementData, &VertexDataDescRTTI::setVertexElementData, &VertexDataDescRTTI::setNumVertexElementData);
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr<VertexDataDesc>(new (bs_alloc<VertexDataDesc>()) VertexDataDesc());
-		}
-
-		virtual const String& getRTTIName() override
-		{
-			static String name = "VertexDataDesc";
-			throw name;
-		}
-
-		virtual UINT32 getRTTIId() override
-		{
-			return TID_VertexDataDesc;
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsVertexDataDesc.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT VertexDataDescRTTI : public RTTIType<VertexDataDesc, IReflectable, VertexDataDescRTTI>
+	{
+	private:
+		VertexElement& getVertexElementData(VertexDataDesc* obj, UINT32 arrayIdx) { return obj->mVertexElements[arrayIdx]; }
+		void setVertexElementData(VertexDataDesc* obj, UINT32 arrayIdx, VertexElement& value) { obj->mVertexElements[arrayIdx] = value; }
+
+		UINT32 getNumVertexElementData(VertexDataDesc* obj) { return (UINT32)obj->mVertexElements.size(); }
+		void setNumVertexElementData(VertexDataDesc* obj, UINT32 numElements) { obj->mVertexElements.resize(numElements); }
+
+	public:
+		VertexDataDescRTTI()
+		{
+			addPlainArrayField("mVertexData", 0, &VertexDataDescRTTI::getVertexElementData, 
+				&VertexDataDescRTTI::getNumVertexElementData, &VertexDataDescRTTI::setVertexElementData, &VertexDataDescRTTI::setNumVertexElementData);
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr<VertexDataDesc>(new (bs_alloc<VertexDataDesc>()) VertexDataDesc());
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "VertexDataDesc";
+			throw name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_VertexDataDesc;
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 80 - 72
BansheeCore/Include/BsVertexDeclarationRTTI.h

@@ -1,73 +1,81 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsVertexBuffer.h"
-#include "BsHardwareBufferManager.h"
-
-namespace BansheeEngine
-{
-	class VertexDeclarationRTTI : public RTTIType<VertexDeclaration, IReflectable, VertexDeclarationRTTI>
-	{
-	private:
-		VertexElement& getElement(VertexDeclaration* obj, UINT32 idx)
-		{
-			List<VertexElement>& elemList = obj->mProperties.mElementList;
-
-			auto iter = elemList.begin();
-			for(UINT32 i = 0; i < idx; i++)
-				++iter;
-
-			return *iter;
-		}
-
-		void setElement(VertexDeclaration* obj, UINT32 idx, VertexElement& data)
-		{
-			List<VertexElement>& elemList = obj->mProperties.mElementList;
-
-			auto iter = elemList.begin();
-			for(UINT32 i = 0; i < idx; i++)
-				++iter;
-
-			*iter = data;
-		}
-
-		UINT32 getElementArraySize(VertexDeclaration* obj)
-		{
-			List<VertexElement>& elemList = obj->mProperties.mElementList;
-
-			return (UINT32)elemList.size();
-		}
-
-		void setElementArraySize(VertexDeclaration* obj, UINT32 size)
-		{
-			List<VertexElement>& elemList = obj->mProperties.mElementList;
-
-			for (size_t i = elemList.size(); i < size; i++)
-				elemList.push_back(VertexElement());
-		}
-
-	public:
-		VertexDeclarationRTTI()
-		{
-			addPlainArrayField("mElementList", 0, &VertexDeclarationRTTI::getElement, &VertexDeclarationRTTI::getElementArraySize, 
-				&VertexDeclarationRTTI::setElement, &VertexDeclarationRTTI::setElementArraySize);
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() 
-		{
-			return HardwareBufferManager::instance().createVertexDeclaration(List<VertexElement>());
-		}
-
-		virtual const String& getRTTIName() 
-		{
-			static String name = "VertexDeclaration";
-			throw name;
-		}
-
-		virtual UINT32 getRTTIId() 
-		{
-			return TID_VertexDeclaration;
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsVertexBuffer.h"
+#include "BsHardwareBufferManager.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class VertexDeclarationRTTI : public RTTIType<VertexDeclaration, IReflectable, VertexDeclarationRTTI>
+	{
+	private:
+		VertexElement& getElement(VertexDeclaration* obj, UINT32 idx)
+		{
+			List<VertexElement>& elemList = obj->mProperties.mElementList;
+
+			auto iter = elemList.begin();
+			for(UINT32 i = 0; i < idx; i++)
+				++iter;
+
+			return *iter;
+		}
+
+		void setElement(VertexDeclaration* obj, UINT32 idx, VertexElement& data)
+		{
+			List<VertexElement>& elemList = obj->mProperties.mElementList;
+
+			auto iter = elemList.begin();
+			for(UINT32 i = 0; i < idx; i++)
+				++iter;
+
+			*iter = data;
+		}
+
+		UINT32 getElementArraySize(VertexDeclaration* obj)
+		{
+			List<VertexElement>& elemList = obj->mProperties.mElementList;
+
+			return (UINT32)elemList.size();
+		}
+
+		void setElementArraySize(VertexDeclaration* obj, UINT32 size)
+		{
+			List<VertexElement>& elemList = obj->mProperties.mElementList;
+
+			for (size_t i = elemList.size(); i < size; i++)
+				elemList.push_back(VertexElement());
+		}
+
+	public:
+		VertexDeclarationRTTI()
+		{
+			addPlainArrayField("mElementList", 0, &VertexDeclarationRTTI::getElement, &VertexDeclarationRTTI::getElementArraySize, 
+				&VertexDeclarationRTTI::setElement, &VertexDeclarationRTTI::setElementArraySize);
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return HardwareBufferManager::instance().createVertexDeclaration(List<VertexElement>());
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "VertexDeclaration";
+			throw name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_VertexDeclaration;
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 75 - 67
BansheeCore/Include/BsViewportRTTI.h

@@ -1,68 +1,76 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsViewport.h"
-
-namespace BansheeEngine
-{
-	class BS_CORE_EXPORT ViewportRTTI : public RTTIType<Viewport, IReflectable, ViewportRTTI>
-	{
-	private:
-		Rect2& getNormArea(Viewport* obj) { return obj->mNormArea; }
-		void setNormArea(Viewport* obj, Rect2& val) { obj->mNormArea = val; }
-
-		bool& getRequireColorClear(Viewport* obj) { return obj->mRequiresColorClear; }
-		void setRequireColorClear(Viewport* obj, bool& val) { obj->mRequiresColorClear = val; }
-
-		bool& getRequireDepthClear(Viewport* obj) { return obj->mRequiresDepthClear; }
-		void setRequireDepthClear(Viewport* obj, bool& val) { obj->mRequiresDepthClear = val; }
-
-		bool& getRequireStencilClear(Viewport* obj) { return obj->mRequiresStencilClear; }
-		void setRequireStencilClear(Viewport* obj, bool& val) { obj->mRequiresStencilClear = val; }
-
-		Color& getClearColor(Viewport* obj) { return obj->mClearColor; }
-		void setClearColor(Viewport* obj, Color& val) { obj->mClearColor = val; }
-
-		float& getDepthClearValue(Viewport* obj) { return obj->mDepthClearValue; }
-		void setDepthClearValue(Viewport* obj, float& val) { obj->mDepthClearValue = val; }
-
-		UINT16& getStencilClearValue(Viewport* obj) { return obj->mStencilClearValue; }
-		void setStencilClearValue(Viewport* obj, UINT16& val) { obj->mStencilClearValue = val; }
-
-		// TODO - Not saving a render target reference. Need to re-think the design on how to reference those. Likely as a handle to resource.
-	public:
-		ViewportRTTI()
-		{
-			addPlainField("mNormArea", 0, &ViewportRTTI::getNormArea, &ViewportRTTI::setNormArea);
-			addPlainField("mRequiresColorClear", 1, &ViewportRTTI::getRequireColorClear, &ViewportRTTI::setRequireColorClear);
-			addPlainField("mRequiresDepthClear", 2, &ViewportRTTI::getRequireDepthClear, &ViewportRTTI::setRequireDepthClear);
-			addPlainField("mRequiresStencilClear", 3, &ViewportRTTI::getRequireStencilClear, &ViewportRTTI::setRequireStencilClear);
-			addPlainField("mClearColor", 4, &ViewportRTTI::getClearColor, &ViewportRTTI::setClearColor);
-			addPlainField("mDepthClearValue", 5, &ViewportRTTI::getDepthClearValue, &ViewportRTTI::setDepthClearValue);
-			addPlainField("mStencilClearValue", 6, &ViewportRTTI::getStencilClearValue, &ViewportRTTI::setStencilClearValue);
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj)
-		{
-			Viewport* viewport = static_cast<Viewport*>(obj);
-			viewport->initialize();
-		}
-
-		virtual const String& getRTTIName()
-		{
-			static String name = "Viewport";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId()
-		{
-			return TID_Viewport;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject()
-		{
-			return Viewport::createEmpty();
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsViewport.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class BS_CORE_EXPORT ViewportRTTI : public RTTIType<Viewport, IReflectable, ViewportRTTI>
+	{
+	private:
+		Rect2& getNormArea(Viewport* obj) { return obj->mNormArea; }
+		void setNormArea(Viewport* obj, Rect2& val) { obj->mNormArea = val; }
+
+		bool& getRequireColorClear(Viewport* obj) { return obj->mRequiresColorClear; }
+		void setRequireColorClear(Viewport* obj, bool& val) { obj->mRequiresColorClear = val; }
+
+		bool& getRequireDepthClear(Viewport* obj) { return obj->mRequiresDepthClear; }
+		void setRequireDepthClear(Viewport* obj, bool& val) { obj->mRequiresDepthClear = val; }
+
+		bool& getRequireStencilClear(Viewport* obj) { return obj->mRequiresStencilClear; }
+		void setRequireStencilClear(Viewport* obj, bool& val) { obj->mRequiresStencilClear = val; }
+
+		Color& getClearColor(Viewport* obj) { return obj->mClearColor; }
+		void setClearColor(Viewport* obj, Color& val) { obj->mClearColor = val; }
+
+		float& getDepthClearValue(Viewport* obj) { return obj->mDepthClearValue; }
+		void setDepthClearValue(Viewport* obj, float& val) { obj->mDepthClearValue = val; }
+
+		UINT16& getStencilClearValue(Viewport* obj) { return obj->mStencilClearValue; }
+		void setStencilClearValue(Viewport* obj, UINT16& val) { obj->mStencilClearValue = val; }
+
+		// TODO - Not saving a render target reference. Need to re-think the design on how to reference those. Likely as a handle to resource.
+	public:
+		ViewportRTTI()
+		{
+			addPlainField("mNormArea", 0, &ViewportRTTI::getNormArea, &ViewportRTTI::setNormArea);
+			addPlainField("mRequiresColorClear", 1, &ViewportRTTI::getRequireColorClear, &ViewportRTTI::setRequireColorClear);
+			addPlainField("mRequiresDepthClear", 2, &ViewportRTTI::getRequireDepthClear, &ViewportRTTI::setRequireDepthClear);
+			addPlainField("mRequiresStencilClear", 3, &ViewportRTTI::getRequireStencilClear, &ViewportRTTI::setRequireStencilClear);
+			addPlainField("mClearColor", 4, &ViewportRTTI::getClearColor, &ViewportRTTI::setClearColor);
+			addPlainField("mDepthClearValue", 5, &ViewportRTTI::getDepthClearValue, &ViewportRTTI::setDepthClearValue);
+			addPlainField("mStencilClearValue", 6, &ViewportRTTI::getStencilClearValue, &ViewportRTTI::setStencilClearValue);
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			Viewport* viewport = static_cast<Viewport*>(obj);
+			viewport->initialize();
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "Viewport";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_Viewport;
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return Viewport::createEmpty();
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 26 - 59
BansheeCore/Include/Win32/BsWin32Window.h

@@ -6,9 +6,12 @@
 
 namespace BansheeEngine
 {
-	/**
-	 * @brief	Descriptor used for creating a platform specific native window.
+	/** @cond INTERNAL */
+	/** @addtogroup Platform-Core
+	 *  @{
 	 */
+
+	/**	Descriptor used for creating a platform specific native window. */
 	struct BS_CORE_EXPORT WINDOW_DESC
 	{
 		WINDOW_DESC()
@@ -37,105 +40,69 @@ namespace BansheeEngine
 		bool alphaBlending; /**< If true the window will support transparency based on the alpha channel of the background image. */
 	};
 
-	/**
-	 * @brief	Represents a Windows native window.
-	 */
+	/**	Represents a Windows native window. */
 	class BS_CORE_EXPORT Win32Window
 	{
 	public:
 		Win32Window(const WINDOW_DESC& desc);
 		~Win32Window();
 
-		/**
-         * @brief	Returns position of the left-most border of the window, relative to the screen.
-         */
+		/**	Returns position of the left-most border of the window, relative to the screen. */
 		INT32 getLeft() const;
 
-		/**
-         * @brief	Returns position of the top-most border of the window, relative to the screen.
-         */
+		/**	Returns position of the top-most border of the window, relative to the screen. */
 		INT32 getTop() const;
 
-		/**
-         * @brief	Returns width of the window in pixels.
-         */
+		/**	Returns width of the window in pixels. */
 		UINT32 getWidth() const;
 
-		/**
-         * @brief	Returns height of the window in pixels.
-         */
+		/**	Returns height of the window in pixels. */
 		UINT32 getHeight() const;
 
-		/**
-         * @brief	Returns the native window handle.
-         */
+		/**	Returns the native window handle. */
 		HWND getHWnd() const;
 
-        /**
-         * @brief	Hide or show the window.
-         */
+        /**	Hide or show the window. */
         void setHidden(bool hidden);
 
-		/**
-		 * @brief	Restores or minimizes the window.
-		 */
+		/**	Restores or minimizes the window. */
 		void setActive(bool state);
 
-		/**
-		 * @brief	Minimizes the window to the taskbar.
-		 */
+		/**	Minimizes the window to the taskbar. */
 		void minimize();
 
-		/**
-		 * @brief	Maximizes the window over the entire current screen.
-		 */
+		/**	Maximizes the window over the entire current screen. */
 		void maximize();
 
-		/**
-		 * @brief	Restores the window to original position and size if it is
-		 *			minimized or maximized.
-		 */
+		/**	Restores the window to original position and size if it is minimized or maximized. */
 		void restore();
 
-        /**
-         * @brief	Change the size of the window.
-         */
+        /**	Change the size of the window. */
         void resize(UINT32 width, UINT32 height);
 
-        /**
-         * @brief	Reposition the window.
-         */
+        /**	Reposition the window. */
 		void move(INT32 left, INT32 top);
 
-		/**
-		 * @brief	Converts screen position into window local position.
-		 */
+		/**	Converts screen position into window local position. */
 		Vector2I screenToWindowPos(const Vector2I& screenPos) const;
 
-		/**
-		 * @brief	Converts window local position to screen position.
-		 */
+		/**	Converts window local position to screen position. */
 		Vector2I windowToScreenPos(const Vector2I& windowPos) const;
 
-		/**
-		 * @brief	Returns the window style flags used for creating it.
-		 */
+		/**	Returns the window style flags used for creating it. */
 		DWORD getStyle() const;
 
-		/**
-		 * @brief	Returns the extended window style flags used for creating it.
-		 */
+		/**	Returns the extended window style flags used for creating it. */
 		DWORD getStyleEx() const;
 
-		/**
-		 * @brief	Called when window is moved or resized externally.
-		 *
-		 * @note	Internal method.
-		 */
+		/** Called when window is moved or resized externally. */
 		void _windowMovedOrResized();
 
 	private:
 		struct Pimpl;
 		Pimpl* m;
 	};
+
+	/** @} */
+	/** @endcond */
 }

+ 78 - 70
BansheeCore/Source/BsMeshRTTI.h

@@ -1,71 +1,79 @@
-#pragma once
-
-#include "BsCorePrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsCoreApplication.h"
-#include "BsMesh.h"
-#include "BsMeshManager.h"
-#include "BsCoreThread.h"
-
-namespace BansheeEngine
-{
-	class MeshRTTI : public RTTIType<Mesh, MeshBase, MeshRTTI>
-	{
-		VertexDataDescPtr getVertexDesc(Mesh* obj) { return obj->mVertexDesc; }
-		void setVertexDesc(Mesh* obj, VertexDataDescPtr value) { obj->mVertexDesc = value; }
-
-		IndexType& getIndexType(Mesh* obj) { return obj->mIndexType; }
-		void setIndexType(Mesh* obj, IndexType& value) { obj->mIndexType = value; }
-
-		int& getBufferType(Mesh* obj) { return (int&)obj->mUsage; }
-		void setBufferType(Mesh* obj, int& value) { obj->mUsage = value; }
-
-		MeshDataPtr getMeshData(Mesh* obj) 
-		{ 
-			MeshDataPtr meshData = obj->allocateSubresourceBuffer(0);
-
-			obj->readSubresource(gCoreAccessor(), 0, meshData);
-			gCoreAccessor().submitToCoreThread(true);
-
-			return meshData;
-		}
-
-		void setMeshData(Mesh* obj, MeshDataPtr meshData) 
-		{ 
-			obj->mCPUData = meshData;
-		}
-
-	public:
-		MeshRTTI()
-		{
-			addReflectablePtrField("mVertexDesc", 0, &MeshRTTI::getVertexDesc, &MeshRTTI::setVertexDesc);
-
-			addPlainField("mIndexType", 1, &MeshRTTI::getIndexType, &MeshRTTI::setIndexType);
-			addPlainField("mUsage", 2, &MeshRTTI::getBufferType, &MeshRTTI::setBufferType);
-
-			addReflectablePtrField("mMeshData", 3, &MeshRTTI::getMeshData, &MeshRTTI::setMeshData);
-		}
-
-		virtual void onDeserializationEnded(IReflectable* obj)
-		{
-			Mesh* mesh = static_cast<Mesh*>(obj);
-			mesh->initialize();
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject() 
-		{
-			return MeshManager::instance().createEmpty();
-		}
-
-		virtual const String& getRTTIName() 
-		{
-			static String name = "Mesh";
-			throw name;
-		}
-
-		virtual UINT32 getRTTIId() 
-		{
-			return TID_Mesh;
-		}
-	};
+#pragma once
+
+#include "BsCorePrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsCoreApplication.h"
+#include "BsMesh.h"
+#include "BsMeshManager.h"
+#include "BsCoreThread.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Core
+	 *  @{
+	 */
+
+	class MeshRTTI : public RTTIType<Mesh, MeshBase, MeshRTTI>
+	{
+		VertexDataDescPtr getVertexDesc(Mesh* obj) { return obj->mVertexDesc; }
+		void setVertexDesc(Mesh* obj, VertexDataDescPtr value) { obj->mVertexDesc = value; }
+
+		IndexType& getIndexType(Mesh* obj) { return obj->mIndexType; }
+		void setIndexType(Mesh* obj, IndexType& value) { obj->mIndexType = value; }
+
+		int& getBufferType(Mesh* obj) { return (int&)obj->mUsage; }
+		void setBufferType(Mesh* obj, int& value) { obj->mUsage = value; }
+
+		MeshDataPtr getMeshData(Mesh* obj) 
+		{ 
+			MeshDataPtr meshData = obj->allocateSubresourceBuffer(0);
+
+			obj->readSubresource(gCoreAccessor(), 0, meshData);
+			gCoreAccessor().submitToCoreThread(true);
+
+			return meshData;
+		}
+
+		void setMeshData(Mesh* obj, MeshDataPtr meshData) 
+		{ 
+			obj->mCPUData = meshData;
+		}
+
+	public:
+		MeshRTTI()
+		{
+			addReflectablePtrField("mVertexDesc", 0, &MeshRTTI::getVertexDesc, &MeshRTTI::setVertexDesc);
+
+			addPlainField("mIndexType", 1, &MeshRTTI::getIndexType, &MeshRTTI::setIndexType);
+			addPlainField("mUsage", 2, &MeshRTTI::getBufferType, &MeshRTTI::setBufferType);
+
+			addReflectablePtrField("mMeshData", 3, &MeshRTTI::getMeshData, &MeshRTTI::setMeshData);
+		}
+
+		void onDeserializationEnded(IReflectable* obj) override
+		{
+			Mesh* mesh = static_cast<Mesh*>(obj);
+			mesh->initialize();
+		}
+
+		std::shared_ptr<IReflectable> newRTTIObject() override
+		{
+			return MeshManager::instance().createEmpty();
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "Mesh";
+			throw name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_Mesh;
+		}
+	};
+
+	/** @} */
+	/** @endcond */
 }

+ 323 - 263
BansheeEditor/BansheeEditor.vcxproj.filters

@@ -9,9 +9,6 @@
       <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
       <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
     </Filter>
-    <Filter Include="Header Files\Commands">
-      <UniqueIdentifier>{c23d8d16-3a53-4e53-9e87-a15e33d5758c}</UniqueIdentifier>
-    </Filter>
     <Filter Include="Header Files\RTTI">
       <UniqueIdentifier>{24ec8e18-6fa3-44c2-a6a5-04d811e55169}</UniqueIdentifier>
     </Filter>
@@ -21,22 +18,85 @@
     <Filter Include="Source Files\Win32">
       <UniqueIdentifier>{482fa361-f45b-45d4-9d09-05ffb91c39b8}</UniqueIdentifier>
     </Filter>
-    <Filter Include="Source Files\Commands">
+    <Filter Include="Header Files\GUI">
+      <UniqueIdentifier>{e13d72e6-db5c-4582-8014-ac7bd030b210}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\GUI">
+      <UniqueIdentifier>{8cc80fd6-ed17-4638-b9a7-80cd1106cd60}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\Build">
+      <UniqueIdentifier>{d1d7f13f-6df8-45b9-98ce-71d086ca11e1}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\Build">
+      <UniqueIdentifier>{097f7557-d5fb-45e4-a88b-a59bcdaa8e62}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\Handles">
+      <UniqueIdentifier>{f0543a22-85b3-4db1-9842-eb6bdea3a9e1}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\Handles">
+      <UniqueIdentifier>{caba917b-fd60-48c9-9656-9764e17763cf}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\EditorWindow">
+      <UniqueIdentifier>{c305cee9-91cb-40b4-8c1b-da3a7d9d4dbb}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\EditorWindow">
+      <UniqueIdentifier>{b0aeac01-8fa0-4274-96af-89881eb97412}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\SceneView">
+      <UniqueIdentifier>{c05637ba-7fb5-4f5f-a84b-4eb95f54111a}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\SceneView">
+      <UniqueIdentifier>{75e6779c-51e7-47f4-8156-8a17ce92b0be}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\Library">
+      <UniqueIdentifier>{8fc76a14-3aac-4bef-ae61-abc7b54df3ca}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\Library">
+      <UniqueIdentifier>{d8e8adc3-f488-435a-8851-725fd87e2e55}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\Settings">
+      <UniqueIdentifier>{20f2ccde-81f8-4b94-8edc-4cf6f030cd2a}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\Settings">
+      <UniqueIdentifier>{fc90a84e-d7c5-4fa6-b476-b16d096d7452}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\UndoRedo">
+      <UniqueIdentifier>{c23d8d16-3a53-4e53-9e87-a15e33d5758c}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\UndoRedo">
       <UniqueIdentifier>{fc5eed3b-3a94-4c0b-b462-636e84615f94}</UniqueIdentifier>
     </Filter>
+    <Filter Include="Header Files\Testing">
+      <UniqueIdentifier>{e34e68f9-d9a6-45c7-9bbb-22d5fbd81b0f}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\Testing">
+      <UniqueIdentifier>{4c19963d-84dc-4536-a5ad-a7f2e11ee40e}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\CodeEditor">
+      <UniqueIdentifier>{d952f819-4603-4dbe-a764-c972bc7c98a7}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\CodeEditor">
+      <UniqueIdentifier>{c3407516-6f1a-4711-ac52-5fd00713215c}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\Utility">
+      <UniqueIdentifier>{7caa1dbe-dcab-40fb-ad3d-7f82f9629457}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\Utility">
+      <UniqueIdentifier>{7bd61ca8-543d-4029-a0ed-1751d97477a3}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="Include\BsEditorCommand.h">
-      <Filter>Header Files\Commands</Filter>
+      <Filter>Header Files\UndoRedo</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsCmdReparentSO.h">
-      <Filter>Header Files\Commands</Filter>
+      <Filter>Header Files\UndoRedo</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsCmdInputFieldValueChange.h">
-      <Filter>Header Files\Commands</Filter>
+      <Filter>Header Files\UndoRedo</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsCmdRecordSO.h">
-      <Filter>Header Files\Commands</Filter>
+      <Filter>Header Files\UndoRedo</Filter>
     </ClInclude>
     <ClInclude Include="Include\Win32\BsVSCodeEditor.h">
       <Filter>Header Files\Win32</Filter>
@@ -53,466 +113,466 @@
     <ClInclude Include="Include\BsEditorWidgetLayoutRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsBuildManager.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsBuiltinEditorResources.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsCodeEditor.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsDockManager.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsDockManagerLayout.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsDropDownWindow.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsDropDownWindowManager.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsEditorApplication.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsEditorPrerequisites.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsEditorSettings.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsProjectLibraryEntriesRTTI.h">
+      <Filter>Header Files\RTTI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsEditorTestSuite.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsProjectResourceMetaRTTI.h">
+      <Filter>Header Files\RTTI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsEditorUtility.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsCmdUtility.h">
+      <Filter>Header Files\UndoRedo</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsEditorWidget.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsCmdDeleteSO.h">
+      <Filter>Header Files\UndoRedo</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsEditorWidgetContainer.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsCmdCreateSO.h">
+      <Filter>Header Files\UndoRedo</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsEditorWidgetLayout.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsCmdCloneSO.h">
+      <Filter>Header Files\UndoRedo</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsEditorWidgetManager.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsCmdInstantiateSO.h">
+      <Filter>Header Files\UndoRedo</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsEditorWindow.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsEditorSettingsRTTI.h">
+      <Filter>Header Files\RTTI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsEditorWindowBase.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsSettingsRTTI.h">
+      <Filter>Header Files\RTTI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsEditorWindowManager.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsProjectSettingsRTTI.h">
+      <Filter>Header Files\RTTI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsGizmoManager.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsGUIWindowFrameWidgetRTTI.h">
+      <Filter>Header Files\RTTI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsCmdBreakPrefab.h">
+      <Filter>Header Files\UndoRedo</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIColor.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIColorField.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIDockSlider.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIDropButton.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIFieldBase.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIFloatField.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUIHoverHitBox.h">
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIIntField.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUIListBoxField.h">
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIMenuBar.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIResourceTreeView.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUISceneTreeView.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUISliderField.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUIStatusBar.h">
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUITabbedTitleBar.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUITabButton.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUITextField.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIToggleField.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUITreeView.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUITreeViewEditBox.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIVector2Field.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIVector3Field.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIVector4Field.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIWindowFrame.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGUIWindowFrameWidget.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsBuildManager.h">
+      <Filter>Header Files\Build</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsBuiltinEditorResources.h">
+      <Filter>Header Files\Build</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsPlatformInfo.h">
+      <Filter>Header Files\Build</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsHandleDrawManager.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\Handles</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsHandleManager.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\Handles</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsHandleSlider.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\Handles</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsHandleSliderDisc.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\Handles</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsHandleSliderLine.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\Handles</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsHandleSliderManager.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\Handles</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsHandleSliderPlane.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\Handles</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsMainEditorWindow.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsDockManager.h">
+      <Filter>Header Files\EditorWindow</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsModalWindow.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsDockManagerLayout.h">
+      <Filter>Header Files\EditorWindow</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsPlatformInfo.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsDropDownWindow.h">
+      <Filter>Header Files\EditorWindow</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsProjectLibrary.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsDropDownWindowManager.h">
+      <Filter>Header Files\EditorWindow</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsProjectLibraryEntries.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsEditorWidget.h">
+      <Filter>Header Files\EditorWindow</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsProjectResourceMeta.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsEditorWidgetContainer.h">
+      <Filter>Header Files\EditorWindow</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsSceneGrid.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsEditorWidgetLayout.h">
+      <Filter>Header Files\EditorWindow</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsScenePicking.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsEditorWidgetManager.h">
+      <Filter>Header Files\EditorWindow</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsSelection.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsEditorWindow.h">
+      <Filter>Header Files\EditorWindow</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsSelectionRenderer.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsEditorWindowBase.h">
+      <Filter>Header Files\EditorWindow</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsShaderIncludeHandler.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsEditorWindowManager.h">
+      <Filter>Header Files\EditorWindow</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsUndoRedo.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsMainEditorWindow.h">
+      <Filter>Header Files\EditorWindow</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsProjectLibraryEntriesRTTI.h">
-      <Filter>Header Files\RTTI</Filter>
+    <ClInclude Include="Include\BsModalWindow.h">
+      <Filter>Header Files\EditorWindow</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsProjectResourceMetaRTTI.h">
-      <Filter>Header Files\RTTI</Filter>
+    <ClInclude Include="Include\BsGizmoManager.h">
+      <Filter>Header Files\SceneView</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsGUIStatusBar.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsSceneGrid.h">
+      <Filter>Header Files\SceneView</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsCmdUtility.h">
-      <Filter>Header Files\Commands</Filter>
+    <ClInclude Include="Include\BsScenePicking.h">
+      <Filter>Header Files\SceneView</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsCmdDeleteSO.h">
-      <Filter>Header Files\Commands</Filter>
+    <ClInclude Include="Include\BsSelection.h">
+      <Filter>Header Files\SceneView</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsCmdCreateSO.h">
-      <Filter>Header Files\Commands</Filter>
+    <ClInclude Include="Include\BsSelectionRenderer.h">
+      <Filter>Header Files\SceneView</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsCmdCloneSO.h">
-      <Filter>Header Files\Commands</Filter>
+    <ClInclude Include="Include\BsProjectLibrary.h">
+      <Filter>Header Files\Library</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsCmdInstantiateSO.h">
-      <Filter>Header Files\Commands</Filter>
+    <ClInclude Include="Include\BsProjectLibraryEntries.h">
+      <Filter>Header Files\Library</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsEditorSettingsRTTI.h">
-      <Filter>Header Files\RTTI</Filter>
+    <ClInclude Include="Include\BsProjectResourceMeta.h">
+      <Filter>Header Files\Library</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsSettings.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsEditorSettings.h">
+      <Filter>Header Files\Settings</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsSettingsRTTI.h">
-      <Filter>Header Files\RTTI</Filter>
+    <ClInclude Include="Include\BsSettings.h">
+      <Filter>Header Files\Settings</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsProjectSettings.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsProjectSettingsRTTI.h">
-      <Filter>Header Files\RTTI</Filter>
+      <Filter>Header Files\Settings</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsGUIHoverHitBox.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsUndoRedo.h">
+      <Filter>Header Files\UndoRedo</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsGUIListBoxField.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsShaderIncludeHandler.h">
+      <Filter>Header Files\Library</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsGUISliderField.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsEditorTestSuite.h">
+      <Filter>Header Files\Testing</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsGUIWindowFrameWidgetRTTI.h">
-      <Filter>Header Files\RTTI</Filter>
+    <ClInclude Include="Include\BsCodeEditor.h">
+      <Filter>Header Files\CodeEditor</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsCmdBreakPrefab.h">
-      <Filter>Header Files\Commands</Filter>
+    <ClInclude Include="Include\BsEditorUtility.h">
+      <Filter>Header Files\Utility</Filter>
     </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="Source\BsEditorCommand.cpp">
-      <Filter>Source Files\Commands</Filter>
+      <Filter>Source Files\UndoRedo</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsCmdReparentSO.cpp">
-      <Filter>Source Files\Commands</Filter>
+      <Filter>Source Files\UndoRedo</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsCmdRecordSO.cpp">
-      <Filter>Source Files\Commands</Filter>
+      <Filter>Source Files\UndoRedo</Filter>
     </ClCompile>
     <ClCompile Include="Source\Win32\BsVSCodeEditor.cpp">
       <Filter>Source Files\Win32</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsBuildManager.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsBuiltinEditorResources.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsCodeEditor.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsDockManager.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsDockManagerLayout.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsDropDownWindow.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsDropDownWindowManager.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Source\BsEditorApplication.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsEditorSettings.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsEditorTestSuite.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsEditorUtility.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsEditorWidget.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsEditorWidgetContainer.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsEditorWidgetLayout.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsCmdUtility.cpp">
+      <Filter>Source Files\UndoRedo</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsEditorWidgetManager.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsCmdDeleteSO.cpp">
+      <Filter>Source Files\UndoRedo</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsEditorWindow.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsCmdCreateSO.cpp">
+      <Filter>Source Files\UndoRedo</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsEditorWindowBase.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsCmdCloneSO.cpp">
+      <Filter>Source Files\UndoRedo</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsEditorWindowManager.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsCmdInstantiateSO.cpp">
+      <Filter>Source Files\UndoRedo</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsGizmoManager.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsCmdBreakPrefab.cpp">
+      <Filter>Source Files\UndoRedo</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIColor.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIColorField.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIDockSlider.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIDropButton.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIFieldBase.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIFloatField.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsGUIHoverHitBox.cpp">
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIIntField.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsGUIListBoxField.cpp">
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIMenuBar.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIResourceTreeView.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUISceneTreeView.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsGUISliderField.cpp">
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsGUIStatusBar.cpp">
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUITabbedTitleBar.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUITabButton.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUITextField.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIToggleField.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUITreeView.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUITreeViewEditBox.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIVector2Field.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIVector3Field.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIVector4Field.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIWindowFrame.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGUIWindowFrameWidget.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsBuildManager.cpp">
+      <Filter>Source Files\Build</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsBuiltinEditorResources.cpp">
+      <Filter>Source Files\Build</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsPlatformInfo.cpp">
+      <Filter>Source Files\Build</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsHandleDrawManager.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\Handles</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsHandleManager.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\Handles</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsHandleSlider.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\Handles</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsHandleSliderDisc.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\Handles</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsHandleSliderLine.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\Handles</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsHandleSliderManager.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\Handles</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsHandleSliderPlane.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\Handles</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsMainEditorWindow.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsDockManager.cpp">
+      <Filter>Source Files\EditorWindow</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsDockManagerLayout.cpp">
+      <Filter>Source Files\EditorWindow</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsDropDownWindow.cpp">
+      <Filter>Source Files\EditorWindow</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsDropDownWindowManager.cpp">
+      <Filter>Source Files\EditorWindow</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsModalWindow.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\EditorWindow</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsPlatformInfo.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsMainEditorWindow.cpp">
+      <Filter>Source Files\EditorWindow</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsProjectLibrary.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsEditorWindowManager.cpp">
+      <Filter>Source Files\EditorWindow</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsProjectLibraryEntries.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsEditorWindowBase.cpp">
+      <Filter>Source Files\EditorWindow</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsProjectResourceMeta.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsEditorWindow.cpp">
+      <Filter>Source Files\EditorWindow</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsSceneGrid.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsEditorWidgetManager.cpp">
+      <Filter>Source Files\EditorWindow</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsScenePicking.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsEditorWidgetLayout.cpp">
+      <Filter>Source Files\EditorWindow</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsSelection.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsEditorWidgetContainer.cpp">
+      <Filter>Source Files\EditorWindow</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsEditorWidget.cpp">
+      <Filter>Source Files\EditorWindow</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsGizmoManager.cpp">
+      <Filter>Source Files\SceneView</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsSelectionRenderer.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\SceneView</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsShaderIncludeHandler.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsSelection.cpp">
+      <Filter>Source Files\SceneView</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsUndoRedo.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsScenePicking.cpp">
+      <Filter>Source Files\SceneView</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsGUIStatusBar.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsSceneGrid.cpp">
+      <Filter>Source Files\SceneView</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsCmdUtility.cpp">
-      <Filter>Source Files\Commands</Filter>
+    <ClCompile Include="Source\BsProjectLibrary.cpp">
+      <Filter>Source Files\Library</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsCmdDeleteSO.cpp">
-      <Filter>Source Files\Commands</Filter>
+    <ClCompile Include="Source\BsProjectLibraryEntries.cpp">
+      <Filter>Source Files\Library</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsCmdCreateSO.cpp">
-      <Filter>Source Files\Commands</Filter>
+    <ClCompile Include="Source\BsProjectResourceMeta.cpp">
+      <Filter>Source Files\Library</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsCmdCloneSO.cpp">
-      <Filter>Source Files\Commands</Filter>
+    <ClCompile Include="Source\BsEditorSettings.cpp">
+      <Filter>Source Files\Settings</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsCmdInstantiateSO.cpp">
-      <Filter>Source Files\Commands</Filter>
+    <ClCompile Include="Source\BsProjectSettings.cpp">
+      <Filter>Source Files\Settings</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsSettings.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\Settings</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsProjectSettings.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsUndoRedo.cpp">
+      <Filter>Source Files\UndoRedo</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsGUIHoverHitBox.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsShaderIncludeHandler.cpp">
+      <Filter>Source Files\Library</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsGUIListBoxField.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsEditorTestSuite.cpp">
+      <Filter>Source Files\Testing</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsGUISliderField.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsCodeEditor.cpp">
+      <Filter>Source Files\CodeEditor</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsCmdBreakPrefab.cpp">
-      <Filter>Source Files\Commands</Filter>
+    <ClCompile Include="Source\BsEditorUtility.cpp">
+      <Filter>Source Files\Utility</Filter>
     </ClCompile>
   </ItemGroup>
 </Project>

+ 190 - 160
BansheeEngine/BansheeEngine.vcxproj.filters

@@ -39,11 +39,38 @@
     <Filter Include="Source Files\RTTI">
       <UniqueIdentifier>{ced1e9e9-483b-493e-b64b-9de22ec86f3e}</UniqueIdentifier>
     </Filter>
+    <Filter Include="Header Files\Renderer">
+      <UniqueIdentifier>{fceaa158-0e8b-4f59-9e3c-50ce361e39c0}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\Renderer">
+      <UniqueIdentifier>{8b28e418-8a2a-47b5-889b-17dc8a356392}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\Resources">
+      <UniqueIdentifier>{52edf0ee-4afa-4842-8e30-a9e77674cd72}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\Resources">
+      <UniqueIdentifier>{f0fdd7c2-8168-4dc8-b70d-83ffabf689e3}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\Input">
+      <UniqueIdentifier>{38aef70c-b12d-4883-baa1-77172b45af95}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\Input">
+      <UniqueIdentifier>{9885424e-7fa7-4d1e-9c88-170ba337f18b}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\Utility">
+      <UniqueIdentifier>{9070ba6d-7d9d-437e-b74a-88d633ec0722}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files\Platform">
+      <UniqueIdentifier>{9f2d37e4-5945-460d-989e-51fcf041bf0f}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\Utility">
+      <UniqueIdentifier>{411909d3-5bb3-4965-b34d-15b540e7a383}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\Platform">
+      <UniqueIdentifier>{9aee3cb0-8e54-4bf3-8b7e-2ea42c2b82a2}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="Include\BsPrerequisites.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsGUIElement.h">
       <Filter>Header Files\GUI</Filter>
     </ClInclude>
@@ -74,9 +101,6 @@
     <ClInclude Include="Include\BsApplication.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsSceneManager.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsGUILayout.h">
       <Filter>Header Files\GUI</Filter>
     </ClInclude>
@@ -185,48 +209,12 @@
     <ClInclude Include="Include\BsGUIDropDownHitBox.h">
       <Filter>Header Files\GUI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsVirtualInput.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsInputConfiguration.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsGUIVirtualButtonEvent.h">
       <Filter>Header Files\GUI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsCursor.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsBuiltinResources.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsEnums.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsRectOffset.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsRenderQueue.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsGUILayoutUtility.h">
       <Filter>Header Files\GUI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsShapeMeshes2D.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsShapeMeshes3D.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsDrawHelper.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsRenderableElement.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsRenderer.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsGUISliderHandle.h">
       <Filter>Header Files\GUI</Filter>
     </ClInclude>
@@ -236,36 +224,15 @@
     <ClInclude Include="Include\BsGUIProgressBar.h">
       <Filter>Header Files\GUI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsPlainText.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsPlainTextImporter.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsScriptCode.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsScriptCodeImporter.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsPlainTextRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsScriptCodeRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsScriptCodeImportOptions.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsScriptCodeImportOptionsRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsShortcutKey.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsShortcutManager.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsGUIDropDownContent.h">
       <Filter>Header Files\GUI</Filter>
     </ClInclude>
@@ -293,9 +260,6 @@
     <ClInclude Include="Include\BsProfilerOverlayRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsHEString.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsCCamera.h">
       <Filter>Header Files\Components</Filter>
     </ClInclude>
@@ -314,58 +278,124 @@
     <ClInclude Include="Include\BsCLight.h">
       <Filter>Header Files\Components</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsCamera.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsCameraRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsRenderableRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsRenderable.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsLight.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsLightRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsCGUIWidgetRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
+    <ClInclude Include="Include\BsGameSettingsRTTI.h">
+      <Filter>Header Files\RTTI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUITooltipManager.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUITooltip.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsGUIWidget.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsCGUIWidget.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsCamera.h">
+      <Filter>Header Files\Renderer</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsLight.h">
+      <Filter>Header Files\Renderer</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsRenderable.h">
+      <Filter>Header Files\Renderer</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsRenderableElement.h">
+      <Filter>Header Files\Renderer</Filter>
+    </ClInclude>
     <ClInclude Include="Include\BsRenderableHandler.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\Renderer</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsRenderer.h">
+      <Filter>Header Files\Renderer</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsRendererMaterial.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\Renderer</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsRendererMaterialManager.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\Renderer</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsSplashScreen.h">
-      <Filter>Header Files</Filter>
+    <ClInclude Include="Include\BsRenderQueue.h">
+      <Filter>Header Files\Renderer</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsSceneManager.h">
+      <Filter>Header Files\Renderer</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsPlainText.h">
+      <Filter>Header Files\Resources</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsPlainTextImporter.h">
+      <Filter>Header Files\Resources</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsScriptCode.h">
+      <Filter>Header Files\Resources</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsScriptCodeImporter.h">
+      <Filter>Header Files\Resources</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsScriptCodeImportOptions.h">
+      <Filter>Header Files\Resources</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsBuiltinResources.h">
+      <Filter>Header Files\Resources</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsInputConfiguration.h">
+      <Filter>Header Files\Input</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsVirtualInput.h">
+      <Filter>Header Files\Input</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsDrawHelper.h">
+      <Filter>Header Files\Utility</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsEnums.h">
+      <Filter>Header Files\Utility</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsGameSettings.h">
-      <Filter>Header Files</Filter>
+      <Filter>Header Files\Utility</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsGameSettingsRTTI.h">
-      <Filter>Header Files\RTTI</Filter>
+    <ClInclude Include="Include\BsHEString.h">
+      <Filter>Header Files\Utility</Filter>
     </ClInclude>
     <ClInclude Include="Include\BsPaths.h">
+      <Filter>Header Files\Utility</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsRectOffset.h">
+      <Filter>Header Files\Utility</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsShapeMeshes2D.h">
+      <Filter>Header Files\Utility</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsShapeMeshes3D.h">
+      <Filter>Header Files\Utility</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsPrerequisites.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsGUITooltipManager.h">
-      <Filter>Header Files\GUI</Filter>
+    <ClInclude Include="Include\BsCursor.h">
+      <Filter>Header Files\Platform</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsGUITooltip.h">
-      <Filter>Header Files\GUI</Filter>
+    <ClInclude Include="Include\BsSplashScreen.h">
+      <Filter>Header Files\Platform</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsGUIWidget.h">
+    <ClInclude Include="Include\BsShortcutManager.h">
       <Filter>Header Files\GUI</Filter>
     </ClInclude>
-    <ClInclude Include="Include\BsCGUIWidget.h">
+    <ClInclude Include="Include\BsShortcutKey.h">
       <Filter>Header Files\GUI</Filter>
     </ClInclude>
   </ItemGroup>
@@ -397,9 +427,6 @@
     <ClCompile Include="Source\BsApplication.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsSceneManager.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Source\BsGUILayout.cpp">
       <Filter>Source Files\GUI</Filter>
     </ClCompile>
@@ -499,36 +526,9 @@
     <ClCompile Include="Source\BsGUIDropDownHitBox.cpp">
       <Filter>Source Files\GUI</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsVirtualInput.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsInputConfiguration.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsCursor.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsBuiltinResources.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsRenderQueue.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Source\BsGUILayoutUtility.cpp">
       <Filter>Source Files\GUI</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsShapeMeshes2D.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsShapeMeshes3D.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsDrawHelper.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsRenderer.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Source\BsGUISliderHandle.cpp">
       <Filter>Source Files\GUI</Filter>
     </ClCompile>
@@ -541,27 +541,6 @@
     <ClCompile Include="Source\BsGUISpace.cpp">
       <Filter>Source Files\GUI</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsPlainText.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsScriptCode.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsPlainTextImporter.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsScriptCodeImporter.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsScriptCodeImportOptions.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsShortcutManager.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsShortcutKey.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Source\BsGUIDropDownContent.cpp">
       <Filter>Source Files\GUI</Filter>
     </ClCompile>
@@ -583,9 +562,6 @@
     <ClCompile Include="Source\BsDropDownAreaPlacement.cpp">
       <Filter>Source Files\GUI</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsHEString.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Source\BsCCamera.cpp">
       <Filter>Source Files\Components</Filter>
     </ClCompile>
@@ -595,42 +571,96 @@
     <ClCompile Include="Source\BsCLight.cpp">
       <Filter>Source Files\Components</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsCamera.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsGUITooltipManager.cpp">
+      <Filter>Source Files\GUI</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsRenderable.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsGUITooltip.cpp">
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsGUIWidget.cpp">
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsCamera.cpp">
+      <Filter>Source Files\Renderer</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsLight.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\Renderer</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsRenderable.cpp">
+      <Filter>Source Files\Renderer</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsRenderableHandler.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\Renderer</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsRendererMaterialManager.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsRenderer.cpp">
+      <Filter>Source Files\Renderer</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsRendererMaterial.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\Renderer</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsSplashScreen.cpp">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="Source\BsRendererMaterialManager.cpp">
+      <Filter>Source Files\Renderer</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsRenderQueue.cpp">
+      <Filter>Source Files\Renderer</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsSceneManager.cpp">
+      <Filter>Source Files\Renderer</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsScriptCodeImportOptions.cpp">
+      <Filter>Source Files\Resources</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsScriptCodeImporter.cpp">
+      <Filter>Source Files\Resources</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsScriptCode.cpp">
+      <Filter>Source Files\Resources</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsPlainTextImporter.cpp">
+      <Filter>Source Files\Resources</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsPlainText.cpp">
+      <Filter>Source Files\Resources</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsBuiltinResources.cpp">
+      <Filter>Source Files\Resources</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsInputConfiguration.cpp">
+      <Filter>Source Files\Input</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsVirtualInput.cpp">
+      <Filter>Source Files\Input</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsDrawHelper.cpp">
+      <Filter>Source Files\Utility</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsGameSettings.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\Utility</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsHEString.cpp">
+      <Filter>Source Files\Utility</Filter>
     </ClCompile>
     <ClCompile Include="Source\BsPaths.cpp">
-      <Filter>Source Files</Filter>
+      <Filter>Source Files\Utility</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsGUITooltipManager.cpp">
-      <Filter>Source Files\GUI</Filter>
+    <ClCompile Include="Source\BsShapeMeshes2D.cpp">
+      <Filter>Source Files\Utility</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsGUITooltip.cpp">
+    <ClCompile Include="Source\BsShapeMeshes3D.cpp">
+      <Filter>Source Files\Utility</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsShortcutKey.cpp">
       <Filter>Source Files\GUI</Filter>
     </ClCompile>
-    <ClCompile Include="Source\BsGUIWidget.cpp">
+    <ClCompile Include="Source\BsShortcutManager.cpp">
       <Filter>Source Files\GUI</Filter>
     </ClCompile>
+    <ClCompile Include="Source\BsCursor.cpp">
+      <Filter>Source Files\Platform</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsSplashScreen.cpp">
+      <Filter>Source Files\Platform</Filter>
+    </ClCompile>
     <ClCompile Include="Source\BsCGUIWidget.cpp">
       <Filter>Source Files\GUI</Filter>
     </ClCompile>

+ 3 - 5
BansheeEngine/Include/BsEnums.h

@@ -2,9 +2,7 @@
 
 namespace BansheeEngine
 {
-	/**
-	 * @brief	Available cursor types.
-	 */
+	/**	Available cursor types. */
 	enum class CursorType
 	{
 		Arrow,
@@ -23,8 +21,8 @@ namespace BansheeEngine
 	};
 
 	/**
-	 * @brief	Contains a basic sent of renderable types that may be supported by a renderer.
-	 *			These can be used just as a guide since renderer plugins can use their own types as needed.
+	 * Contains a basic sent of renderable types that may be supported by a renderer. These can be used just as a guide 
+	 * since renderer plugins can use their own types as needed.
 	 */
 	enum RenderableType
 	{

+ 4 - 0
BansheeUtility/Include/BsPrerequisitesUtil.h

@@ -60,6 +60,10 @@
  *  Contains functionality for manipulating threads and thread synchronization.
  */
 
+/** @defgroup RTTI-Impl-Utility RTTI types
+ *  Types containing RTTI for specific classes.
+ */
+
 /** @} */
 
 /** @defgroup Implementation Implementation

+ 20 - 16
BansheeUtility/Include/BsSerializedObjectRTTI.h

@@ -7,6 +7,9 @@
 namespace BansheeEngine
 {
 	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Utility
+	 *  @{
+	 */
 
 	class BS_UTILITY_EXPORT SerializedInstanceRTTI : public RTTIType <SerializedInstance, IReflectable, SerializedInstanceRTTI>
 	{
@@ -165,7 +168,7 @@ namespace BansheeEngine
 				&SerializedArrayRTTI::setEntry, &SerializedArrayRTTI::setNumEntries);
 		}
 
-		virtual void onSerializationStarted(IReflectable* obj)
+		void onSerializationStarted(IReflectable* obj) override
 		{
 			SerializedArray* serializedArray = static_cast<SerializedArray*>(obj);
 
@@ -176,24 +179,24 @@ namespace BansheeEngine
 			serializedArray->mRTTIData = sequentialData;
 		}
 
-		virtual void onSerializationEnded(IReflectable* obj)
+		void onSerializationEnded(IReflectable* obj) override
 		{
 			SerializedArray* serializedArray = static_cast<SerializedArray*>(obj);
 			serializedArray->mRTTIData = nullptr;
 		}
 
-		virtual const String& getRTTIName() override
+		const String& getRTTIName() override
 		{
 			static String name = "SerializedArray";
 			return name;
 		}
 
-		virtual UINT32 getRTTIId() override
+		UINT32 getRTTIId() override
 		{
 			return TID_SerializedArray;
 		}
 
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
+		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			return bs_shared_ptr_new<SerializedArray>();
 		}
@@ -241,7 +244,7 @@ namespace BansheeEngine
 				&SerializedSubObjectRTTI::setEntry, &SerializedSubObjectRTTI::setNumEntries);
 		}
 
-		virtual void onSerializationStarted(IReflectable* obj) override
+		void onSerializationStarted(IReflectable* obj) override
 		{
 			SerializedSubObject* serializableObject = static_cast<SerializedSubObject*>(obj);
 
@@ -252,24 +255,24 @@ namespace BansheeEngine
 			serializableObject->mRTTIData = sequentialData;
 		}
 
-		virtual void onSerializationEnded(IReflectable* obj) override
+		void onSerializationEnded(IReflectable* obj) override
 		{
 			SerializedSubObject* serializableObject = static_cast<SerializedSubObject*>(obj);
 			serializableObject->mRTTIData = nullptr;
 		}
 
-		virtual const String& getRTTIName() override
+		const String& getRTTIName() override
 		{
 			static String name = "SerializedSubObject";
 			return name;
 		}
 
-		virtual UINT32 getRTTIId() override
+		UINT32 getRTTIId() override
 		{
 			return TID_SerializedSubObject;
 		}
 
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
+		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			return bs_shared_ptr_new<SerializedSubObject>();
 		}
@@ -305,18 +308,18 @@ namespace BansheeEngine
 			addReflectablePtrField("serialized", 1, &SerializedEntryRTTI::getSerialized, &SerializedEntryRTTI::setSerialized);
 		}
 
-		virtual const String& getRTTIName() override
+		const String& getRTTIName() override
 		{
 			static String name = "SerializedEntry";
 			return name;
 		}
 
-		virtual UINT32 getRTTIId() override
+		UINT32 getRTTIId() override
 		{
 			return TID_SerializedEntry;
 		}
 
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
+		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			return bs_shared_ptr_new<SerializedEntry>();
 		}
@@ -352,22 +355,23 @@ namespace BansheeEngine
 			addReflectablePtrField("serialized", 1, &SerializedArrayEntryRTTI::getSerialized, &SerializedArrayEntryRTTI::setSerialized);
 		}
 
-		virtual const String& getRTTIName() override
+		const String& getRTTIName() override
 		{
 			static String name = "SerializedArrayEntry";
 			return name;
 		}
 
-		virtual UINT32 getRTTIId() override
+		UINT32 getRTTIId() override
 		{
 			return TID_SerializedArrayEntry;
 		}
 
-		virtual std::shared_ptr<IReflectable> newRTTIObject() override
+		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			return bs_shared_ptr_new<SerializedArrayEntry>();
 		}
 	};
 
+	/** @} */
 	/** @endcond */
 }