Browse Source

Renamed all macros/methods starting with "cm" to "bs"

Marko Pintera 11 years ago
parent
commit
203fbc8fc6
100 changed files with 581 additions and 581 deletions
  1. 2 2
      BansheeCore/Include/BsCoreApplication.h
  2. 1 1
      BansheeCore/Include/CmBlendState.h
  3. 2 2
      BansheeCore/Include/CmBlendStateRTTI.h
  4. 2 2
      BansheeCore/Include/CmCPUProfiler.h
  5. 28 28
      BansheeCore/Include/CmCommandQueue.h
  6. 1 1
      BansheeCore/Include/CmComponentRTTI.h
  7. 11 11
      BansheeCore/Include/CmCoreObject.h
  8. 1 1
      BansheeCore/Include/CmCoreObjectManager.h
  9. 9 9
      BansheeCore/Include/CmCoreThread.h
  10. 2 2
      BansheeCore/Include/CmCoreThreadAccessor.h
  11. 1 1
      BansheeCore/Include/CmDepthStencilState.h
  12. 1 1
      BansheeCore/Include/CmFolderMonitor.h
  13. 1 1
      BansheeCore/Include/CmFontImportOptionsRTTI.h
  14. 4 4
      BansheeCore/Include/CmFontRTTI.h
  15. 2 2
      BansheeCore/Include/CmGameObjectHandle.h
  16. 1 1
      BansheeCore/Include/CmGameObjectHandleRTTI.h
  17. 1 1
      BansheeCore/Include/CmGameObjectRTTI.h
  18. 8 8
      BansheeCore/Include/CmGpuParam.h
  19. 7 7
      BansheeCore/Include/CmGpuParams.h
  20. 1 1
      BansheeCore/Include/CmGpuProgramImportOptionsRTTI.h
  21. 13 13
      BansheeCore/Include/CmGpuProgramRTTI.h
  22. 1 1
      BansheeCore/Include/CmGpuResourceDataRTTI.h
  23. 1 1
      BansheeCore/Include/CmGpuResourceRTTI.h
  24. 1 1
      BansheeCore/Include/CmImportOptionsRTTI.h
  25. 1 1
      BansheeCore/Include/CmMaterial.h
  26. 10 10
      BansheeCore/Include/CmMaterialRTTI.h
  27. 2 2
      BansheeCore/Include/CmMeshBaseRTTI.h
  28. 2 2
      BansheeCore/Include/CmMeshData.h
  29. 2 2
      BansheeCore/Include/CmMeshDataRTTI.h
  30. 1 1
      BansheeCore/Include/CmOSInputHandler.h
  31. 1 1
      BansheeCore/Include/CmPassRTTI.h
  32. 1 1
      BansheeCore/Include/CmPixelDataRTTI.h
  33. 3 3
      BansheeCore/Include/CmPlatform.h
  34. 12 12
      BansheeCore/Include/CmPrerequisites.h
  35. 7 7
      BansheeCore/Include/CmProfiler.h
  36. 1 1
      BansheeCore/Include/CmRasterizerStateRTTI.h
  37. 41 41
      BansheeCore/Include/CmRenderSystemCapabilities.h
  38. 1 1
      BansheeCore/Include/CmRenderWindowManager.h
  39. 5 5
      BansheeCore/Include/CmResourceHandle.h
  40. 2 2
      BansheeCore/Include/CmResourceHandleRTTI.h
  41. 1 1
      BansheeCore/Include/CmResourceRTTI.h
  42. 2 2
      BansheeCore/Include/CmResources.h
  43. 1 1
      BansheeCore/Include/CmSamplerStateRTTI.h
  44. 3 3
      BansheeCore/Include/CmSceneObject.h
  45. 6 6
      BansheeCore/Include/CmShaderRTTI.h
  46. 1 1
      BansheeCore/Include/CmTechniqueRTTI.h
  47. 10 10
      BansheeCore/Include/CmTextData.h
  48. 24 24
      BansheeCore/Include/CmTextureRTTI.h
  49. 1 1
      BansheeCore/Include/CmVertexDataDescRTTI.h
  50. 1 1
      BansheeCore/Include/CmVertexDeclaration.h
  51. 1 1
      BansheeCore/Include/Win32/CmPlatformImpl.h
  52. 2 2
      BansheeCore/Include/Win32/CmWin32Defs.h
  53. 13 13
      BansheeCore/Include/Win32/CmWin32DropTarget.h
  54. 8 8
      BansheeCore/Source/BsCoreApplication.cpp
  55. 5 5
      BansheeCore/Source/BsGPUProfiler.cpp
  56. 3 3
      BansheeCore/Source/CmBindableGpuParams.cpp
  57. 8 8
      BansheeCore/Source/CmBlendState.cpp
  58. 10 10
      BansheeCore/Source/CmCPUProfiler.cpp
  59. 17 17
      BansheeCore/Source/CmCommandQueue.cpp
  60. 22 22
      BansheeCore/Source/CmCoreObject.cpp
  61. 5 5
      BansheeCore/Source/CmCoreObjectManager.cpp
  62. 44 44
      BansheeCore/Source/CmCoreThread.cpp
  63. 1 1
      BansheeCore/Source/CmCoreThreadAccessor.cpp
  64. 2 2
      BansheeCore/Source/CmFontManager.cpp
  65. 1 1
      BansheeCore/Source/CmGameObject.cpp
  66. 4 4
      BansheeCore/Source/CmGameObjectHandle.cpp
  67. 6 6
      BansheeCore/Source/CmGameObjectManager.cpp
  68. 4 4
      BansheeCore/Source/CmGpuBuffer.cpp
  69. 17 17
      BansheeCore/Source/CmGpuParam.cpp
  70. 9 9
      BansheeCore/Source/CmGpuParamBlock.cpp
  71. 4 4
      BansheeCore/Source/CmGpuParamBlockBuffer.cpp
  72. 6 6
      BansheeCore/Source/CmGpuParams.cpp
  73. 2 2
      BansheeCore/Source/CmGpuProgInclude.cpp
  74. 1 1
      BansheeCore/Source/CmGpuProgram.cpp
  75. 1 1
      BansheeCore/Source/CmGpuProgramImporter.cpp
  76. 4 4
      BansheeCore/Source/CmGpuProgramManager.cpp
  77. 14 14
      BansheeCore/Source/CmGpuResourceData.cpp
  78. 1 1
      BansheeCore/Source/CmHardwareBufferManager.cpp
  79. 5 5
      BansheeCore/Source/CmImporter.cpp
  80. 7 7
      BansheeCore/Source/CmInput.cpp
  81. 8 8
      BansheeCore/Source/CmMaterial.cpp
  82. 2 2
      BansheeCore/Source/CmMaterialManager.cpp
  83. 5 5
      BansheeCore/Source/CmMaterialRTTI.cpp
  84. 15 15
      BansheeCore/Source/CmMesh.cpp
  85. 1 1
      BansheeCore/Source/CmMeshBase.cpp
  86. 8 8
      BansheeCore/Source/CmMeshData.cpp
  87. 14 14
      BansheeCore/Source/CmMeshHeap.cpp
  88. 6 6
      BansheeCore/Source/CmMeshManager.cpp
  89. 10 10
      BansheeCore/Source/CmMultiRenderTexture.cpp
  90. 8 8
      BansheeCore/Source/CmOSInputHandler.cpp
  91. 1 1
      BansheeCore/Source/CmPass.cpp
  92. 3 3
      BansheeCore/Source/CmPixelBuffer.cpp
  93. 2 2
      BansheeCore/Source/CmPixelData.cpp
  94. 4 4
      BansheeCore/Source/CmPixelUtil.cpp
  95. 2 2
      BansheeCore/Source/CmPlatform.cpp
  96. 11 11
      BansheeCore/Source/CmProfiler.cpp
  97. 3 3
      BansheeCore/Source/CmQueryManager.cpp
  98. 4 4
      BansheeCore/Source/CmRenderStateManager.cpp
  99. 2 2
      BansheeCore/Source/CmRenderSystem.cpp
  100. 1 1
      BansheeCore/Source/CmRenderTarget.cpp

+ 2 - 2
BansheeCore/Include/BsCoreApplication.h

@@ -100,8 +100,8 @@ namespace BansheeEngine
 		DynLib* mSceneManagerPlugin;
 		DynLib* mSceneManagerPlugin;
 
 
 		bool mIsFrameRenderingFinished;
 		bool mIsFrameRenderingFinished;
-		CM_MUTEX(mFrameRenderingFinishedMutex);
-		CM_THREAD_SYNCHRONISER(mFrameRenderingFinishedCondition);
+		BS_MUTEX(mFrameRenderingFinishedMutex);
+		BS_THREAD_SYNCHRONISER(mFrameRenderingFinishedCondition);
 
 
 		volatile bool mRunMainLoop;
 		volatile bool mRunMainLoop;
 	};
 	};

+ 1 - 1
BansheeCore/Include/CmBlendState.h

@@ -51,7 +51,7 @@ namespace BansheeEngine
 
 
 		bool alphaToCoverageEnable;
 		bool alphaToCoverageEnable;
 		bool independantBlendEnable;
 		bool independantBlendEnable;
-		RENDER_TARGET_BLEND_STATE_DESC renderTargetDesc[CM_MAX_MULTIPLE_RENDER_TARGETS];
+		RENDER_TARGET_BLEND_STATE_DESC renderTargetDesc[BS_MAX_MULTIPLE_RENDER_TARGETS];
 	};
 	};
 
 
 	/**
 	/**

+ 2 - 2
BansheeCore/Include/CmBlendStateRTTI.h

@@ -37,10 +37,10 @@ namespace BansheeEngine
 		{ 
 		{ 
 			UINT64 dataSize = sizeof(data) + sizeof(UINT32);
 			UINT64 dataSize = sizeof(data) + sizeof(UINT32);
 
 
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 			if(dataSize > std::numeric_limits<UINT32>::max())
 			if(dataSize > std::numeric_limits<UINT32>::max())
 			{
 			{
-				CM_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
+				BS_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
 			}
 			}
 #endif
 #endif
 
 

+ 2 - 2
BansheeCore/Include/CmCPUProfiler.h

@@ -262,7 +262,7 @@ namespace BansheeEngine
 			 */
 			 */
 			void releaseBlock(ProfiledBlock* block);
 			void releaseBlock(ProfiledBlock* block);
 
 
-			static CM_THREADLOCAL ThreadInfo* activeThread;
+			static BS_THREADLOCAL ThreadInfo* activeThread;
 			bool isActive;
 			bool isActive;
 
 
 			ProfiledBlock* rootBlock;
 			ProfiledBlock* rootBlock;
@@ -357,7 +357,7 @@ namespace BansheeEngine
 		UINT64 mPreciseSamplingOverheadCycles;
 		UINT64 mPreciseSamplingOverheadCycles;
 
 
 		ProfilerVector<ThreadInfo*> mActiveThreads;
 		ProfilerVector<ThreadInfo*> mActiveThreads;
-		CM_MUTEX(mThreadSync);
+		BS_MUTEX(mThreadSync);
 	};
 	};
 
 
 	/**
 	/**

+ 28 - 28
BansheeCore/Include/CmCommandQueue.h

@@ -16,9 +16,9 @@ namespace BansheeEngine
 		CommandQueueNoSync() {}
 		CommandQueueNoSync() {}
 		virtual ~CommandQueueNoSync() {}
 		virtual ~CommandQueueNoSync() {}
 
 
-		bool isValidThread(CM_THREAD_ID_TYPE ownerThread) const
+		bool isValidThread(BS_THREAD_ID_TYPE ownerThread) const
 		{
 		{
-			return CM_THREAD_CURRENT_ID == ownerThread;
+			return BS_THREAD_CURRENT_ID == ownerThread;
 		}
 		}
 
 
 		void lock() { };
 		void lock() { };
@@ -33,11 +33,11 @@ namespace BansheeEngine
 	{
 	{
 	public:
 	public:
 		CommandQueueSync()
 		CommandQueueSync()
-			:mLock(mCommandQueueMutex, CM_DEFER_LOCK)
+			:mLock(mCommandQueueMutex, BS_DEFER_LOCK)
 		{ }
 		{ }
 		virtual ~CommandQueueSync() {}
 		virtual ~CommandQueueSync() {}
 
 
-		bool isValidThread(CM_THREAD_ID_TYPE ownerThread) const
+		bool isValidThread(BS_THREAD_ID_TYPE ownerThread) const
 		{
 		{
 			return true;
 			return true;
 		}
 		}
@@ -53,8 +53,8 @@ namespace BansheeEngine
 		}
 		}
 
 
 	private:
 	private:
-		CM_MUTEX(mCommandQueueMutex);
-		CM_LOCK_TYPE mLock;
+		BS_MUTEX(mCommandQueueMutex);
+		BS_LOCK_TYPE mLock;
 	};
 	};
 
 
 	/**
 	/**
@@ -63,9 +63,9 @@ namespace BansheeEngine
 	 */
 	 */
 	struct QueuedCommand
 	struct QueuedCommand
 	{
 	{
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		QueuedCommand(std::function<void(AsyncOp&)> _callback, UINT32 _debugId, bool _notifyWhenComplete = false, UINT32 _callbackId = 0)
 		QueuedCommand(std::function<void(AsyncOp&)> _callback, UINT32 _debugId, bool _notifyWhenComplete = false, UINT32 _callbackId = 0)
-			:callbackWithReturnValue(_callback), debugId(_debugId), returnsValue(true), notifyWhenComplete(_notifyWhenComplete), callbackId(_callbackId), asyncOp(cm_new<AsyncOp>()), ownsData(true)
+			:callbackWithReturnValue(_callback), debugId(_debugId), returnsValue(true), notifyWhenComplete(_notifyWhenComplete), callbackId(_callbackId), asyncOp(bs_new<AsyncOp>()), ownsData(true)
 		{ }
 		{ }
 
 
 		QueuedCommand(std::function<void()> _callback, UINT32 _debugId, bool _notifyWhenComplete = false, UINT32 _callbackId = 0)
 		QueuedCommand(std::function<void()> _callback, UINT32 _debugId, bool _notifyWhenComplete = false, UINT32 _callbackId = 0)
@@ -75,7 +75,7 @@ namespace BansheeEngine
 		UINT32 debugId;
 		UINT32 debugId;
 #else
 #else
 		QueuedCommand(std::function<void(AsyncOp&)> _callback, bool _notifyWhenComplete = false, UINT32 _callbackId = 0)
 		QueuedCommand(std::function<void(AsyncOp&)> _callback, bool _notifyWhenComplete = false, UINT32 _callbackId = 0)
-			:callbackWithReturnValue(_callback), returnsValue(true), notifyWhenComplete(_notifyWhenComplete), callbackId(_callbackId), asyncOp(cm_new<AsyncOp>()), ownsData(true)
+			:callbackWithReturnValue(_callback), returnsValue(true), notifyWhenComplete(_notifyWhenComplete), callbackId(_callbackId), asyncOp(bs_new<AsyncOp>()), ownsData(true)
 		{ }
 		{ }
 
 
 		QueuedCommand(std::function<void()> _callback, bool _notifyWhenComplete = false, UINT32 _callbackId = 0)
 		QueuedCommand(std::function<void()> _callback, bool _notifyWhenComplete = false, UINT32 _callbackId = 0)
@@ -86,7 +86,7 @@ namespace BansheeEngine
 		~QueuedCommand()
 		~QueuedCommand()
 		{
 		{
 			if(ownsData && asyncOp != nullptr)
 			if(ownsData && asyncOp != nullptr)
-				cm_delete(asyncOp);
+				bs_delete(asyncOp);
 		}
 		}
 
 
 		QueuedCommand(const QueuedCommand& source)
 		QueuedCommand(const QueuedCommand& source)
@@ -138,7 +138,7 @@ namespace BansheeEngine
 		 *
 		 *
 		 * @param	threadId	   	Identifier for the thread the command queue will be getting commands from.					
 		 * @param	threadId	   	Identifier for the thread the command queue will be getting commands from.					
 		 */
 		 */
-		CommandQueueBase(CM_THREAD_ID_TYPE threadId);
+		CommandQueueBase(BS_THREAD_ID_TYPE threadId);
 		virtual ~CommandQueueBase();
 		virtual ~CommandQueueBase();
 
 
 		/**
 		/**
@@ -147,7 +147,7 @@ namespace BansheeEngine
 		 * @note	If the command queue is using a synchonized access policy generally this
 		 * @note	If the command queue is using a synchonized access policy generally this
 		 * 			is not relevant as it may be used on multiple threads.
 		 * 			is not relevant as it may be used on multiple threads.
 		 */
 		 */
-		CM_THREAD_ID_TYPE getThreadId() const { return mMyThreadId; }
+		BS_THREAD_ID_TYPE getThreadId() const { return mMyThreadId; }
 
 
 		/**
 		/**
 		 * @brief	Executes all provided commands one by one in order. To get the commands you should call flush().
 		 * @brief	Executes all provided commands one by one in order. To get the commands you should call flush().
@@ -235,11 +235,11 @@ namespace BansheeEngine
 		BansheeEngine::Queue<QueuedCommand>* mCommands;
 		BansheeEngine::Queue<QueuedCommand>* mCommands;
 		Stack<BansheeEngine::Queue<QueuedCommand>*> mEmptyCommandQueues; // List of empty queues for reuse
 		Stack<BansheeEngine::Queue<QueuedCommand>*> mEmptyCommandQueues; // List of empty queues for reuse
 
 
-		CM_THREAD_ID_TYPE mMyThreadId;
+		BS_THREAD_ID_TYPE mMyThreadId;
 
 
 		// Various variables that allow for easier debugging by allowing us to trigger breakpoints
 		// Various variables that allow for easier debugging by allowing us to trigger breakpoints
 		// when a certain command was queued.
 		// when a certain command was queued.
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		struct QueueBreakpoint
 		struct QueueBreakpoint
 		{
 		{
 			class HashFunction
 			class HashFunction
@@ -269,7 +269,7 @@ namespace BansheeEngine
 
 
 		static UINT32 MaxCommandQueueIdx;
 		static UINT32 MaxCommandQueueIdx;
 		static UnorderedSet<QueueBreakpoint, QueueBreakpoint::HashFunction, QueueBreakpoint::EqualFunction> SetBreakpoints;
 		static UnorderedSet<QueueBreakpoint, QueueBreakpoint::HashFunction, QueueBreakpoint::EqualFunction> SetBreakpoints;
-		CM_STATIC_MUTEX(CommandQueueBreakpointMutex);
+		BS_STATIC_MUTEX(CommandQueueBreakpointMutex);
 
 
 		/**
 		/**
 		 * @brief	Checks if the specified command has a breakpoint and throw an assert if it does.
 		 * @brief	Checks if the specified command has a breakpoint and throw an assert if it does.
@@ -291,14 +291,14 @@ namespace BansheeEngine
 		/**
 		/**
 		 * @copydoc CommandQueueBase::CommandQueueBase
 		 * @copydoc CommandQueueBase::CommandQueueBase
 		 */
 		 */
-		CommandQueue(CM_THREAD_ID_TYPE threadId)
+		CommandQueue(BS_THREAD_ID_TYPE threadId)
 			:CommandQueueBase(threadId)
 			:CommandQueueBase(threadId)
 		{ }
 		{ }
 
 
 		~CommandQueue() 
 		~CommandQueue() 
 		{
 		{
-#if CM_DEBUG_MODE
-#if CM_THREAD_SUPPORT != 0
+#if BS_DEBUG_MODE
+#if BS_THREAD_SUPPORT != 0
 			if(!isValidThread(getThreadId()))
 			if(!isValidThread(getThreadId()))
 				throwInvalidThreadException("Command queue accessed outside of its creation thread.");
 				throwInvalidThreadException("Command queue accessed outside of its creation thread.");
 #endif
 #endif
@@ -310,8 +310,8 @@ namespace BansheeEngine
 		 */
 		 */
 		AsyncOp queueReturn(std::function<void(AsyncOp&)> commandCallback, bool _notifyWhenComplete = false, UINT32 _callbackId = 0)
 		AsyncOp queueReturn(std::function<void(AsyncOp&)> commandCallback, bool _notifyWhenComplete = false, UINT32 _callbackId = 0)
 		{
 		{
-#if CM_DEBUG_MODE
-#if CM_THREAD_SUPPORT != 0
+#if BS_DEBUG_MODE
+#if BS_THREAD_SUPPORT != 0
 			if(!isValidThread(getThreadId()))
 			if(!isValidThread(getThreadId()))
 				throwInvalidThreadException("Command queue accessed outside of its creation thread.");
 				throwInvalidThreadException("Command queue accessed outside of its creation thread.");
 #endif
 #endif
@@ -329,8 +329,8 @@ namespace BansheeEngine
 		 */
 		 */
 		void queue(std::function<void()> commandCallback, bool _notifyWhenComplete = false, UINT32 _callbackId = 0)
 		void queue(std::function<void()> commandCallback, bool _notifyWhenComplete = false, UINT32 _callbackId = 0)
 		{
 		{
-#if CM_DEBUG_MODE
-#if CM_THREAD_SUPPORT != 0
+#if BS_DEBUG_MODE
+#if BS_THREAD_SUPPORT != 0
 			if(!isValidThread(getThreadId()))
 			if(!isValidThread(getThreadId()))
 				throwInvalidThreadException("Command queue accessed outside of its creation thread.");
 				throwInvalidThreadException("Command queue accessed outside of its creation thread.");
 #endif
 #endif
@@ -346,8 +346,8 @@ namespace BansheeEngine
 		 */
 		 */
 		BansheeEngine::Queue<QueuedCommand>* flush()
 		BansheeEngine::Queue<QueuedCommand>* flush()
 		{
 		{
-#if CM_DEBUG_MODE
-#if CM_THREAD_SUPPORT != 0
+#if BS_DEBUG_MODE
+#if BS_THREAD_SUPPORT != 0
 			if(!isValidThread(getThreadId()))
 			if(!isValidThread(getThreadId()))
 				throwInvalidThreadException("Command queue accessed outside of its creation thread.");
 				throwInvalidThreadException("Command queue accessed outside of its creation thread.");
 #endif
 #endif
@@ -365,8 +365,8 @@ namespace BansheeEngine
 		 */
 		 */
 		void cancelAll()
 		void cancelAll()
 		{
 		{
-#if CM_DEBUG_MODE
-#if CM_THREAD_SUPPORT != 0
+#if BS_DEBUG_MODE
+#if BS_THREAD_SUPPORT != 0
 			if(!isValidThread(getThreadId()))
 			if(!isValidThread(getThreadId()))
 				throwInvalidThreadException("Command queue accessed outside of its creation thread.");
 				throwInvalidThreadException("Command queue accessed outside of its creation thread.");
 #endif
 #endif
@@ -382,8 +382,8 @@ namespace BansheeEngine
 		 */
 		 */
 		bool isEmpty()
 		bool isEmpty()
 		{
 		{
-#if CM_DEBUG_MODE
-#if CM_THREAD_SUPPORT != 0
+#if BS_DEBUG_MODE
+#if BS_THREAD_SUPPORT != 0
 			if(!isValidThread(getThreadId()))
 			if(!isValidThread(getThreadId()))
 				throwInvalidThreadException("Command queue accessed outside of its creation thread.");
 				throwInvalidThreadException("Command queue accessed outside of its creation thread.");
 #endif
 #endif

+ 1 - 1
BansheeCore/Include/CmComponentRTTI.h

@@ -29,7 +29,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			CM_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
 		}
 		}
 	};
 	};
 }
 }

+ 11 - 11
BansheeCore/Include/CmCoreObject.h

@@ -105,7 +105,7 @@ namespace BansheeEngine
 			}
 			}
 			else
 			else
 			{
 			{
-				cm_delete<MemAlloc, T>((T*)obj);
+				bs_delete<MemAlloc, T>((T*)obj);
 			}
 			}
 		}
 		}
 
 
@@ -172,8 +172,8 @@ namespace BansheeEngine
 		UINT64 mInternalID; // ID == 0 is not a valid ID
 		UINT64 mInternalID; // ID == 0 is not a valid ID
 		std::weak_ptr<CoreObject> mThis;
 		std::weak_ptr<CoreObject> mThis;
 
 
-		CM_STATIC_THREAD_SYNCHRONISER(mCoreGpuObjectLoadedCondition)
-		CM_STATIC_MUTEX(mCoreGpuObjectLoadedMutex)
+		BS_STATIC_THREAD_SYNCHRONISER(mCoreGpuObjectLoadedCondition)
+		BS_STATIC_MUTEX(mCoreGpuObjectLoadedMutex)
 
 
 		/**
 		/**
 		 * @brief	Queues object initialization command on the core thread. The command is added to the
 		 * @brief	Queues object initialization command on the core thread. The command is added to the
@@ -208,9 +208,9 @@ namespace BansheeEngine
 	 * 			and you should not create them manually.
 	 * 			and you should not create them manually.
 	 */
 	 */
 	template<class Type, class MainAlloc, class PtrDataAlloc, class... Args>
 	template<class Type, class MainAlloc, class PtrDataAlloc, class... Args>
-	std::shared_ptr<Type> cm_core_ptr(Args &&...args)
+	std::shared_ptr<Type> bs_core_ptr(Args &&...args)
 	{
 	{
-		return std::shared_ptr<Type>(cm_new<Type, MainAlloc>(std::forward<Args>(args)...),
+		return std::shared_ptr<Type>(bs_new<Type, MainAlloc>(std::forward<Args>(args)...),
 			&CoreObject::_deleteDelayed<Type, MainAlloc>, StdAlloc<PtrDataAlloc>());
 			&CoreObject::_deleteDelayed<Type, MainAlloc>, StdAlloc<PtrDataAlloc>());
 	}
 	}
 
 
@@ -221,9 +221,9 @@ namespace BansheeEngine
 	 * 			and you should not create them manually.
 	 * 			and you should not create them manually.
 	 */
 	 */
 	template<class Type, class MainAlloc, class... Args>
 	template<class Type, class MainAlloc, class... Args>
-	std::shared_ptr<Type> cm_core_ptr(Args &&...args)
+	std::shared_ptr<Type> bs_core_ptr(Args &&...args)
 	{
 	{
-		return std::shared_ptr<Type>(cm_new<Type, MainAlloc>(std::forward<Args>(args)...),
+		return std::shared_ptr<Type>(bs_new<Type, MainAlloc>(std::forward<Args>(args)...),
 			&CoreObject::_deleteDelayed<Type, MainAlloc>, StdAlloc<GenAlloc>());
 			&CoreObject::_deleteDelayed<Type, MainAlloc>, StdAlloc<GenAlloc>());
 	}
 	}
 
 
@@ -234,9 +234,9 @@ namespace BansheeEngine
 	 * 			and you should not create them manually.
 	 * 			and you should not create them manually.
 	 */
 	 */
 	template<class Type, class... Args>
 	template<class Type, class... Args>
-	std::shared_ptr<Type> cm_core_ptr(Args &&...args)
+	std::shared_ptr<Type> bs_core_ptr(Args &&...args)
 	{
 	{
-		return std::shared_ptr<Type>(cm_new<Type, GenAlloc>(std::forward<Args>(args)...),
+		return std::shared_ptr<Type>(bs_new<Type, GenAlloc>(std::forward<Args>(args)...),
 			&CoreObject::_deleteDelayed<Type, GenAlloc>, StdAlloc<GenAlloc>());
 			&CoreObject::_deleteDelayed<Type, GenAlloc>, StdAlloc<GenAlloc>());
 	}
 	}
 
 
@@ -247,7 +247,7 @@ namespace BansheeEngine
 	 * 			and you should not create them manually.
 	 * 			and you should not create them manually.
 	 */
 	 */
 	template<class Type, class MainAlloc>
 	template<class Type, class MainAlloc>
-	std::shared_ptr<Type> cm_core_ptr(Type* data)
+	std::shared_ptr<Type> bs_core_ptr(Type* data)
 	{
 	{
 		return std::shared_ptr<Type>(data, &CoreObject::_deleteDelayed<Type, MainAlloc>, StdAlloc<GenAlloc>());  
 		return std::shared_ptr<Type>(data, &CoreObject::_deleteDelayed<Type, MainAlloc>, StdAlloc<GenAlloc>());  
 	}
 	}
@@ -259,7 +259,7 @@ namespace BansheeEngine
 	 * 			and you should not create them manually.
 	 * 			and you should not create them manually.
 	 */
 	 */
 	template<class Type, class MainAlloc, class PtrDataAlloc>
 	template<class Type, class MainAlloc, class PtrDataAlloc>
-	std::shared_ptr<Type> cm_core_ptr(Type* data)
+	std::shared_ptr<Type> bs_core_ptr(Type* data)
 	{
 	{
 		return std::shared_ptr<Type>(data, &CoreObject::_deleteDelayed<Type, MainAlloc>, StdAlloc<PtrDataAlloc>());  
 		return std::shared_ptr<Type>(data, &CoreObject::_deleteDelayed<Type, MainAlloc>, StdAlloc<PtrDataAlloc>());  
 	}
 	}

+ 1 - 1
BansheeCore/Include/CmCoreObjectManager.h

@@ -34,6 +34,6 @@ namespace BansheeEngine
 	private:
 	private:
 		UINT64 mNextAvailableID;
 		UINT64 mNextAvailableID;
 		Map<UINT64, CoreObject*> mObjects;
 		Map<UINT64, CoreObject*> mObjects;
-		CM_MUTEX(mObjectsMutex);
+		BS_MUTEX(mObjectsMutex);
 	};
 	};
 }
 }

+ 9 - 9
BansheeCore/Include/CmCoreThread.h

@@ -38,7 +38,7 @@ public:
 	/**
 	/**
 		* @brief	Returns the id of the core thread. 
 		* @brief	Returns the id of the core thread. 
 		*/
 		*/
-	BS_CORE_EXPORT CM_THREAD_ID_TYPE getCoreThreadId() { return mCoreThreadId; }
+	BS_CORE_EXPORT BS_THREAD_ID_TYPE getCoreThreadId() { return mCoreThreadId; }
 
 
 	/**
 	/**
 		* @brief	Creates or retrieves an accessor that you can use for executing commands on the core thread from 
 		* @brief	Creates or retrieves an accessor that you can use for executing commands on the core thread from 
@@ -111,17 +111,17 @@ private:
 	FrameAlloc* mFrameAllocs[2]; 
 	FrameAlloc* mFrameAllocs[2]; 
 	UINT32 mActiveFrameAlloc;
 	UINT32 mActiveFrameAlloc;
 
 
-	static CM_THREADLOCAL AccessorContainer* mAccessor;
+	static BS_THREADLOCAL AccessorContainer* mAccessor;
 	Vector<AccessorContainer*> mAccessors;
 	Vector<AccessorContainer*> mAccessors;
 
 
 	volatile bool mCoreThreadShutdown;
 	volatile bool mCoreThreadShutdown;
 
 
-	CM_THREAD_ID_TYPE mCoreThreadId;
-	CM_MUTEX(mCommandQueueMutex)
-	CM_MUTEX(mAccessorMutex)
-	CM_THREAD_SYNCHRONISER(mCommandReadyCondition)
-	CM_MUTEX(mCommandNotifyMutex)
-	CM_THREAD_SYNCHRONISER(mCommandCompleteCondition)
+	BS_THREAD_ID_TYPE mCoreThreadId;
+	BS_MUTEX(mCommandQueueMutex)
+	BS_MUTEX(mAccessorMutex)
+	BS_THREAD_SYNCHRONISER(mCommandReadyCondition)
+	BS_MUTEX(mCommandNotifyMutex)
+	BS_THREAD_SYNCHRONISER(mCommandCompleteCondition)
 
 
 	CommandQueue<CommandQueueSync>* mCommandQueue;
 	CommandQueue<CommandQueueSync>* mCommandQueue;
 
 
@@ -194,7 +194,7 @@ private:
 	  */
 	  */
 	BS_CORE_EXPORT void throwIfCoreThread();
 	BS_CORE_EXPORT void throwIfCoreThread();
 
 
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 #define THROW_IF_NOT_CORE_THREAD throwIfNotCoreThread();
 #define THROW_IF_NOT_CORE_THREAD throwIfNotCoreThread();
 #define THROW_IF_CORE_THREAD throwIfCoreThread();
 #define THROW_IF_CORE_THREAD throwIfCoreThread();
 #else
 #else

+ 2 - 2
BansheeCore/Include/CmCoreThreadAccessor.h

@@ -196,8 +196,8 @@ namespace BansheeEngine
 		 *
 		 *
 		 * @param	threadId		Identifier for the thread that created the accessor.
 		 * @param	threadId		Identifier for the thread that created the accessor.
 		 */
 		 */
-		CoreThreadAccessor(CM_THREAD_ID_TYPE threadId)
-			:CoreThreadAccessorBase(cm_new<CommandQueue<CommandQueueSyncPolicy>>(threadId))
+		CoreThreadAccessor(BS_THREAD_ID_TYPE threadId)
+			:CoreThreadAccessorBase(bs_new<CommandQueue<CommandQueueSyncPolicy>>(threadId))
 		{
 		{
 
 
 		}
 		}

+ 1 - 1
BansheeCore/Include/CmDepthStencilState.h

@@ -48,7 +48,7 @@ namespace BansheeEngine
 		CompareFunction backStencilComparisonFunc;
 		CompareFunction backStencilComparisonFunc;
 	};
 	};
 
 
-	CM_ALLOW_MEMCPY_SERIALIZATION(DEPTH_STENCIL_STATE_DESC);
+	BS_ALLOW_MEMCPY_SERIALIZATION(DEPTH_STENCIL_STATE_DESC);
 
 
 	/**
 	/**
 	* @brief	Render system pipeline state that allows you to modify how an object is rendered.
 	* @brief	Render system pipeline state that allows you to modify how an object is rendered.

+ 1 - 1
BansheeCore/Include/CmFolderMonitor.h

@@ -2,6 +2,6 @@
 
 
 #include "CmPrerequisites.h"
 #include "CmPrerequisites.h"
 
 
-#if CM_PLATFORM == CM_PLATFORM_WIN32
+#if BS_PLATFORM == BS_PLATFORM_WIN32
 #include "Win32/CmWin32FolderMonitor.h"
 #include "Win32/CmWin32FolderMonitor.h"
 #endif
 #endif

+ 1 - 1
BansheeCore/Include/CmFontImportOptionsRTTI.h

@@ -43,7 +43,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			return cm_shared_ptr<FontImportOptions, PoolAlloc>();
+			return bs_shared_ptr<FontImportOptions, PoolAlloc>();
 		}
 		}
 	};
 	};
 }
 }

+ 4 - 4
BansheeCore/Include/CmFontRTTI.h

@@ -72,7 +72,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			return cm_shared_ptr<FontData, PoolAlloc>();
+			return bs_shared_ptr<FontData, PoolAlloc>();
 		}
 		}
 	};
 	};
 
 
@@ -87,7 +87,7 @@ namespace BansheeEngine
 		FontData& getFontData(Font* obj, UINT32 idx)
 		FontData& getFontData(Font* obj, UINT32 idx)
 		{
 		{
 			if(idx >= obj->mFontDataPerSize.size())
 			if(idx >= obj->mFontDataPerSize.size())
-				CM_EXCEPT(InternalErrorException, "Index out of range: " + toString(idx) + ". Valid range: 0 .. " + toString((int)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();
 			auto iter = obj->mFontDataPerSize.begin();
 			for(UINT32 i = 0; i < idx; i++, ++iter)
 			for(UINT32 i = 0; i < idx; i++, ++iter)
@@ -140,7 +140,7 @@ namespace BansheeEngine
 	protected:
 	protected:
 		virtual void onDeserializationStarted(IReflectable* obj)
 		virtual void onDeserializationStarted(IReflectable* obj)
 		{
 		{
-			FontInitData* initData = cm_new<FontInitData, PoolAlloc>();
+			FontInitData* initData = bs_new<FontInitData, PoolAlloc>();
 
 
 			Font* font = static_cast<Font*>(obj);
 			Font* font = static_cast<Font*>(obj);
 			font->mRTTIData = initData;
 			font->mRTTIData = initData;
@@ -153,7 +153,7 @@ namespace BansheeEngine
 
 
 			font->initialize(initData->fontDataPerSize);
 			font->initialize(initData->fontDataPerSize);
 
 
-			cm_delete<PoolAlloc>(initData);
+			bs_delete<PoolAlloc>(initData);
 		}
 		}
 	};
 	};
 }
 }

+ 2 - 2
BansheeCore/Include/CmGameObjectHandle.h

@@ -160,7 +160,7 @@ namespace BansheeEngine
 		GameObjectHandle()
 		GameObjectHandle()
 			:GameObjectHandleBase()
 			:GameObjectHandleBase()
 		{	
 		{	
-			mData = cm_shared_ptr<GameObjectHandleData, PoolAlloc>();
+			mData = bs_shared_ptr<GameObjectHandleData, PoolAlloc>();
 		}
 		}
 
 
 		/**
 		/**
@@ -187,7 +187,7 @@ namespace BansheeEngine
 		 */
 		 */
 		inline GameObjectHandle<T>& operator=(std::nullptr_t ptr)
 		inline GameObjectHandle<T>& operator=(std::nullptr_t ptr)
 		{ 	
 		{ 	
-			mData = cm_shared_ptr<GameObjectHandleData, PoolAlloc>();
+			mData = bs_shared_ptr<GameObjectHandleData, PoolAlloc>();
 
 
 			return *this;
 			return *this;
 		}
 		}

+ 1 - 1
BansheeCore/Include/CmGameObjectHandleRTTI.h

@@ -39,7 +39,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			std::shared_ptr<GameObjectHandleBase> obj = cm_shared_ptr<GameObjectHandleBase, PoolAlloc>(new (cm_alloc<GameObjectHandleBase, PoolAlloc>()) GameObjectHandleBase());
+			std::shared_ptr<GameObjectHandleBase> obj = bs_shared_ptr<GameObjectHandleBase, PoolAlloc>(new (bs_alloc<GameObjectHandleBase, PoolAlloc>()) GameObjectHandleBase());
 
 
 			return obj;
 			return obj;
 		}
 		}

+ 1 - 1
BansheeCore/Include/CmGameObjectRTTI.h

@@ -49,7 +49,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			CM_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
 		}
 		}
 	};
 	};
 }
 }

+ 8 - 8
BansheeCore/Include/CmGpuParam.h

@@ -91,7 +91,7 @@ namespace BansheeEngine
 
 
 	public:
 	public:
 		GpuDataParamBase()
 		GpuDataParamBase()
-			:mData(cm_shared_ptr<InternalData>())
+			:mData(bs_shared_ptr<InternalData>())
 		{ }
 		{ }
 
 
 		/**
 		/**
@@ -104,14 +104,14 @@ namespace BansheeEngine
 		void set(const T& value, UINT32 arrayIdx = 0)
 		void set(const T& value, UINT32 arrayIdx = 0)
 		{
 		{
 			if(mData->isDestroyed)
 			if(mData->isDestroyed)
-				CM_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
+				BS_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
 
 
 			GpuParamDataDesc* paramDesc = mData->paramDesc;
 			GpuParamDataDesc* paramDesc = mData->paramDesc;
 
 
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 			if(arrayIdx >= paramDesc->arraySize)
 			if(arrayIdx >= paramDesc->arraySize)
 			{
 			{
-				CM_EXCEPT(InvalidParametersException, "Array index out of range. Array size: " + 
+				BS_EXCEPT(InvalidParametersException, "Array index out of range. Array size: " + 
 					toString(paramDesc->arraySize) + ". Requested size: " + toString(arrayIdx));
 					toString(paramDesc->arraySize) + ". Requested size: " + toString(arrayIdx));
 			}
 			}
 #endif
 #endif
@@ -145,14 +145,14 @@ namespace BansheeEngine
 		T get(UINT32 arrayIdx = 0)
 		T get(UINT32 arrayIdx = 0)
 		{
 		{
 			if(mData->isDestroyed)
 			if(mData->isDestroyed)
-				CM_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
+				BS_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
 
 
 			GpuParamDataDesc* paramDesc = mData->paramDesc;
 			GpuParamDataDesc* paramDesc = mData->paramDesc;
 
 
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 			if(arrayIdx >= paramDesc->arraySize)
 			if(arrayIdx >= paramDesc->arraySize)
 			{
 			{
-				CM_EXCEPT(InvalidParametersException, "Array index out of range. Array size: " + 
+				BS_EXCEPT(InvalidParametersException, "Array index out of range. Array size: " + 
 					toString(paramDesc->arraySize) + ". Requested size: " + toString(arrayIdx));
 					toString(paramDesc->arraySize) + ". Requested size: " + toString(arrayIdx));
 			}
 			}
 #endif
 #endif
@@ -181,7 +181,7 @@ namespace BansheeEngine
 
 
 	private:
 	private:
 		GpuDataParamBase(GpuParamDataDesc* paramDesc, GpuParamBlock** paramBlocks, bool transpose)
 		GpuDataParamBase(GpuParamDataDesc* paramDesc, GpuParamBlock** paramBlocks, bool transpose)
-			:mData(cm_shared_ptr<InternalData>(paramDesc, paramBlocks, transpose))
+			:mData(bs_shared_ptr<InternalData>(paramDesc, paramBlocks, transpose))
 		{ }
 		{ }
 
 
 	private:
 	private:

+ 7 - 7
BansheeCore/Include/CmGpuParams.h

@@ -97,7 +97,7 @@ namespace BansheeEngine
 		 */
 		 */
 		template<class T> void getParam(const String& name, GpuDataParamBase<T>& output) const
 		template<class T> void getParam(const String& name, GpuDataParamBase<T>& output) const
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Unsupported parameter type");
+			BS_EXCEPT(InvalidParametersException, "Unsupported parameter type");
 		}
 		}
 
 
 		/**
 		/**
@@ -109,7 +109,7 @@ namespace BansheeEngine
 			auto iterFind = mFloatParams.find(name);
 			auto iterFind = mFloatParams.find(name);
 
 
 			if(iterFind == mFloatParams.end())
 			if(iterFind == mFloatParams.end())
-				CM_EXCEPT(InvalidParametersException, "Cannot find float parameter with the name '" + name + "'");
+				BS_EXCEPT(InvalidParametersException, "Cannot find float parameter with the name '" + name + "'");
 
 
 			output = iterFind->second;
 			output = iterFind->second;
 		}
 		}
@@ -123,7 +123,7 @@ namespace BansheeEngine
 			auto iterFind = mVec2Params.find(name);
 			auto iterFind = mVec2Params.find(name);
 
 
 			if(iterFind == mVec2Params.end())
 			if(iterFind == mVec2Params.end())
-				CM_EXCEPT(InvalidParametersException, "Cannot find vector(2) parameter with the name '" + name + "'");
+				BS_EXCEPT(InvalidParametersException, "Cannot find vector(2) parameter with the name '" + name + "'");
 
 
 			output = iterFind->second;
 			output = iterFind->second;
 		}
 		}
@@ -137,7 +137,7 @@ namespace BansheeEngine
 			auto iterFind = mVec3Params.find(name);
 			auto iterFind = mVec3Params.find(name);
 
 
 			if(iterFind == mVec3Params.end())
 			if(iterFind == mVec3Params.end())
-				CM_EXCEPT(InvalidParametersException, "Cannot find vector(3) parameter with the name '" + name + "'");
+				BS_EXCEPT(InvalidParametersException, "Cannot find vector(3) parameter with the name '" + name + "'");
 
 
 			output = iterFind->second;
 			output = iterFind->second;
 		}
 		}
@@ -151,7 +151,7 @@ namespace BansheeEngine
 			auto iterFind = mVec4Params.find(name);
 			auto iterFind = mVec4Params.find(name);
 
 
 			if(iterFind == mVec4Params.end())
 			if(iterFind == mVec4Params.end())
-				CM_EXCEPT(InvalidParametersException, "Cannot find vector(4) parameter with the name '" + name + "'");
+				BS_EXCEPT(InvalidParametersException, "Cannot find vector(4) parameter with the name '" + name + "'");
 
 
 			output = iterFind->second;
 			output = iterFind->second;
 		}
 		}
@@ -165,7 +165,7 @@ namespace BansheeEngine
 			auto iterFind = mMat3Params.find(name);
 			auto iterFind = mMat3Params.find(name);
 
 
 			if(iterFind == mMat3Params.end())
 			if(iterFind == mMat3Params.end())
-				CM_EXCEPT(InvalidParametersException, "Cannot find matrix(3x3) parameter with the name '" + name + "'");
+				BS_EXCEPT(InvalidParametersException, "Cannot find matrix(3x3) parameter with the name '" + name + "'");
 
 
 			output = iterFind->second;
 			output = iterFind->second;
 		}
 		}
@@ -179,7 +179,7 @@ namespace BansheeEngine
 			auto iterFind = mMat4Params.find(name);
 			auto iterFind = mMat4Params.find(name);
 
 
 			if(iterFind == mMat4Params.end())
 			if(iterFind == mMat4Params.end())
-				CM_EXCEPT(InvalidParametersException, "Cannot find matrix(4x4) parameter with the name '" + name + "'");
+				BS_EXCEPT(InvalidParametersException, "Cannot find matrix(4x4) parameter with the name '" + name + "'");
 
 
 			output = iterFind->second;
 			output = iterFind->second;
 		}
 		}

+ 1 - 1
BansheeCore/Include/CmGpuProgramImportOptionsRTTI.h

@@ -50,7 +50,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			return cm_shared_ptr<GpuProgramImportOptions, PoolAlloc>();
+			return bs_shared_ptr<GpuProgramImportOptions, PoolAlloc>();
 		}
 		}
 	};
 	};
 }
 }

+ 13 - 13
BansheeCore/Include/CmGpuProgramRTTI.h

@@ -9,24 +9,24 @@ namespace BansheeEngine
 	class BS_CORE_EXPORT GpuProgramRTTI : public RTTIType<GpuProgram, Resource, GpuProgramRTTI>
 	class BS_CORE_EXPORT GpuProgramRTTI : public RTTIType<GpuProgram, Resource, GpuProgramRTTI>
 	{
 	{
 	private:
 	private:
-		CM_SETGET_MEMBER(mSize, UINT32, GpuProgram)
+		BS_SETGET_MEMBER(mSize, UINT32, GpuProgram)
 
 
-		CM_SETGET_MEMBER(mType, GpuProgramType, GpuProgram);
-		CM_SETGET_MEMBER(mNeedsAdjacencyInfo, bool, GpuProgram);
-		CM_SETGET_MEMBER(mEntryPoint, String, GpuProgram);
-		CM_SETGET_MEMBER(mProfile, GpuProgramProfile, GpuProgram);
-		CM_SETGET_MEMBER(mSource, String, GpuProgram);
+		BS_SETGET_MEMBER(mType, GpuProgramType, GpuProgram);
+		BS_SETGET_MEMBER(mNeedsAdjacencyInfo, bool, GpuProgram);
+		BS_SETGET_MEMBER(mEntryPoint, String, GpuProgram);
+		BS_SETGET_MEMBER(mProfile, GpuProgramProfile, GpuProgram);
+		BS_SETGET_MEMBER(mSource, String, GpuProgram);
 
 
 	public:
 	public:
 		GpuProgramRTTI()
 		GpuProgramRTTI()
 		{
 		{
-			CM_ADD_PLAINFIELD(mSize, 0, GpuProgramRTTI)
+			BS_ADD_PLAINFIELD(mSize, 0, GpuProgramRTTI)
 
 
-			CM_ADD_PLAINFIELD(mType, 2, GpuProgramRTTI)
-			CM_ADD_PLAINFIELD(mNeedsAdjacencyInfo, 3, GpuProgramRTTI)
-			CM_ADD_PLAINFIELD(mEntryPoint, 4, GpuProgramRTTI)
-			CM_ADD_PLAINFIELD(mProfile, 5, GpuProgramRTTI)
-			CM_ADD_PLAINFIELD(mSource, 6, GpuProgramRTTI)
+			BS_ADD_PLAINFIELD(mType, 2, GpuProgramRTTI)
+			BS_ADD_PLAINFIELD(mNeedsAdjacencyInfo, 3, GpuProgramRTTI)
+			BS_ADD_PLAINFIELD(mEntryPoint, 4, GpuProgramRTTI)
+			BS_ADD_PLAINFIELD(mProfile, 5, GpuProgramRTTI)
+			BS_ADD_PLAINFIELD(mSource, 6, GpuProgramRTTI)
 		}
 		}
 
 
 		virtual void onDeserializationEnded(IReflectable* obj)
 		virtual void onDeserializationEnded(IReflectable* obj)
@@ -48,7 +48,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			CM_EXCEPT(InternalErrorException, "Cannot instantiate abstract class!"); // TODO - Need to initialize this properly
+			BS_EXCEPT(InternalErrorException, "Cannot instantiate abstract class!"); // TODO - Need to initialize this properly
 		}
 		}
 	};
 	};
 }
 }

+ 1 - 1
BansheeCore/Include/CmGpuResourceDataRTTI.h

@@ -27,7 +27,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			CM_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
 		}
 		}
 	};
 	};
 }
 }

+ 1 - 1
BansheeCore/Include/CmGpuResourceRTTI.h

@@ -27,7 +27,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			CM_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
 		}
 		}
 	};
 	};
 }
 }

+ 1 - 1
BansheeCore/Include/CmImportOptionsRTTI.h

@@ -26,7 +26,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			return cm_shared_ptr<ImportOptions, PoolAlloc>();
+			return bs_shared_ptr<ImportOptions, PoolAlloc>();
 		}
 		}
 	};
 	};
 }
 }

+ 1 - 1
BansheeCore/Include/CmMaterial.h

@@ -64,7 +64,7 @@ namespace BansheeEngine
 			StructData(UINT32 _size)
 			StructData(UINT32 _size)
 				:size(_size)
 				:size(_size)
 			{
 			{
-				data = std::shared_ptr<void>(cm_alloc<ScratchAlloc>(_size), &cm_free<ScratchAlloc>);
+				data = std::shared_ptr<void>(bs_alloc<ScratchAlloc>(_size), &bs_free<ScratchAlloc>);
 			}
 			}
 
 
 			/**
 			/**

+ 10 - 10
BansheeCore/Include/CmMaterialRTTI.h

@@ -176,7 +176,7 @@ namespace BansheeEngine
 		virtual UINT32 getRTTIId() { return TID_MaterialParamFloat; }
 		virtual UINT32 getRTTIId() { return TID_MaterialParamFloat; }
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		{ 
 		{ 
-			return cm_shared_ptr<MaterialFloatParam, ScratchAlloc>(); 
+			return bs_shared_ptr<MaterialFloatParam, ScratchAlloc>(); 
 		}
 		}
 	};
 	};
 
 
@@ -208,7 +208,7 @@ namespace BansheeEngine
 		virtual UINT32 getRTTIId() { return TID_MaterialParamVec2; }
 		virtual UINT32 getRTTIId() { return TID_MaterialParamVec2; }
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		{ 
 		{ 
-			return cm_shared_ptr<MaterialVec2Param, ScratchAlloc>(); 
+			return bs_shared_ptr<MaterialVec2Param, ScratchAlloc>(); 
 		}
 		}
 	};
 	};
 
 
@@ -240,7 +240,7 @@ namespace BansheeEngine
 		virtual UINT32 getRTTIId() { return TID_MaterialParamVec3; }
 		virtual UINT32 getRTTIId() { return TID_MaterialParamVec3; }
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		{ 
 		{ 
-			return cm_shared_ptr<MaterialVec3Param, ScratchAlloc>(); 
+			return bs_shared_ptr<MaterialVec3Param, ScratchAlloc>(); 
 		}
 		}
 	};
 	};
 
 
@@ -272,7 +272,7 @@ namespace BansheeEngine
 		virtual UINT32 getRTTIId() { return TID_MaterialParamVec4; }
 		virtual UINT32 getRTTIId() { return TID_MaterialParamVec4; }
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		{
 		{
-			return cm_shared_ptr<MaterialVec4Param, ScratchAlloc>();
+			return bs_shared_ptr<MaterialVec4Param, ScratchAlloc>();
 		}
 		}
 	};
 	};
 
 
@@ -304,7 +304,7 @@ namespace BansheeEngine
 		virtual UINT32 getRTTIId() { return TID_MaterialParamMat3; }
 		virtual UINT32 getRTTIId() { return TID_MaterialParamMat3; }
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		{ 
 		{ 
-			return cm_shared_ptr<MaterialMat3Param, ScratchAlloc>();
+			return bs_shared_ptr<MaterialMat3Param, ScratchAlloc>();
 		}
 		}
 	};
 	};
 
 
@@ -336,7 +336,7 @@ namespace BansheeEngine
 		virtual UINT32 getRTTIId() { return TID_MaterialParamMat4; }
 		virtual UINT32 getRTTIId() { return TID_MaterialParamMat4; }
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		{ 
 		{ 
-			return cm_shared_ptr<MaterialMat4Param, ScratchAlloc>();
+			return bs_shared_ptr<MaterialMat4Param, ScratchAlloc>();
 		}
 		}
 	};
 	};
 
 
@@ -386,7 +386,7 @@ namespace BansheeEngine
 		virtual UINT32 getRTTIId() { return TID_MaterialParamStruct; }
 		virtual UINT32 getRTTIId() { return TID_MaterialParamStruct; }
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		{ 
 		{ 
-			return cm_shared_ptr<MaterialStructParam, ScratchAlloc>();
+			return bs_shared_ptr<MaterialStructParam, ScratchAlloc>();
 		}
 		}
 	};
 	};
 
 
@@ -414,7 +414,7 @@ namespace BansheeEngine
 		virtual UINT32 getRTTIId() { return TID_MaterialParamTexture; }
 		virtual UINT32 getRTTIId() { return TID_MaterialParamTexture; }
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		{ 
 		{ 
-			return cm_shared_ptr<MaterialTextureParam, ScratchAlloc>();
+			return bs_shared_ptr<MaterialTextureParam, ScratchAlloc>();
 		}
 		}
 	};
 	};
 
 
@@ -442,7 +442,7 @@ namespace BansheeEngine
 		virtual UINT32 getRTTIId() { return TID_MaterialParamSamplerState; }
 		virtual UINT32 getRTTIId() { return TID_MaterialParamSamplerState; }
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		{ 
 		{ 
-			return cm_shared_ptr<MaterialSamplerStateParam, ScratchAlloc>();
+			return bs_shared_ptr<MaterialSamplerStateParam, ScratchAlloc>();
 		}
 		}
 	};
 	};
 
 
@@ -533,7 +533,7 @@ namespace BansheeEngine
 		virtual UINT32 getRTTIId() { return TID_MaterialParams; }
 		virtual UINT32 getRTTIId() { return TID_MaterialParams; }
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		{ 
 		{ 
-			return cm_shared_ptr<MaterialParams, ScratchAlloc>();
+			return bs_shared_ptr<MaterialParams, ScratchAlloc>();
 		}
 		}
 	};
 	};
 
 

+ 2 - 2
BansheeCore/Include/CmMeshBaseRTTI.h

@@ -8,7 +8,7 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-	CM_ALLOW_MEMCPY_SERIALIZATION(SubMesh);
+	BS_ALLOW_MEMCPY_SERIALIZATION(SubMesh);
 
 
 	class MeshBaseRTTI : public RTTIType<MeshBase, GpuResource, MeshBaseRTTI>
 	class MeshBaseRTTI : public RTTIType<MeshBase, GpuResource, MeshBaseRTTI>
 	{
 	{
@@ -40,7 +40,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		{
 		{
-			CM_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
 		}
 		}
 
 
 		virtual const String& getRTTIName() 
 		virtual const String& getRTTIName() 

+ 2 - 2
BansheeCore/Include/CmMeshData.h

@@ -62,10 +62,10 @@ namespace BansheeEngine
 		 */
 		 */
 		bool moveNext()
 		bool moveNext()
 		{
 		{
-#ifdef CM_DEBUG_MODE
+#ifdef BS_DEBUG_MODE
 			if(mData >= mEnd)
 			if(mData >= mEnd)
 			{
 			{
-				CM_EXCEPT(InternalErrorException, "Vertex element iterator out of buffer bounds.");
+				BS_EXCEPT(InternalErrorException, "Vertex element iterator out of buffer bounds.");
 			}
 			}
 #endif
 #endif
 
 

+ 2 - 2
BansheeCore/Include/CmMeshDataRTTI.h

@@ -8,7 +8,7 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-	CM_ALLOW_MEMCPY_SERIALIZATION(IndexBuffer::IndexType);
+	BS_ALLOW_MEMCPY_SERIALIZATION(IndexBuffer::IndexType);
 
 
 	class BS_CORE_EXPORT MeshDataRTTI : public RTTIType<MeshData, GpuResourceData, MeshDataRTTI>
 	class BS_CORE_EXPORT MeshDataRTTI : public RTTIType<MeshData, GpuResourceData, MeshDataRTTI>
 	{
 	{
@@ -58,7 +58,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		{
 		{
-			return cm_shared_ptr<MeshData, PoolAlloc>(new (cm_alloc<MeshData, PoolAlloc>()) MeshData());
+			return bs_shared_ptr<MeshData, PoolAlloc>(new (bs_alloc<MeshData, PoolAlloc>()) MeshData());
 		}
 		}
 
 
 		virtual const String& getRTTIName() 
 		virtual const String& getRTTIName() 

+ 1 - 1
BansheeCore/Include/CmOSInputHandler.h

@@ -96,7 +96,7 @@ namespace BansheeEngine
 		virtual void _inputWindowChanged(const RenderWindow& win) {}
 		virtual void _inputWindowChanged(const RenderWindow& win) {}
 
 
 	private:
 	private:
-		CM_MUTEX(mOSInputMutex);
+		BS_MUTEX(mOSInputMutex);
 		Vector2I mLastCursorPos;
 		Vector2I mLastCursorPos;
 		Vector2I mCursorPosition;
 		Vector2I mCursorPosition;
 		float mMouseScroll;
 		float mMouseScroll;

+ 1 - 1
BansheeCore/Include/CmPassRTTI.h

@@ -63,7 +63,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			return cm_shared_ptr<Pass, PoolAlloc>();
+			return bs_shared_ptr<Pass, PoolAlloc>();
 		}
 		}
 	};
 	};
 }
 }

+ 1 - 1
BansheeCore/Include/CmPixelDataRTTI.h

@@ -84,7 +84,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			PixelDataPtr newPixelData = cm_shared_ptr<PixelData, PoolAlloc>();
+			PixelDataPtr newPixelData = bs_shared_ptr<PixelData, PoolAlloc>();
 
 
 			return newPixelData;
 			return newPixelData;
 		}
 		}

+ 3 - 3
BansheeCore/Include/CmPlatform.h

@@ -180,10 +180,10 @@ namespace BansheeEngine
 }
 }
 
 
 // Bring in the specific platform's header file
 // Bring in the specific platform's header file
-#if CM_PLATFORM == CM_PLATFORM_WIN32
+#if BS_PLATFORM == BS_PLATFORM_WIN32
 # include "Win32/CmPlatformImpl.h"
 # include "Win32/CmPlatformImpl.h"
-#elif (CM_PLATFORM == CM_PLATFORM_LINUX)
+#elif (BS_PLATFORM == BS_PLATFORM_LINUX)
 # include "GLX/CmPlatformImpl.h"
 # include "GLX/CmPlatformImpl.h"
-#elif CM_PLATFORM == CM_PLATFORM_APPLE
+#elif BS_PLATFORM == BS_PLATFORM_APPLE
 # include "OSX/CmPlatformImpl.h"
 # include "OSX/CmPlatformImpl.h"
 #endif
 #endif

+ 12 - 12
BansheeCore/Include/CmPrerequisites.h

@@ -2,15 +2,15 @@
 
 
 #include "CmPrerequisitesUtil.h"
 #include "CmPrerequisitesUtil.h"
 
 
-#define CM_MAX_MULTIPLE_RENDER_TARGETS 8
-#define CM_FORCE_SINGLETHREADED_RENDERING 0
+#define BS_MAX_MULTIPLE_RENDER_TARGETS 8
+#define BS_FORCE_SINGLETHREADED_RENDERING 0
 
 
 // Windows Settings
 // Windows Settings
-#if CM_PLATFORM == CM_PLATFORM_WIN32
+#if BS_PLATFORM == BS_PLATFORM_WIN32
 
 
 // If we're not including this from a client build, specify that the stuff
 // If we're not including this from a client build, specify that the stuff
 // should get exported. Otherwise, import it.
 // should get exported. Otherwise, import it.
-#	if defined(CM_STATIC_LIB)
+#	if defined(BS_STATIC_LIB)
 // Linux compilers don't have symbol import/export directives.
 // Linux compilers don't have symbol import/export directives.
 #   	define BS_CORE_EXPORT
 #   	define BS_CORE_EXPORT
 #   else
 #   else
@@ -27,32 +27,32 @@
 // Win32 compilers use _DEBUG for specifying debug builds.
 // Win32 compilers use _DEBUG for specifying debug builds.
 // for MinGW, we set DEBUG
 // for MinGW, we set DEBUG
 #   if defined(_DEBUG) || defined(DEBUG)
 #   if defined(_DEBUG) || defined(DEBUG)
-#       define CM_DEBUG_MODE 1
+#       define BS_DEBUG_MODE 1
 #   else
 #   else
-#       define CM_DEBUG_MODE 0
+#       define BS_DEBUG_MODE 0
 #   endif
 #   endif
 
 
 #endif
 #endif
 
 
 // Linux/Apple Settings
 // Linux/Apple Settings
-#if CM_PLATFORM == CM_PLATFORM_LINUX || CM_PLATFORM == CM_PLATFORM_APPLE
+#if BS_PLATFORM == BS_PLATFORM_LINUX || BS_PLATFORM == BS_PLATFORM_APPLE
 
 
 // Enable GCC symbol visibility
 // Enable GCC symbol visibility
-#   if defined( CM_GCC_VISIBILITY )
+#   if defined( BS_GCC_VISIBILITY )
 #       define BS_CORE_EXPORT  __attribute__ ((visibility("default")))
 #       define BS_CORE_EXPORT  __attribute__ ((visibility("default")))
-#       define CM_HIDDEN __attribute__ ((visibility("hidden")))
+#       define BS_HIDDEN __attribute__ ((visibility("hidden")))
 #   else
 #   else
 #       define BS_CORE_EXPORT
 #       define BS_CORE_EXPORT
-#       define CM_HIDDEN
+#       define BS_HIDDEN
 #   endif
 #   endif
 
 
 // A quick define to overcome different names for the same function
 // A quick define to overcome different names for the same function
 #   define stricmp strcasecmp
 #   define stricmp strcasecmp
 
 
 #   ifdef DEBUG
 #   ifdef DEBUG
-#       define CM_DEBUG_MODE 1
+#       define BS_DEBUG_MODE 1
 #   else
 #   else
-#       define CM_DEBUG_MODE 0
+#       define BS_DEBUG_MODE 0
 #   endif
 #   endif
 
 
 #endif
 #endif

+ 7 - 7
BansheeCore/Include/CmProfiler.h

@@ -45,7 +45,7 @@ namespace BansheeEngine
 		 */
 		 */
 		void beginThread(const ProfilerString& name) 
 		void beginThread(const ProfilerString& name) 
 		{ 
 		{ 
-#if CM_PROFILING_ENABLED
+#if BS_PROFILING_ENABLED
 			mCPUProfiler->beginThread(name); 
 			mCPUProfiler->beginThread(name); 
 #endif
 #endif
 		}
 		}
@@ -55,7 +55,7 @@ namespace BansheeEngine
 		 */
 		 */
 		void endThread() 
 		void endThread() 
 		{ 
 		{ 
-#if CM_PROFILING_ENABLED
+#if BS_PROFILING_ENABLED
 			mCPUProfiler->endThread(); 
 			mCPUProfiler->endThread(); 
 #endif
 #endif
 		}
 		}
@@ -65,7 +65,7 @@ namespace BansheeEngine
 		 */
 		 */
 		void beginSample(const ProfilerString& name) 
 		void beginSample(const ProfilerString& name) 
 		{ 
 		{ 
-#if CM_PROFILING_ENABLED
+#if BS_PROFILING_ENABLED
 			mCPUProfiler->beginSample(name); 
 			mCPUProfiler->beginSample(name); 
 #endif
 #endif
 		}
 		}
@@ -75,7 +75,7 @@ namespace BansheeEngine
 		 */
 		 */
 		void endSample(const ProfilerString& name) 
 		void endSample(const ProfilerString& name) 
 		{ 
 		{ 
-#if CM_PROFILING_ENABLED
+#if BS_PROFILING_ENABLED
 			mCPUProfiler->endSample(name); 
 			mCPUProfiler->endSample(name); 
 #endif
 #endif
 		}
 		}
@@ -85,7 +85,7 @@ namespace BansheeEngine
 		 */
 		 */
 		void beginSamplePrecise(const ProfilerString& name) 
 		void beginSamplePrecise(const ProfilerString& name) 
 		{ 
 		{ 
-#if CM_PROFILING_ENABLED
+#if BS_PROFILING_ENABLED
 			mCPUProfiler->beginSamplePrecise(name); 
 			mCPUProfiler->beginSamplePrecise(name); 
 #endif
 #endif
 		}
 		}
@@ -95,7 +95,7 @@ namespace BansheeEngine
 		 */
 		 */
 		void endSamplePrecise(const ProfilerString& name) 
 		void endSamplePrecise(const ProfilerString& name) 
 		{ 
 		{ 
-#if CM_PROFILING_ENABLED
+#if BS_PROFILING_ENABLED
 			mCPUProfiler->endSamplePrecise(name); 
 			mCPUProfiler->endSamplePrecise(name); 
 #endif
 #endif
 		}
 		}
@@ -136,7 +136,7 @@ namespace BansheeEngine
 
 
 		CPUProfiler* mCPUProfiler;
 		CPUProfiler* mCPUProfiler;
 
 
-		CM_MUTEX(mSync);
+		BS_MUTEX(mSync);
 	};
 	};
 
 
 	/**
 	/**

+ 1 - 1
BansheeCore/Include/CmRasterizerStateRTTI.h

@@ -7,7 +7,7 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-	CM_ALLOW_MEMCPY_SERIALIZATION(RASTERIZER_STATE_DESC);
+	BS_ALLOW_MEMCPY_SERIALIZATION(RASTERIZER_STATE_DESC);
 
 
 	class BS_CORE_EXPORT RasterizerStateRTTI : public RTTIType<RasterizerState, IReflectable, RasterizerStateRTTI>
 	class BS_CORE_EXPORT RasterizerStateRTTI : public RTTIType<RasterizerState, IReflectable, RasterizerStateRTTI>
 	{
 	{

+ 41 - 41
BansheeCore/Include/CmRenderSystemCapabilities.h

@@ -5,9 +5,9 @@
 #include "CmGpuProgram.h"
 #include "CmGpuProgram.h"
 
 
 #define CAPS_CATEGORY_SIZE 8i64
 #define CAPS_CATEGORY_SIZE 8i64
-#define CM_CAPS_BITSHIFT (64i64 - CAPS_CATEGORY_SIZE)
-#define CAPS_CATEGORY_MASK (((1i64 << CAPS_CATEGORY_SIZE) - 1i64) << CM_CAPS_BITSHIFT)
-#define CM_CAPS_VALUE(cat, val) ((cat << CM_CAPS_BITSHIFT) | (1i64 << val))
+#define BS_CAPS_BITSHIFT (64i64 - CAPS_CATEGORY_SIZE)
+#define CAPS_CATEGORY_MASK (((1i64 << CAPS_CATEGORY_SIZE) - 1i64) << BS_CAPS_BITSHIFT)
+#define BS_CAPS_VALUE(cat, val) ((cat << BS_CAPS_BITSHIFT) | (1i64 << val))
 
 
 #define MAX_BOUND_VERTEX_BUFFERS 32
 #define MAX_BOUND_VERTEX_BUFFERS 32
 
 
@@ -28,45 +28,45 @@ namespace BansheeEngine
 	 */
 	 */
 	enum Capabilities : UINT64
 	enum Capabilities : UINT64
 	{
 	{
-		RSC_AUTOMIPMAP				= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 0), /**< Supports generating mipmaps in hardware. */
-		RSC_ANISOTROPY				= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 1), /**< Supports anisotropic texture filtering. */
-		RSC_CUBEMAPPING				= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 2), /**< Supports cube mapping. */
-		RSC_TWO_SIDED_STENCIL		= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 3), /**< Supports separate stencil updates for both front and back faces. */
-		RSC_STENCIL_WRAP			= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 4), /**< Supports wrapping the stencil value at the range extremes. */
-		RSC_HWOCCLUSION				= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 5), /**< Supports hardware occlusion queries. */
-		RSC_USER_CLIP_PLANES		= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 6), /**< Supports user clipping planes. */
-		RSC_VERTEX_FORMAT_UBYTE4	= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 7), /**< Supports the VET_UBYTE4 vertex element type. */
-		RSC_INFINITE_FAR_PLANE		= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 8), /**< Supports infinite far plane projection. */
-		RSC_HWRENDER_TO_TEXTURE		= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 9), /**< Supports hardware render-to-texture. */
-		RSC_TEXTURE_FLOAT			= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 10), /**< Supports float textures and render targets. */
-		RSC_NON_POWER_OF_2_TEXTURES = CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 11), /**< Supports non-power of two textures. */
-		RSC_TEXTURE_3D				= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 12), /**< Supports 3d (volume) textures. */
-		RSC_POINT_SPRITES			= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 13), /**< Supports basic point sprite rendering. */
-
-		RSC_POINT_EXTENDED_PARAMETERS	= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 14), /**< Supports extra point parameters (minsize, maxsize, attenuation). */
-		RSC_VERTEX_TEXTURE_FETCH		= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 15), /**< Supports vertex texture fetch. */
-		RSC_MIPMAP_LOD_BIAS				= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 16), /**< Supports mipmap LOD biasing. */
-		RSC_GEOMETRY_PROGRAM			= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 17), /**< Supports hardware geometry programs. */
-
-		RSC_TEXTURE_COMPRESSION			= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 18), /**< Supports compressed textures. */
-		RSC_TEXTURE_COMPRESSION_DXT		= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 19), /**< Supports compressed textures in the DXT/ST3C formats. */
-		RSC_TEXTURE_COMPRESSION_VTC		= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 20), /**< Supports compressed textures in the VTC format. */
-		RSC_TEXTURE_COMPRESSION_PVRTC	= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 21), /**< Supports compressed textures in the PVRTC format. */
-		RSC_MRT_DIFFERENT_BIT_DEPTHS	= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 22), /**< Supports multiple render targets with different bit depths. */
-		RSC_ALPHA_TO_COVERAGE			= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 23), /**< Supports Alpha to Coverage. */
-		RSC_ADVANCED_BLEND_OPERATIONS	= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 24), /**< Supports blend operations like subtract, min, max. */
-		RSC_SHADER_SUBROUTINE			= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 25), /**< Supports dynamic shader linking. */
-		RSC_HWOCCLUSION_ASYNCHRONOUS	= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 26), /**< Support for async occlusion queries. */
-		RSC_HWRENDER_TO_VERTEX_BUFFER	= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 27), /**< Supports rendering to vertex buffers. */
-		RSC_TESSELLATION_PROGRAM		= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 28), /**< Supports hardware tessellation programs. */
-		RSC_COMPUTE_PROGRAM				= CM_CAPS_VALUE(CAPS_CATEGORY_COMMON, 29), /**< Supports hardware compute programs. */
+		RSC_AUTOMIPMAP				= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 0), /**< Supports generating mipmaps in hardware. */
+		RSC_ANISOTROPY				= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 1), /**< Supports anisotropic texture filtering. */
+		RSC_CUBEMAPPING				= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 2), /**< Supports cube mapping. */
+		RSC_TWO_SIDED_STENCIL		= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 3), /**< Supports separate stencil updates for both front and back faces. */
+		RSC_STENCIL_WRAP			= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 4), /**< Supports wrapping the stencil value at the range extremes. */
+		RSC_HWOCCLUSION				= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 5), /**< Supports hardware occlusion queries. */
+		RSC_USER_CLIP_PLANES		= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 6), /**< Supports user clipping planes. */
+		RSC_VERTEX_FORMAT_UBYTE4	= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 7), /**< Supports the VET_UBYTE4 vertex element type. */
+		RSC_INFINITE_FAR_PLANE		= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 8), /**< Supports infinite far plane projection. */
+		RSC_HWRENDER_TO_TEXTURE		= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 9), /**< Supports hardware render-to-texture. */
+		RSC_TEXTURE_FLOAT			= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 10), /**< Supports float textures and render targets. */
+		RSC_NON_POWER_OF_2_TEXTURES = BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 11), /**< Supports non-power of two textures. */
+		RSC_TEXTURE_3D				= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 12), /**< Supports 3d (volume) textures. */
+		RSC_POINT_SPRITES			= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 13), /**< Supports basic point sprite rendering. */
+
+		RSC_POINT_EXTENDED_PARAMETERS	= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 14), /**< Supports extra point parameters (minsize, maxsize, attenuation). */
+		RSC_VERTEX_TEXTURE_FETCH		= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 15), /**< Supports vertex texture fetch. */
+		RSC_MIPMAP_LOD_BIAS				= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 16), /**< Supports mipmap LOD biasing. */
+		RSC_GEOMETRY_PROGRAM			= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 17), /**< Supports hardware geometry programs. */
+
+		RSC_TEXTURE_COMPRESSION			= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 18), /**< Supports compressed textures. */
+		RSC_TEXTURE_COMPRESSION_DXT		= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 19), /**< Supports compressed textures in the DXT/ST3C formats. */
+		RSC_TEXTURE_COMPRESSION_VTC		= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 20), /**< Supports compressed textures in the VTC format. */
+		RSC_TEXTURE_COMPRESSION_PVRTC	= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 21), /**< Supports compressed textures in the PVRTC format. */
+		RSC_MRT_DIFFERENT_BIT_DEPTHS	= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 22), /**< Supports multiple render targets with different bit depths. */
+		RSC_ALPHA_TO_COVERAGE			= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 23), /**< Supports Alpha to Coverage. */
+		RSC_ADVANCED_BLEND_OPERATIONS	= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 24), /**< Supports blend operations like subtract, min, max. */
+		RSC_SHADER_SUBROUTINE			= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 25), /**< Supports dynamic shader linking. */
+		RSC_HWOCCLUSION_ASYNCHRONOUS	= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 26), /**< Support for async occlusion queries. */
+		RSC_HWRENDER_TO_VERTEX_BUFFER	= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 27), /**< Supports rendering to vertex buffers. */
+		RSC_TESSELLATION_PROGRAM		= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 28), /**< Supports hardware tessellation programs. */
+		RSC_COMPUTE_PROGRAM				= BS_CAPS_VALUE(CAPS_CATEGORY_COMMON, 29), /**< Supports hardware compute programs. */
 
 
 		// ***** DirectX 9 specific caps *****
 		// ***** DirectX 9 specific caps *****
-		RSC_PERSTAGECONSTANT = CM_CAPS_VALUE(CAPS_CATEGORY_D3D9, 0), /**< Are per stage constants supported. */
+		RSC_PERSTAGECONSTANT = BS_CAPS_VALUE(CAPS_CATEGORY_D3D9, 0), /**< Are per stage constants supported. */
 
 
 		// ***** GL Specific caps *****
 		// ***** GL Specific caps *****
-		RSC_FBO              = CM_CAPS_VALUE(CAPS_CATEGORY_GL, 0), /**< Support for Frame Buffer Objects. */
-		RSC_PBUFFER			 = CM_CAPS_VALUE(CAPS_CATEGORY_GL, 1), /**< Support for PBuffers. */
+		RSC_FBO              = BS_CAPS_VALUE(CAPS_CATEGORY_GL, 0), /**< Support for Frame Buffer Objects. */
+		RSC_PBUFFER			 = BS_CAPS_VALUE(CAPS_CATEGORY_GL, 1), /**< Support for PBuffers. */
 	};
 	};
 
 
 	/**
 	/**
@@ -311,7 +311,7 @@ namespace BansheeEngine
 		 */
 		 */
 		void setCapability(const Capabilities c) 
 		void setCapability(const Capabilities c) 
 		{ 
 		{ 
-			UINT64 index = (CAPS_CATEGORY_MASK & c) >> CM_CAPS_BITSHIFT;
+			UINT64 index = (CAPS_CATEGORY_MASK & c) >> BS_CAPS_BITSHIFT;
 			mCapabilities[index] |= (c & ~CAPS_CATEGORY_MASK);
 			mCapabilities[index] |= (c & ~CAPS_CATEGORY_MASK);
 		}
 		}
 
 
@@ -321,7 +321,7 @@ namespace BansheeEngine
 		 */
 		 */
 		void unsetCapability(const Capabilities c) 
 		void unsetCapability(const Capabilities c) 
 		{ 
 		{ 
-			UINT64 index = (CAPS_CATEGORY_MASK & c) >> CM_CAPS_BITSHIFT;
+			UINT64 index = (CAPS_CATEGORY_MASK & c) >> BS_CAPS_BITSHIFT;
 			mCapabilities[index] &= (~c | CAPS_CATEGORY_MASK);
 			mCapabilities[index] &= (~c | CAPS_CATEGORY_MASK);
 		}
 		}
 
 
@@ -330,7 +330,7 @@ namespace BansheeEngine
 		 */
 		 */
 		bool hasCapability(const Capabilities c) const
 		bool hasCapability(const Capabilities c) const
 		{
 		{
-			UINT64 index = (CAPS_CATEGORY_MASK & c) >> CM_CAPS_BITSHIFT;
+			UINT64 index = (CAPS_CATEGORY_MASK & c) >> BS_CAPS_BITSHIFT;
 
 
 			return (mCapabilities[index] & (c & ~CAPS_CATEGORY_MASK)) != 0;
 			return (mCapabilities[index] & (c & ~CAPS_CATEGORY_MASK)) != 0;
 		}
 		}

+ 1 - 1
BansheeCore/Include/CmRenderWindowManager.h

@@ -73,7 +73,7 @@ namespace BansheeEngine
 		void windowMovedOrResized(RenderWindow* window);
 		void windowMovedOrResized(RenderWindow* window);
 
 
 	protected:
 	protected:
-		CM_MUTEX(mWindowMutex);
+		BS_MUTEX(mWindowMutex);
 		Vector<RenderWindow*> mCreatedWindows;
 		Vector<RenderWindow*> mCreatedWindows;
 
 
 		RenderWindow* mWindowInFocus;
 		RenderWindow* mWindowInFocus;

+ 5 - 5
BansheeCore/Include/CmResourceHandle.h

@@ -69,8 +69,8 @@ namespace BansheeEngine
 	private:
 	private:
 		friend class Resources;
 		friend class Resources;
 
 
-		CM_STATIC_THREAD_SYNCHRONISER(mResourceCreatedCondition)
-		CM_STATIC_MUTEX(mResourceCreatedMutex)
+		BS_STATIC_THREAD_SYNCHRONISER(mResourceCreatedCondition)
+		BS_STATIC_MUTEX(mResourceCreatedMutex)
 
 
 	protected:
 	protected:
 		inline void throwIfNotLoaded() const;
 		inline void throwIfNotLoaded() const;
@@ -107,7 +107,7 @@ namespace BansheeEngine
 		ResourceHandle(const String& uuid)
 		ResourceHandle(const String& uuid)
 			:ResourceHandleBase()
 			:ResourceHandleBase()
 		{
 		{
-			mData = cm_shared_ptr<ResourceHandleData, PoolAlloc>();
+			mData = bs_shared_ptr<ResourceHandleData, PoolAlloc>();
 			mData->mUUID = uuid;
 			mData->mUUID = uuid;
 		}
 		}
 
 
@@ -206,7 +206,7 @@ namespace BansheeEngine
 		explicit ResourceHandle(T* ptr, const String& uuid)
 		explicit ResourceHandle(T* ptr, const String& uuid)
 			:ResourceHandleBase()
 			:ResourceHandleBase()
 		{
 		{
-			mData = cm_shared_ptr<ResourceHandleData, PoolAlloc>();
+			mData = bs_shared_ptr<ResourceHandleData, PoolAlloc>();
 			_setHandleData(std::shared_ptr<Resource>(ptr, uuid));
 			_setHandleData(std::shared_ptr<Resource>(ptr, uuid));
 		}
 		}
 
 
@@ -216,7 +216,7 @@ namespace BansheeEngine
 		ResourceHandle(std::shared_ptr<T> ptr, const String& uuid)
 		ResourceHandle(std::shared_ptr<T> ptr, const String& uuid)
 			:ResourceHandleBase()
 			:ResourceHandleBase()
 		{
 		{
-			mData = cm_shared_ptr<ResourceHandleData, PoolAlloc>();
+			mData = bs_shared_ptr<ResourceHandleData, PoolAlloc>();
 			_setHandleData(ptr, uuid);
 			_setHandleData(ptr, uuid);
 		}
 		}
 	};
 	};

+ 2 - 2
BansheeCore/Include/CmResourceHandleRTTI.h

@@ -52,8 +52,8 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			std::shared_ptr<ResourceHandleBase> obj = cm_shared_ptr<ResourceHandleBase, PoolAlloc>(new (cm_alloc<ResourceHandleBase, PoolAlloc>()) ResourceHandleBase());
-			obj->mData = cm_shared_ptr<ResourceHandleData>();
+			std::shared_ptr<ResourceHandleBase> obj = bs_shared_ptr<ResourceHandleBase, PoolAlloc>(new (bs_alloc<ResourceHandleBase, PoolAlloc>()) ResourceHandleBase());
+			obj->mData = bs_shared_ptr<ResourceHandleData>();
 
 
 			return obj;
 			return obj;
 		}
 		}

+ 1 - 1
BansheeCore/Include/CmResourceRTTI.h

@@ -35,7 +35,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			CM_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
 		}
 		}
 	};
 	};
 }
 }

+ 2 - 2
BansheeCore/Include/CmResources.h

@@ -148,8 +148,8 @@ namespace BansheeEngine
 		Vector<ResourceManifestPtr> mResourceManifests;
 		Vector<ResourceManifestPtr> mResourceManifests;
 		ResourceManifestPtr mDefaultResourceManifest;
 		ResourceManifestPtr mDefaultResourceManifest;
 
 
-		CM_MUTEX(mInProgressResourcesMutex);
-		CM_MUTEX(mLoadedResourceMutex);
+		BS_MUTEX(mInProgressResourcesMutex);
+		BS_MUTEX(mLoadedResourceMutex);
 
 
 		UnorderedMap<String, HResource> mLoadedResources;
 		UnorderedMap<String, HResource> mLoadedResources;
 		UnorderedMap<String, HResource> mInProgressResources; // Resources that are being asynchronously loaded
 		UnorderedMap<String, HResource> mInProgressResources; // Resources that are being asynchronously loaded

+ 1 - 1
BansheeCore/Include/CmSamplerStateRTTI.h

@@ -7,7 +7,7 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-	CM_ALLOW_MEMCPY_SERIALIZATION(SAMPLER_STATE_DESC);
+	BS_ALLOW_MEMCPY_SERIALIZATION(SAMPLER_STATE_DESC);
 
 
 	class BS_CORE_EXPORT SamplerStateRTTI : public RTTIType<SamplerState, IReflectable, SamplerStateRTTI>
 	class BS_CORE_EXPORT SamplerStateRTTI : public RTTIType<SamplerState, IReflectable, SamplerStateRTTI>
 	{
 	{

+ 3 - 3
BansheeCore/Include/CmSceneObject.h

@@ -304,9 +304,9 @@ namespace BansheeEngine
 			static_assert((std::is_base_of<BansheeEngine::Component, T>::value),
 			static_assert((std::is_base_of<BansheeEngine::Component, T>::value),
 				"Specified type is not a valid Component.");
 				"Specified type is not a valid Component.");
 
 
-			std::shared_ptr<T> gameObject(new (cm_alloc<T, PoolAlloc>()) T(mThisHandle,
+			std::shared_ptr<T> gameObject(new (bs_alloc<T, PoolAlloc>()) T(mThisHandle,
 				std::forward<Args>(args)...),
 				std::forward<Args>(args)...),
-				&cm_delete<PoolAlloc, T>, StdAlloc<PoolAlloc>());
+				&bs_delete<PoolAlloc, T>, StdAlloc<PoolAlloc>());
 
 
 			GameObjectHandle<T> newComponent =
 			GameObjectHandle<T> newComponent =
 				GameObjectHandle<T>(GameObjectManager::instance().registerObject(gameObject));
 				GameObjectHandle<T>(GameObjectManager::instance().registerObject(gameObject));
@@ -397,7 +397,7 @@ namespace BansheeEngine
 		{
 		{
 			static_assert((std::is_base_of<BansheeEngine::Component, T>::value), "Specified type is not a valid Component.");
 			static_assert((std::is_base_of<BansheeEngine::Component, T>::value), "Specified type is not a valid Component.");
 
 
-			std::shared_ptr<T> gameObject(new (cm_alloc<T, PoolAlloc>()) T(), &cm_delete<PoolAlloc, T>, StdAlloc<PoolAlloc>());
+			std::shared_ptr<T> gameObject(new (bs_alloc<T, PoolAlloc>()) T(), &bs_delete<PoolAlloc, T>, StdAlloc<PoolAlloc>());
 			GameObjectHandle<T>(GameObjectManager::instance().registerObject(gameObject));
 			GameObjectHandle<T>(GameObjectManager::instance().registerObject(gameObject));
 
 
 			return gameObject;
 			return gameObject;

+ 6 - 6
BansheeCore/Include/CmShaderRTTI.h

@@ -48,10 +48,10 @@ namespace BansheeEngine
 			UINT64 dataSize = rttiGetElemSize(data.arraySize) + rttiGetElemSize(data.hidden) + rttiGetElemSize(data.type) + 
 			UINT64 dataSize = rttiGetElemSize(data.arraySize) + rttiGetElemSize(data.hidden) + rttiGetElemSize(data.type) + 
 				rttiGetElemSize(data.name) + rttiGetElemSize(data.gpuVariableName) + rttiGetElemSize(data.elementSize) + sizeof(UINT32);
 				rttiGetElemSize(data.name) + rttiGetElemSize(data.gpuVariableName) + rttiGetElemSize(data.elementSize) + sizeof(UINT32);
 
 
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 			if(dataSize > std::numeric_limits<UINT32>::max())
 			if(dataSize > std::numeric_limits<UINT32>::max())
 			{
 			{
-				CM_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
+				BS_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
 			}
 			}
 #endif
 #endif
 
 
@@ -96,10 +96,10 @@ namespace BansheeEngine
 			UINT64 dataSize = rttiGetElemSize(data.hidden) + rttiGetElemSize(data.type) + 
 			UINT64 dataSize = rttiGetElemSize(data.hidden) + rttiGetElemSize(data.type) + 
 				rttiGetElemSize(data.name) + rttiGetElemSize(data.gpuVariableName) + sizeof(UINT32);
 				rttiGetElemSize(data.name) + rttiGetElemSize(data.gpuVariableName) + sizeof(UINT32);
 
 
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 			if(dataSize > std::numeric_limits<UINT32>::max())
 			if(dataSize > std::numeric_limits<UINT32>::max())
 			{
 			{
-				CM_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
+				BS_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
 			}
 			}
 #endif
 #endif
 
 
@@ -142,10 +142,10 @@ namespace BansheeEngine
 			UINT64 dataSize = rttiGetElemSize(data.shared) + rttiGetElemSize(data.usage) + 
 			UINT64 dataSize = rttiGetElemSize(data.shared) + rttiGetElemSize(data.usage) + 
 				rttiGetElemSize(data.name) + sizeof(UINT32);
 				rttiGetElemSize(data.name) + sizeof(UINT32);
 
 
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 			if(dataSize > std::numeric_limits<UINT32>::max())
 			if(dataSize > std::numeric_limits<UINT32>::max())
 			{
 			{
-				CM_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
+				BS_EXCEPT(InternalErrorException, "Data overflow! Size doesn't fit into 32 bits.");
 			}
 			}
 #endif
 #endif
 
 

+ 1 - 1
BansheeCore/Include/CmTechniqueRTTI.h

@@ -57,7 +57,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		virtual std::shared_ptr<IReflectable> newRTTIObject()
 		{
 		{
-			return cm_shared_ptr<Technique, PoolAlloc>(new (cm_alloc<Technique, PoolAlloc>()) Technique());
+			return bs_shared_ptr<Technique, PoolAlloc>(new (bs_alloc<Technique, PoolAlloc>()) Technique());
 		}
 		}
 	};
 	};
 }
 }

+ 10 - 10
BansheeCore/Include/CmTextData.h

@@ -312,19 +312,19 @@ namespace BansheeEngine
 
 
 		// Static buffers used to reduce runtime memory allocation
 		// Static buffers used to reduce runtime memory allocation
 	private:
 	private:
-		static CM_THREADLOCAL bool BuffersInitialized;
+		static BS_THREADLOCAL bool BuffersInitialized;
 
 
-		static CM_THREADLOCAL TextWord* WordBuffer;
-		static CM_THREADLOCAL UINT32 WordBufferSize;
-		static CM_THREADLOCAL UINT32 NextFreeWord;
+		static BS_THREADLOCAL TextWord* WordBuffer;
+		static BS_THREADLOCAL UINT32 WordBufferSize;
+		static BS_THREADLOCAL UINT32 NextFreeWord;
 
 
-		static CM_THREADLOCAL TextLine* LineBuffer;
-		static CM_THREADLOCAL UINT32 LineBufferSize;
-		static CM_THREADLOCAL UINT32 NextFreeLine;
+		static BS_THREADLOCAL TextLine* LineBuffer;
+		static BS_THREADLOCAL UINT32 LineBufferSize;
+		static BS_THREADLOCAL UINT32 NextFreeLine;
 
 
-		static CM_THREADLOCAL PageInfo* PageBuffer;
-		static CM_THREADLOCAL UINT32 PageBufferSize;
-		static CM_THREADLOCAL UINT32 NextFreePageInfo;
+		static BS_THREADLOCAL PageInfo* PageBuffer;
+		static BS_THREADLOCAL UINT32 PageBufferSize;
+		static BS_THREADLOCAL UINT32 NextFreePageInfo;
 
 
 		/**
 		/**
 		 * @brief	Allocates an initial set of buffers that will be reused while parsing
 		 * @brief	Allocates an initial set of buffers that will be reused while parsing

+ 24 - 24
BansheeCore/Include/CmTextureRTTI.h

@@ -16,17 +16,17 @@ namespace BansheeEngine
 	class BS_CORE_EXPORT TextureRTTI : public RTTIType<Texture, Resource, TextureRTTI>
 	class BS_CORE_EXPORT TextureRTTI : public RTTIType<Texture, Resource, TextureRTTI>
 	{
 	{
 	private:
 	private:
-		CM_SETGET_MEMBER(mSize, UINT32, Texture)
-		CM_SETGET_MEMBER(mHeight, UINT32, Texture)
-		CM_SETGET_MEMBER(mWidth, UINT32, Texture)
-		CM_SETGET_MEMBER(mDepth, UINT32, Texture)
-		CM_SETGET_MEMBER(mNumMipmaps, UINT32, Texture)
-		CM_SETGET_MEMBER(mHwGamma, bool, Texture)
-		CM_SETGET_MEMBER(mMultisampleCount, UINT32, Texture)
-		CM_SETGET_MEMBER(mMultisampleHint, String, Texture)
-		CM_SETGET_MEMBER(mTextureType, TextureType, Texture)
-		CM_SETGET_MEMBER(mFormat, PixelFormat, Texture)
-		CM_SETGET_MEMBER(mUsage, INT32, Texture)
+		BS_SETGET_MEMBER(mSize, UINT32, Texture)
+		BS_SETGET_MEMBER(mHeight, UINT32, Texture)
+		BS_SETGET_MEMBER(mWidth, UINT32, Texture)
+		BS_SETGET_MEMBER(mDepth, UINT32, Texture)
+		BS_SETGET_MEMBER(mNumMipmaps, UINT32, Texture)
+		BS_SETGET_MEMBER(mHwGamma, bool, Texture)
+		BS_SETGET_MEMBER(mMultisampleCount, UINT32, Texture)
+		BS_SETGET_MEMBER(mMultisampleHint, String, Texture)
+		BS_SETGET_MEMBER(mTextureType, TextureType, Texture)
+		BS_SETGET_MEMBER(mFormat, PixelFormat, Texture)
+		BS_SETGET_MEMBER(mUsage, INT32, Texture)
 
 
 		PixelDataPtr getPixelData(Texture* obj, UINT32 idx)
 		PixelDataPtr getPixelData(Texture* obj, UINT32 idx)
 		{
 		{
@@ -69,17 +69,17 @@ namespace BansheeEngine
 	public:
 	public:
 		TextureRTTI()
 		TextureRTTI()
 		{
 		{
-			CM_ADD_PLAINFIELD(mSize, 0, TextureRTTI)
-			CM_ADD_PLAINFIELD(mHeight, 2, TextureRTTI)
-			CM_ADD_PLAINFIELD(mWidth, 3, TextureRTTI)
-			CM_ADD_PLAINFIELD(mDepth, 4, TextureRTTI)
-			CM_ADD_PLAINFIELD(mNumMipmaps, 5, TextureRTTI)
-			CM_ADD_PLAINFIELD(mHwGamma, 6, TextureRTTI)
-			CM_ADD_PLAINFIELD(mMultisampleCount, 7, TextureRTTI)
-			CM_ADD_PLAINFIELD(mMultisampleHint, 8, TextureRTTI)
-			CM_ADD_PLAINFIELD(mTextureType, 9, TextureRTTI)
-			CM_ADD_PLAINFIELD(mFormat, 10, TextureRTTI)
-			CM_ADD_PLAINFIELD(mUsage, 11, TextureRTTI)
+			BS_ADD_PLAINFIELD(mSize, 0, TextureRTTI)
+			BS_ADD_PLAINFIELD(mHeight, 2, TextureRTTI)
+			BS_ADD_PLAINFIELD(mWidth, 3, TextureRTTI)
+			BS_ADD_PLAINFIELD(mDepth, 4, TextureRTTI)
+			BS_ADD_PLAINFIELD(mNumMipmaps, 5, TextureRTTI)
+			BS_ADD_PLAINFIELD(mHwGamma, 6, TextureRTTI)
+			BS_ADD_PLAINFIELD(mMultisampleCount, 7, TextureRTTI)
+			BS_ADD_PLAINFIELD(mMultisampleHint, 8, TextureRTTI)
+			BS_ADD_PLAINFIELD(mTextureType, 9, TextureRTTI)
+			BS_ADD_PLAINFIELD(mFormat, 10, TextureRTTI)
+			BS_ADD_PLAINFIELD(mUsage, 11, TextureRTTI)
 
 
 			addReflectablePtrArrayField("mPixelData", 12, &TextureRTTI::getPixelData, &TextureRTTI::getPixelDataArraySize, 
 			addReflectablePtrArrayField("mPixelData", 12, &TextureRTTI::getPixelData, &TextureRTTI::getPixelDataArraySize, 
 				&TextureRTTI::setPixelData, &TextureRTTI::setPixelDataArraySize);
 				&TextureRTTI::setPixelData, &TextureRTTI::setPixelDataArraySize);
@@ -89,7 +89,7 @@ namespace BansheeEngine
 		{
 		{
 			Texture* texture = static_cast<Texture*>(obj);
 			Texture* texture = static_cast<Texture*>(obj);
 
 
-			texture->mRTTIData = cm_new<Vector<PixelDataPtr>, PoolAlloc>();
+			texture->mRTTIData = bs_new<Vector<PixelDataPtr>, PoolAlloc>();
 		}
 		}
 
 
 		virtual void onDeserializationEnded(IReflectable* obj)
 		virtual void onDeserializationEnded(IReflectable* obj)
@@ -120,7 +120,7 @@ namespace BansheeEngine
 					sharedTexPtr, subresourceIdx, pixelData->at(i), false, std::placeholders::_1));
 					sharedTexPtr, subresourceIdx, pixelData->at(i), false, std::placeholders::_1));
 			}
 			}
 
 
-			cm_delete<PoolAlloc>(pixelData);
+			bs_delete<PoolAlloc>(pixelData);
 			texture->mRTTIData = nullptr;	
 			texture->mRTTIData = nullptr;	
 		}
 		}
 
 

+ 1 - 1
BansheeCore/Include/CmVertexDataDescRTTI.h

@@ -38,7 +38,7 @@ namespace BansheeEngine
 
 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		virtual std::shared_ptr<IReflectable> newRTTIObject() 
 		{
 		{
-			return cm_shared_ptr<VertexDataDesc, PoolAlloc>(new (cm_alloc<VertexDataDesc, PoolAlloc>()) VertexDataDesc());
+			return bs_shared_ptr<VertexDataDesc, PoolAlloc>(new (bs_alloc<VertexDataDesc, PoolAlloc>()) VertexDataDesc());
 		}
 		}
 
 
 		virtual const String& getRTTIName() 
 		virtual const String& getRTTIName() 

+ 1 - 1
BansheeCore/Include/CmVertexDeclaration.h

@@ -114,7 +114,7 @@ namespace BansheeEngine
 		UINT16 mIndex;
 		UINT16 mIndex;
     };
     };
 
 
-	CM_ALLOW_MEMCPY_SERIALIZATION(VertexElement);
+	BS_ALLOW_MEMCPY_SERIALIZATION(VertexElement);
 
 
 	/**
 	/**
 	 * @brief	Describes a set of vertex elements, used for describing contents of
 	 * @brief	Describes a set of vertex elements, used for describing contents of

+ 1 - 1
BansheeCore/Include/Win32/CmPlatformImpl.h

@@ -364,7 +364,7 @@ namespace BansheeEngine
 		static bool mRequiresStartUp;
 		static bool mRequiresStartUp;
 		static bool mRequiresShutDown;
 		static bool mRequiresShutDown;
 
 
-		CM_STATIC_MUTEX(mSync);
+		BS_STATIC_MUTEX(mSync);
 
 
 		static void win32ShowCursor();
 		static void win32ShowCursor();
 		static void win32HideCursor();
 		static void win32HideCursor();

+ 2 - 2
BansheeCore/Include/Win32/CmWin32Defs.h

@@ -6,5 +6,5 @@
 #include <windowsx.h>
 #include <windowsx.h>
 #include <oleidl.h>
 #include <oleidl.h>
 
 
-#define WM_CM_SETCAPTURE WM_USER + 101
-#define WM_CM_RELEASECAPTURE WM_USER + 102
+#define WM_BS_SETCAPTURE WM_USER + 101
+#define WM_BS_RELEASECAPTURE WM_USER + 102

+ 13 - 13
BansheeCore/Include/Win32/CmWin32DropTarget.h

@@ -61,11 +61,11 @@ namespace BansheeEngine
 
 
 		~Win32DropTarget()
 		~Win32DropTarget()
 		{
 		{
-			CM_LOCK_MUTEX(mSync);
+			BS_LOCK_MUTEX(mSync);
 
 
 			for(auto& fileList : mFileLists)
 			for(auto& fileList : mFileLists)
 			{
 			{
-				cm_delete(fileList);
+				bs_delete(fileList);
 			}
 			}
 
 
 			mFileLists.clear();
 			mFileLists.clear();
@@ -131,7 +131,7 @@ namespace BansheeEngine
 
 
 			if(count == 0)
 			if(count == 0)
 			{
 			{
-				cm_delete(this);
+				bs_delete(this);
 				return 0;
 				return 0;
 			}
 			}
 			else
 			else
@@ -154,7 +154,7 @@ namespace BansheeEngine
 				return S_OK;
 				return S_OK;
 
 
 			{
 			{
-				CM_LOCK_MUTEX(mSync);
+				BS_LOCK_MUTEX(mSync);
 
 
 				mFileLists.push_back(getFileListFromData(pDataObj));
 				mFileLists.push_back(getFileListFromData(pDataObj));
 
 
@@ -182,7 +182,7 @@ namespace BansheeEngine
 				return S_OK;
 				return S_OK;
 
 
 			{
 			{
-				CM_LOCK_MUTEX(mSync);
+				BS_LOCK_MUTEX(mSync);
 
 
 				ScreenToClient(mHWnd, (POINT *)&pt);
 				ScreenToClient(mHWnd, (POINT *)&pt);
 				mQueuedDropOps.push_back(DropTargetOp(DropOpType::DragOver, Vector2I((int)pt.x, (int)pt.y)));
 				mQueuedDropOps.push_back(DropTargetOp(DropOpType::DragOver, Vector2I((int)pt.x, (int)pt.y)));
@@ -203,7 +203,7 @@ namespace BansheeEngine
 		HRESULT __stdcall DragLeave()
 		HRESULT __stdcall DragLeave()
 		{
 		{
 			{
 			{
-				CM_LOCK_MUTEX(mSync);
+				BS_LOCK_MUTEX(mSync);
 
 
 				mQueuedDropOps.push_back(DropTargetOp(DropOpType::Leave, Vector2I()));
 				mQueuedDropOps.push_back(DropTargetOp(DropOpType::Leave, Vector2I()));
 
 
@@ -230,7 +230,7 @@ namespace BansheeEngine
 				return S_OK;
 				return S_OK;
 
 
 			{
 			{
-				CM_LOCK_MUTEX(mSync);
+				BS_LOCK_MUTEX(mSync);
 
 
 				mFileLists.push_back(getFileListFromData(pDataObj));
 				mFileLists.push_back(getFileListFromData(pDataObj));
 
 
@@ -282,7 +282,7 @@ namespace BansheeEngine
 		 */
 		 */
 		void update()
 		void update()
 		{
 		{
-			CM_LOCK_MUTEX(mSync);
+			BS_LOCK_MUTEX(mSync);
 
 
 			for(auto& op: mQueuedDropOps)
 			for(auto& op: mQueuedDropOps)
 			{
 			{
@@ -329,7 +329,7 @@ namespace BansheeEngine
 
 
 				if(op.type == DropOpType::Leave || op.type == DropOpType::Drop)
 				if(op.type == DropOpType::Leave || op.type == DropOpType::Drop)
 				{
 				{
-					cm_delete(op.mFileList);
+					bs_delete(op.mFileList);
 					mFileLists.erase(mFileLists.begin());
 					mFileLists.erase(mFileLists.begin());
 				}
 				}
 			}
 			}
@@ -357,7 +357,7 @@ namespace BansheeEngine
 			FORMATETC fmtetc = { CF_HDROP, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
 			FORMATETC fmtetc = { CF_HDROP, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
 			STGMEDIUM stgmed;
 			STGMEDIUM stgmed;
 
 
-			Vector<WString>* files = cm_new<Vector<WString>>();
+			Vector<WString>* files = bs_new<Vector<WString>>();
 			if(data->GetData(&fmtetc, &stgmed) == S_OK)
 			if(data->GetData(&fmtetc, &stgmed) == S_OK)
 			{
 			{
 				PVOID data = GlobalLock(stgmed.hGlobal);
 				PVOID data = GlobalLock(stgmed.hGlobal);
@@ -369,13 +369,13 @@ namespace BansheeEngine
 				for(UINT i = 0; i < numFiles; i++)
 				for(UINT i = 0; i < numFiles; i++)
 				{
 				{
 					UINT numChars = DragQueryFileW(hDrop, i, nullptr, 0) + 1;
 					UINT numChars = DragQueryFileW(hDrop, i, nullptr, 0) + 1;
-					wchar_t* buffer = (wchar_t*)cm_alloc((UINT32)numChars * sizeof(wchar_t));
+					wchar_t* buffer = (wchar_t*)bs_alloc((UINT32)numChars * sizeof(wchar_t));
 
 
 					DragQueryFileW(hDrop, i, buffer, numChars);
 					DragQueryFileW(hDrop, i, buffer, numChars);
 
 
 					(*files)[i] = WString(buffer);
 					(*files)[i] = WString(buffer);
 
 
-					cm_free(buffer);
+					bs_free(buffer);
 				}
 				}
 
 
 				GlobalUnlock(stgmed.hGlobal);
 				GlobalUnlock(stgmed.hGlobal);
@@ -395,6 +395,6 @@ namespace BansheeEngine
 		Vector<DropTargetOp> mQueuedDropOps;
 		Vector<DropTargetOp> mQueuedDropOps;
 		Vector<Vector<WString>*> mFileLists; 
 		Vector<Vector<WString>*> mFileLists; 
 
 
-		CM_MUTEX(mSync);
+		BS_MUTEX(mSync);
 	};
 	};
 }
 }

+ 8 - 8
BansheeCore/Source/BsCoreApplication.cpp

@@ -48,7 +48,7 @@ namespace BansheeEngine
 	CoreApplication::CoreApplication(START_UP_DESC& desc)
 	CoreApplication::CoreApplication(START_UP_DESC& desc)
 		:mPrimaryWindow(nullptr), mIsFrameRenderingFinished(true), mRunMainLoop(false), mSceneManagerPlugin(nullptr)
 		:mPrimaryWindow(nullptr), mIsFrameRenderingFinished(true), mRunMainLoop(false), mSceneManagerPlugin(nullptr)
 	{
 	{
-		UINT32 numWorkerThreads = CM_THREAD_HARDWARE_CONCURRENCY - 1; // Number of cores while excluding current thread.
+		UINT32 numWorkerThreads = BS_THREAD_HARDWARE_CONCURRENCY - 1; // Number of cores while excluding current thread.
 
 
 		Platform::_startUp();
 		Platform::_startUp();
 		MemStack::beginThread();
 		MemStack::beginThread();
@@ -155,12 +155,12 @@ namespace BansheeEngine
 			// thread, in which case sim thread needs to wait. Optimal solution would be to get an average 
 			// thread, in which case sim thread needs to wait. Optimal solution would be to get an average 
 			// difference between sim/core thread and start the sim thread a bit later so they finish at nearly the same time.
 			// difference between sim/core thread and start the sim thread a bit later so they finish at nearly the same time.
 			{
 			{
-				CM_LOCK_MUTEX_NAMED(mFrameRenderingFinishedMutex, lock);
+				BS_LOCK_MUTEX_NAMED(mFrameRenderingFinishedMutex, lock);
 
 
 				while(!mIsFrameRenderingFinished)
 				while(!mIsFrameRenderingFinished)
 				{
 				{
 					TaskScheduler::instance().addWorker();
 					TaskScheduler::instance().addWorker();
-					CM_THREAD_WAIT(mFrameRenderingFinishedCondition, mFrameRenderingFinishedMutex, lock);
+					BS_THREAD_WAIT(mFrameRenderingFinishedCondition, mFrameRenderingFinishedMutex, lock);
 					TaskScheduler::instance().removeWorker();
 					TaskScheduler::instance().removeWorker();
 				}
 				}
 
 
@@ -190,10 +190,10 @@ namespace BansheeEngine
 
 
 	void CoreApplication::frameRenderingFinishedCallback()
 	void CoreApplication::frameRenderingFinishedCallback()
 	{
 	{
-		CM_LOCK_MUTEX(mFrameRenderingFinishedMutex);
+		BS_LOCK_MUTEX(mFrameRenderingFinishedMutex);
 
 
 		mIsFrameRenderingFinished = true;
 		mIsFrameRenderingFinished = true;
-		CM_THREAD_NOTIFY_ONE(mFrameRenderingFinishedCondition);
+		BS_THREAD_NOTIFY_ONE(mFrameRenderingFinishedCondition);
 	}
 	}
 
 
 	void CoreApplication::beginCoreProfiling()
 	void CoreApplication::beginCoreProfiling()
@@ -210,15 +210,15 @@ namespace BansheeEngine
 	void* CoreApplication::loadPlugin(const String& pluginName, DynLib** library, void* passThrough)
 	void* CoreApplication::loadPlugin(const String& pluginName, DynLib** library, void* passThrough)
 	{
 	{
 		String name = pluginName;
 		String name = pluginName;
-#if CM_PLATFORM == CM_PLATFORM_LINUX
+#if BS_PLATFORM == BS_PLATFORM_LINUX
 		// dlopen() does not add .so to the filename, like windows does for .dll
 		// dlopen() does not add .so to the filename, like windows does for .dll
 		if (name.substr(name.length() - 3, 3) != ".so")
 		if (name.substr(name.length() - 3, 3) != ".so")
 			name += ".so";
 			name += ".so";
-#elif CM_PLATFORM == CM_PLATFORM_APPLE
+#elif BS_PLATFORM == BS_PLATFORM_APPLE
 		// dlopen() does not add .dylib to the filename, like windows does for .dll
 		// dlopen() does not add .dylib to the filename, like windows does for .dll
 		if (name.substr(name.length() - 6, 6) != ".dylib")
 		if (name.substr(name.length() - 6, 6) != ".dylib")
 			name += ".dylib";
 			name += ".dylib";
-#elif CM_PLATFORM == CM_PLATFORM_WIN32
+#elif BS_PLATFORM == BS_PLATFORM_WIN32
 		// Although LoadLibraryEx will add .dll itself when you only specify the library name,
 		// Although LoadLibraryEx will add .dll itself when you only specify the library name,
 		// if you include a relative path then it does not. So, add it to be sure.
 		// if you include a relative path then it does not. So, add it to be sure.
 		if (name.substr(name.length() - 4, 4) != ".dll")
 		if (name.substr(name.length() - 4, 4) != ".dll")

+ 5 - 5
BansheeCore/Source/BsGPUProfiler.cpp

@@ -13,7 +13,7 @@ namespace BansheeEngine
 	void GPUProfiler::beginFrame()
 	void GPUProfiler::beginFrame()
 	{
 	{
 		if (mIsFrameActive)
 		if (mIsFrameActive)
-			CM_EXCEPT(InvalidStateException, "Cannot begin a frame because another frame is active.");
+			BS_EXCEPT(InvalidStateException, "Cannot begin a frame because another frame is active.");
 
 
 		mActiveFrame = ActiveFrame();
 		mActiveFrame = ActiveFrame();
 
 
@@ -26,7 +26,7 @@ namespace BansheeEngine
 	void GPUProfiler::endFrame()
 	void GPUProfiler::endFrame()
 	{
 	{
 		if (mNumActiveSamples > 0)
 		if (mNumActiveSamples > 0)
-			CM_EXCEPT(InvalidStateException, "Attempting to end a frame while a sample is active.");
+			BS_EXCEPT(InvalidStateException, "Attempting to end a frame while a sample is active.");
 
 
 		if (!mIsFrameActive)
 		if (!mIsFrameActive)
 			return;
 			return;
@@ -40,7 +40,7 @@ namespace BansheeEngine
 	void GPUProfiler::beginSample(const ProfilerString& name)
 	void GPUProfiler::beginSample(const ProfilerString& name)
 	{
 	{
 		if (!mIsFrameActive)
 		if (!mIsFrameActive)
-			CM_EXCEPT(InvalidStateException, "Cannot begin a sample because no frame is active.");
+			BS_EXCEPT(InvalidStateException, "Cannot begin a sample because no frame is active.");
 
 
 		mActiveFrame.samples.push_back(ActiveSample());
 		mActiveFrame.samples.push_back(ActiveSample());
 		ActiveSample& sample = mActiveFrame.samples.back();
 		ActiveSample& sample = mActiveFrame.samples.back();
@@ -61,7 +61,7 @@ namespace BansheeEngine
 			String errorStr = "Attempting to end a sample that doesn't match. Got: " + 
 			String errorStr = "Attempting to end a sample that doesn't match. Got: " + 
 				String(name.c_str()) + ". Expected: " + String(sample.sampleName.c_str());
 				String(name.c_str()) + ". Expected: " + String(sample.sampleName.c_str());
 
 
-			CM_EXCEPT(InvalidStateException, errorStr);
+			BS_EXCEPT(InvalidStateException, errorStr);
 		}
 		}
 
 
 		endSampleInternal(sample);
 		endSampleInternal(sample);
@@ -76,7 +76,7 @@ namespace BansheeEngine
 	GPUProfilerReport GPUProfiler::getNextReport()
 	GPUProfilerReport GPUProfiler::getNextReport()
 	{
 	{
 		if (mReadyReports.empty())
 		if (mReadyReports.empty())
-			CM_EXCEPT(InvalidStateException, "No reports are available.")
+			BS_EXCEPT(InvalidStateException, "No reports are available.")
 
 
 		GPUProfilerReport report = mReadyReports.front();
 		GPUProfilerReport report = mReadyReports.front();
 		mReadyReports.pop();
 		mReadyReports.pop();

+ 3 - 3
BansheeCore/Source/CmBindableGpuParams.cpp

@@ -99,7 +99,7 @@ namespace BansheeEngine
 	{
 	{
 		if(slot < 0 || slot >= mNumParamBlocks)
 		if(slot < 0 || slot >= mNumParamBlocks)
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Index out of range: Valid range: 0 .. " + 
+			BS_EXCEPT(InvalidParametersException, "Index out of range: Valid range: 0 .. " + 
 				toString(mNumParamBlocks - 1) + ". Requested: " + toString(slot));
 				toString(mNumParamBlocks - 1) + ". Requested: " + toString(slot));
 		}
 		}
 
 
@@ -123,7 +123,7 @@ namespace BansheeEngine
 	{
 	{
 		if(slot < 0 || slot >= mNumTextures)
 		if(slot < 0 || slot >= mNumTextures)
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Index out of range: Valid range: 0 .. " + 
+			BS_EXCEPT(InvalidParametersException, "Index out of range: Valid range: 0 .. " + 
 				toString(mNumTextures - 1) + ". Requested: " + toString(slot));
 				toString(mNumTextures - 1) + ". Requested: " + toString(slot));
 		}
 		}
 
 
@@ -134,7 +134,7 @@ namespace BansheeEngine
 	{
 	{
 		if(slot < 0 || slot >= mNumSamplerStates)
 		if(slot < 0 || slot >= mNumSamplerStates)
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Index out of range: Valid range: 0 .. " + 
+			BS_EXCEPT(InvalidParametersException, "Index out of range: Valid range: 0 .. " + 
 				toString(mNumSamplerStates - 1) + ". Requested: " + toString(slot));
 				toString(mNumSamplerStates - 1) + ". Requested: " + toString(slot));
 		}
 		}
 
 

+ 8 - 8
BansheeCore/Source/CmBlendState.cpp

@@ -20,56 +20,56 @@ namespace BansheeEngine
 
 
 	bool BlendState::getBlendEnabled(UINT32 renderTargetIdx) const
 	bool BlendState::getBlendEnabled(UINT32 renderTargetIdx) const
 	{
 	{
-		assert(renderTargetIdx >= 0 && renderTargetIdx < CM_MAX_MULTIPLE_RENDER_TARGETS);
+		assert(renderTargetIdx >= 0 && renderTargetIdx < BS_MAX_MULTIPLE_RENDER_TARGETS);
 
 
 		return mData.renderTargetDesc[renderTargetIdx].blendEnable;
 		return mData.renderTargetDesc[renderTargetIdx].blendEnable;
 	}
 	}
 
 
 	BlendFactor BlendState::getSrcBlend(UINT32 renderTargetIdx) const
 	BlendFactor BlendState::getSrcBlend(UINT32 renderTargetIdx) const
 	{
 	{
-		assert(renderTargetIdx >= 0 && renderTargetIdx < CM_MAX_MULTIPLE_RENDER_TARGETS);
+		assert(renderTargetIdx >= 0 && renderTargetIdx < BS_MAX_MULTIPLE_RENDER_TARGETS);
 
 
 		return mData.renderTargetDesc[renderTargetIdx].srcBlend;
 		return mData.renderTargetDesc[renderTargetIdx].srcBlend;
 	}
 	}
 
 
 	BlendFactor BlendState::getDstBlend(UINT32 renderTargetIdx) const
 	BlendFactor BlendState::getDstBlend(UINT32 renderTargetIdx) const
 	{
 	{
-		assert(renderTargetIdx >= 0 && renderTargetIdx < CM_MAX_MULTIPLE_RENDER_TARGETS);
+		assert(renderTargetIdx >= 0 && renderTargetIdx < BS_MAX_MULTIPLE_RENDER_TARGETS);
 
 
 		return mData.renderTargetDesc[renderTargetIdx].dstBlend;
 		return mData.renderTargetDesc[renderTargetIdx].dstBlend;
 	}
 	}
 
 
 	BlendOperation BlendState::getBlendOperation(UINT32 renderTargetIdx) const
 	BlendOperation BlendState::getBlendOperation(UINT32 renderTargetIdx) const
 	{
 	{
-		assert(renderTargetIdx >= 0 && renderTargetIdx < CM_MAX_MULTIPLE_RENDER_TARGETS);
+		assert(renderTargetIdx >= 0 && renderTargetIdx < BS_MAX_MULTIPLE_RENDER_TARGETS);
 
 
 		return mData.renderTargetDesc[renderTargetIdx].blendOp;
 		return mData.renderTargetDesc[renderTargetIdx].blendOp;
 	}
 	}
 
 
 	BlendFactor BlendState::getAlphaSrcBlend(UINT32 renderTargetIdx) const
 	BlendFactor BlendState::getAlphaSrcBlend(UINT32 renderTargetIdx) const
 	{
 	{
-		assert(renderTargetIdx >= 0 && renderTargetIdx < CM_MAX_MULTIPLE_RENDER_TARGETS);
+		assert(renderTargetIdx >= 0 && renderTargetIdx < BS_MAX_MULTIPLE_RENDER_TARGETS);
 
 
 		return mData.renderTargetDesc[renderTargetIdx].srcBlendAlpha;
 		return mData.renderTargetDesc[renderTargetIdx].srcBlendAlpha;
 	}
 	}
 
 
 	BlendFactor BlendState::getAlphaDstBlend(UINT32 renderTargetIdx) const
 	BlendFactor BlendState::getAlphaDstBlend(UINT32 renderTargetIdx) const
 	{
 	{
-		assert(renderTargetIdx >= 0 && renderTargetIdx < CM_MAX_MULTIPLE_RENDER_TARGETS);
+		assert(renderTargetIdx >= 0 && renderTargetIdx < BS_MAX_MULTIPLE_RENDER_TARGETS);
 		
 		
 		return mData.renderTargetDesc[renderTargetIdx].dstBlendAlpha;
 		return mData.renderTargetDesc[renderTargetIdx].dstBlendAlpha;
 	}
 	}
 
 
 	BlendOperation BlendState::getAlphaBlendOperation(UINT32 renderTargetIdx) const
 	BlendOperation BlendState::getAlphaBlendOperation(UINT32 renderTargetIdx) const
 	{
 	{
-		assert(renderTargetIdx >= 0 && renderTargetIdx < CM_MAX_MULTIPLE_RENDER_TARGETS);
+		assert(renderTargetIdx >= 0 && renderTargetIdx < BS_MAX_MULTIPLE_RENDER_TARGETS);
 
 
 		return mData.renderTargetDesc[renderTargetIdx].blendOpAlpha;
 		return mData.renderTargetDesc[renderTargetIdx].blendOpAlpha;
 	}
 	}
 
 
 	UINT8 BlendState::getRenderTargetWriteMask(UINT32 renderTargetIdx) const
 	UINT8 BlendState::getRenderTargetWriteMask(UINT32 renderTargetIdx) const
 	{
 	{
-		assert(renderTargetIdx >= 0 && renderTargetIdx < CM_MAX_MULTIPLE_RENDER_TARGETS);
+		assert(renderTargetIdx >= 0 && renderTargetIdx < BS_MAX_MULTIPLE_RENDER_TARGETS);
 
 
 		return mData.renderTargetDesc[renderTargetIdx].renderTargetWriteMask;
 		return mData.renderTargetDesc[renderTargetIdx].renderTargetWriteMask;
 	}
 	}

+ 10 - 10
BansheeCore/Source/CmCPUProfiler.cpp

@@ -51,7 +51,7 @@ namespace BansheeEngine
 
 
 	inline UINT64 CPUProfiler::TimerPrecise::getNumCycles() 
 	inline UINT64 CPUProfiler::TimerPrecise::getNumCycles() 
 	{
 	{
-#if CM_COMPILER == CM_COMPILER_GNUC
+#if BS_COMPILER == BS_COMPILER_GNUC
 		asm volatile("cpuid" : : : "%eax", "%ebx", "%ecx", "%edx" );
 		asm volatile("cpuid" : : : "%eax", "%ebx", "%ecx", "%edx" );
 		UINT32 __a,__d;
 		UINT32 __a,__d;
 		asm volatile("rdtsc" : "=a" (__a), "=d" (__d));
 		asm volatile("rdtsc" : "=a" (__a), "=d" (__d));
@@ -114,7 +114,7 @@ namespace BansheeEngine
 		samples.erase(samples.end() - 1);
 		samples.erase(samples.end() - 1);
 	}
 	}
 
 
-	CM_THREADLOCAL CPUProfiler::ThreadInfo* CPUProfiler::ThreadInfo::activeThread = nullptr;
+	BS_THREADLOCAL CPUProfiler::ThreadInfo* CPUProfiler::ThreadInfo::activeThread = nullptr;
 
 
 	CPUProfiler::ThreadInfo::ThreadInfo()
 	CPUProfiler::ThreadInfo::ThreadInfo()
 		:isActive(false), rootBlock(nullptr)
 		:isActive(false), rootBlock(nullptr)
@@ -189,12 +189,12 @@ namespace BansheeEngine
 	{
 	{
 		// TODO - Pool this, if possible using the memory allocator stuff
 		// TODO - Pool this, if possible using the memory allocator stuff
 		// TODO - Also consider moving all samples in ThreadInfo, and also pool them (otherwise I can't pool ProfiledBlock since it will be variable size)
 		// TODO - Also consider moving all samples in ThreadInfo, and also pool them (otherwise I can't pool ProfiledBlock since it will be variable size)
-		return cm_new<ProfiledBlock, ProfilerAlloc>();
+		return bs_new<ProfiledBlock, ProfilerAlloc>();
 	}
 	}
 
 
 	void CPUProfiler::ThreadInfo::releaseBlock(CPUProfiler::ProfiledBlock* block)
 	void CPUProfiler::ThreadInfo::releaseBlock(CPUProfiler::ProfiledBlock* block)
 	{
 	{
-		cm_delete<ProfilerAlloc>(block);
+		bs_delete<ProfilerAlloc>(block);
 	}
 	}
 
 
 	CPUProfiler::ProfiledBlock::ProfiledBlock()
 	CPUProfiler::ProfiledBlock::ProfiledBlock()
@@ -234,10 +234,10 @@ namespace BansheeEngine
 	{
 	{
 		reset();
 		reset();
 
 
-		CM_LOCK_MUTEX(mThreadSync);
+		BS_LOCK_MUTEX(mThreadSync);
 
 
 		for(auto& threadInfo : mActiveThreads)
 		for(auto& threadInfo : mActiveThreads)
-			cm_delete<ProfilerAlloc>(threadInfo);
+			bs_delete<ProfilerAlloc>(threadInfo);
 	}
 	}
 
 
 	void CPUProfiler::beginThread(const ProfilerString& name)
 	void CPUProfiler::beginThread(const ProfilerString& name)
@@ -245,11 +245,11 @@ namespace BansheeEngine
 		ThreadInfo* thread = ThreadInfo::activeThread;
 		ThreadInfo* thread = ThreadInfo::activeThread;
 		if(thread == nullptr)
 		if(thread == nullptr)
 		{
 		{
-			ThreadInfo::activeThread = cm_new<ThreadInfo, ProfilerAlloc>();
+			ThreadInfo::activeThread = bs_new<ThreadInfo, ProfilerAlloc>();
 			thread = ThreadInfo::activeThread;
 			thread = ThreadInfo::activeThread;
 
 
 			{
 			{
-				CM_LOCK_MUTEX(mThreadSync);
+				BS_LOCK_MUTEX(mThreadSync);
 
 
 				mActiveThreads.push_back(thread);
 				mActiveThreads.push_back(thread);
 			}
 			}
@@ -301,7 +301,7 @@ namespace BansheeEngine
 		ThreadInfo* thread = ThreadInfo::activeThread;
 		ThreadInfo* thread = ThreadInfo::activeThread;
 		ProfiledBlock* block = thread->activeBlock.block;
 		ProfiledBlock* block = thread->activeBlock.block;
 
 
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(block == nullptr)
 		if(block == nullptr)
 		{
 		{
 			LOGWRN("Mismatched CPUProfiler::endSample. No beginSample was called.");
 			LOGWRN("Mismatched CPUProfiler::endSample. No beginSample was called.");
@@ -369,7 +369,7 @@ namespace BansheeEngine
 		ThreadInfo* thread = ThreadInfo::activeThread;
 		ThreadInfo* thread = ThreadInfo::activeThread;
 		ProfiledBlock* block = thread->activeBlock.block;
 		ProfiledBlock* block = thread->activeBlock.block;
 
 
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(block == nullptr)
 		if(block == nullptr)
 		{
 		{
 			LOGWRN("Mismatched Profiler::endSamplePrecise. No beginSamplePrecise was called.");
 			LOGWRN("Mismatched Profiler::endSamplePrecise. No beginSamplePrecise was called.");

+ 17 - 17
BansheeCore/Source/CmCommandQueue.cpp

@@ -6,41 +6,41 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-#if CM_DEBUG_MODE
-	CommandQueueBase::CommandQueueBase(CM_THREAD_ID_TYPE threadId)
+#if BS_DEBUG_MODE
+	CommandQueueBase::CommandQueueBase(BS_THREAD_ID_TYPE threadId)
 		:mMyThreadId(threadId), mMaxDebugIdx(0)
 		:mMyThreadId(threadId), mMaxDebugIdx(0)
 	{
 	{
-		mCommands = cm_new<BansheeEngine::Queue<QueuedCommand>, PoolAlloc>();
+		mCommands = bs_new<BansheeEngine::Queue<QueuedCommand>, PoolAlloc>();
 
 
 		{
 		{
-			CM_LOCK_MUTEX(CommandQueueBreakpointMutex);
+			BS_LOCK_MUTEX(CommandQueueBreakpointMutex);
 
 
 			mCommandQueueIdx = MaxCommandQueueIdx++;
 			mCommandQueueIdx = MaxCommandQueueIdx++;
 		}
 		}
 	}
 	}
 #else
 #else
-	CommandQueueBase::CommandQueueBase(CM_THREAD_ID_TYPE threadId)
+	CommandQueueBase::CommandQueueBase(BS_THREAD_ID_TYPE threadId)
 		:mMyThreadId(threadId)
 		:mMyThreadId(threadId)
 	{
 	{
-		mCommands = cm_new<BansheeEngine::Queue<QueuedCommand>, PoolAlloc>();
+		mCommands = bs_new<BansheeEngine::Queue<QueuedCommand>, PoolAlloc>();
 	}
 	}
 #endif
 #endif
 
 
 	CommandQueueBase::~CommandQueueBase()
 	CommandQueueBase::~CommandQueueBase()
 	{
 	{
 		if(mCommands != nullptr)
 		if(mCommands != nullptr)
-			cm_delete(mCommands);
+			bs_delete(mCommands);
 
 
 		while(!mEmptyCommandQueues.empty())
 		while(!mEmptyCommandQueues.empty())
 		{
 		{
-			cm_delete(mEmptyCommandQueues.top());
+			bs_delete(mEmptyCommandQueues.top());
 			mEmptyCommandQueues.pop();
 			mEmptyCommandQueues.pop();
 		}
 		}
 	}
 	}
 
 
 	AsyncOp CommandQueueBase::queueReturn(std::function<void(AsyncOp&)> commandCallback, bool _notifyWhenComplete, UINT32 _callbackId)
 	AsyncOp CommandQueueBase::queueReturn(std::function<void(AsyncOp&)> commandCallback, bool _notifyWhenComplete, UINT32 _callbackId)
 	{
 	{
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		breakIfNeeded(mCommandQueueIdx, mMaxDebugIdx);
 		breakIfNeeded(mCommandQueueIdx, mMaxDebugIdx);
 
 
 		QueuedCommand newCommand(commandCallback, mMaxDebugIdx++, _notifyWhenComplete, _callbackId);
 		QueuedCommand newCommand(commandCallback, mMaxDebugIdx++, _notifyWhenComplete, _callbackId);
@@ -50,7 +50,7 @@ namespace BansheeEngine
 
 
 		mCommands->push(newCommand);
 		mCommands->push(newCommand);
 
 
-#if CM_FORCE_SINGLETHREADED_RENDERING
+#if BS_FORCE_SINGLETHREADED_RENDERING
 		Queue<QueuedCommand>* commands = flush();
 		Queue<QueuedCommand>* commands = flush();
 		playback(commands);
 		playback(commands);
 #endif
 #endif
@@ -60,7 +60,7 @@ namespace BansheeEngine
 
 
 	void CommandQueueBase::queue(std::function<void()> commandCallback, bool _notifyWhenComplete, UINT32 _callbackId)
 	void CommandQueueBase::queue(std::function<void()> commandCallback, bool _notifyWhenComplete, UINT32 _callbackId)
 	{
 	{
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		breakIfNeeded(mCommandQueueIdx, mMaxDebugIdx);
 		breakIfNeeded(mCommandQueueIdx, mMaxDebugIdx);
 
 
 		QueuedCommand newCommand(commandCallback, mMaxDebugIdx++, _notifyWhenComplete, _callbackId);
 		QueuedCommand newCommand(commandCallback, mMaxDebugIdx++, _notifyWhenComplete, _callbackId);
@@ -70,7 +70,7 @@ namespace BansheeEngine
 
 
 		mCommands->push(newCommand);
 		mCommands->push(newCommand);
 
 
-#if CM_FORCE_SINGLETHREADED_RENDERING
+#if BS_FORCE_SINGLETHREADED_RENDERING
 		Queue<QueuedCommand>* commands = flush();
 		Queue<QueuedCommand>* commands = flush();
 		playback(commands);
 		playback(commands);
 #endif
 #endif
@@ -87,7 +87,7 @@ namespace BansheeEngine
 		}
 		}
 		else
 		else
 		{
 		{
-			mCommands = cm_new<BansheeEngine::Queue<QueuedCommand>, PoolAlloc>();
+			mCommands = bs_new<BansheeEngine::Queue<QueuedCommand>, PoolAlloc>();
 		}
 		}
 
 
 		return oldCommands;
 		return oldCommands;
@@ -157,11 +157,11 @@ namespace BansheeEngine
 
 
 	void CommandQueueBase::throwInvalidThreadException(const String& message) const
 	void CommandQueueBase::throwInvalidThreadException(const String& message) const
 	{
 	{
-		CM_EXCEPT(InternalErrorException, message);
+		BS_EXCEPT(InternalErrorException, message);
 	}
 	}
 
 
-#if CM_DEBUG_MODE
-	CM_STATIC_MUTEX_CLASS_INSTANCE(CommandQueueBreakpointMutex, CommandQueueBase);
+#if BS_DEBUG_MODE
+	BS_STATIC_MUTEX_CLASS_INSTANCE(CommandQueueBreakpointMutex, CommandQueueBase);
 
 
 	UINT32 CommandQueueBase::MaxCommandQueueIdx = 0;
 	UINT32 CommandQueueBase::MaxCommandQueueIdx = 0;
 
 
@@ -183,7 +183,7 @@ namespace BansheeEngine
 
 
 	void CommandQueueBase::addBreakpoint(UINT32 queueIdx, UINT32 commandIdx)
 	void CommandQueueBase::addBreakpoint(UINT32 queueIdx, UINT32 commandIdx)
 	{
 	{
-		CM_LOCK_MUTEX(CommandQueueBreakpointMutex);
+		BS_LOCK_MUTEX(CommandQueueBreakpointMutex);
 
 
 		SetBreakpoints.insert(QueueBreakpoint(queueIdx, commandIdx));
 		SetBreakpoints.insert(QueueBreakpoint(queueIdx, commandIdx));
 	}
 	}

+ 22 - 22
BansheeCore/Source/CmCoreObject.cpp

@@ -8,8 +8,8 @@ using namespace std::placeholders;
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-	CM_STATIC_THREAD_SYNCHRONISER_CLASS_INSTANCE(mCoreGpuObjectLoadedCondition, CoreObject)
-	CM_STATIC_MUTEX_CLASS_INSTANCE(mCoreGpuObjectLoadedMutex, CoreObject)
+	BS_STATIC_THREAD_SYNCHRONISER_CLASS_INSTANCE(mCoreGpuObjectLoadedCondition, CoreObject)
+	BS_STATIC_MUTEX_CLASS_INSTANCE(mCoreGpuObjectLoadedMutex, CoreObject)
 
 
 	CoreObject::CoreObject(bool initializeOnRenderThread)
 	CoreObject::CoreObject(bool initializeOnRenderThread)
 		: mFlags(0), mInternalID(0)
 		: mFlags(0), mInternalID(0)
@@ -24,13 +24,13 @@ namespace BansheeEngine
 		{
 		{
 			// Object must be released with destroy() otherwise engine can still try to use it, even if it was destructed
 			// Object must be released with destroy() otherwise engine can still try to use it, even if it was destructed
 			// (e.g. if an object has one of its methods queued in a command queue, and is destructed, you will be accessing invalid memory)
 			// (e.g. if an object has one of its methods queued in a command queue, and is destructed, you will be accessing invalid memory)
-			CM_EXCEPT(InternalErrorException, "Destructor called but object is not destroyed. This will result in nasty issues.");
+			BS_EXCEPT(InternalErrorException, "Destructor called but object is not destroyed. This will result in nasty issues.");
 		}
 		}
 
 
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(!mThis.expired())
 		if(!mThis.expired())
 		{
 		{
-			CM_EXCEPT(InternalErrorException, "Shared pointer to this object still has active references but " \
+			BS_EXCEPT(InternalErrorException, "Shared pointer to this object still has active references but " \
 				"the object is being deleted? You shouldn't delete CoreGpuObjects manually.");
 				"the object is being deleted? You shouldn't delete CoreGpuObjects manually.");
 		}
 		}
 #endif
 #endif
@@ -44,7 +44,7 @@ namespace BansheeEngine
 		{
 		{
 			setScheduledToBeDeleted(true);
 			setScheduledToBeDeleted(true);
 
 
-			if(CM_THREAD_CURRENT_ID == CoreThread::instance().getCoreThreadId())
+			if(BS_THREAD_CURRENT_ID == CoreThread::instance().getCoreThreadId())
 				mThis.lock()->destroy_internal();
 				mThis.lock()->destroy_internal();
 			else
 			else
 				queueDestroyGpuCommand(mThis.lock());
 				queueDestroyGpuCommand(mThis.lock());
@@ -57,9 +57,9 @@ namespace BansheeEngine
 
 
 	void CoreObject::destroy_internal()
 	void CoreObject::destroy_internal()
 	{
 	{
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(!isInitialized())
 		if(!isInitialized())
-			CM_EXCEPT(InternalErrorException, "Trying to destroy an object that is already destroyed (or it never was initialized).");
+			BS_EXCEPT(InternalErrorException, "Trying to destroy an object that is already destroyed (or it never was initialized).");
 #endif
 #endif
 
 
 		setIsInitialized(false);
 		setIsInitialized(false);
@@ -67,16 +67,16 @@ namespace BansheeEngine
 
 
 	void CoreObject::initialize()
 	void CoreObject::initialize()
 	{
 	{
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(isInitialized() || isScheduledToBeInitialized())
 		if(isInitialized() || isScheduledToBeInitialized())
-			CM_EXCEPT(InternalErrorException, "Trying to initialize an object that is already initialized.");
+			BS_EXCEPT(InternalErrorException, "Trying to initialize an object that is already initialized.");
 #endif
 #endif
 
 
 		if(requiresInitOnCoreThread())
 		if(requiresInitOnCoreThread())
 		{
 		{
 			setScheduledToBeInitialized(true);
 			setScheduledToBeInitialized(true);
 
 
-			if(CM_THREAD_CURRENT_ID == CoreThread::instance().getCoreThreadId())
+			if(BS_THREAD_CURRENT_ID == CoreThread::instance().getCoreThreadId())
 				mThis.lock()->initialize_internal();
 				mThis.lock()->initialize_internal();
 			else
 			else
 				queueInitializeGpuCommand(mThis.lock());
 				queueInitializeGpuCommand(mThis.lock());
@@ -92,13 +92,13 @@ namespace BansheeEngine
 		if(requiresInitOnCoreThread())
 		if(requiresInitOnCoreThread())
 		{
 		{
 			{
 			{
-				CM_LOCK_MUTEX(mCoreGpuObjectLoadedMutex);
+				BS_LOCK_MUTEX(mCoreGpuObjectLoadedMutex);
 				setIsInitialized(true);
 				setIsInitialized(true);
 			}	
 			}	
 
 
 			setScheduledToBeInitialized(false);
 			setScheduledToBeInitialized(false);
 
 
-			CM_THREAD_NOTIFY_ALL(mCoreGpuObjectLoadedCondition);
+			BS_THREAD_NOTIFY_ALL(mCoreGpuObjectLoadedCondition);
 		}
 		}
 		else
 		else
 		{
 		{
@@ -112,23 +112,23 @@ namespace BansheeEngine
 		{
 		{
 			if(requiresInitOnCoreThread())
 			if(requiresInitOnCoreThread())
 			{
 			{
-#if CM_DEBUG_MODE
-				if(CM_THREAD_CURRENT_ID == CoreThread::instance().getCoreThreadId())
-					CM_EXCEPT(InternalErrorException, "You cannot call this method on the core thread. It will cause a deadlock!");
+#if BS_DEBUG_MODE
+				if(BS_THREAD_CURRENT_ID == CoreThread::instance().getCoreThreadId())
+					BS_EXCEPT(InternalErrorException, "You cannot call this method on the core thread. It will cause a deadlock!");
 #endif
 #endif
 
 
-				CM_LOCK_MUTEX_NAMED(mCoreGpuObjectLoadedMutex, lock);
+				BS_LOCK_MUTEX_NAMED(mCoreGpuObjectLoadedMutex, lock);
 				while(!isInitialized())
 				while(!isInitialized())
 				{
 				{
 					if(!isScheduledToBeInitialized())
 					if(!isScheduledToBeInitialized())
-						CM_EXCEPT(InternalErrorException, "Attempting to wait until initialization finishes but object is not scheduled to be initialized.");
+						BS_EXCEPT(InternalErrorException, "Attempting to wait until initialization finishes but object is not scheduled to be initialized.");
 
 
-					CM_THREAD_WAIT(mCoreGpuObjectLoadedCondition, mCoreGpuObjectLoadedMutex, lock);
+					BS_THREAD_WAIT(mCoreGpuObjectLoadedCondition, mCoreGpuObjectLoadedMutex, lock);
 				}
 				}
 			}
 			}
 			else
 			else
 			{
 			{
-				CM_EXCEPT(InternalErrorException, "Attempting to wait until initialization finishes but object is not scheduled to be initialized.");
+				BS_EXCEPT(InternalErrorException, "Attempting to wait until initialization finishes but object is not scheduled to be initialized.");
 			}
 			}
 		}
 		}
 	}
 	}
@@ -150,10 +150,10 @@ namespace BansheeEngine
 		//    - destroy() makes sure it keeps a reference of mThis so object isn't deleted
 		//    - destroy() makes sure it keeps a reference of mThis so object isn't deleted
 		//    - Once the destroy() finishes the reference is removed and the default shared_ptr deleter is called
 		//    - Once the destroy() finishes the reference is removed and the default shared_ptr deleter is called
 
 
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(obj->isScheduledToBeInitialized())
 		if(obj->isScheduledToBeInitialized())
 		{
 		{
-			CM_EXCEPT(InternalErrorException, "Object scheduled to be initialized, yet it's being deleted. " \
+			BS_EXCEPT(InternalErrorException, "Object scheduled to be initialized, yet it's being deleted. " \
 				"By design objects queued in the command queue should always have a reference count >= 1, therefore never be deleted " \
 				"By design objects queued in the command queue should always have a reference count >= 1, therefore never be deleted " \
 				"while still in the queue.");
 				"while still in the queue.");
 		}
 		}

+ 5 - 5
BansheeCore/Source/CmCoreObjectManager.cpp

@@ -12,8 +12,8 @@ namespace BansheeEngine
 
 
 	CoreObjectManager::~CoreObjectManager()
 	CoreObjectManager::~CoreObjectManager()
 	{
 	{
-#if CM_DEBUG_MODE
-		CM_LOCK_MUTEX(mObjectsMutex);
+#if BS_DEBUG_MODE
+		BS_LOCK_MUTEX(mObjectsMutex);
 
 
 		if(mObjects.size() > 0)
 		if(mObjects.size() > 0)
 		{
 		{
@@ -21,7 +21,7 @@ namespace BansheeEngine
 			// (Reason: This is called on application shutdown and at that point we also unload any dynamic libraries, 
 			// (Reason: This is called on application shutdown and at that point we also unload any dynamic libraries, 
 			// which will invalidate any pointers to objects created from those libraries. Therefore we require of the user to 
 			// which will invalidate any pointers to objects created from those libraries. Therefore we require of the user to 
 			// clean up all objects manually before shutting down the application).
 			// clean up all objects manually before shutting down the application).
-			CM_EXCEPT(InternalErrorException, "Core object manager shut down, but not all objects were released. User must release ALL " \
+			BS_EXCEPT(InternalErrorException, "Core object manager shut down, but not all objects were released. User must release ALL " \
 				"engine objects before application shutdown.");
 				"engine objects before application shutdown.");
 		}
 		}
 #endif
 #endif
@@ -31,7 +31,7 @@ namespace BansheeEngine
 	{
 	{
 		assert(object != nullptr);
 		assert(object != nullptr);
 
 
-		CM_LOCK_MUTEX(mObjectsMutex);
+		BS_LOCK_MUTEX(mObjectsMutex);
 
 
 		mObjects[mNextAvailableID] = object;
 		mObjects[mNextAvailableID] = object;
 
 
@@ -42,7 +42,7 @@ namespace BansheeEngine
 	{
 	{
 		assert(object != nullptr);
 		assert(object != nullptr);
 
 
-		CM_LOCK_MUTEX(mObjectsMutex);
+		BS_LOCK_MUTEX(mObjectsMutex);
 
 
 		mObjects.erase(object->getInternalID());
 		mObjects.erase(object->getInternalID());
 	}
 	}

+ 44 - 44
BansheeCore/Source/CmCoreThread.cpp

@@ -7,7 +7,7 @@ using namespace std::placeholders;
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-	CM_THREADLOCAL CoreThread::AccessorContainer* CoreThread::mAccessor = nullptr;
+	BS_THREADLOCAL CoreThread::AccessorContainer* CoreThread::mAccessor = nullptr;
 
 
 	CoreThread::CoreThread()
 	CoreThread::CoreThread()
 		: mCoreThreadShutdown(false)
 		: mCoreThreadShutdown(false)
@@ -16,11 +16,11 @@ namespace BansheeEngine
 		, mSyncedCoreAccessor(nullptr)
 		, mSyncedCoreAccessor(nullptr)
 		, mActiveFrameAlloc(0)
 		, mActiveFrameAlloc(0)
 	{
 	{
-		mFrameAllocs[0] = cm_new<FrameAlloc>();
-		mFrameAllocs[1] = cm_new<FrameAlloc>();
+		mFrameAllocs[0] = bs_new<FrameAlloc>();
+		mFrameAllocs[1] = bs_new<FrameAlloc>();
 
 
-		mCoreThreadId = CM_THREAD_CURRENT_ID;
-		mCommandQueue = cm_new<CommandQueue<CommandQueueSync>>(CM_THREAD_CURRENT_ID);
+		mCoreThreadId = BS_THREAD_CURRENT_ID;
+		mCommandQueue = bs_new<CommandQueue<CommandQueueSync>>(BS_THREAD_CURRENT_ID);
 
 
 		initCoreThread();
 		initCoreThread();
 	}
 	}
@@ -31,11 +31,11 @@ namespace BansheeEngine
 		shutdownCoreThread();
 		shutdownCoreThread();
 
 
 		{
 		{
-			CM_LOCK_MUTEX(mAccessorMutex);
+			BS_LOCK_MUTEX(mAccessorMutex);
 
 
 			for(auto& accessor : mAccessors)
 			for(auto& accessor : mAccessors)
 			{
 			{
-				cm_delete(accessor);
+				bs_delete(accessor);
 			}
 			}
 
 
 			mAccessors.clear();
 			mAccessors.clear();
@@ -43,51 +43,51 @@ namespace BansheeEngine
 
 
 		if(mCommandQueue != nullptr)
 		if(mCommandQueue != nullptr)
 		{
 		{
-			cm_delete(mCommandQueue);
+			bs_delete(mCommandQueue);
 			mCommandQueue = nullptr;
 			mCommandQueue = nullptr;
 		}
 		}
 
 
-		cm_delete(mFrameAllocs[0]);
-		cm_delete(mFrameAllocs[1]);
+		bs_delete(mFrameAllocs[0]);
+		bs_delete(mFrameAllocs[1]);
 	}
 	}
 
 
 	void CoreThread::initCoreThread()
 	void CoreThread::initCoreThread()
 	{
 	{
-#if !CM_FORCE_SINGLETHREADED_RENDERING
-#if CM_THREAD_SUPPORT
+#if !BS_FORCE_SINGLETHREADED_RENDERING
+#if BS_THREAD_SUPPORT
 		ThreadPool::instance().run("Core", std::bind(&CoreThread::runCoreThread, this));
 		ThreadPool::instance().run("Core", std::bind(&CoreThread::runCoreThread, this));
 #else
 #else
-		CM_EXCEPT(InternalErrorException, "Attempting to start a core thread but application isn't compiled with thread support.");
+		BS_EXCEPT(InternalErrorException, "Attempting to start a core thread but application isn't compiled with thread support.");
 #endif
 #endif
 #endif
 #endif
 	}
 	}
 
 
 	void CoreThread::runCoreThread()
 	void CoreThread::runCoreThread()
 	{
 	{
-#if !CM_FORCE_SINGLETHREADED_RENDERING
+#if !BS_FORCE_SINGLETHREADED_RENDERING
 		TaskScheduler::instance().removeWorker(); // One less worker because we are reserving one core for this thread
 		TaskScheduler::instance().removeWorker(); // One less worker because we are reserving one core for this thread
 
 
-		mCoreThreadId = CM_THREAD_CURRENT_ID;
-		mSyncedCoreAccessor = cm_new<CoreThreadAccessor<CommandQueueSync>>(CM_THREAD_CURRENT_ID);
+		mCoreThreadId = BS_THREAD_CURRENT_ID;
+		mSyncedCoreAccessor = bs_new<CoreThreadAccessor<CommandQueueSync>>(BS_THREAD_CURRENT_ID);
 
 
 		while(true)
 		while(true)
 		{
 		{
 			// Wait until we get some ready commands
 			// Wait until we get some ready commands
 			Queue<QueuedCommand>* commands = nullptr;
 			Queue<QueuedCommand>* commands = nullptr;
 			{
 			{
-				CM_LOCK_MUTEX_NAMED(mCommandQueueMutex, lock)
+				BS_LOCK_MUTEX_NAMED(mCommandQueueMutex, lock)
 
 
 				while(mCommandQueue->isEmpty())
 				while(mCommandQueue->isEmpty())
 				{
 				{
 					if(mCoreThreadShutdown)
 					if(mCoreThreadShutdown)
 					{
 					{
-						cm_delete(mSyncedCoreAccessor);
+						bs_delete(mSyncedCoreAccessor);
 						TaskScheduler::instance().addWorker();
 						TaskScheduler::instance().addWorker();
 						return;
 						return;
 					}
 					}
 
 
 					TaskScheduler::instance().addWorker(); // Do something else while we wait, otherwise this core will be unused
 					TaskScheduler::instance().addWorker(); // Do something else while we wait, otherwise this core will be unused
-					CM_THREAD_WAIT(mCommandReadyCondition, mCommandQueueMutex, lock);
+					BS_THREAD_WAIT(mCommandReadyCondition, mCommandQueueMutex, lock);
 					TaskScheduler::instance().removeWorker();
 					TaskScheduler::instance().removeWorker();
 				}
 				}
 
 
@@ -102,17 +102,17 @@ namespace BansheeEngine
 
 
 	void CoreThread::shutdownCoreThread()
 	void CoreThread::shutdownCoreThread()
 	{
 	{
-#if !CM_FORCE_SINGLETHREADED_RENDERING
+#if !BS_FORCE_SINGLETHREADED_RENDERING
 
 
 		{
 		{
-			CM_LOCK_MUTEX(mCommandQueueMutex);
+			BS_LOCK_MUTEX(mCommandQueueMutex);
 			mCoreThreadShutdown = true;
 			mCoreThreadShutdown = true;
 		}
 		}
 
 
 		// Wake all threads. They will quit after they see the shutdown flag
 		// Wake all threads. They will quit after they see the shutdown flag
-		CM_THREAD_NOTIFY_ALL(mCommandReadyCondition);
+		BS_THREAD_NOTIFY_ALL(mCommandReadyCondition);
 
 
-		mCoreThreadId = CM_THREAD_CURRENT_ID;
+		mCoreThreadId = BS_THREAD_CURRENT_ID;
 #endif
 #endif
 	}
 	}
 
 
@@ -120,11 +120,11 @@ namespace BansheeEngine
 	{
 	{
 		if(mAccessor == nullptr)
 		if(mAccessor == nullptr)
 		{
 		{
-			CoreAccessorPtr newAccessor = cm_shared_ptr<CoreThreadAccessor<CommandQueueNoSync>>(CM_THREAD_CURRENT_ID);
-			mAccessor = cm_new<AccessorContainer>();
+			CoreAccessorPtr newAccessor = bs_shared_ptr<CoreThreadAccessor<CommandQueueNoSync>>(BS_THREAD_CURRENT_ID);
+			mAccessor = bs_new<AccessorContainer>();
 			mAccessor->accessor = newAccessor;
 			mAccessor->accessor = newAccessor;
 
 
-			CM_LOCK_MUTEX(mAccessorMutex);
+			BS_LOCK_MUTEX(mAccessorMutex);
 			mAccessors.push_back(mAccessor);
 			mAccessors.push_back(mAccessor);
 		}
 		}
 
 
@@ -141,7 +141,7 @@ namespace BansheeEngine
 		Vector<AccessorContainer*> accessorCopies;
 		Vector<AccessorContainer*> accessorCopies;
 
 
 		{
 		{
-			CM_LOCK_MUTEX(mAccessorMutex);
+			BS_LOCK_MUTEX(mAccessorMutex);
 
 
 			accessorCopies = mAccessors;
 			accessorCopies = mAccessors;
 		}
 		}
@@ -156,7 +156,7 @@ namespace BansheeEngine
 	{
 	{
 		AsyncOp op;
 		AsyncOp op;
 
 
-		if(CM_THREAD_CURRENT_ID == getCoreThreadId())
+		if(BS_THREAD_CURRENT_ID == getCoreThreadId())
 		{
 		{
 			commandCallback(op); // Execute immediately
 			commandCallback(op); // Execute immediately
 			return op;
 			return op;
@@ -164,7 +164,7 @@ namespace BansheeEngine
 
 
 		UINT32 commandId = -1;
 		UINT32 commandId = -1;
 		{
 		{
-			CM_LOCK_MUTEX(mCommandQueueMutex);
+			BS_LOCK_MUTEX(mCommandQueueMutex);
 
 
 			if(blockUntilComplete)
 			if(blockUntilComplete)
 			{
 			{
@@ -175,7 +175,7 @@ namespace BansheeEngine
 				op = mCommandQueue->queueReturn(commandCallback);
 				op = mCommandQueue->queueReturn(commandCallback);
 		}
 		}
 
 
-		CM_THREAD_NOTIFY_ALL(mCommandReadyCondition);
+		BS_THREAD_NOTIFY_ALL(mCommandReadyCondition);
 
 
 		if(blockUntilComplete)
 		if(blockUntilComplete)
 			blockUntilCommandCompleted(commandId);
 			blockUntilCommandCompleted(commandId);
@@ -185,7 +185,7 @@ namespace BansheeEngine
 
 
 	void CoreThread::queueCommand(std::function<void()> commandCallback, bool blockUntilComplete)
 	void CoreThread::queueCommand(std::function<void()> commandCallback, bool blockUntilComplete)
 	{
 	{
-		if(CM_THREAD_CURRENT_ID == getCoreThreadId())
+		if(BS_THREAD_CURRENT_ID == getCoreThreadId())
 		{
 		{
 			commandCallback(); // Execute immediately
 			commandCallback(); // Execute immediately
 			return;
 			return;
@@ -193,7 +193,7 @@ namespace BansheeEngine
 
 
 		UINT32 commandId = -1;
 		UINT32 commandId = -1;
 		{
 		{
-			CM_LOCK_MUTEX(mCommandQueueMutex);
+			BS_LOCK_MUTEX(mCommandQueueMutex);
 
 
 			if(blockUntilComplete)
 			if(blockUntilComplete)
 			{
 			{
@@ -204,7 +204,7 @@ namespace BansheeEngine
 				mCommandQueue->queue(commandCallback);
 				mCommandQueue->queue(commandCallback);
 		}
 		}
 
 
-		CM_THREAD_NOTIFY_ALL(mCommandReadyCondition);
+		BS_THREAD_NOTIFY_ALL(mCommandReadyCondition);
 
 
 		if(blockUntilComplete)
 		if(blockUntilComplete)
 			blockUntilCommandCompleted(commandId);
 			blockUntilCommandCompleted(commandId);
@@ -223,8 +223,8 @@ namespace BansheeEngine
 
 
 	void CoreThread::blockUntilCommandCompleted(UINT32 commandId)
 	void CoreThread::blockUntilCommandCompleted(UINT32 commandId)
 	{
 	{
-#if !CM_FORCE_SINGLETHREADED_RENDERING
-		CM_LOCK_MUTEX_NAMED(mCommandNotifyMutex, lock);
+#if !BS_FORCE_SINGLETHREADED_RENDERING
+		BS_LOCK_MUTEX_NAMED(mCommandNotifyMutex, lock);
 
 
 		while(true)
 		while(true)
 		{
 		{
@@ -244,7 +244,7 @@ namespace BansheeEngine
 				break;
 				break;
 			}
 			}
 
 
-			CM_THREAD_WAIT(mCommandCompleteCondition, mCommandNotifyMutex, lock);
+			BS_THREAD_WAIT(mCommandCompleteCondition, mCommandNotifyMutex, lock);
 		}
 		}
 #endif
 #endif
 	}
 	}
@@ -252,12 +252,12 @@ namespace BansheeEngine
 	void CoreThread::commandCompletedNotify(UINT32 commandId)
 	void CoreThread::commandCompletedNotify(UINT32 commandId)
 	{
 	{
 		{
 		{
-			CM_LOCK_MUTEX(mCommandNotifyMutex);
+			BS_LOCK_MUTEX(mCommandNotifyMutex);
 
 
 			mCommandsCompleted.push_back(commandId);
 			mCommandsCompleted.push_back(commandId);
 		}
 		}
 
 
-		CM_THREAD_NOTIFY_ALL(mCommandCompleteCondition);
+		BS_THREAD_NOTIFY_ALL(mCommandCompleteCondition);
 	}
 	}
 
 
 	CoreThread& gCoreThread()
 	CoreThread& gCoreThread()
@@ -272,17 +272,17 @@ namespace BansheeEngine
 
 
 	void throwIfNotCoreThread()
 	void throwIfNotCoreThread()
 	{
 	{
-#if !CM_FORCE_SINGLETHREADED_RENDERING
-		if(CM_THREAD_CURRENT_ID != CoreThread::instance().getCoreThreadId())
-			CM_EXCEPT(InternalErrorException, "This method can only be accessed from the core thread.");
+#if !BS_FORCE_SINGLETHREADED_RENDERING
+		if(BS_THREAD_CURRENT_ID != CoreThread::instance().getCoreThreadId())
+			BS_EXCEPT(InternalErrorException, "This method can only be accessed from the core thread.");
 #endif
 #endif
 	}
 	}
 
 
 	void throwIfCoreThread()
 	void throwIfCoreThread()
 	{
 	{
-#if !CM_FORCE_SINGLETHREADED_RENDERING
-		if(CM_THREAD_CURRENT_ID == CoreThread::instance().getCoreThreadId())
-			CM_EXCEPT(InternalErrorException, "This method cannot be accessed from the core thread.");
+#if !BS_FORCE_SINGLETHREADED_RENDERING
+		if(BS_THREAD_CURRENT_ID == CoreThread::instance().getCoreThreadId())
+			BS_EXCEPT(InternalErrorException, "This method cannot be accessed from the core thread.");
 #endif
 #endif
 	}
 	}
 }
 }

+ 1 - 1
BansheeCore/Source/CmCoreThreadAccessor.cpp

@@ -21,7 +21,7 @@ namespace BansheeEngine
 
 
 	CoreThreadAccessorBase::~CoreThreadAccessorBase()
 	CoreThreadAccessorBase::~CoreThreadAccessorBase()
 	{
 	{
-		cm_delete(mCommandQueue);
+		bs_delete(mCommandQueue);
 	}
 	}
 
 
 	void CoreThreadAccessorBase::disableTextureUnit(GpuProgramType gptype, UINT16 texUnit)
 	void CoreThreadAccessorBase::disableTextureUnit(GpuProgramType gptype, UINT16 texUnit)

+ 2 - 2
BansheeCore/Source/CmFontManager.cpp

@@ -5,7 +5,7 @@ namespace BansheeEngine
 {
 {
 	FontPtr FontManager::create(const Vector<FontData>& fontData) const
 	FontPtr FontManager::create(const Vector<FontData>& fontData) const
 	{
 	{
-		FontPtr newFont = cm_core_ptr<Font, PoolAlloc>(new (cm_alloc<Font, PoolAlloc>()) Font());
+		FontPtr newFont = bs_core_ptr<Font, PoolAlloc>(new (bs_alloc<Font, PoolAlloc>()) Font());
 		newFont->_setThisPtr(newFont);
 		newFont->_setThisPtr(newFont);
 		newFont->initialize(fontData);
 		newFont->initialize(fontData);
 
 
@@ -14,7 +14,7 @@ namespace BansheeEngine
 
 
 	FontPtr FontManager::_createEmpty() const
 	FontPtr FontManager::_createEmpty() const
 	{
 	{
-		FontPtr newFont = cm_core_ptr<Font, PoolAlloc>(new (cm_alloc<Font, PoolAlloc>()) Font());
+		FontPtr newFont = bs_core_ptr<Font, PoolAlloc>(new (bs_alloc<Font, PoolAlloc>()) Font());
 		newFont->_setThisPtr(newFont);
 		newFont->_setThisPtr(newFont);
 
 
 		return newFont;
 		return newFont;

+ 1 - 1
BansheeCore/Source/CmGameObject.cpp

@@ -12,7 +12,7 @@ namespace BansheeEngine
 
 
 	void GameObject::initialize(const std::shared_ptr<GameObject>& object, UINT64 instanceId)
 	void GameObject::initialize(const std::shared_ptr<GameObject>& object, UINT64 instanceId)
 	{
 	{
-		mInstanceData = cm_shared_ptr<GameObjectInstanceData>();
+		mInstanceData = bs_shared_ptr<GameObjectInstanceData>();
 		mInstanceData->object = object;
 		mInstanceData->object = object;
 		mInstanceData->mInstanceId = instanceId;
 		mInstanceData->mInstanceId = instanceId;
 	}
 	}

+ 4 - 4
BansheeCore/Source/CmGameObjectHandle.cpp

@@ -12,17 +12,17 @@ namespace BansheeEngine
 
 
 	GameObjectHandleBase::GameObjectHandleBase(const std::shared_ptr<GameObject> ptr)
 	GameObjectHandleBase::GameObjectHandleBase(const std::shared_ptr<GameObject> ptr)
 	{
 	{
-		mData = cm_shared_ptr<GameObjectHandleData, PoolAlloc>(ptr->mInstanceData);
+		mData = bs_shared_ptr<GameObjectHandleData, PoolAlloc>(ptr->mInstanceData);
 	}
 	}
 
 
 	GameObjectHandleBase::GameObjectHandleBase(std::nullptr_t ptr)
 	GameObjectHandleBase::GameObjectHandleBase(std::nullptr_t ptr)
 	{
 	{
-		mData = cm_shared_ptr<GameObjectHandleData, PoolAlloc>(nullptr);
+		mData = bs_shared_ptr<GameObjectHandleData, PoolAlloc>(nullptr);
 	}
 	}
 
 
 	GameObjectHandleBase::GameObjectHandleBase()
 	GameObjectHandleBase::GameObjectHandleBase()
 	{
 	{
-		mData = cm_shared_ptr<GameObjectHandleData, PoolAlloc>(nullptr);
+		mData = bs_shared_ptr<GameObjectHandleData, PoolAlloc>(nullptr);
 	}
 	}
 
 
 	void GameObjectHandleBase::_resolve(const GameObjectHandleBase& object) 
 	void GameObjectHandleBase::_resolve(const GameObjectHandleBase& object) 
@@ -35,7 +35,7 @@ namespace BansheeEngine
 	{
 	{
 		if(isDestroyed()) 
 		if(isDestroyed()) 
 		{
 		{
-			CM_EXCEPT(InternalErrorException, "Trying to access an object that has been destroyed.");
+			BS_EXCEPT(InternalErrorException, "Trying to access an object that has been destroyed.");
 		}
 		}
 	}
 	}
 
 

+ 6 - 6
BansheeCore/Source/CmGameObjectManager.cpp

@@ -99,10 +99,10 @@ namespace BansheeEngine
 
 
 	void GameObjectManager::registerDeserializedId(UINT64 serializedId, UINT64 actualId)
 	void GameObjectManager::registerDeserializedId(UINT64 serializedId, UINT64 actualId)
 	{
 	{
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(!mIsDeserializationActive)
 		if(!mIsDeserializationActive)
 		{
 		{
-			CM_EXCEPT(InvalidStateException, "ID mapping may only be modified while deserialization is active.");
+			BS_EXCEPT(InvalidStateException, "ID mapping may only be modified while deserialization is active.");
 		}
 		}
 #endif
 #endif
 
 
@@ -111,10 +111,10 @@ namespace BansheeEngine
 
 
 	void GameObjectManager::registerUnresolvedHandle(const GameObjectHandleBase& object)
 	void GameObjectManager::registerUnresolvedHandle(const GameObjectHandleBase& object)
 	{
 	{
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(!mIsDeserializationActive)
 		if(!mIsDeserializationActive)
 		{
 		{
-			CM_EXCEPT(InvalidStateException, "Unresolved handle queue only be modified while deserialization is active.");
+			BS_EXCEPT(InvalidStateException, "Unresolved handle queue only be modified while deserialization is active.");
 		}
 		}
 #endif
 #endif
 
 
@@ -123,10 +123,10 @@ namespace BansheeEngine
 
 
 	void GameObjectManager::registerOnDeserializationEndCallback(std::function<void()> callback)
 	void GameObjectManager::registerOnDeserializationEndCallback(std::function<void()> callback)
 	{
 	{
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(!mIsDeserializationActive)
 		if(!mIsDeserializationActive)
 		{
 		{
-			CM_EXCEPT(InvalidStateException, "Callback queue only be modified while deserialization is active.");
+			BS_EXCEPT(InvalidStateException, "Callback queue only be modified while deserialization is active.");
 		}
 		}
 #endif
 #endif
 
 

+ 4 - 4
BansheeCore/Source/CmGpuBuffer.cpp

@@ -27,7 +27,7 @@ namespace BansheeEngine
 		for(auto iter = mBufferViews.begin(); iter != mBufferViews.end(); ++iter)
 		for(auto iter = mBufferViews.begin(); iter != mBufferViews.end(); ++iter)
 		{
 		{
 			destroyView(iter->second->view);
 			destroyView(iter->second->view);
-			cm_delete<PoolAlloc>(iter->second);
+			bs_delete<PoolAlloc>(iter->second);
 		}
 		}
 
 
 		mBufferViews.clear();
 		mBufferViews.clear();
@@ -47,7 +47,7 @@ namespace BansheeEngine
 		{
 		{
 			GpuBufferView* newView = buffer->createView();
 			GpuBufferView* newView = buffer->createView();
 			newView->initialize(buffer, key);
 			newView->initialize(buffer, key);
-			buffer->mBufferViews[key] = cm_new<GpuBufferReference, PoolAlloc>(newView);
+			buffer->mBufferViews[key] = bs_new<GpuBufferReference, PoolAlloc>(newView);
 
 
 			iterFind = buffer->mBufferViews.find(key);
 			iterFind = buffer->mBufferViews.find(key);
 		}
 		}
@@ -63,7 +63,7 @@ namespace BansheeEngine
 		auto iterFind = buffer->mBufferViews.find(view->getDesc());
 		auto iterFind = buffer->mBufferViews.find(view->getDesc());
 		if(iterFind == buffer->mBufferViews.end())
 		if(iterFind == buffer->mBufferViews.end())
 		{
 		{
-			CM_EXCEPT(InternalErrorException, "Trying to release a buffer view that doesn't exist!");
+			BS_EXCEPT(InternalErrorException, "Trying to release a buffer view that doesn't exist!");
 		}
 		}
 
 
 		iterFind->second->refCount--;
 		iterFind->second->refCount--;
@@ -75,7 +75,7 @@ namespace BansheeEngine
 			buffer->mBufferViews.erase(iterFind);
 			buffer->mBufferViews.erase(iterFind);
 
 
 			buffer->destroyView(toRemove->view);
 			buffer->destroyView(toRemove->view);
-			cm_delete<PoolAlloc>(toRemove);
+			bs_delete<PoolAlloc>(toRemove);
 		}
 		}
 	}
 	}
 }
 }

+ 17 - 17
BansheeCore/Source/CmGpuParam.cpp

@@ -18,22 +18,22 @@ namespace BansheeEngine
 	{ }
 	{ }
 
 
 	GpuParamStruct::GpuParamStruct()
 	GpuParamStruct::GpuParamStruct()
-		:mData(cm_shared_ptr<InternalData>())
+		:mData(bs_shared_ptr<InternalData>())
 	{ }
 	{ }
 
 
 	GpuParamStruct::GpuParamStruct(GpuParamDataDesc* paramDesc, GpuParamBlock** paramBlocks)
 	GpuParamStruct::GpuParamStruct(GpuParamDataDesc* paramDesc, GpuParamBlock** paramBlocks)
-		:mData(cm_shared_ptr<InternalData>(paramDesc, paramBlocks))
+		:mData(bs_shared_ptr<InternalData>(paramDesc, paramBlocks))
 	{ }
 	{ }
 
 
 	void GpuParamStruct::set(const void* value, UINT32 sizeBytes, UINT32 arrayIdx)
 	void GpuParamStruct::set(const void* value, UINT32 sizeBytes, UINT32 arrayIdx)
 	{
 	{
 		if(mData->isDestroyed)
 		if(mData->isDestroyed)
-			CM_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
+			BS_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
 
 
 		GpuParamDataDesc* paramDesc = mData->paramDesc;
 		GpuParamDataDesc* paramDesc = mData->paramDesc;
 		UINT32 elementSizeBytes = paramDesc->elementSize * sizeof(UINT32);
 		UINT32 elementSizeBytes = paramDesc->elementSize * sizeof(UINT32);
 
 
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(sizeBytes > elementSizeBytes)
 		if(sizeBytes > elementSizeBytes)
 		{
 		{
 			LOGWRN("Provided element size larger than maximum element size. Maximum size: " + 
 			LOGWRN("Provided element size larger than maximum element size. Maximum size: " + 
@@ -42,7 +42,7 @@ namespace BansheeEngine
 
 
 		if(arrayIdx >= paramDesc->arraySize)
 		if(arrayIdx >= paramDesc->arraySize)
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Array index out of range. Array size: " + 
+			BS_EXCEPT(InvalidParametersException, "Array index out of range. Array size: " + 
 				toString(paramDesc->arraySize) + ". Requested size: " + toString(arrayIdx));
 				toString(paramDesc->arraySize) + ". Requested size: " + toString(arrayIdx));
 		}
 		}
 #endif
 #endif
@@ -63,12 +63,12 @@ namespace BansheeEngine
 	void GpuParamStruct::get(void* value, UINT32 sizeBytes, UINT32 arrayIdx)
 	void GpuParamStruct::get(void* value, UINT32 sizeBytes, UINT32 arrayIdx)
 	{
 	{
 		if(mData->isDestroyed)
 		if(mData->isDestroyed)
-			CM_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
+			BS_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
 
 
 		GpuParamDataDesc* paramDesc = mData->paramDesc;
 		GpuParamDataDesc* paramDesc = mData->paramDesc;
 		UINT32 elementSizeBytes = paramDesc->elementSize * sizeof(UINT32);
 		UINT32 elementSizeBytes = paramDesc->elementSize * sizeof(UINT32);
 
 
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(sizeBytes > elementSizeBytes)
 		if(sizeBytes > elementSizeBytes)
 		{
 		{
 			LOGWRN("Provided element size larger than maximum element size. Maximum size: " + 
 			LOGWRN("Provided element size larger than maximum element size. Maximum size: " + 
@@ -77,7 +77,7 @@ namespace BansheeEngine
 
 
 		if(arrayIdx >= paramDesc->arraySize)
 		if(arrayIdx >= paramDesc->arraySize)
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Array index out of range. Array size: " + 
+			BS_EXCEPT(InvalidParametersException, "Array index out of range. Array size: " + 
 				toString(paramDesc->arraySize) + ". Requested size: " + toString(arrayIdx));
 				toString(paramDesc->arraySize) + ". Requested size: " + toString(arrayIdx));
 		}
 		}
 #endif
 #endif
@@ -90,7 +90,7 @@ namespace BansheeEngine
 	UINT32 GpuParamStruct::getElementSize() const
 	UINT32 GpuParamStruct::getElementSize() const
 	{
 	{
 		if(mData->isDestroyed)
 		if(mData->isDestroyed)
-			CM_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
+			BS_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
 
 
 		GpuParamDataDesc* paramDesc = mData->paramDesc;
 		GpuParamDataDesc* paramDesc = mData->paramDesc;
 		return paramDesc->elementSize * sizeof(UINT32);
 		return paramDesc->elementSize * sizeof(UINT32);
@@ -117,17 +117,17 @@ namespace BansheeEngine
 	{ }
 	{ }
 
 
 	GpuParamTexture::GpuParamTexture()
 	GpuParamTexture::GpuParamTexture()
-		:mData(cm_shared_ptr<InternalData>())
+		:mData(bs_shared_ptr<InternalData>())
 	{ }
 	{ }
 
 
 	GpuParamTexture::GpuParamTexture(GpuParamObjectDesc* paramDesc, HTexture* textures)
 	GpuParamTexture::GpuParamTexture(GpuParamObjectDesc* paramDesc, HTexture* textures)
-		:mData(cm_shared_ptr<InternalData>(paramDesc, textures))
+		:mData(bs_shared_ptr<InternalData>(paramDesc, textures))
 	{ }
 	{ }
 
 
 	void GpuParamTexture::set(const HTexture& texture)
 	void GpuParamTexture::set(const HTexture& texture)
 	{
 	{
 		if(mData->isDestroyed)
 		if(mData->isDestroyed)
-			CM_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
+			BS_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
 
 
 		mData->textures[mData->paramDesc->slot] = texture;
 		mData->textures[mData->paramDesc->slot] = texture;
 	}
 	}
@@ -135,7 +135,7 @@ namespace BansheeEngine
 	HTexture GpuParamTexture::get()
 	HTexture GpuParamTexture::get()
 	{
 	{
 		if(mData->isDestroyed)
 		if(mData->isDestroyed)
-			CM_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
+			BS_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
 
 
 		return mData->textures[mData->paramDesc->slot];
 		return mData->textures[mData->paramDesc->slot];
 	}
 	}
@@ -161,17 +161,17 @@ namespace BansheeEngine
 	{ }
 	{ }
 
 
 	GpuParamSampState::GpuParamSampState()
 	GpuParamSampState::GpuParamSampState()
-		:mData(cm_shared_ptr<InternalData>())
+		:mData(bs_shared_ptr<InternalData>())
 	{ }
 	{ }
 
 
 	GpuParamSampState::GpuParamSampState(GpuParamObjectDesc* paramDesc, HSamplerState* samplerStates)
 	GpuParamSampState::GpuParamSampState(GpuParamObjectDesc* paramDesc, HSamplerState* samplerStates)
-		:mData(cm_shared_ptr<InternalData>(paramDesc, samplerStates))
+		:mData(bs_shared_ptr<InternalData>(paramDesc, samplerStates))
 	{ }
 	{ }
 
 
 	void GpuParamSampState::set(const HSamplerState& samplerState)
 	void GpuParamSampState::set(const HSamplerState& samplerState)
 	{
 	{
 		if(mData->isDestroyed)
 		if(mData->isDestroyed)
-			CM_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
+			BS_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
 
 
 		mData->samplerStates[mData->paramDesc->slot] = samplerState;
 		mData->samplerStates[mData->paramDesc->slot] = samplerState;
 	}
 	}
@@ -179,7 +179,7 @@ namespace BansheeEngine
 	HSamplerState GpuParamSampState::get()
 	HSamplerState GpuParamSampState::get()
 	{
 	{
 		if(mData->isDestroyed)
 		if(mData->isDestroyed)
-			CM_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
+			BS_EXCEPT(InternalErrorException, "Trying to access a destroyed gpu parameter.");
 
 
 		return mData->samplerStates[mData->paramDesc->slot];
 		return mData->samplerStates[mData->paramDesc->slot];
 	}
 	}

+ 9 - 9
BansheeCore/Source/CmGpuParamBlock.cpp

@@ -9,14 +9,14 @@ namespace BansheeEngine
 	GpuParamBlock::GpuParamBlock(UINT32 size)
 	GpuParamBlock::GpuParamBlock(UINT32 size)
 		:mDirty(true), mData(nullptr), mSize(size)
 		:mDirty(true), mData(nullptr), mSize(size)
 	{
 	{
-		mData = (UINT8*)cm_alloc<ScratchAlloc>(mSize);
+		mData = (UINT8*)bs_alloc<ScratchAlloc>(mSize);
 		memset(mData, 0, mSize);
 		memset(mData, 0, mSize);
 	}
 	}
 
 
 	GpuParamBlock::GpuParamBlock(GpuParamBlock* otherBlock)
 	GpuParamBlock::GpuParamBlock(GpuParamBlock* otherBlock)
 	{
 	{
 		mSize = otherBlock->mSize;
 		mSize = otherBlock->mSize;
-		mData = (UINT8*)cm_alloc<ScratchAlloc>(mSize);
+		mData = (UINT8*)bs_alloc<ScratchAlloc>(mSize);
 		write(0, otherBlock->getData(), otherBlock->getSize());
 		write(0, otherBlock->getData(), otherBlock->getSize());
 		mDirty = otherBlock->mDirty;
 		mDirty = otherBlock->mDirty;
 	}
 	}
@@ -24,15 +24,15 @@ namespace BansheeEngine
 	GpuParamBlock::~GpuParamBlock()
 	GpuParamBlock::~GpuParamBlock()
 	{
 	{
 		if(mData != nullptr)
 		if(mData != nullptr)
-			cm_free<ScratchAlloc>(mData);
+			bs_free<ScratchAlloc>(mData);
 	}
 	}
 
 
 	void GpuParamBlock::write(UINT32 offset, const void* data, UINT32 size)
 	void GpuParamBlock::write(UINT32 offset, const void* data, UINT32 size)
 	{
 	{
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(offset < 0 || (offset + size) > mSize)
 		if(offset < 0 || (offset + size) > mSize)
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Wanted range is out of buffer bounds. " \
+			BS_EXCEPT(InvalidParametersException, "Wanted range is out of buffer bounds. " \
 				"Available range: 0 .. " + toString(mSize) + ". " \
 				"Available range: 0 .. " + toString(mSize) + ". " \
 				"Wanted range: " + toString(offset) + " .. " + toString(offset + size) + ".");
 				"Wanted range: " + toString(offset) + " .. " + toString(offset + size) + ".");
 		}
 		}
@@ -45,10 +45,10 @@ namespace BansheeEngine
 
 
 	void GpuParamBlock::read(UINT32 offset, void* data, UINT32 size)
 	void GpuParamBlock::read(UINT32 offset, void* data, UINT32 size)
 	{
 	{
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(offset < 0 || (offset + size) > mSize)
 		if(offset < 0 || (offset + size) > mSize)
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Wanted range is out of buffer bounds. " \
+			BS_EXCEPT(InvalidParametersException, "Wanted range is out of buffer bounds. " \
 				"Available range: 0 .. " + toString(mSize) + ". " \
 				"Available range: 0 .. " + toString(mSize) + ". " \
 				"Wanted range: " + toString(offset) + " .. " + toString(offset + size) + ".");
 				"Wanted range: " + toString(offset) + " .. " + toString(offset + size) + ".");
 		}
 		}
@@ -59,10 +59,10 @@ namespace BansheeEngine
 
 
 	void GpuParamBlock::zeroOut(UINT32 offset, UINT32 size)
 	void GpuParamBlock::zeroOut(UINT32 offset, UINT32 size)
 	{
 	{
-#if CM_DEBUG_MODE
+#if BS_DEBUG_MODE
 		if(offset < 0 || (offset + size) > mSize)
 		if(offset < 0 || (offset + size) > mSize)
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Wanted range is out of buffer bounds. " \
+			BS_EXCEPT(InvalidParametersException, "Wanted range is out of buffer bounds. " \
 				"Available range: 0 .. " + toString(mSize) + ". " \
 				"Available range: 0 .. " + toString(mSize) + ". " \
 				"Wanted range: " + toString(offset) + " .. " + toString(offset + size) + ".");
 				"Wanted range: " + toString(offset) + " .. " + toString(offset + size) + ".");
 		}
 		}

+ 4 - 4
BansheeCore/Source/CmGpuParamBlockBuffer.cpp

@@ -12,7 +12,7 @@ namespace BansheeEngine
 	GpuParamBlockBuffer::~GpuParamBlockBuffer()
 	GpuParamBlockBuffer::~GpuParamBlockBuffer()
 	{
 	{
 		if(mParamBlock != nullptr)
 		if(mParamBlock != nullptr)
-			cm_delete(mParamBlock);
+			bs_delete(mParamBlock);
 	}
 	}
 
 
 	void GpuParamBlockBuffer::initialize(UINT32 size, GpuParamBlockUsage usage)
 	void GpuParamBlockBuffer::initialize(UINT32 size, GpuParamBlockUsage usage)
@@ -20,7 +20,7 @@ namespace BansheeEngine
 		mSize = size;
 		mSize = size;
 		mUsage = usage;
 		mUsage = usage;
 
 
-		mParamBlock = cm_new<GpuParamBlock, PoolAlloc>(size);
+		mParamBlock = bs_new<GpuParamBlock, PoolAlloc>(size);
 
 
 		CoreObject::initialize();
 		CoreObject::initialize();
 	}
 	}
@@ -37,7 +37,7 @@ namespace BansheeEngine
 
 
 	void GenericGpuParamBlockBuffer::initialize_internal()
 	void GenericGpuParamBlockBuffer::initialize_internal()
 	{
 	{
-		mData = (UINT8*)cm_alloc<ScratchAlloc>(mSize);
+		mData = (UINT8*)bs_alloc<ScratchAlloc>(mSize);
 		memset(mData, 0, mSize);
 		memset(mData, 0, mSize);
 
 
 		GpuParamBlockBuffer::initialize_internal();
 		GpuParamBlockBuffer::initialize_internal();
@@ -46,7 +46,7 @@ namespace BansheeEngine
 	void GenericGpuParamBlockBuffer::destroy_internal()
 	void GenericGpuParamBlockBuffer::destroy_internal()
 	{
 	{
 		if(mData != nullptr)
 		if(mData != nullptr)
-			cm_free<ScratchAlloc>(mData);
+			bs_free<ScratchAlloc>(mData);
 
 
 		GpuParamBlockBuffer::destroy_internal();
 		GpuParamBlockBuffer::destroy_internal();
 	}
 	}

+ 6 - 6
BansheeCore/Source/CmGpuParams.cpp

@@ -39,7 +39,7 @@ namespace BansheeEngine
 
 
 		UINT32 bufferSize = paramBlockBufferSize + paramBlockBuffersBufferSize + textureBufferSize + samplerStateBufferSize;
 		UINT32 bufferSize = paramBlockBufferSize + paramBlockBuffersBufferSize + textureBufferSize + samplerStateBufferSize;
 
 
-		mData = (UINT8*)cm_alloc(bufferSize);
+		mData = (UINT8*)bs_alloc(bufferSize);
 		
 		
 		UINT8* dataIter = mData;
 		UINT8* dataIter = mData;
 		mParamBlocks = (GpuParamBlock**)dataIter;
 		mParamBlocks = (GpuParamBlock**)dataIter;
@@ -152,14 +152,14 @@ namespace BansheeEngine
 		for(UINT32 i = 0; i < mNumSamplerStates; i++)
 		for(UINT32 i = 0; i < mNumSamplerStates; i++)
 			mSamplerStates[i].~ResourceHandle();
 			mSamplerStates[i].~ResourceHandle();
 
 
-		cm_free(mData);
+		bs_free(mData);
 	}
 	}
 
 
 	void GpuParams::setParamBlockBuffer(UINT32 slot, const GpuParamBlockBufferPtr& paramBlockBuffer)
 	void GpuParams::setParamBlockBuffer(UINT32 slot, const GpuParamBlockBufferPtr& paramBlockBuffer)
 	{
 	{
 		if(slot < 0 || slot >= mNumParamBlocks)
 		if(slot < 0 || slot >= mNumParamBlocks)
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Index out of range: Valid range: 0 .. " + 
+			BS_EXCEPT(InvalidParametersException, "Index out of range: Valid range: 0 .. " + 
 				toString(mNumParamBlocks - 1) + ". Requested: " + toString(slot));
 				toString(mNumParamBlocks - 1) + ". Requested: " + toString(slot));
 		}
 		}
 
 
@@ -227,7 +227,7 @@ namespace BansheeEngine
 		auto iterFind = mStructParams.find(name);
 		auto iterFind = mStructParams.find(name);
 
 
 		if(iterFind == mStructParams.end())
 		if(iterFind == mStructParams.end())
-			CM_EXCEPT(InvalidParametersException, "Cannot find struct parameter with the name '" + name + "'");
+			BS_EXCEPT(InvalidParametersException, "Cannot find struct parameter with the name '" + name + "'");
 
 
 		output = iterFind->second;
 		output = iterFind->second;
 	}
 	}
@@ -237,7 +237,7 @@ namespace BansheeEngine
 		auto iterFind = mTextureParams.find(name);
 		auto iterFind = mTextureParams.find(name);
 
 
 		if(iterFind == mTextureParams.end())
 		if(iterFind == mTextureParams.end())
-			CM_EXCEPT(InvalidParametersException, "Cannot find texture parameter with the name '" + name + "'");
+			BS_EXCEPT(InvalidParametersException, "Cannot find texture parameter with the name '" + name + "'");
 
 
 		output = iterFind->second;
 		output = iterFind->second;
 	}
 	}
@@ -247,7 +247,7 @@ namespace BansheeEngine
 		auto iterFind = mSampStateParams.find(name);
 		auto iterFind = mSampStateParams.find(name);
 
 
 		if(iterFind == mSampStateParams.end())
 		if(iterFind == mSampStateParams.end())
-			CM_EXCEPT(InvalidParametersException, "Cannot find sampler state parameter with the name '" + name + "'");
+			BS_EXCEPT(InvalidParametersException, "Cannot find sampler state parameter with the name '" + name + "'");
 
 
 		output = iterFind->second;
 		output = iterFind->second;
 	}
 	}

+ 2 - 2
BansheeCore/Source/CmGpuProgInclude.cpp

@@ -16,8 +16,8 @@ namespace BansheeEngine
 
 
 	GpuProgIncludePtr GpuProgInclude::_createPtr(const String& includeString)
 	GpuProgIncludePtr GpuProgInclude::_createPtr(const String& includeString)
 	{
 	{
-		GpuProgIncludePtr gpuProgIncludePtr = cm_core_ptr<GpuProgInclude, PoolAlloc>(
-			new (cm_alloc<GpuProgInclude, PoolAlloc>()) GpuProgInclude(includeString));
+		GpuProgIncludePtr gpuProgIncludePtr = bs_core_ptr<GpuProgInclude, PoolAlloc>(
+			new (bs_alloc<GpuProgInclude, PoolAlloc>()) GpuProgInclude(includeString));
 		gpuProgIncludePtr->_setThisPtr(gpuProgIncludePtr);
 		gpuProgIncludePtr->_setThisPtr(gpuProgIncludePtr);
 		gpuProgIncludePtr->initialize();
 		gpuProgIncludePtr->initialize();
 
 

+ 1 - 1
BansheeCore/Source/CmGpuProgram.cpp

@@ -61,7 +61,7 @@ namespace BansheeEngine
 
 
 	GpuParamsPtr GpuProgram::createParameters()
 	GpuParamsPtr GpuProgram::createParameters()
 	{
 	{
-		return cm_shared_ptr<GpuParams, PoolAlloc>(std::ref(mParametersDesc), false);
+		return bs_shared_ptr<GpuParams, PoolAlloc>(std::ref(mParametersDesc), false);
 	}
 	}
 
 
     const String& GpuProgram::getLanguage() const
     const String& GpuProgram::getLanguage() const

+ 1 - 1
BansheeCore/Source/CmGpuProgramImporter.cpp

@@ -55,6 +55,6 @@ namespace BansheeEngine
 
 
 	ImportOptionsPtr GpuProgramImporter::createImportOptions() const
 	ImportOptionsPtr GpuProgramImporter::createImportOptions() const
 	{
 	{
-		return cm_shared_ptr<GpuProgramImportOptions, PoolAlloc>();
+		return bs_shared_ptr<GpuProgramImportOptions, PoolAlloc>();
 	}
 	}
 }
 }

+ 4 - 4
BansheeCore/Source/CmGpuProgramManager.cpp

@@ -45,24 +45,24 @@ namespace BansheeEngine
 		GpuProgramPtr create(const String& source, const String& entryPoint, GpuProgramType gptype, 
 		GpuProgramPtr create(const String& source, const String& entryPoint, GpuProgramType gptype, 
 			GpuProgramProfile profile, const Vector<HGpuProgInclude>* includes, bool requiresAdjacencyInformation)
 			GpuProgramProfile profile, const Vector<HGpuProgInclude>* includes, bool requiresAdjacencyInformation)
 		{
 		{
-			return cm_core_ptr<NullProgram, PoolAlloc>();
+			return bs_core_ptr<NullProgram, PoolAlloc>();
 		}
 		}
 
 
 		GpuProgramPtr create(GpuProgramType type)
 		GpuProgramPtr create(GpuProgramType type)
 		{
 		{
-			return cm_core_ptr<NullProgram, PoolAlloc>();
+			return bs_core_ptr<NullProgram, PoolAlloc>();
 		}
 		}
 	};
 	};
 
 
 	GpuProgramManager::GpuProgramManager()
 	GpuProgramManager::GpuProgramManager()
 	{
 	{
-		mNullFactory = cm_new<NullProgramFactory>();
+		mNullFactory = bs_new<NullProgramFactory>();
 		addFactory(mNullFactory);
 		addFactory(mNullFactory);
 	}
 	}
 
 
 	GpuProgramManager::~GpuProgramManager()
 	GpuProgramManager::~GpuProgramManager()
 	{
 	{
-		cm_delete((NullProgramFactory*)mNullFactory);
+		bs_delete((NullProgramFactory*)mNullFactory);
 	}
 	}
 
 
 	void GpuProgramManager::addFactory(GpuProgramFactory* factory)
 	void GpuProgramManager::addFactory(GpuProgramFactory* factory)

+ 14 - 14
BansheeCore/Source/CmGpuResourceData.cpp

@@ -34,11 +34,11 @@ namespace BansheeEngine
 
 
 	UINT8* GpuResourceData::getData() const
 	UINT8* GpuResourceData::getData() const
 	{
 	{
-#if !CM_FORCE_SINGLETHREADED_RENDERING
+#if !BS_FORCE_SINGLETHREADED_RENDERING
 		if(mLocked)
 		if(mLocked)
 		{
 		{
-			if(CM_THREAD_CURRENT_ID != CoreThread::instance().getCoreThreadId())
-				CM_EXCEPT(InternalErrorException, "You are not allowed to access buffer data from non-core thread when the buffer is locked.");
+			if(BS_THREAD_CURRENT_ID != CoreThread::instance().getCoreThreadId())
+				BS_EXCEPT(InternalErrorException, "You are not allowed to access buffer data from non-core thread when the buffer is locked.");
 		}
 		}
 #endif
 #endif
 
 
@@ -52,17 +52,17 @@ namespace BansheeEngine
 
 
 	void GpuResourceData::allocateInternalBuffer(UINT32 size)
 	void GpuResourceData::allocateInternalBuffer(UINT32 size)
 	{
 	{
-#if !CM_FORCE_SINGLETHREADED_RENDERING
+#if !BS_FORCE_SINGLETHREADED_RENDERING
 		if(mLocked)
 		if(mLocked)
 		{
 		{
-			if(CM_THREAD_CURRENT_ID != CoreThread::instance().getCoreThreadId())
-				CM_EXCEPT(InternalErrorException, "You are not allowed to access buffer data from non-core thread when the buffer is locked.");
+			if(BS_THREAD_CURRENT_ID != CoreThread::instance().getCoreThreadId())
+				BS_EXCEPT(InternalErrorException, "You are not allowed to access buffer data from non-core thread when the buffer is locked.");
 		}
 		}
 #endif
 #endif
 
 
 		freeInternalBuffer();
 		freeInternalBuffer();
 
 
-		mData = (UINT8*)cm_alloc<ScratchAlloc>(size);
+		mData = (UINT8*)bs_alloc<ScratchAlloc>(size);
 		mOwnsData = true;
 		mOwnsData = true;
 	}
 	}
 
 
@@ -71,25 +71,25 @@ namespace BansheeEngine
 		if(mData == nullptr || !mOwnsData)
 		if(mData == nullptr || !mOwnsData)
 			return;
 			return;
 
 
-#if !CM_FORCE_SINGLETHREADED_RENDERING
+#if !BS_FORCE_SINGLETHREADED_RENDERING
 		if(mLocked)
 		if(mLocked)
 		{
 		{
-			if(CM_THREAD_CURRENT_ID != CoreThread::instance().getCoreThreadId())
-				CM_EXCEPT(InternalErrorException, "You are not allowed to access buffer data from non-core thread when the buffer is locked.");
+			if(BS_THREAD_CURRENT_ID != CoreThread::instance().getCoreThreadId())
+				BS_EXCEPT(InternalErrorException, "You are not allowed to access buffer data from non-core thread when the buffer is locked.");
 		}
 		}
 #endif
 #endif
 
 
-		cm_free<ScratchAlloc>(mData);
+		bs_free<ScratchAlloc>(mData);
 		mData = nullptr;
 		mData = nullptr;
 	}
 	}
 
 
 	void GpuResourceData::setExternalBuffer(UINT8* data)
 	void GpuResourceData::setExternalBuffer(UINT8* data)
 	{
 	{
-#if !CM_FORCE_SINGLETHREADED_RENDERING
+#if !BS_FORCE_SINGLETHREADED_RENDERING
 		if(mLocked)
 		if(mLocked)
 		{
 		{
-			if(CM_THREAD_CURRENT_ID != CoreThread::instance().getCoreThreadId())
-				CM_EXCEPT(InternalErrorException, "You are not allowed to access buffer data from non-core thread when the buffer is locked.");
+			if(BS_THREAD_CURRENT_ID != CoreThread::instance().getCoreThreadId())
+				BS_EXCEPT(InternalErrorException, "You are not allowed to access buffer data from non-core thread when the buffer is locked.");
 		}
 		}
 #endif
 #endif
 
 

+ 1 - 1
BansheeCore/Source/CmHardwareBufferManager.cpp

@@ -64,6 +64,6 @@ namespace BansheeEngine
 
 
 	VertexDeclarationPtr HardwareBufferManager::createVertexDeclarationImpl(const VertexDeclaration::VertexElementList& elements)
 	VertexDeclarationPtr HardwareBufferManager::createVertexDeclarationImpl(const VertexDeclaration::VertexElementList& elements)
 	{
 	{
-		return cm_core_ptr<VertexDeclaration, PoolAlloc>(new (cm_alloc<VertexDeclaration, PoolAlloc>()) VertexDeclaration(elements));
+		return bs_core_ptr<VertexDeclaration, PoolAlloc>(new (bs_alloc<VertexDeclaration, PoolAlloc>()) VertexDeclaration(elements));
 	}
 	}
 }
 }

+ 5 - 5
BansheeCore/Source/CmImporter.cpp

@@ -16,8 +16,8 @@ namespace BansheeEngine
 {
 {
 	Importer::Importer()
 	Importer::Importer()
 	{
 	{
-		_registerAssetImporter(cm_new<GpuProgIncludeImporter>());
-		_registerAssetImporter(cm_new<GpuProgramImporter>());
+		_registerAssetImporter(bs_new<GpuProgIncludeImporter>());
+		_registerAssetImporter(bs_new<GpuProgramImporter>());
 	}
 	}
 
 
 	Importer::~Importer()
 	Importer::~Importer()
@@ -25,7 +25,7 @@ namespace BansheeEngine
 		for(auto i = mAssetImporters.begin(); i != mAssetImporters.end(); ++i)
 		for(auto i = mAssetImporters.begin(); i != mAssetImporters.end(); ++i)
 		{
 		{
 			if((*i) != nullptr)
 			if((*i) != nullptr)
-				cm_delete(*i);
+				bs_delete(*i);
 		}
 		}
 
 
 		mAssetImporters.clear();
 		mAssetImporters.clear();
@@ -72,7 +72,7 @@ namespace BansheeEngine
 			ConstImportOptionsPtr defaultImportOptions = importer->getDefaultImportOptions();
 			ConstImportOptionsPtr defaultImportOptions = importer->getDefaultImportOptions();
 			if(importOptions->getTypeId() != defaultImportOptions->getTypeId())
 			if(importOptions->getTypeId() != defaultImportOptions->getTypeId())
 			{
 			{
-				CM_EXCEPT(InvalidParametersException, "Provided import options is not of valid type. " \
+				BS_EXCEPT(InvalidParametersException, "Provided import options is not of valid type. " \
 					"Expected: " + defaultImportOptions->getTypeName() + ". Got: " + importOptions->getTypeName() + ".");
 					"Expected: " + defaultImportOptions->getTypeName() + ". Got: " + importOptions->getTypeName() + ".");
 			}
 			}
 		}
 		}
@@ -100,7 +100,7 @@ namespace BansheeEngine
 			ConstImportOptionsPtr defaultImportOptions = importer->getDefaultImportOptions();
 			ConstImportOptionsPtr defaultImportOptions = importer->getDefaultImportOptions();
 			if(importOptions->getTypeId() != defaultImportOptions->getTypeId())
 			if(importOptions->getTypeId() != defaultImportOptions->getTypeId())
 			{
 			{
-				CM_EXCEPT(InvalidParametersException, "Provided import options is not of valid type. " \
+				BS_EXCEPT(InvalidParametersException, "Provided import options is not of valid type. " \
 					"Expected: " + defaultImportOptions->getTypeName() + ". Got: " + importOptions->getTypeName() + ".");
 					"Expected: " + defaultImportOptions->getTypeName() + ". Got: " + importOptions->getTypeName() + ".");
 			}
 			}
 		}
 		}

+ 7 - 7
BansheeCore/Source/CmInput.cpp

@@ -15,9 +15,9 @@ namespace BansheeEngine
 	Input::Input()
 	Input::Input()
 		:mSmoothHorizontalAxis(0.0f), mSmoothVerticalAxis(0.0f), mCurrentBufferIdx(0), mMouseLastRel(0, 0), mRawInputHandler(nullptr)
 		:mSmoothHorizontalAxis(0.0f), mSmoothVerticalAxis(0.0f), mCurrentBufferIdx(0), mMouseLastRel(0, 0), mRawInputHandler(nullptr)
 	{ 
 	{ 
-		mHorizontalHistoryBuffer = cm_newN<float>(HISTORY_BUFFER_SIZE);
-		mVerticalHistoryBuffer = cm_newN<float>(HISTORY_BUFFER_SIZE);
-		mTimesHistoryBuffer = cm_newN<float>(HISTORY_BUFFER_SIZE);
+		mHorizontalHistoryBuffer = bs_newN<float>(HISTORY_BUFFER_SIZE);
+		mVerticalHistoryBuffer = bs_newN<float>(HISTORY_BUFFER_SIZE);
+		mTimesHistoryBuffer = bs_newN<float>(HISTORY_BUFFER_SIZE);
 
 
 		for(int i = 0; i < HISTORY_BUFFER_SIZE; i++)
 		for(int i = 0; i < HISTORY_BUFFER_SIZE; i++)
 		{
 		{
@@ -29,7 +29,7 @@ namespace BansheeEngine
 		for(int i = 0; i < BC_Count; i++)
 		for(int i = 0; i < BC_Count; i++)
 			mKeyState[i] = ButtonState::Off;
 			mKeyState[i] = ButtonState::Off;
 
 
-		mOSInputHandler = cm_shared_ptr<OSInputHandler>();
+		mOSInputHandler = bs_shared_ptr<OSInputHandler>();
 
 
 		mOSInputHandler->onCharInput.connect(std::bind(&Input::charInput, this, _1));
 		mOSInputHandler->onCharInput.connect(std::bind(&Input::charInput, this, _1));
 		mOSInputHandler->onCursorMoved.connect(std::bind(&Input::cursorMoved, this, _1));
 		mOSInputHandler->onCursorMoved.connect(std::bind(&Input::cursorMoved, this, _1));
@@ -43,9 +43,9 @@ namespace BansheeEngine
 
 
 	Input::~Input()
 	Input::~Input()
 	{
 	{
-		cm_deleteN(mHorizontalHistoryBuffer, HISTORY_BUFFER_SIZE);
-		cm_deleteN(mVerticalHistoryBuffer, HISTORY_BUFFER_SIZE);
-		cm_deleteN(mTimesHistoryBuffer, HISTORY_BUFFER_SIZE);
+		bs_deleteN(mHorizontalHistoryBuffer, HISTORY_BUFFER_SIZE);
+		bs_deleteN(mVerticalHistoryBuffer, HISTORY_BUFFER_SIZE);
+		bs_deleteN(mTimesHistoryBuffer, HISTORY_BUFFER_SIZE);
 	}
 	}
 
 
 	void Input::_registerRawInputHandler(std::shared_ptr<RawInputHandler> inputHandler)
 	void Input::_registerRawInputHandler(std::shared_ptr<RawInputHandler> inputHandler)

+ 8 - 8
BansheeCore/Source/CmMaterial.cpp

@@ -171,7 +171,7 @@ namespace BansheeEngine
 				auto findBlockIter = paramToParamBlockMap.find(iter->second.gpuVariableName);
 				auto findBlockIter = paramToParamBlockMap.find(iter->second.gpuVariableName);
 
 
 				if(findBlockIter == paramToParamBlockMap.end())
 				if(findBlockIter == paramToParamBlockMap.end())
-					CM_EXCEPT(InternalErrorException, "Parameter doesn't exist in param to param block map but exists in valid param map.");
+					BS_EXCEPT(InternalErrorException, "Parameter doesn't exist in param to param block map but exists in valid param map.");
 
 
 				String& paramBlockName = findBlockIter->second;
 				String& paramBlockName = findBlockIter->second;
 				mValidParams[iter->first] = iter->second.gpuVariableName;
 				mValidParams[iter->first] = iter->second.gpuVariableName;
@@ -455,12 +455,12 @@ namespace BansheeEngine
 	{
 	{
 		if(mShader == nullptr)
 		if(mShader == nullptr)
 		{
 		{
-			CM_EXCEPT(InternalErrorException, "Material does not have shader set.");
+			BS_EXCEPT(InternalErrorException, "Material does not have shader set.");
 		}
 		}
 
 
 		if(mBestTechnique == nullptr)
 		if(mBestTechnique == nullptr)
 		{
 		{
-			CM_EXCEPT(InternalErrorException, "Shader does not contain a supported technique.");
+			BS_EXCEPT(InternalErrorException, "Shader does not contain a supported technique.");
 		}
 		}
 	}
 	}
 
 
@@ -504,7 +504,7 @@ namespace BansheeEngine
 	PassPtr Material::getPass(UINT32 passIdx) const
 	PassPtr Material::getPass(UINT32 passIdx) const
 	{
 	{
 		if(passIdx < 0 || passIdx >= mShader->getBestTechnique()->getNumPasses())
 		if(passIdx < 0 || passIdx >= mShader->getBestTechnique()->getNumPasses())
-			CM_EXCEPT(InvalidParametersException, "Invalid pass index.");
+			BS_EXCEPT(InvalidParametersException, "Invalid pass index.");
 
 
 		return mShader->getBestTechnique()->getPass(passIdx);
 		return mShader->getBestTechnique()->getPass(passIdx);
 	}
 	}
@@ -512,7 +512,7 @@ namespace BansheeEngine
 	PassParametersPtr Material::getPassParameters(UINT32 passIdx) const
 	PassParametersPtr Material::getPassParameters(UINT32 passIdx) const
 	{
 	{
 		if(passIdx < 0 || passIdx >= mParametersPerPass.size())
 		if(passIdx < 0 || passIdx >= mParametersPerPass.size())
-			CM_EXCEPT(InvalidParametersException, "Invalid pass index.");
+			BS_EXCEPT(InvalidParametersException, "Invalid pass index.");
 
 
 		PassParametersPtr params = mParametersPerPass[passIdx];
 		PassParametersPtr params = mParametersPerPass[passIdx];
 
 
@@ -654,7 +654,7 @@ namespace BansheeEngine
 			}
 			}
 		}
 		}
 
 
-		CM_EXCEPT(InternalErrorException, "Shader has no parameter with the name: " + name);
+		BS_EXCEPT(InternalErrorException, "Shader has no parameter with the name: " + name);
 	}
 	}
 
 
 	GpuParamsPtr Material::findTexWithName(const String& name) const
 	GpuParamsPtr Material::findTexWithName(const String& name) const
@@ -674,7 +674,7 @@ namespace BansheeEngine
 			}
 			}
 		}
 		}
 
 
-		CM_EXCEPT(InternalErrorException, "Shader has no parameter with the name: " + name);
+		BS_EXCEPT(InternalErrorException, "Shader has no parameter with the name: " + name);
 	}
 	}
 
 
 	GpuParamsPtr Material::findSamplerStateWithName(const String& name) const
 	GpuParamsPtr Material::findSamplerStateWithName(const String& name) const
@@ -694,7 +694,7 @@ namespace BansheeEngine
 			}
 			}
 		}
 		}
 
 
-		CM_EXCEPT(InternalErrorException, "Shader has no parameter with the name: " + name);
+		BS_EXCEPT(InternalErrorException, "Shader has no parameter with the name: " + name);
 	}
 	}
 
 
 	void Material::destroy_internal()
 	void Material::destroy_internal()

+ 2 - 2
BansheeCore/Source/CmMaterialManager.cpp

@@ -5,7 +5,7 @@ namespace BansheeEngine
 {
 {
 	MaterialPtr MaterialManager::create() const
 	MaterialPtr MaterialManager::create() const
 	{
 	{
-		MaterialPtr newMat = cm_core_ptr<Material, PoolAlloc>(new (cm_alloc<Material, PoolAlloc>()) Material());
+		MaterialPtr newMat = bs_core_ptr<Material, PoolAlloc>(new (bs_alloc<Material, PoolAlloc>()) Material());
 		newMat->_setThisPtr(newMat);
 		newMat->_setThisPtr(newMat);
 		newMat->initialize();
 		newMat->initialize();
 
 
@@ -14,7 +14,7 @@ namespace BansheeEngine
 
 
 	MaterialPtr MaterialManager::create(ShaderPtr shader) const
 	MaterialPtr MaterialManager::create(ShaderPtr shader) const
 	{
 	{
-		MaterialPtr newMat = cm_core_ptr<Material, PoolAlloc>(new (cm_alloc<Material, PoolAlloc>()) Material());
+		MaterialPtr newMat = bs_core_ptr<Material, PoolAlloc>(new (bs_alloc<Material, PoolAlloc>()) Material());
 		newMat->_setThisPtr(newMat);
 		newMat->_setThisPtr(newMat);
 		newMat->initialize();
 		newMat->initialize();
 		newMat->setShader(shader);
 		newMat->setShader(shader);

+ 5 - 5
BansheeCore/Source/CmMaterialRTTI.cpp

@@ -37,7 +37,7 @@ namespace BansheeEngine
 	void MaterialRTTI::onSerializationStarted(IReflectable* obj)
 	void MaterialRTTI::onSerializationStarted(IReflectable* obj)
 	{
 	{
 		Material* material = static_cast<Material*>(obj);
 		Material* material = static_cast<Material*>(obj);
-		std::shared_ptr<MaterialParams> params = cm_shared_ptr<MaterialParams, ScratchAlloc>();
+		std::shared_ptr<MaterialParams> params = bs_shared_ptr<MaterialParams, ScratchAlloc>();
 
 
 		ShaderPtr shader = material->getShader();
 		ShaderPtr shader = material->getShader();
 		if(shader != nullptr)
 		if(shader != nullptr)
@@ -147,7 +147,7 @@ namespace BansheeEngine
 						}
 						}
 						break;
 						break;
 					default:
 					default:
-						CM_EXCEPT(InternalErrorException, "Cannot serialize this paramater type: " + toString(paramDesc.type));
+						BS_EXCEPT(InternalErrorException, "Cannot serialize this paramater type: " + toString(paramDesc.type));
 					}
 					}
 				}
 				}
 				else if(type == GPT_OBJECT)
 				else if(type == GPT_OBJECT)
@@ -172,15 +172,15 @@ namespace BansheeEngine
 					}
 					}
 					else if(Shader::isBuffer(paramDesc.type))
 					else if(Shader::isBuffer(paramDesc.type))
 					{
 					{
-						CM_EXCEPT(NotImplementedException, "Buffers can't be serialized yet."); // TODO
+						BS_EXCEPT(NotImplementedException, "Buffers can't be serialized yet."); // TODO
 					}
 					}
 					else
 					else
 					{
 					{
-						CM_EXCEPT(InternalErrorException, "Cannot serialize this paramater type: " + toString(paramDesc.type));
+						BS_EXCEPT(InternalErrorException, "Cannot serialize this paramater type: " + toString(paramDesc.type));
 					}
 					}
 				}
 				}
 				else
 				else
-					CM_EXCEPT(InternalErrorException, "Invalid parameter type.");
+					BS_EXCEPT(InternalErrorException, "Invalid parameter type.");
 
 
 			}
 			}
 		}
 		}

+ 15 - 15
BansheeCore/Source/CmMesh.cpp

@@ -57,7 +57,7 @@ namespace BansheeEngine
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
 		if(data.getTypeId() != TID_MeshData)
 		if(data.getTypeId() != TID_MeshData)
-			CM_EXCEPT(InvalidParametersException, "Invalid GpuResourceData type. Only MeshData is supported.");
+			BS_EXCEPT(InvalidParametersException, "Invalid GpuResourceData type. Only MeshData is supported.");
 
 
 		if(discardEntireBuffer)
 		if(discardEntireBuffer)
 		{
 		{
@@ -85,12 +85,12 @@ namespace BansheeEngine
 
 
 		if(meshData.getIndexElementSize() != mIndexData->indexBuffer->getIndexSize())
 		if(meshData.getIndexElementSize() != mIndexData->indexBuffer->getIndexSize())
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Provided index size doesn't match meshes index size. Needed: " + 
+			BS_EXCEPT(InvalidParametersException, "Provided index size doesn't match meshes index size. Needed: " + 
 				toString(mIndexData->indexBuffer->getIndexSize()) + ". Got: " + toString(meshData.getIndexElementSize()));
 				toString(mIndexData->indexBuffer->getIndexSize()) + ". Got: " + toString(meshData.getIndexElementSize()));
 		}
 		}
 
 
 		if((indexOffset + indicesSize) > mIndexData->indexBuffer->getSizeInBytes())
 		if((indexOffset + indicesSize) > mIndexData->indexBuffer->getSizeInBytes())
-			CM_EXCEPT(InvalidParametersException, "Index buffer values are being written out of valid range.");
+			BS_EXCEPT(InvalidParametersException, "Index buffer values are being written out of valid range.");
 
 
 		mIndexData->indexBuffer->writeData(indexOffset, indicesSize, srcIdxData, discardEntireBuffer ? BufferWriteType::Discard : BufferWriteType::Normal);
 		mIndexData->indexBuffer->writeData(indexOffset, indicesSize, srcIdxData, discardEntireBuffer ? BufferWriteType::Discard : BufferWriteType::Normal);
 
 
@@ -108,7 +108,7 @@ namespace BansheeEngine
 			UINT32 otherVertSize = meshData.getVertexDesc()->getVertexStride(i);
 			UINT32 otherVertSize = meshData.getVertexDesc()->getVertexStride(i);
 			if(myVertSize != otherVertSize)
 			if(myVertSize != otherVertSize)
 			{
 			{
-				CM_EXCEPT(InvalidParametersException, "Provided vertex size for stream " + toString(i) + " doesn't match meshes vertex size. Needed: " + 
+				BS_EXCEPT(InvalidParametersException, "Provided vertex size for stream " + toString(i) + " doesn't match meshes vertex size. Needed: " + 
 					toString(myVertSize) + ". Got: " + toString(otherVertSize));
 					toString(myVertSize) + ". Got: " + toString(otherVertSize));
 			}
 			}
 
 
@@ -119,11 +119,11 @@ namespace BansheeEngine
 			UINT8* srcVertBufferData = meshData.getStreamData(i);
 			UINT8* srcVertBufferData = meshData.getStreamData(i);
 
 
 			if((bufferOffset + bufferSize) > vertexBuffer->getSizeInBytes())
 			if((bufferOffset + bufferSize) > vertexBuffer->getSizeInBytes())
-				CM_EXCEPT(InvalidParametersException, "Vertex buffer values for stream \"" + toString(i) + "\" are being written out of valid range.");
+				BS_EXCEPT(InvalidParametersException, "Vertex buffer values for stream \"" + toString(i) + "\" are being written out of valid range.");
 
 
 			if(vertexBuffer->vertexColorReqRGBFlip())
 			if(vertexBuffer->vertexColorReqRGBFlip())
 			{
 			{
-				UINT8* bufferCopy = (UINT8*)cm_alloc(bufferSize);
+				UINT8* bufferCopy = (UINT8*)bs_alloc(bufferSize);
 				memcpy(bufferCopy, srcVertBufferData, bufferSize); // TODO Low priority - Attempt to avoid this copy
 				memcpy(bufferCopy, srcVertBufferData, bufferSize); // TODO Low priority - Attempt to avoid this copy
 
 
 				UINT32 vertexStride = meshData.getVertexDesc()->getVertexStride(i);
 				UINT32 vertexStride = meshData.getVertexDesc()->getVertexStride(i);
@@ -145,7 +145,7 @@ namespace BansheeEngine
 
 
 				vertexBuffer->writeData(bufferOffset, bufferSize, bufferCopy, discardEntireBuffer ? BufferWriteType::Discard : BufferWriteType::Normal);
 				vertexBuffer->writeData(bufferOffset, bufferSize, bufferCopy, discardEntireBuffer ? BufferWriteType::Discard : BufferWriteType::Normal);
 
 
-				cm_free(bufferCopy);
+				bs_free(bufferCopy);
 			}
 			}
 			else
 			else
 			{
 			{
@@ -159,7 +159,7 @@ namespace BansheeEngine
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
 		if(data.getTypeId() != TID_MeshData)
 		if(data.getTypeId() != TID_MeshData)
-			CM_EXCEPT(InvalidParametersException, "Invalid GpuResourceData type. Only MeshData is supported.");
+			BS_EXCEPT(InvalidParametersException, "Invalid GpuResourceData type. Only MeshData is supported.");
 
 
 		IndexBuffer::IndexType indexType = IndexBuffer::IT_32BIT;
 		IndexBuffer::IndexType indexType = IndexBuffer::IT_32BIT;
 		if(mIndexData)
 		if(mIndexData)
@@ -171,7 +171,7 @@ namespace BansheeEngine
 		{
 		{
 			if(meshData.getIndexElementSize() != mIndexData->indexBuffer->getIndexSize())
 			if(meshData.getIndexElementSize() != mIndexData->indexBuffer->getIndexSize())
 			{
 			{
-				CM_EXCEPT(InvalidParametersException, "Provided index size doesn't match meshes index size. Needed: " + 
+				BS_EXCEPT(InvalidParametersException, "Provided index size doesn't match meshes index size. Needed: " + 
 					toString(mIndexData->indexBuffer->getIndexSize()) + ". Got: " + toString(meshData.getIndexElementSize()));
 					toString(mIndexData->indexBuffer->getIndexSize()) + ". Got: " + toString(meshData.getIndexElementSize()));
 			}
 			}
 
 
@@ -191,7 +191,7 @@ namespace BansheeEngine
 
 
 			UINT32 indicesSize = numIndicesToCopy * idxElemSize;
 			UINT32 indicesSize = numIndicesToCopy * idxElemSize;
 			if(indicesSize > meshData.getIndexBufferSize())
 			if(indicesSize > meshData.getIndexBufferSize())
-				CM_EXCEPT(InvalidParametersException, "Provided buffer doesn't have enough space to store mesh indices.");
+				BS_EXCEPT(InvalidParametersException, "Provided buffer doesn't have enough space to store mesh indices.");
 
 
 			idxData += indexResourceOffset * idxElemSize;
 			idxData += indexResourceOffset * idxElemSize;
 			memcpy(indices, idxData, numIndicesToCopy * idxElemSize);
 			memcpy(indices, idxData, numIndicesToCopy * idxElemSize);
@@ -214,7 +214,7 @@ namespace BansheeEngine
 				UINT32 otherVertSize = meshData.getVertexDesc()->getVertexStride(streamIdx);
 				UINT32 otherVertSize = meshData.getVertexDesc()->getVertexStride(streamIdx);
 				if(myVertSize != otherVertSize)
 				if(myVertSize != otherVertSize)
 				{
 				{
-					CM_EXCEPT(InvalidParametersException, "Provided vertex size for stream " + toString(streamIdx) + " doesn't match meshes vertex size. Needed: " + 
+					BS_EXCEPT(InvalidParametersException, "Provided vertex size for stream " + toString(streamIdx) + " doesn't match meshes vertex size. Needed: " + 
 						toString(myVertSize) + ". Got: " + toString(otherVertSize));
 						toString(myVertSize) + ". Got: " + toString(otherVertSize));
 				}
 				}
 
 
@@ -227,7 +227,7 @@ namespace BansheeEngine
 				UINT32 bufferSize = vertexBuffer->getVertexSize() * numVerticesToCopy;
 				UINT32 bufferSize = vertexBuffer->getVertexSize() * numVerticesToCopy;
 				
 				
 				if((bufferOffset + bufferSize) > vertexBuffer->getSizeInBytes())
 				if((bufferOffset + bufferSize) > vertexBuffer->getSizeInBytes())
-					CM_EXCEPT(InvalidParametersException, "Vertex buffer values for stream \"" + toString(streamIdx) + "\" are being read out of valid range.");
+					BS_EXCEPT(InvalidParametersException, "Vertex buffer values for stream \"" + toString(streamIdx) + "\" are being read out of valid range.");
 
 
 				UINT8* vertDataPtr = static_cast<UINT8*>(vertexBuffer->lock(GBL_READ_ONLY)) + vertexResourceOffset * meshData.getVertexDesc()->getVertexStride(streamIdx);
 				UINT8* vertDataPtr = static_cast<UINT8*>(vertexBuffer->lock(GBL_READ_ONLY)) + vertexResourceOffset * meshData.getVertexDesc()->getVertexStride(streamIdx);
 
 
@@ -247,7 +247,7 @@ namespace BansheeEngine
 		if(mIndexData)
 		if(mIndexData)
 			indexType = mIndexData->indexBuffer->getType();
 			indexType = mIndexData->indexBuffer->getType();
 
 
-		MeshDataPtr meshData = cm_shared_ptr<MeshData>(mVertexData->vertexCount, mNumIndices, mVertexDesc, indexType);
+		MeshDataPtr meshData = bs_shared_ptr<MeshData>(mVertexData->vertexCount, mNumIndices, mVertexDesc, indexType);
 
 
 		return meshData;
 		return meshData;
 	}
 	}
@@ -282,7 +282,7 @@ namespace BansheeEngine
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 		
 		
-		mIndexData = std::shared_ptr<IndexData>(cm_new<IndexData, PoolAlloc>());
+		mIndexData = std::shared_ptr<IndexData>(bs_new<IndexData, PoolAlloc>());
 
 
 		mIndexData->indexCount = mNumIndices;
 		mIndexData->indexCount = mNumIndices;
 		mIndexData->indexBuffer = HardwareBufferManager::instance().createIndexBuffer(
 		mIndexData->indexBuffer = HardwareBufferManager::instance().createIndexBuffer(
@@ -290,7 +290,7 @@ namespace BansheeEngine
 			mIndexData->indexCount, 
 			mIndexData->indexCount, 
 			mBufferType == MeshBufferType::Dynamic ? GBU_DYNAMIC : GBU_STATIC);
 			mBufferType == MeshBufferType::Dynamic ? GBU_DYNAMIC : GBU_STATIC);
 
 
-		mVertexData = std::shared_ptr<VertexData>(cm_new<VertexData, PoolAlloc>());
+		mVertexData = std::shared_ptr<VertexData>(bs_new<VertexData, PoolAlloc>());
 
 
 		mVertexData->vertexCount = mNumVertices;
 		mVertexData->vertexCount = mNumVertices;
 		mVertexData->vertexDeclaration = mVertexDesc->createDeclaration();
 		mVertexData->vertexDeclaration = mVertexDesc->createDeclaration();

+ 1 - 1
BansheeCore/Source/CmMeshBase.cpp

@@ -74,7 +74,7 @@ namespace BansheeEngine
 
 
 		if(subMeshIdx < 0 || subMeshIdx >= mSubMeshes.size())
 		if(subMeshIdx < 0 || subMeshIdx >= mSubMeshes.size())
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Invalid sub-mesh index (" 
+			BS_EXCEPT(InvalidParametersException, "Invalid sub-mesh index (" 
 				+ toString(subMeshIdx) + "). Number of sub-meshes available: " + toString((int)mSubMeshes.size()));
 				+ toString(subMeshIdx) + "). Number of sub-meshes available: " + toString((int)mSubMeshes.size()));
 		}
 		}
 
 

+ 8 - 8
BansheeCore/Source/CmMeshData.cpp

@@ -32,7 +32,7 @@ namespace BansheeEngine
 	UINT16* MeshData::getIndices16() const
 	UINT16* MeshData::getIndices16() const
 	{
 	{
 		if(mIndexType != IndexBuffer::IT_16BIT)
 		if(mIndexType != IndexBuffer::IT_16BIT)
-			CM_EXCEPT(InternalErrorException, "Attempting to get 16bit index buffer, but internally allocated buffer is 32 bit.");
+			BS_EXCEPT(InternalErrorException, "Attempting to get 16bit index buffer, but internally allocated buffer is 32 bit.");
 
 
 		UINT32 indexBufferOffset = getIndexBufferOffset();
 		UINT32 indexBufferOffset = getIndexBufferOffset();
 
 
@@ -42,7 +42,7 @@ namespace BansheeEngine
 	UINT32* MeshData::getIndices32() const
 	UINT32* MeshData::getIndices32() const
 	{
 	{
 		if(mIndexType != IndexBuffer::IT_32BIT)
 		if(mIndexType != IndexBuffer::IT_32BIT)
-			CM_EXCEPT(InternalErrorException, "Attempting to get 32bit index buffer, but internally allocated buffer is 16 bit.");
+			BS_EXCEPT(InternalErrorException, "Attempting to get 32bit index buffer, but internally allocated buffer is 16 bit.");
 
 
 		UINT32 indexBufferOffset = getIndexBufferOffset();
 		UINT32 indexBufferOffset = getIndexBufferOffset();
 
 
@@ -67,7 +67,7 @@ namespace BansheeEngine
 			totalIndexCount += meshData->getNumIndices();
 			totalIndexCount += meshData->getNumIndices();
 		}
 		}
 
 
-		VertexDataDescPtr vertexData = cm_shared_ptr<VertexDataDesc, PoolAlloc>();
+		VertexDataDescPtr vertexData = bs_shared_ptr<VertexDataDesc, PoolAlloc>();
 		
 		
 		Vector<VertexElement> combinedVertexElements;
 		Vector<VertexElement> combinedVertexElements;
 		for(auto& meshData : meshes)
 		for(auto& meshData : meshes)
@@ -86,7 +86,7 @@ namespace BansheeEngine
 					{
 					{
 						if(newElement.getType() != existingElement.getType())
 						if(newElement.getType() != existingElement.getType())
 						{
 						{
-							CM_EXCEPT(NotImplementedException, "Two elements have same semantics but different types. This is not supported yet.");
+							BS_EXCEPT(NotImplementedException, "Two elements have same semantics but different types. This is not supported yet.");
 						}
 						}
 
 
 						alreadyExistsIdx = idx;
 						alreadyExistsIdx = idx;
@@ -104,7 +104,7 @@ namespace BansheeEngine
 			}
 			}
 		}
 		}
 
 
-		MeshDataPtr combinedMeshData = cm_shared_ptr<MeshData, PoolAlloc>(totalVertexCount, totalIndexCount, vertexData);
+		MeshDataPtr combinedMeshData = bs_shared_ptr<MeshData, PoolAlloc>(totalVertexCount, totalIndexCount, vertexData);
 
 
 		// Copy indices
 		// Copy indices
 		UINT32 vertexOffset = 0;
 		UINT32 vertexOffset = 0;
@@ -189,7 +189,7 @@ namespace BansheeEngine
 
 
 		if(!mVertexData->hasElement(semantic, semanticIdx, streamIdx))
 		if(!mVertexData->hasElement(semantic, semanticIdx, streamIdx))
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "MeshData doesn't contain an element of specified type: Semantic: " + toString(semantic) + ", Semantic index: "
+			BS_EXCEPT(InvalidParametersException, "MeshData doesn't contain an element of specified type: Semantic: " + toString(semantic) + ", Semantic index: "
 				+ toString(semanticIdx) + ", Stream index: " + toString(streamIdx));
 				+ toString(semanticIdx) + ", Stream index: " + toString(streamIdx));
 		}
 		}
 
 
@@ -198,7 +198,7 @@ namespace BansheeEngine
 
 
 		if(totalSize != size)
 		if(totalSize != size)
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Buffer sizes don't match. Expected: " + toString(totalSize) + ". Got: " + toString(size));
+			BS_EXCEPT(InvalidParametersException, "Buffer sizes don't match. Expected: " + toString(totalSize) + ". Got: " + toString(size));
 		}
 		}
 
 
 		UINT32 indexBufferOffset = getIndexBufferSize();
 		UINT32 indexBufferOffset = getIndexBufferSize();
@@ -256,7 +256,7 @@ namespace BansheeEngine
 	{
 	{
 		if(!mVertexData->hasElement(semantic, semanticIdx, streamIdx))
 		if(!mVertexData->hasElement(semantic, semanticIdx, streamIdx))
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "MeshData doesn't contain an element of specified type: Semantic: " + toString(semantic) + ", Semantic index: "
+			BS_EXCEPT(InvalidParametersException, "MeshData doesn't contain an element of specified type: Semantic: " + toString(semantic) + ", Semantic index: "
 				+ toString(semanticIdx) + ", Stream index: " + toString(streamIdx));
 				+ toString(semanticIdx) + ", Stream index: " + toString(streamIdx));
 		}
 		}
 
 

+ 14 - 14
BansheeCore/Source/CmMeshHeap.cpp

@@ -33,8 +33,8 @@ namespace BansheeEngine
 	MeshHeapPtr MeshHeap::create(UINT32 numVertices, UINT32 numIndices, 
 	MeshHeapPtr MeshHeap::create(UINT32 numVertices, UINT32 numIndices, 
 		const VertexDataDescPtr& vertexDesc, IndexBuffer::IndexType indexType)
 		const VertexDataDescPtr& vertexDesc, IndexBuffer::IndexType indexType)
 	{
 	{
-		MeshHeap* meshHeap = new (cm_alloc<MeshHeap>()) MeshHeap(numVertices, numIndices, vertexDesc, indexType); 
-		MeshHeapPtr meshHeapPtr = cm_core_ptr<MeshHeap, GenAlloc>(meshHeap);
+		MeshHeap* meshHeap = new (bs_alloc<MeshHeap>()) MeshHeap(numVertices, numIndices, vertexDesc, indexType); 
+		MeshHeapPtr meshHeapPtr = bs_core_ptr<MeshHeap, GenAlloc>(meshHeap);
 
 
 		meshHeapPtr->_setThisPtr(meshHeapPtr);
 		meshHeapPtr->_setThisPtr(meshHeapPtr);
 		meshHeapPtr->initialize();
 		meshHeapPtr->initialize();
@@ -55,10 +55,10 @@ namespace BansheeEngine
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
 
 
 		for(auto& cpuVertBuffer : mCPUVertexData)
 		for(auto& cpuVertBuffer : mCPUVertexData)
-			cm_free(cpuVertBuffer);
+			bs_free(cpuVertBuffer);
 
 
 		if(mCPUIndexData != nullptr)
 		if(mCPUIndexData != nullptr)
-			cm_free(mCPUIndexData);
+			bs_free(mCPUIndexData);
 
 
 		CoreObject::destroy_internal();
 		CoreObject::destroy_internal();
 	}
 	}
@@ -68,8 +68,8 @@ namespace BansheeEngine
 		UINT32 meshIdx = mNextFreeId++;
 		UINT32 meshIdx = mNextFreeId++;
 
 
 		MeshHeapPtr thisPtr = std::static_pointer_cast<MeshHeap>(getThisPtr());
 		MeshHeapPtr thisPtr = std::static_pointer_cast<MeshHeap>(getThisPtr());
-		TransientMesh* transientMesh = new (cm_alloc<TransientMesh>()) TransientMesh(thisPtr, meshIdx, meshData->getNumVertices(), meshData->getNumIndices(), drawOp); 
-		TransientMeshPtr transientMeshPtr = cm_core_ptr<TransientMesh, GenAlloc>(transientMesh);
+		TransientMesh* transientMesh = new (bs_alloc<TransientMesh>()) TransientMesh(thisPtr, meshIdx, meshData->getNumVertices(), meshData->getNumIndices(), drawOp); 
+		TransientMeshPtr transientMeshPtr = bs_core_ptr<TransientMesh, GenAlloc>(transientMesh);
 
 
 		transientMeshPtr->_setThisPtr(transientMeshPtr);
 		transientMeshPtr->_setThisPtr(transientMeshPtr);
 		transientMeshPtr->initialize();
 		transientMeshPtr->initialize();
@@ -260,7 +260,7 @@ namespace BansheeEngine
 			UINT32 otherVertSize = meshData->getVertexDesc()->getVertexStride(i);
 			UINT32 otherVertSize = meshData->getVertexDesc()->getVertexStride(i);
 			if(otherVertSize != vertSize)
 			if(otherVertSize != vertSize)
 			{
 			{
-				CM_EXCEPT(InvalidParametersException, "Provided vertex size for stream " + toString(i) + " doesn't match meshes vertex size. Needed: " + 
+				BS_EXCEPT(InvalidParametersException, "Provided vertex size for stream " + toString(i) + " doesn't match meshes vertex size. Needed: " + 
 					toString(vertSize) + ". Got: " + toString(otherVertSize));
 					toString(vertSize) + ". Got: " + toString(otherVertSize));
 			}
 			}
 
 
@@ -298,7 +298,7 @@ namespace BansheeEngine
 		// Ensure index sizes match
 		// Ensure index sizes match
 		if(meshData->getIndexElementSize() != idxSize)
 		if(meshData->getIndexElementSize() != idxSize)
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Provided index size doesn't match meshes index size. Needed: " + 
+			BS_EXCEPT(InvalidParametersException, "Provided index size doesn't match meshes index size. Needed: " + 
 				toString(idxSize) + ". Got: " + toString(meshData->getIndexElementSize()));
 				toString(idxSize) + ". Got: " + toString(meshData->getIndexElementSize()));
 		}
 		}
 
 
@@ -332,7 +332,7 @@ namespace BansheeEngine
 	void MeshHeap::growVertexBuffer(UINT32 numVertices)
 	void MeshHeap::growVertexBuffer(UINT32 numVertices)
 	{
 	{
 		mNumVertices = numVertices;
 		mNumVertices = numVertices;
-		mVertexData = std::shared_ptr<VertexData>(cm_new<VertexData, PoolAlloc>());
+		mVertexData = std::shared_ptr<VertexData>(bs_new<VertexData, PoolAlloc>());
 
 
 		mVertexData->vertexCount = mNumVertices;
 		mVertexData->vertexCount = mNumVertices;
 		mVertexData->vertexDeclaration = mVertexDesc->createDeclaration();
 		mVertexData->vertexDeclaration = mVertexDesc->createDeclaration();
@@ -351,7 +351,7 @@ namespace BansheeEngine
 
 
 			// Copy all data to the new buffer
 			// Copy all data to the new buffer
 			UINT8* oldBuffer = mCPUVertexData[i];
 			UINT8* oldBuffer = mCPUVertexData[i];
-			UINT8* buffer = (UINT8*)cm_alloc(vertSize * numVertices);
+			UINT8* buffer = (UINT8*)bs_alloc(vertSize * numVertices);
 
 
 			UINT32 destOffset = 0;
 			UINT32 destOffset = 0;
 			if(oldBuffer != nullptr)
 			if(oldBuffer != nullptr)
@@ -366,7 +366,7 @@ namespace BansheeEngine
 					destOffset += oldChunk.size;
 					destOffset += oldChunk.size;
 				}
 				}
 
 
-				cm_free(oldBuffer);
+				bs_free(oldBuffer);
 			}
 			}
 
 
 			if(destOffset > 0)
 			if(destOffset > 0)
@@ -416,7 +416,7 @@ namespace BansheeEngine
 	{
 	{
 		mNumIndices = numIndices;
 		mNumIndices = numIndices;
 
 
-		mIndexData = std::shared_ptr<IndexData>(cm_new<IndexData, PoolAlloc>());
+		mIndexData = std::shared_ptr<IndexData>(bs_new<IndexData, PoolAlloc>());
 		mIndexData->indexCount = mNumIndices;
 		mIndexData->indexCount = mNumIndices;
 		mIndexData->indexBuffer = HardwareBufferManager::instance().createIndexBuffer(
 		mIndexData->indexBuffer = HardwareBufferManager::instance().createIndexBuffer(
 			mIndexType, mIndexData->indexCount, GBU_DYNAMIC);
 			mIndexType, mIndexData->indexCount, GBU_DYNAMIC);
@@ -425,7 +425,7 @@ namespace BansheeEngine
 		UINT32 idxSize = mIndexData->indexBuffer->getIndexSize();
 		UINT32 idxSize = mIndexData->indexBuffer->getIndexSize();
 
 
 		UINT8* oldBuffer = mCPUIndexData;
 		UINT8* oldBuffer = mCPUIndexData;
-		UINT8* buffer = (UINT8*)cm_alloc(idxSize * numIndices);
+		UINT8* buffer = (UINT8*)bs_alloc(idxSize * numIndices);
 
 
 		UINT32 destOffset = 0;
 		UINT32 destOffset = 0;
 		if(oldBuffer != nullptr)
 		if(oldBuffer != nullptr)
@@ -440,7 +440,7 @@ namespace BansheeEngine
 				destOffset += oldChunk.size;
 				destOffset += oldChunk.size;
 			}
 			}
 
 
-			cm_free(oldBuffer);
+			bs_free(oldBuffer);
 		}
 		}
 
 
 		if(destOffset > 0)
 		if(destOffset > 0)

+ 6 - 6
BansheeCore/Source/CmMeshManager.cpp

@@ -20,7 +20,7 @@ namespace BansheeEngine
 	MeshPtr MeshManager::create(UINT32 numVertices, UINT32 numIndices, const VertexDataDescPtr& vertexDesc, 
 	MeshPtr MeshManager::create(UINT32 numVertices, UINT32 numIndices, const VertexDataDescPtr& vertexDesc, 
 		MeshBufferType bufferType, DrawOperationType drawOp, IndexBuffer::IndexType indexType)
 		MeshBufferType bufferType, DrawOperationType drawOp, IndexBuffer::IndexType indexType)
 	{
 	{
-		MeshPtr mesh = cm_core_ptr<Mesh, PoolAlloc>(new (cm_alloc<Mesh, PoolAlloc>()) 
+		MeshPtr mesh = bs_core_ptr<Mesh, PoolAlloc>(new (bs_alloc<Mesh, PoolAlloc>()) 
 			Mesh(numVertices, numIndices, vertexDesc, bufferType, drawOp, indexType));
 			Mesh(numVertices, numIndices, vertexDesc, bufferType, drawOp, indexType));
 		mesh->_setThisPtr(mesh);
 		mesh->_setThisPtr(mesh);
 		mesh->initialize();
 		mesh->initialize();
@@ -31,7 +31,7 @@ namespace BansheeEngine
 	MeshPtr MeshManager::create(UINT32 numVertices, UINT32 numIndices, const VertexDataDescPtr& vertexDesc, 
 	MeshPtr MeshManager::create(UINT32 numVertices, UINT32 numIndices, const VertexDataDescPtr& vertexDesc, 
 		const MeshDataPtr& initialData, MeshBufferType bufferType, DrawOperationType drawOp, IndexBuffer::IndexType indexType)
 		const MeshDataPtr& initialData, MeshBufferType bufferType, DrawOperationType drawOp, IndexBuffer::IndexType indexType)
 	{
 	{
-		MeshPtr mesh = cm_core_ptr<Mesh, PoolAlloc>(new (cm_alloc<Mesh, PoolAlloc>()) 
+		MeshPtr mesh = bs_core_ptr<Mesh, PoolAlloc>(new (bs_alloc<Mesh, PoolAlloc>()) 
 			Mesh(numVertices, numIndices, vertexDesc, initialData, bufferType, drawOp, indexType));
 			Mesh(numVertices, numIndices, vertexDesc, initialData, bufferType, drawOp, indexType));
 		mesh->_setThisPtr(mesh);
 		mesh->_setThisPtr(mesh);
 		mesh->initialize();
 		mesh->initialize();
@@ -41,7 +41,7 @@ namespace BansheeEngine
 
 
 	MeshPtr MeshManager::create(const MeshDataPtr& initialData, MeshBufferType bufferType, DrawOperationType drawOp)
 	MeshPtr MeshManager::create(const MeshDataPtr& initialData, MeshBufferType bufferType, DrawOperationType drawOp)
 	{
 	{
-		MeshPtr mesh = cm_core_ptr<Mesh, PoolAlloc>(new (cm_alloc<Mesh, PoolAlloc>()) Mesh(initialData, bufferType, drawOp));
+		MeshPtr mesh = bs_core_ptr<Mesh, PoolAlloc>(new (bs_alloc<Mesh, PoolAlloc>()) Mesh(initialData, bufferType, drawOp));
 		mesh->_setThisPtr(mesh);
 		mesh->_setThisPtr(mesh);
 		mesh->initialize();
 		mesh->initialize();
 
 
@@ -50,7 +50,7 @@ namespace BansheeEngine
 
 
 	MeshPtr MeshManager::createEmpty()
 	MeshPtr MeshManager::createEmpty()
 	{
 	{
-		MeshPtr mesh = cm_core_ptr<Mesh, PoolAlloc>(new (cm_alloc<Mesh, PoolAlloc>()) Mesh());
+		MeshPtr mesh = bs_core_ptr<Mesh, PoolAlloc>(new (bs_alloc<Mesh, PoolAlloc>()) Mesh());
 		mesh->_setThisPtr(mesh);
 		mesh->_setThisPtr(mesh);
 
 
 		return mesh;
 		return mesh;
@@ -58,10 +58,10 @@ namespace BansheeEngine
 
 
 	void MeshManager::onStartUp()
 	void MeshManager::onStartUp()
 	{
 	{
-		VertexDataDescPtr vertexDesc = cm_shared_ptr<VertexDataDesc>();
+		VertexDataDescPtr vertexDesc = bs_shared_ptr<VertexDataDesc>();
 		vertexDesc->addVertElem(VET_FLOAT3, VES_POSITION);
 		vertexDesc->addVertElem(VET_FLOAT3, VES_POSITION);
 
 
-		mDummyMeshData = cm_shared_ptr<MeshData>(1, 3, vertexDesc);
+		mDummyMeshData = bs_shared_ptr<MeshData>(1, 3, vertexDesc);
 
 
 		auto vecIter = mDummyMeshData->getVec3DataIter(VES_POSITION);
 		auto vecIter = mDummyMeshData->getVec3DataIter(VES_POSITION);
 		vecIter.setValue(Vector3(0, 0, 0));
 		vecIter.setValue(Vector3(0, 0, 0));

+ 10 - 10
BansheeCore/Source/CmMultiRenderTexture.cpp

@@ -7,7 +7,7 @@ namespace BansheeEngine
 {
 {
 	MultiRenderTexture::MultiRenderTexture()
 	MultiRenderTexture::MultiRenderTexture()
 	{
 	{
-		mColorSurfaces.resize(CM_MAX_MULTIPLE_RENDER_TARGETS);
+		mColorSurfaces.resize(BS_MAX_MULTIPLE_RENDER_TARGETS);
 	}
 	}
 
 
 	MultiRenderTexture::~MultiRenderTexture()
 	MultiRenderTexture::~MultiRenderTexture()
@@ -22,10 +22,10 @@ namespace BansheeEngine
 		{
 		{
 			if(desc.colorSurfaces[i].texture != nullptr)
 			if(desc.colorSurfaces[i].texture != nullptr)
 			{
 			{
-				if(i >= CM_MAX_MULTIPLE_RENDER_TARGETS)
+				if(i >= BS_MAX_MULTIPLE_RENDER_TARGETS)
 				{
 				{
 					LOGWRN("Render texture index is larger than the maximum number of supported render targets. Index: " + toString((int)i) + 
 					LOGWRN("Render texture index is larger than the maximum number of supported render targets. Index: " + toString((int)i) + 
-						". Max. number of render targets: " + toString(CM_MAX_MULTIPLE_RENDER_TARGETS));
+						". Max. number of render targets: " + toString(BS_MAX_MULTIPLE_RENDER_TARGETS));
 
 
 					continue;
 					continue;
 				}
 				}
@@ -33,7 +33,7 @@ namespace BansheeEngine
 				TexturePtr texture = desc.colorSurfaces[i].texture;
 				TexturePtr texture = desc.colorSurfaces[i].texture;
 
 
 				if(texture->getUsage() != TU_RENDERTARGET)
 				if(texture->getUsage() != TU_RENDERTARGET)
-					CM_EXCEPT(InvalidParametersException, "Provided texture is not created with render target usage.");
+					BS_EXCEPT(InvalidParametersException, "Provided texture is not created with render target usage.");
 
 
 				mColorSurfaces[i] = Texture::requestView(texture, desc.colorSurfaces[i].mipLevel, 1, 
 				mColorSurfaces[i] = Texture::requestView(texture, desc.colorSurfaces[i].mipLevel, 1, 
 					desc.colorSurfaces[i].face, desc.colorSurfaces[i].numFaces, GVU_RENDERTARGET);
 					desc.colorSurfaces[i].face, desc.colorSurfaces[i].numFaces, GVU_RENDERTARGET);
@@ -58,7 +58,7 @@ namespace BansheeEngine
 			TexturePtr texture = desc.depthStencilSurface.texture;
 			TexturePtr texture = desc.depthStencilSurface.texture;
 
 
 			if(texture->getUsage() != TU_DEPTHSTENCIL)
 			if(texture->getUsage() != TU_DEPTHSTENCIL)
-				CM_EXCEPT(InvalidParametersException, "Provided texture is not created with depth stencil usage.");
+				BS_EXCEPT(InvalidParametersException, "Provided texture is not created with depth stencil usage.");
 
 
 			mDepthStencilSurface = Texture::requestView(texture, desc.depthStencilSurface.mipLevel, 1, 
 			mDepthStencilSurface = Texture::requestView(texture, desc.depthStencilSurface.mipLevel, 1, 
 				desc.depthStencilSurface.face, desc.depthStencilSurface.numFaces, GVU_DEPTHSTENCIL);
 				desc.depthStencilSurface.face, desc.depthStencilSurface.numFaces, GVU_DEPTHSTENCIL);
@@ -107,7 +107,7 @@ namespace BansheeEngine
 				errorInfo += "\nMultisample Count: " + toString(mColorSurfaces[i]->getTexture()->getMultisampleCount()) + "/" + toString(firstSurfaceDesc->getTexture()->getMultisampleCount());
 				errorInfo += "\nMultisample Count: " + toString(mColorSurfaces[i]->getTexture()->getMultisampleCount()) + "/" + toString(firstSurfaceDesc->getTexture()->getMultisampleCount());
 				errorInfo += "\nMultisample Hint: " + mColorSurfaces[i]->getTexture()->getMultisampleHint() + "/" + firstSurfaceDesc->getTexture()->getMultisampleHint();
 				errorInfo += "\nMultisample Hint: " + mColorSurfaces[i]->getTexture()->getMultisampleHint() + "/" + firstSurfaceDesc->getTexture()->getMultisampleHint();
 
 
-				CM_EXCEPT(InvalidParametersException, "Provided texture and depth stencil buffer don't match!" + errorInfo);
+				BS_EXCEPT(InvalidParametersException, "Provided texture and depth stencil buffer don't match!" + errorInfo);
 			}
 			}
 		}
 		}
 
 
@@ -115,17 +115,17 @@ namespace BansheeEngine
 			return;
 			return;
 
 
 		if(firstSurfaceDesc->getTexture()->getTextureType() != TEX_TYPE_2D)
 		if(firstSurfaceDesc->getTexture()->getTextureType() != TEX_TYPE_2D)
-			CM_EXCEPT(NotImplementedException, "Render textures are currently only implemented for 2D surfaces.");
+			BS_EXCEPT(NotImplementedException, "Render textures are currently only implemented for 2D surfaces.");
 
 
 		if((firstSurfaceDesc->getFirstArraySlice() + firstSurfaceDesc->getNumArraySlices()) >= firstSurfaceDesc->getTexture()->getNumFaces())
 		if((firstSurfaceDesc->getFirstArraySlice() + firstSurfaceDesc->getNumArraySlices()) >= firstSurfaceDesc->getTexture()->getNumFaces())
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Provided number of faces is out of range. Face: " + 
+			BS_EXCEPT(InvalidParametersException, "Provided number of faces is out of range. Face: " + 
 				toString(firstSurfaceDesc->getFirstArraySlice() + firstSurfaceDesc->getNumArraySlices()) + ". Max num faces: " + toString(firstSurfaceDesc->getTexture()->getNumFaces()));
 				toString(firstSurfaceDesc->getFirstArraySlice() + firstSurfaceDesc->getNumArraySlices()) + ". Max num faces: " + toString(firstSurfaceDesc->getTexture()->getNumFaces()));
 		}
 		}
 
 
 		if(firstSurfaceDesc->getMostDetailedMip() >= firstSurfaceDesc->getTexture()->getNumMipmaps())
 		if(firstSurfaceDesc->getMostDetailedMip() >= firstSurfaceDesc->getTexture()->getNumMipmaps())
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Provided number of mip maps is out of range. Mip level: " + 
+			BS_EXCEPT(InvalidParametersException, "Provided number of mip maps is out of range. Mip level: " + 
 				toString(firstSurfaceDesc->getMostDetailedMip()) + ". Max num mipmaps: " + toString(firstSurfaceDesc->getTexture()->getNumMipmaps()));
 				toString(firstSurfaceDesc->getMostDetailedMip()) + ". Max num mipmaps: " + toString(firstSurfaceDesc->getTexture()->getNumMipmaps()));
 		}
 		}
 
 
@@ -142,7 +142,7 @@ namespace BansheeEngine
 			errorInfo += "\nMultisample Count: " + toString(mDepthStencilSurface->getTexture()->getMultisampleCount()) + "/" + toString(firstSurfaceDesc->getTexture()->getMultisampleCount());
 			errorInfo += "\nMultisample Count: " + toString(mDepthStencilSurface->getTexture()->getMultisampleCount()) + "/" + toString(firstSurfaceDesc->getTexture()->getMultisampleCount());
 			errorInfo += "\nMultisample Hint: " + mDepthStencilSurface->getTexture()->getMultisampleHint() + "/" + firstSurfaceDesc->getTexture()->getMultisampleHint();
 			errorInfo += "\nMultisample Hint: " + mDepthStencilSurface->getTexture()->getMultisampleHint() + "/" + firstSurfaceDesc->getTexture()->getMultisampleHint();
 
 
-			CM_EXCEPT(InvalidParametersException, "Provided texture and depth stencil buffer don't match!" + errorInfo);
+			BS_EXCEPT(InvalidParametersException, "Provided texture and depth stencil buffer don't match!" + errorInfo);
 		}
 		}
 	}
 	}
 
 

+ 8 - 8
BansheeCore/Source/CmOSInputHandler.cpp

@@ -42,7 +42,7 @@ namespace BansheeEngine
 		Queue<InputCommandType> inputCommands;
 		Queue<InputCommandType> inputCommands;
 
 
 		{
 		{
-			CM_LOCK_MUTEX(mOSInputMutex);
+			BS_LOCK_MUTEX(mOSInputMutex);
 			inputString = mInputString;
 			inputString = mInputString;
 			mInputString.clear();
 			mInputString.clear();
 
 
@@ -171,14 +171,14 @@ namespace BansheeEngine
 
 
 	void OSInputHandler::charInput(UINT32 character)
 	void OSInputHandler::charInput(UINT32 character)
 	{
 	{
-		CM_LOCK_MUTEX(mOSInputMutex);
+		BS_LOCK_MUTEX(mOSInputMutex);
 
 
 		mInputString += character;
 		mInputString += character;
 	}
 	}
 
 
 	void OSInputHandler::cursorMoved(const Vector2I& cursorPos, OSPointerButtonStates& btnStates)
 	void OSInputHandler::cursorMoved(const Vector2I& cursorPos, OSPointerButtonStates& btnStates)
 	{
 	{
-		CM_LOCK_MUTEX(mOSInputMutex);
+		BS_LOCK_MUTEX(mOSInputMutex);
 
 
 		mCursorPosition = cursorPos;
 		mCursorPosition = cursorPos;
 		mMouseMoveBtnState = btnStates;
 		mMouseMoveBtnState = btnStates;
@@ -187,7 +187,7 @@ namespace BansheeEngine
 	void OSInputHandler::cursorPressed(const Vector2I& cursorPos, 
 	void OSInputHandler::cursorPressed(const Vector2I& cursorPos, 
 		OSMouseButton button, OSPointerButtonStates& btnStates)
 		OSMouseButton button, OSPointerButtonStates& btnStates)
 	{
 	{
-		CM_LOCK_MUTEX(mOSInputMutex);
+		BS_LOCK_MUTEX(mOSInputMutex);
 
 
 		mButtonStates.push(ButtonStateChange());
 		mButtonStates.push(ButtonStateChange());
 		ButtonStateChange& btnState = mButtonStates.back();
 		ButtonStateChange& btnState = mButtonStates.back();
@@ -201,7 +201,7 @@ namespace BansheeEngine
 	void OSInputHandler::cursorReleased(const Vector2I& cursorPos, 
 	void OSInputHandler::cursorReleased(const Vector2I& cursorPos, 
 		OSMouseButton button, OSPointerButtonStates& btnStates)
 		OSMouseButton button, OSPointerButtonStates& btnStates)
 	{
 	{
-		CM_LOCK_MUTEX(mOSInputMutex);
+		BS_LOCK_MUTEX(mOSInputMutex);
 
 
 		mButtonStates.push(ButtonStateChange());
 		mButtonStates.push(ButtonStateChange());
 		ButtonStateChange& btnState = mButtonStates.back();
 		ButtonStateChange& btnState = mButtonStates.back();
@@ -214,7 +214,7 @@ namespace BansheeEngine
 
 
 	void OSInputHandler::cursorDoubleClick(const Vector2I& cursorPos, OSPointerButtonStates& btnStates)
 	void OSInputHandler::cursorDoubleClick(const Vector2I& cursorPos, OSPointerButtonStates& btnStates)
 	{
 	{
-		CM_LOCK_MUTEX(mOSInputMutex);
+		BS_LOCK_MUTEX(mOSInputMutex);
 
 
 		mDoubleClicks.push(DoubleClick());
 		mDoubleClicks.push(DoubleClick());
 		DoubleClick& btnState = mDoubleClicks.back();
 		DoubleClick& btnState = mDoubleClicks.back();
@@ -225,14 +225,14 @@ namespace BansheeEngine
 
 
 	void OSInputHandler::inputCommandEntered(InputCommandType commandType)
 	void OSInputHandler::inputCommandEntered(InputCommandType commandType)
 	{
 	{
-		CM_LOCK_MUTEX(mOSInputMutex);
+		BS_LOCK_MUTEX(mOSInputMutex);
 
 
 		mInputCommands.push(commandType);
 		mInputCommands.push(commandType);
 	}
 	}
 
 
 	void OSInputHandler::mouseWheelScrolled(float scrollPos)
 	void OSInputHandler::mouseWheelScrolled(float scrollPos)
 	{
 	{
-		CM_LOCK_MUTEX(mOSInputMutex);
+		BS_LOCK_MUTEX(mOSInputMutex);
 
 
 		mMouseScroll = scrollPos;
 		mMouseScroll = scrollPos;
 	}
 	}

+ 1 - 1
BansheeCore/Source/CmPass.cpp

@@ -47,7 +47,7 @@ namespace BansheeEngine
 
 
 		if(mBlendState != nullptr)
 		if(mBlendState != nullptr)
 		{
 		{
-			for(UINT32 i = 0; i < CM_MAX_MULTIPLE_RENDER_TARGETS; i++)
+			for(UINT32 i = 0; i < BS_MAX_MULTIPLE_RENDER_TARGETS; i++)
 			{
 			{
 				// Transparent if destination color is taken into account
 				// Transparent if destination color is taken into account
 				if (mBlendState->getDstBlend(i) != BF_ZERO ||
 				if (mBlendState->getDstBlend(i) != BF_ZERO ||

+ 3 - 3
BansheeCore/Source/CmPixelBuffer.cpp

@@ -40,18 +40,18 @@ namespace BansheeEngine
     
     
     void* PixelBuffer::lockImpl(UINT32 offset, UINT32 length, GpuLockOptions options)
     void* PixelBuffer::lockImpl(UINT32 offset, UINT32 length, GpuLockOptions options)
     {
     {
-		CM_EXCEPT(InternalErrorException, "lockImpl(offset,length) is not valid for PixelBuffers and should never be called");
+		BS_EXCEPT(InternalErrorException, "lockImpl(offset,length) is not valid for PixelBuffers and should never be called");
     }
     }
 
 
 	void PixelBuffer::readData(UINT32 offset, UINT32 length, void* pDest)
 	void PixelBuffer::readData(UINT32 offset, UINT32 length, void* pDest)
 	{
 	{
 		// TODO
 		// TODO
-		CM_EXCEPT(NotImplementedException, "Reading a byte range is not implemented. Use blitToMemory.");
+		BS_EXCEPT(NotImplementedException, "Reading a byte range is not implemented. Use blitToMemory.");
 	}
 	}
 
 
 	void PixelBuffer::writeData(UINT32 offset, UINT32 length, const void* pSource, BufferWriteType writeFlags)
 	void PixelBuffer::writeData(UINT32 offset, UINT32 length, const void* pSource, BufferWriteType writeFlags)
 	{
 	{
 		// TODO
 		// TODO
-		CM_EXCEPT(NotImplementedException, "Writing a byte range is not implemented. Use blitFromMemory.");
+		BS_EXCEPT(NotImplementedException, "Writing a byte range is not implemented. Use blitFromMemory.");
 	}
 	}
 }
 }

+ 2 - 2
BansheeCore/Source/CmPixelData.cpp

@@ -42,12 +42,12 @@ namespace BansheeEngine
 				return *this;
 				return *this;
 			}
 			}
 
 
-			CM_EXCEPT(InvalidParametersException, "Cannot return subvolume of compressed PixelBuffer");
+			BS_EXCEPT(InvalidParametersException, "Cannot return subvolume of compressed PixelBuffer");
 		}
 		}
 
 
 		if (!mExtents.contains(def))
 		if (!mExtents.contains(def))
 		{
 		{
-			CM_EXCEPT(InvalidParametersException, "Bounds out of range");
+			BS_EXCEPT(InvalidParametersException, "Bounds out of range");
 		}
 		}
 
 
 		const size_t elemSize = PixelUtil::getNumElemBytes(mFormat);
 		const size_t elemSize = PixelUtil::getNumElemBytes(mFormat);

+ 4 - 4
BansheeCore/Source/CmPixelUtil.cpp

@@ -787,7 +787,7 @@ namespace BansheeEngine
 					return ((width+3)/4)*((height+3)/4)*16 * depth;
 					return ((width+3)/4)*((height+3)/4)*16 * depth;
 
 
 				default:
 				default:
-				CM_EXCEPT(InvalidParametersException, "Invalid compressed pixel format");
+				BS_EXCEPT(InvalidParametersException, "Invalid compressed pixel format");
 			}
 			}
 		}
 		}
 		else
 		else
@@ -1013,7 +1013,7 @@ namespace BansheeEngine
 				((UINT8*)dest)[0] = (UINT8)Bitwise::floatToFixed(r, 8);
 				((UINT8*)dest)[0] = (UINT8)Bitwise::floatToFixed(r, 8);
 				break;
 				break;
             default:
             default:
-                CM_EXCEPT(NotImplementedException, "Pack to " + getFormatName(format) + " not implemented");
+                BS_EXCEPT(NotImplementedException, "Pack to " + getFormatName(format) + " not implemented");
                 break;
                 break;
             }
             }
         }
         }
@@ -1139,7 +1139,7 @@ namespace BansheeEngine
 				*a = 1.0f;
 				*a = 1.0f;
 				break;
 				break;
             default:
             default:
-                CM_EXCEPT(NotImplementedException, "Unpack from " + getFormatName(format) + " not implemented");
+                BS_EXCEPT(NotImplementedException, "Unpack from " + getFormatName(format) + " not implemented");
                 break;
                 break;
             }
             }
         }
         }
@@ -1161,7 +1161,7 @@ namespace BansheeEngine
 			}
 			}
 			else
 			else
 			{
 			{
-				CM_EXCEPT(NotImplementedException, "This method can not be used to compress or decompress images");
+				BS_EXCEPT(NotImplementedException, "This method can not be used to compress or decompress images");
 			}
 			}
 		}
 		}
 
 

+ 2 - 2
BansheeCore/Source/CmPlatform.cpp

@@ -26,7 +26,7 @@ namespace BansheeEngine
 	{
 	{
 		if(mFileList != nullptr)
 		if(mFileList != nullptr)
 		{
 		{
-			cm_delete(mFileList);
+			bs_delete(mFileList);
 			mFileList = nullptr;
 			mFileList = nullptr;
 		}
 		}
 	}
 	}
@@ -44,7 +44,7 @@ namespace BansheeEngine
 		_clear();
 		_clear();
 
 
 		mDropType = OSDropType::FileList;
 		mDropType = OSDropType::FileList;
-		mFileList = cm_new<Vector<WString>>();
+		mFileList = bs_new<Vector<WString>>();
 		*mFileList = fileList;
 		*mFileList = fileList;
 	}
 	}
 }
 }

+ 11 - 11
BansheeCore/Source/CmProfiler.cpp

@@ -9,29 +9,29 @@ namespace BansheeEngine
 		:mSavedSimReports(nullptr), mCPUProfiler(nullptr), mNextSimReportIdx(0),
 		:mSavedSimReports(nullptr), mCPUProfiler(nullptr), mNextSimReportIdx(0),
 		mSavedCoreReports(nullptr), mNextCoreReportIdx(0)
 		mSavedCoreReports(nullptr), mNextCoreReportIdx(0)
 	{
 	{
-#if CM_PROFILING_ENABLED
-		mCPUProfiler = cm_new<CPUProfiler, ProfilerAlloc>();
+#if BS_PROFILING_ENABLED
+		mCPUProfiler = bs_new<CPUProfiler, ProfilerAlloc>();
 #endif
 #endif
 
 
-		mSavedSimReports = cm_newN<ProfilerReport, ProfilerAlloc>(NUM_SAVED_FRAMES);
-		mSavedCoreReports = cm_newN<ProfilerReport, ProfilerAlloc>(NUM_SAVED_FRAMES);
+		mSavedSimReports = bs_newN<ProfilerReport, ProfilerAlloc>(NUM_SAVED_FRAMES);
+		mSavedCoreReports = bs_newN<ProfilerReport, ProfilerAlloc>(NUM_SAVED_FRAMES);
 	}
 	}
 
 
 	Profiler::~Profiler()
 	Profiler::~Profiler()
 	{
 	{
 		if(mCPUProfiler != nullptr)
 		if(mCPUProfiler != nullptr)
-			cm_delete<ProfilerAlloc>(mCPUProfiler);
+			bs_delete<ProfilerAlloc>(mCPUProfiler);
 
 
 		if(mSavedSimReports != nullptr)
 		if(mSavedSimReports != nullptr)
-			cm_deleteN<ProfilerAlloc>(mSavedSimReports, NUM_SAVED_FRAMES);
+			bs_deleteN<ProfilerAlloc>(mSavedSimReports, NUM_SAVED_FRAMES);
 
 
 		if(mSavedCoreReports != nullptr)
 		if(mSavedCoreReports != nullptr)
-			cm_deleteN<ProfilerAlloc>(mSavedCoreReports, NUM_SAVED_FRAMES);
+			bs_deleteN<ProfilerAlloc>(mSavedCoreReports, NUM_SAVED_FRAMES);
 	}
 	}
 
 
 	void Profiler::_update()
 	void Profiler::_update()
 	{
 	{
-#if CM_PROFILING_ENABLED
+#if BS_PROFILING_ENABLED
 		mSavedSimReports[mNextSimReportIdx].cpuReport = mCPUProfiler->generateReport();
 		mSavedSimReports[mNextSimReportIdx].cpuReport = mCPUProfiler->generateReport();
 
 
 		mCPUProfiler->reset();
 		mCPUProfiler->reset();
@@ -42,8 +42,8 @@ namespace BansheeEngine
 
 
 	void Profiler::_updateCore()
 	void Profiler::_updateCore()
 	{
 	{
-#if CM_PROFILING_ENABLED
-		CM_LOCK_MUTEX(mSync);
+#if BS_PROFILING_ENABLED
+		BS_LOCK_MUTEX(mSync);
 		mSavedCoreReports[mNextCoreReportIdx].cpuReport = mCPUProfiler->generateReport();
 		mSavedCoreReports[mNextCoreReportIdx].cpuReport = mCPUProfiler->generateReport();
 
 
 		mCPUProfiler->reset();
 		mCPUProfiler->reset();
@@ -58,7 +58,7 @@ namespace BansheeEngine
 
 
 		if(thread == ProfiledThread::Core)
 		if(thread == ProfiledThread::Core)
 		{
 		{
-			CM_LOCK_MUTEX(mSync);
+			BS_LOCK_MUTEX(mSync);
 
 
 			UINT32 reportIdx = mNextCoreReportIdx + (UINT32)((INT32)NUM_SAVED_FRAMES - ((INT32)idx + 1));
 			UINT32 reportIdx = mNextCoreReportIdx + (UINT32)((INT32)NUM_SAVED_FRAMES - ((INT32)idx + 1));
 			reportIdx = (reportIdx) % NUM_SAVED_FRAMES;
 			reportIdx = (reportIdx) % NUM_SAVED_FRAMES;

+ 3 - 3
BansheeCore/Source/CmQueryManager.cpp

@@ -47,7 +47,7 @@ namespace BansheeEngine
 		if(iterFind != instance().mEventQueries.end())
 		if(iterFind != instance().mEventQueries.end())
 			instance().mEventQueries.erase(iterFind);
 			instance().mEventQueries.erase(iterFind);
 
 
-		cm_delete(query);
+		bs_delete(query);
 	}
 	}
 
 
 	void QueryManager::deleteTimerQuery(TimerQuery* query)
 	void QueryManager::deleteTimerQuery(TimerQuery* query)
@@ -57,7 +57,7 @@ namespace BansheeEngine
 		if(iterFind != instance().mTimerQueries.end())
 		if(iterFind != instance().mTimerQueries.end())
 			instance().mTimerQueries.erase(iterFind);
 			instance().mTimerQueries.erase(iterFind);
 
 
-		cm_delete(query);
+		bs_delete(query);
 	}
 	}
 
 
 	void QueryManager::deleteOcclusionQuery(OcclusionQuery* query)
 	void QueryManager::deleteOcclusionQuery(OcclusionQuery* query)
@@ -67,6 +67,6 @@ namespace BansheeEngine
 		if (iterFind != instance().mOcclusionQueries.end())
 		if (iterFind != instance().mOcclusionQueries.end())
 			instance().mOcclusionQueries.erase(iterFind);
 			instance().mOcclusionQueries.erase(iterFind);
 
 
-		cm_delete(query);
+		bs_delete(query);
 	}
 	}
 }
 }

+ 4 - 4
BansheeCore/Source/CmRenderStateManager.cpp

@@ -108,21 +108,21 @@ namespace BansheeEngine
 
 
 	SamplerStatePtr RenderStateManager::createSamplerStateImpl() const
 	SamplerStatePtr RenderStateManager::createSamplerStateImpl() const
 	{
 	{
-		return cm_core_ptr<SamplerState, PoolAlloc>();
+		return bs_core_ptr<SamplerState, PoolAlloc>();
 	}
 	}
 
 
 	BlendStatePtr RenderStateManager::createBlendStateImpl() const
 	BlendStatePtr RenderStateManager::createBlendStateImpl() const
 	{
 	{
-		return cm_core_ptr<BlendState, PoolAlloc>();
+		return bs_core_ptr<BlendState, PoolAlloc>();
 	}
 	}
 
 
 	RasterizerStatePtr RenderStateManager::createRasterizerStateImpl() const
 	RasterizerStatePtr RenderStateManager::createRasterizerStateImpl() const
 	{
 	{
-		return cm_core_ptr<RasterizerState, PoolAlloc>();
+		return bs_core_ptr<RasterizerState, PoolAlloc>();
 	}
 	}
 
 
 	DepthStencilStatePtr RenderStateManager::createDepthStencilStateImpl() const
 	DepthStencilStatePtr RenderStateManager::createDepthStencilStateImpl() const
 	{
 	{
-		return cm_core_ptr<DepthStencilState, PoolAlloc>();
+		return bs_core_ptr<DepthStencilState, PoolAlloc>();
 	}
 	}
 }
 }

+ 2 - 2
BansheeCore/Source/CmRenderSystem.cpp

@@ -36,7 +36,7 @@ namespace BansheeEngine {
     {
     {
 		// Base classes need to call virtual destroy_internal method instead of a destructor
 		// Base classes need to call virtual destroy_internal method instead of a destructor
 
 
-		cm_delete(mCurrentCapabilities);
+		bs_delete(mCurrentCapabilities);
 		mCurrentCapabilities = nullptr;
 		mCurrentCapabilities = nullptr;
     }
     }
 
 
@@ -230,7 +230,7 @@ namespace BansheeEngine {
 			for(auto iter = vertexBuffers.begin(); iter != vertexBuffers.end() ; ++iter)
 			for(auto iter = vertexBuffers.begin(); iter != vertexBuffers.end() ; ++iter)
 			{
 			{
 				if(iter->first >= MAX_BOUND_VERTEX_BUFFERS)
 				if(iter->first >= MAX_BOUND_VERTEX_BUFFERS)
-					CM_EXCEPT(InvalidParametersException, "Buffer index out of range");
+					BS_EXCEPT(InvalidParametersException, "Buffer index out of range");
 
 
 				startSlot = std::min(iter->first, startSlot);
 				startSlot = std::min(iter->first, startSlot);
 				endSlot = std::max(iter->first, endSlot);
 				endSlot = std::max(iter->first, endSlot);

+ 1 - 1
BansheeCore/Source/CmRenderTarget.cpp

@@ -17,6 +17,6 @@ namespace BansheeEngine
 
 
 	void RenderTarget::getCustomAttribute(const String& name, void* pData) const
 	void RenderTarget::getCustomAttribute(const String& name, void* pData) const
     {
     {
-        CM_EXCEPT(InvalidParametersException, "Attribute not found.");
+        BS_EXCEPT(InvalidParametersException, "Attribute not found.");
     }
     }
 }        
 }        

Some files were not shown because too many files changed in this diff