Marko Pintera 13 роки тому
батько
коміт
43b6668a36
32 змінених файлів з 146 додано та 147 видалено
  1. 1 1
      CamelotRenderer/OgreBuildSettings.h
  2. 9 9
      CamelotRenderer/OgreCommon.h
  3. 7 7
      CamelotRenderer/OgreConfig.h
  4. 1 1
      CamelotRenderer/OgreD3D9DeviceManager.cpp
  5. 2 2
      CamelotRenderer/OgreD3D9HLSLProgram.cpp
  6. 2 2
      CamelotRenderer/OgreD3D9HardwareBufferManager.cpp
  7. 1 1
      CamelotRenderer/OgreD3D9HardwarePixelBuffer.cpp
  8. 1 1
      CamelotRenderer/OgreD3D9HardwarePixelBuffer.h
  9. 3 3
      CamelotRenderer/OgreD3D9Prerequisites.h
  10. 4 4
      CamelotRenderer/OgreD3D9RenderSystem.cpp
  11. 1 1
      CamelotRenderer/OgreD3D9Resource.cpp
  12. 1 1
      CamelotRenderer/OgreD3D9Resource.h
  13. 6 6
      CamelotRenderer/OgreD3D9ResourceManager.cpp
  14. 1 1
      CamelotRenderer/OgreD3D9ResourceManager.h
  15. 1 1
      CamelotRenderer/OgreGpuProgramManager.cpp
  16. 2 2
      CamelotRenderer/OgreGpuProgramParams.cpp
  17. 1 1
      CamelotRenderer/OgreGpuProgramParams.h
  18. 10 10
      CamelotRenderer/OgreHardwareBufferManager.cpp
  19. 4 4
      CamelotRenderer/OgreHardwareBufferManager.h
  20. 1 1
      CamelotRenderer/OgreHighLevelGpuProgram.cpp
  21. 1 1
      CamelotRenderer/OgreStdHeaders.h
  22. 31 34
      CamelotRenderer/OgreThreadDefines.h
  23. 1 1
      CamelotRenderer/RenderSystemGL/Include/OgreGLHardwareBufferManager.h
  24. 2 2
      CamelotRenderer/RenderSystemGL/Include/OgreGLPrerequisites.h
  25. 1 1
      CamelotRenderer/RenderSystemGL/Include/OgreGLRenderSystem.h
  26. 4 4
      CamelotRenderer/RenderSystemGL/Source/OgreGLContext.cpp
  27. 4 4
      CamelotRenderer/RenderSystemGL/Source/OgreGLHardwareBufferManager.cpp
  28. 5 5
      CamelotRenderer/RenderSystemGL/Source/OgreGLRenderSystem.cpp
  29. 2 2
      CamelotRenderer/RenderSystemGL/Source/OgreWin32GLSupport.cpp
  30. 4 4
      CamelotRenderer/RenderSystemGL/Source/win32/OgreWin32Context.cpp
  31. 2 0
      CamelotUtility/Include/CmPrerequisitesUtil.h
  32. 30 30
      CamelotUtility/Include/CmThreadDefines.h

+ 1 - 1
CamelotRenderer/OgreBuildSettings.h

@@ -31,7 +31,7 @@
 
 
 #define OGRE_MEMORY_TRACKER_RELEASE_MODE 0
 #define OGRE_MEMORY_TRACKER_RELEASE_MODE 0
 
 
-#define OGRE_THREAD_SUPPORT 0
+#define CM_THREAD_SUPPORT 0
 
 
 #define OGRE_THREAD_PROVIDER 0
 #define OGRE_THREAD_PROVIDER 0
 
 

+ 9 - 9
CamelotRenderer/OgreCommon.h

@@ -743,7 +743,7 @@ namespace Ogre {
 	protected:
 	protected:
 		String mPrefix;
 		String mPrefix;
 		unsigned long long int mNext;
 		unsigned long long int mNext;
-		OGRE_AUTO_MUTEX
+		CM_AUTO_MUTEX
 	public:
 	public:
 		NameGenerator(const NameGenerator& rhs)
 		NameGenerator(const NameGenerator& rhs)
 			: mPrefix(rhs.mPrefix), mNext(rhs.mNext) {}
 			: mPrefix(rhs.mPrefix), mNext(rhs.mNext) {}
@@ -753,7 +753,7 @@ namespace Ogre {
 		/// Generate a new name
 		/// Generate a new name
 		String generate()
 		String generate()
 		{
 		{
-			OGRE_LOCK_AUTO_MUTEX
+			CM_LOCK_AUTO_MUTEX
 			std::ostringstream s;
 			std::ostringstream s;
 			s << mPrefix << mNext++;
 			s << mPrefix << mNext++;
 			return s.str();
 			return s.str();
@@ -762,14 +762,14 @@ namespace Ogre {
 		/// Reset the internal counter
 		/// Reset the internal counter
 		void reset()
 		void reset()
 		{
 		{
-			OGRE_LOCK_AUTO_MUTEX
+			CM_LOCK_AUTO_MUTEX
 			mNext = 1ULL;
 			mNext = 1ULL;
 		}
 		}
 
 
 		/// Manually set the internal counter (use caution)
 		/// Manually set the internal counter (use caution)
 		void setNext(unsigned long long int val)
 		void setNext(unsigned long long int val)
 		{
 		{
-			OGRE_LOCK_AUTO_MUTEX
+			CM_LOCK_AUTO_MUTEX
 			mNext = val;
 			mNext = val;
 		}
 		}
 
 
@@ -777,7 +777,7 @@ namespace Ogre {
 		unsigned long long int getNext() const
 		unsigned long long int getNext() const
 		{
 		{
 			// lock even on get because 64-bit may not be atomic read
 			// lock even on get because 64-bit may not be atomic read
-			OGRE_LOCK_AUTO_MUTEX
+			CM_LOCK_AUTO_MUTEX
 			return mNext;
 			return mNext;
 		}
 		}
 
 
@@ -794,7 +794,7 @@ namespace Ogre {
 	protected:
 	protected:
 		typedef typename list<T>::type ItemList;
 		typedef typename list<T>::type ItemList;
 		ItemList mItems;
 		ItemList mItems;
-		OGRE_AUTO_MUTEX
+		CM_AUTO_MUTEX
 	public:
 	public:
 		Pool() {} 
 		Pool() {} 
 		virtual ~Pool() {}
 		virtual ~Pool() {}
@@ -804,7 +804,7 @@ namespace Ogre {
 		*/
 		*/
 		virtual std::pair<bool, T> removeItem()
 		virtual std::pair<bool, T> removeItem()
 		{
 		{
-			OGRE_LOCK_AUTO_MUTEX
+			CM_LOCK_AUTO_MUTEX
 			std::pair<bool, T> ret;
 			std::pair<bool, T> ret;
 			if (mItems.empty())
 			if (mItems.empty())
 			{
 			{
@@ -823,13 +823,13 @@ namespace Ogre {
 		*/
 		*/
 		virtual void addItem(const T& i)
 		virtual void addItem(const T& i)
 		{
 		{
-			OGRE_LOCK_AUTO_MUTEX
+			CM_LOCK_AUTO_MUTEX
 			mItems.push_front(i);
 			mItems.push_front(i);
 		}
 		}
 		/// Clear the pool
 		/// Clear the pool
 		virtual void clear()
 		virtual void clear()
 		{
 		{
-			OGRE_LOCK_AUTO_MUTEX
+			CM_LOCK_AUTO_MUTEX
 			mItems.clear();
 			mItems.clear();
 		}
 		}
 
 

+ 7 - 7
CamelotRenderer/OgreConfig.h

@@ -120,16 +120,16 @@ THE SOFTWARE.
 
 
 /** Support for multithreading, there are 3 options
 /** Support for multithreading, there are 3 options
 
 
-OGRE_THREAD_SUPPORT = 0
+CM_THREAD_SUPPORT = 0
 	No support for threading.		
 	No support for threading.		
-OGRE_THREAD_SUPPORT = 1
+CM_THREAD_SUPPORT = 1
 	Thread support for background loading, by both loading and constructing resources
 	Thread support for background loading, by both loading and constructing resources
 	in a background thread. Resource management and SharedPtr handling becomes
 	in a background thread. Resource management and SharedPtr handling becomes
 	thread-safe, and resources may be completely loaded in the background. 
 	thread-safe, and resources may be completely loaded in the background. 
 	The places where threading is available are clearly
 	The places where threading is available are clearly
 	marked, you should assume state is NOT thread safe unless otherwise
 	marked, you should assume state is NOT thread safe unless otherwise
 	stated in relation to this flag.
 	stated in relation to this flag.
-OGRE_THREAD_SUPPORT = 2
+CM_THREAD_SUPPORT = 2
 	Thread support for background resource preparation. This means that resource
 	Thread support for background resource preparation. This means that resource
 	data can streamed into memory in the background, but the final resource
 	data can streamed into memory in the background, but the final resource
 	construction (including RenderSystem dependencies) is still done in the primary
 	construction (including RenderSystem dependencies) is still done in the primary
@@ -137,11 +137,11 @@ OGRE_THREAD_SUPPORT = 2
 	while still allowing the major blocking aspects of resource management (I/O)
 	while still allowing the major blocking aspects of resource management (I/O)
 	to be done in the background.
 	to be done in the background.
 */
 */
-#ifndef OGRE_THREAD_SUPPORT
-#define OGRE_THREAD_SUPPORT 0
+#ifndef CM_THREAD_SUPPORT
+#define CM_THREAD_SUPPORT 0
 #endif
 #endif
-#if OGRE_THREAD_SUPPORT != 0 && OGRE_THREAD_SUPPORT != 1 && OGRE_THREAD_SUPPORT != 2
-#define OGRE_THREAD_SUPPORT 0
+#if CM_THREAD_SUPPORT != 0 && CM_THREAD_SUPPORT != 1 && CM_THREAD_SUPPORT != 2
+#define CM_THREAD_SUPPORT 0
 #endif
 #endif
 
 
 /** Provider for threading functionality, there are 4 options.
 /** Provider for threading functionality, there are 4 options.

+ 1 - 1
CamelotRenderer/OgreD3D9DeviceManager.cpp

@@ -363,7 +363,7 @@ namespace Ogre
 		//if (opti != options.end() && opti->second.currentValue == "Consistent")
 		//if (opti != options.end() && opti->second.currentValue == "Consistent")
 		//	extraFlags |= D3DCREATE_FPU_PRESERVE;
 		//	extraFlags |= D3DCREATE_FPU_PRESERVE;
 
 
-#if OGRE_THREAD_SUPPORT == 1
+#if CM_THREAD_SUPPORT == 1
 		extraFlags |= D3DCREATE_MULTITHREADED;
 		extraFlags |= D3DCREATE_MULTITHREADED;
 #endif
 #endif
 
 

+ 2 - 2
CamelotRenderer/OgreD3D9HLSLProgram.cpp

@@ -371,7 +371,7 @@ namespace Ogre {
 				if (def.isFloat())
 				if (def.isFloat())
 				{
 				{
 					def.physicalIndex = mFloatLogicalToPhysical->bufferSize;
 					def.physicalIndex = mFloatLogicalToPhysical->bufferSize;
-					OGRE_LOCK_MUTEX(mFloatLogicalToPhysical->mutex)
+					CM_LOCK_MUTEX(mFloatLogicalToPhysical->mutex)
 					mFloatLogicalToPhysical->map.insert(
 					mFloatLogicalToPhysical->map.insert(
 						GpuLogicalIndexUseMap::value_type(paramIndex, 
 						GpuLogicalIndexUseMap::value_type(paramIndex, 
 						GpuLogicalIndexUse(def.physicalIndex, def.arraySize * def.elementSize, GPV_GLOBAL)));
 						GpuLogicalIndexUse(def.physicalIndex, def.arraySize * def.elementSize, GPV_GLOBAL)));
@@ -381,7 +381,7 @@ namespace Ogre {
 				else
 				else
 				{
 				{
 					def.physicalIndex = mIntLogicalToPhysical->bufferSize;
 					def.physicalIndex = mIntLogicalToPhysical->bufferSize;
-					OGRE_LOCK_MUTEX(mIntLogicalToPhysical->mutex)
+					CM_LOCK_MUTEX(mIntLogicalToPhysical->mutex)
 					mIntLogicalToPhysical->map.insert(
 					mIntLogicalToPhysical->map.insert(
 						GpuLogicalIndexUseMap::value_type(paramIndex, 
 						GpuLogicalIndexUseMap::value_type(paramIndex, 
 						GpuLogicalIndexUse(def.physicalIndex, def.arraySize * def.elementSize, GPV_GLOBAL)));
 						GpuLogicalIndexUse(def.physicalIndex, def.arraySize * def.elementSize, GPV_GLOBAL)));

+ 2 - 2
CamelotRenderer/OgreD3D9HardwareBufferManager.cpp

@@ -72,7 +72,7 @@ namespace Ogre {
 		D3D9HardwareVertexBuffer* vbuf = new D3D9HardwareVertexBuffer(
 		D3D9HardwareVertexBuffer* vbuf = new D3D9HardwareVertexBuffer(
 			this, vertexSize, numVerts, usage, false, useShadowBuffer);
 			this, vertexSize, numVerts, usage, false, useShadowBuffer);
 		{
 		{
-			OGRE_LOCK_MUTEX(mVertexBuffersMutex)
+			CM_LOCK_MUTEX(mVertexBuffersMutex)
 			mVertexBuffers.insert(vbuf);
 			mVertexBuffers.insert(vbuf);
 		}
 		}
         return HardwareVertexBufferPtr(vbuf);
         return HardwareVertexBufferPtr(vbuf);
@@ -104,7 +104,7 @@ namespace Ogre {
 		D3D9HardwareIndexBuffer* idx = new D3D9HardwareIndexBuffer(
 		D3D9HardwareIndexBuffer* idx = new D3D9HardwareIndexBuffer(
 			this, itype, numIndexes, usage, false, useShadowBuffer);
 			this, itype, numIndexes, usage, false, useShadowBuffer);
 		{
 		{
-			OGRE_LOCK_MUTEX(mIndexBuffersMutex)
+			CM_LOCK_MUTEX(mIndexBuffersMutex)
 			mIndexBuffers.insert(idx);
 			mIndexBuffers.insert(idx);
 		}
 		}
 		return HardwareIndexBufferPtr(idx);
 		return HardwareIndexBufferPtr(idx);

+ 1 - 1
CamelotRenderer/OgreD3D9HardwarePixelBuffer.cpp

@@ -36,7 +36,7 @@ THE SOFTWARE.
 
 
 namespace Ogre {
 namespace Ogre {
 
 
-OGRE_STATIC_MUTEX_INSTANCE(D3D9HardwarePixelBuffer::msDeviceAccessMutex)
+CM_STATIC_MUTEX_INSTANCE(D3D9HardwarePixelBuffer::msDeviceAccessMutex)
 //-----------------------------------------------------------------------------  
 //-----------------------------------------------------------------------------  
 
 
 D3D9HardwarePixelBuffer::D3D9HardwarePixelBuffer(HardwareBuffer::Usage usage, 
 D3D9HardwarePixelBuffer::D3D9HardwarePixelBuffer(HardwareBuffer::Usage usage, 

+ 1 - 1
CamelotRenderer/OgreD3D9HardwarePixelBuffer.h

@@ -75,7 +75,7 @@ namespace Ogre {
 		DWORD mLockFlags;
 		DWORD mLockFlags;
 
 
 		// Device access mutex.
 		// Device access mutex.
-		OGRE_STATIC_MUTEX(msDeviceAccessMutex)		
+		CM_STATIC_MUTEX(msDeviceAccessMutex)		
 	protected:
 	protected:
 		/// Lock a box
 		/// Lock a box
 		PixelBox lockImpl(const Box lockBox,  LockOptions options);
 		PixelBox lockImpl(const Box lockBox,  LockOptions options);

+ 3 - 3
CamelotRenderer/OgreD3D9Prerequisites.h

@@ -33,7 +33,7 @@ THE SOFTWARE.
 #  include "WIN32/OgreMinGWSupport.h" // extra defines for MinGW to deal with DX SDK
 #  include "WIN32/OgreMinGWSupport.h" // extra defines for MinGW to deal with DX SDK
 #endif
 #endif
 
 
-#if OGRE_THREAD_SUPPORT
+#if CM_THREAD_SUPPORT
 #define OGRE_LOCK_RECURSIVE_MUTEX(name)   name.lock();
 #define OGRE_LOCK_RECURSIVE_MUTEX(name)   name.lock();
 #define OGRE_UNLOCK_RECURSIVE_MUTEX(name) name.unlock();
 #define OGRE_UNLOCK_RECURSIVE_MUTEX(name) name.unlock();
 #else
 #else
@@ -42,10 +42,10 @@ THE SOFTWARE.
 #endif
 #endif
 
 
 
 
-#if OGRE_THREAD_SUPPORT == 1
+#if CM_THREAD_SUPPORT == 1
 #define D3D9_DEVICE_ACCESS_LOCK				OGRE_LOCK_RECURSIVE_MUTEX(msDeviceAccessMutex);
 #define D3D9_DEVICE_ACCESS_LOCK				OGRE_LOCK_RECURSIVE_MUTEX(msDeviceAccessMutex);
 #define D3D9_DEVICE_ACCESS_UNLOCK			OGRE_UNLOCK_RECURSIVE_MUTEX(msDeviceAccessMutex);
 #define D3D9_DEVICE_ACCESS_UNLOCK			OGRE_UNLOCK_RECURSIVE_MUTEX(msDeviceAccessMutex);
-#define D3D9_DEVICE_ACCESS_CRITICAL_SECTION	OGRE_LOCK_MUTEX(msDeviceAccessMutex)
+#define D3D9_DEVICE_ACCESS_CRITICAL_SECTION	CM_LOCK_MUTEX(msDeviceAccessMutex)
 #else
 #else
 #define D3D9_DEVICE_ACCESS_LOCK	
 #define D3D9_DEVICE_ACCESS_LOCK	
 #define D3D9_DEVICE_ACCESS_UNLOCK
 #define D3D9_DEVICE_ACCESS_UNLOCK

+ 4 - 4
CamelotRenderer/OgreD3D9RenderSystem.cpp

@@ -3130,7 +3130,7 @@ namespace Ogre
 		case GPT_VERTEX_PROGRAM:
 		case GPT_VERTEX_PROGRAM:
 			mActiveVertexGpuProgramParameters = params;
 			mActiveVertexGpuProgramParameters = params;
 			{
 			{
-				OGRE_LOCK_MUTEX(floatLogical->mutex)
+				CM_LOCK_MUTEX(floatLogical->mutex)
 
 
 					for (GpuLogicalIndexUseMap::const_iterator i = floatLogical->map.begin();
 					for (GpuLogicalIndexUseMap::const_iterator i = floatLogical->map.begin();
 						i != floatLogical->map.end(); ++i)
 						i != floatLogical->map.end(); ++i)
@@ -3157,7 +3157,7 @@ namespace Ogre
 			}
 			}
 			// bind ints
 			// bind ints
 			{
 			{
-				OGRE_LOCK_MUTEX(intLogical->mutex)
+				CM_LOCK_MUTEX(intLogical->mutex)
 
 
 					for (GpuLogicalIndexUseMap::const_iterator i = intLogical->map.begin();
 					for (GpuLogicalIndexUseMap::const_iterator i = intLogical->map.begin();
 						i != intLogical->map.end(); ++i)
 						i != intLogical->map.end(); ++i)
@@ -3186,7 +3186,7 @@ namespace Ogre
 		case GPT_FRAGMENT_PROGRAM:
 		case GPT_FRAGMENT_PROGRAM:
 			mActiveFragmentGpuProgramParameters = params;
 			mActiveFragmentGpuProgramParameters = params;
 			{
 			{
-				OGRE_LOCK_MUTEX(floatLogical->mutex)
+				CM_LOCK_MUTEX(floatLogical->mutex)
 
 
 					for (GpuLogicalIndexUseMap::const_iterator i = floatLogical->map.begin();
 					for (GpuLogicalIndexUseMap::const_iterator i = floatLogical->map.begin();
 						i != floatLogical->map.end(); ++i)
 						i != floatLogical->map.end(); ++i)
@@ -3212,7 +3212,7 @@ namespace Ogre
 			}
 			}
 			// bind ints
 			// bind ints
 			{
 			{
-				OGRE_LOCK_MUTEX(intLogical->mutex)
+				CM_LOCK_MUTEX(intLogical->mutex)
 
 
 					for (GpuLogicalIndexUseMap::const_iterator i = intLogical->map.begin();
 					for (GpuLogicalIndexUseMap::const_iterator i = intLogical->map.begin();
 						i != intLogical->map.end(); ++i)
 						i != intLogical->map.end(); ++i)

+ 1 - 1
CamelotRenderer/OgreD3D9Resource.cpp

@@ -31,7 +31,7 @@ THE SOFTWARE.
 
 
 namespace Ogre
 namespace Ogre
 {
 {
-	OGRE_STATIC_MUTEX_INSTANCE(D3D9Resource::msDeviceAccessMutex)
+	CM_STATIC_MUTEX_INSTANCE(D3D9Resource::msDeviceAccessMutex)
 
 
 	D3D9Resource::D3D9Resource()
 	D3D9Resource::D3D9Resource()
 	{				
 	{				

+ 1 - 1
CamelotRenderer/OgreD3D9Resource.h

@@ -70,7 +70,7 @@ namespace Ogre {
 		virtual ~D3D9Resource	();
 		virtual ~D3D9Resource	();
 
 
 	protected:
 	protected:
-		OGRE_STATIC_MUTEX(msDeviceAccessMutex)		
+		CM_STATIC_MUTEX(msDeviceAccessMutex)		
 	};
 	};
 }
 }
 #endif
 #endif

+ 6 - 6
CamelotRenderer/OgreD3D9ResourceManager.cpp

@@ -60,7 +60,7 @@ namespace Ogre
 	 //-----------------------------------------------------------------------
 	 //-----------------------------------------------------------------------
 	void D3D9ResourceManager::notifyOnDeviceCreate(IDirect3DDevice9* d3d9Device)
 	void D3D9ResourceManager::notifyOnDeviceCreate(IDirect3DDevice9* d3d9Device)
 	{				
 	{				
-		OGRE_LOCK_MUTEX(mResourcesMutex)
+		CM_LOCK_MUTEX(mResourcesMutex)
 
 
 		ResourceContainerIterator it = mResources.begin();
 		ResourceContainerIterator it = mResources.begin();
 		while (it != mResources.end())
 		while (it != mResources.end())
@@ -73,7 +73,7 @@ namespace Ogre
 	 //-----------------------------------------------------------------------
 	 //-----------------------------------------------------------------------
 	void D3D9ResourceManager::notifyOnDeviceDestroy(IDirect3DDevice9* d3d9Device)
 	void D3D9ResourceManager::notifyOnDeviceDestroy(IDirect3DDevice9* d3d9Device)
 	{
 	{
-		OGRE_LOCK_MUTEX(mResourcesMutex)
+		CM_LOCK_MUTEX(mResourcesMutex)
 
 
 		ResourceContainerIterator it = mResources.begin();
 		ResourceContainerIterator it = mResources.begin();
 		while (it != mResources.end())
 		while (it != mResources.end())
@@ -86,7 +86,7 @@ namespace Ogre
 	 //-----------------------------------------------------------------------
 	 //-----------------------------------------------------------------------
 	void D3D9ResourceManager::notifyOnDeviceLost(IDirect3DDevice9* d3d9Device)
 	void D3D9ResourceManager::notifyOnDeviceLost(IDirect3DDevice9* d3d9Device)
 	{
 	{
-		OGRE_LOCK_MUTEX(mResourcesMutex)
+		CM_LOCK_MUTEX(mResourcesMutex)
 
 
 		ResourceContainerIterator it = mResources.begin();
 		ResourceContainerIterator it = mResources.begin();
 		while (it != mResources.end())
 		while (it != mResources.end())
@@ -99,7 +99,7 @@ namespace Ogre
 	 //-----------------------------------------------------------------------
 	 //-----------------------------------------------------------------------
 	void D3D9ResourceManager::notifyOnDeviceReset(IDirect3DDevice9* d3d9Device)
 	void D3D9ResourceManager::notifyOnDeviceReset(IDirect3DDevice9* d3d9Device)
 	{		
 	{		
-		OGRE_LOCK_MUTEX(mResourcesMutex)
+		CM_LOCK_MUTEX(mResourcesMutex)
 
 
 		ResourceContainerIterator it = mResources.begin();
 		ResourceContainerIterator it = mResources.begin();
 		while (it != mResources.end())
 		while (it != mResources.end())
@@ -112,14 +112,14 @@ namespace Ogre
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
 	void D3D9ResourceManager::_notifyResourceCreated(D3D9Resource* pResource)
 	void D3D9ResourceManager::_notifyResourceCreated(D3D9Resource* pResource)
 	{		
 	{		
-		OGRE_LOCK_MUTEX(mResourcesMutex)		
+		CM_LOCK_MUTEX(mResourcesMutex)		
 		mResources.push_back(pResource);
 		mResources.push_back(pResource);
 	}
 	}
 	
 	
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
 	void D3D9ResourceManager::_notifyResourceDestroyed(D3D9Resource* pResource)
 	void D3D9ResourceManager::_notifyResourceDestroyed(D3D9Resource* pResource)
 	{		
 	{		
-		OGRE_LOCK_MUTEX(mResourcesMutex)
+		CM_LOCK_MUTEX(mResourcesMutex)
 
 
 		ResourceContainerIterator it = mResources.begin();
 		ResourceContainerIterator it = mResources.begin();
 
 

+ 1 - 1
CamelotRenderer/OgreD3D9ResourceManager.h

@@ -103,7 +103,7 @@ namespace Ogre {
 
 
 	// Attributes.
 	// Attributes.
 	protected:		
 	protected:		
-		OGRE_MUTEX(mResourcesMutex)
+		CM_MUTEX(mResourcesMutex)
 		ResourceContainer			mResources;
 		ResourceContainer			mResources;
 		D3D9ResourceCreationPolicy	mResourceCreationPolicy;
 		D3D9ResourceCreationPolicy	mResourceCreationPolicy;
 		long						mDeviceAccessLockCount;		
 		long						mDeviceAccessLockCount;		

+ 1 - 1
CamelotRenderer/OgreGpuProgramManager.cpp

@@ -58,7 +58,7 @@ namespace Ogre {
     {
     {
 		GpuProgramPtr prg;
 		GpuProgramPtr prg;
 		{
 		{
-			OGRE_LOCK_AUTO_MUTEX
+			CM_LOCK_AUTO_MUTEX
 			prg = createProgram( code, gptype, syntaxCode);
 			prg = createProgram( code, gptype, syntaxCode);
 		}
 		}
         prg->load();
         prg->load();

+ 2 - 2
CamelotRenderer/OgreGpuProgramParams.cpp

@@ -1023,7 +1023,7 @@ namespace Ogre
 			return 0;
 			return 0;
 
 
 		GpuLogicalIndexUse* indexUse = 0;
 		GpuLogicalIndexUse* indexUse = 0;
-		OGRE_LOCK_MUTEX(mFloatLogicalToPhysical->mutex)
+		CM_LOCK_MUTEX(mFloatLogicalToPhysical->mutex)
 
 
 			GpuLogicalIndexUseMap::iterator logi = mFloatLogicalToPhysical->map.find(logicalIndex);
 			GpuLogicalIndexUseMap::iterator logi = mFloatLogicalToPhysical->map.find(logicalIndex);
 		if (logi == mFloatLogicalToPhysical->map.end())
 		if (logi == mFloatLogicalToPhysical->map.end())
@@ -1130,7 +1130,7 @@ namespace Ogre
 			"GpuProgramParameters::_getIntConstantPhysicalIndex");
 			"GpuProgramParameters::_getIntConstantPhysicalIndex");
 
 
 		GpuLogicalIndexUse* indexUse = 0;
 		GpuLogicalIndexUse* indexUse = 0;
-		OGRE_LOCK_MUTEX(mIntLogicalToPhysical->mutex)
+		CM_LOCK_MUTEX(mIntLogicalToPhysical->mutex)
 
 
 			GpuLogicalIndexUseMap::iterator logi = mIntLogicalToPhysical->map.find(logicalIndex);
 			GpuLogicalIndexUseMap::iterator logi = mIntLogicalToPhysical->map.find(logicalIndex);
 		if (logi == mIntLogicalToPhysical->map.end())
 		if (logi == mIntLogicalToPhysical->map.end())

+ 1 - 1
CamelotRenderer/OgreGpuProgramParams.h

@@ -325,7 +325,7 @@ namespace Ogre {
 	/// Container struct to allow params to safely & update shared list of logical buffer assignments
 	/// Container struct to allow params to safely & update shared list of logical buffer assignments
 	struct _OgreExport GpuLogicalBufferStruct
 	struct _OgreExport GpuLogicalBufferStruct
 	{
 	{
-		OGRE_MUTEX(mutex)
+		CM_MUTEX(mutex)
 			/// Map from logical index to physical buffer location
 			/// Map from logical index to physical buffer location
 			GpuLogicalIndexUseMap map;
 			GpuLogicalIndexUseMap map;
 		/// Shortcut to know the buffer size needs
 		/// Shortcut to know the buffer size needs

+ 10 - 10
CamelotRenderer/OgreHardwareBufferManager.cpp

@@ -76,14 +76,14 @@ namespace Ogre {
     VertexDeclaration* HardwareBufferManagerBase::createVertexDeclaration(void)
     VertexDeclaration* HardwareBufferManagerBase::createVertexDeclaration(void)
     {
     {
         VertexDeclaration* decl = createVertexDeclarationImpl();
         VertexDeclaration* decl = createVertexDeclarationImpl();
-		OGRE_LOCK_MUTEX(mVertexDeclarationsMutex)
+		CM_LOCK_MUTEX(mVertexDeclarationsMutex)
         mVertexDeclarations.insert(decl);
         mVertexDeclarations.insert(decl);
         return decl;
         return decl;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     void HardwareBufferManagerBase::destroyVertexDeclaration(VertexDeclaration* decl)
     void HardwareBufferManagerBase::destroyVertexDeclaration(VertexDeclaration* decl)
     {
     {
-		OGRE_LOCK_MUTEX(mVertexDeclarationsMutex)
+		CM_LOCK_MUTEX(mVertexDeclarationsMutex)
         mVertexDeclarations.erase(decl);
         mVertexDeclarations.erase(decl);
         destroyVertexDeclarationImpl(decl);
         destroyVertexDeclarationImpl(decl);
     }
     }
@@ -91,14 +91,14 @@ namespace Ogre {
 	VertexBufferBinding* HardwareBufferManagerBase::createVertexBufferBinding(void)
 	VertexBufferBinding* HardwareBufferManagerBase::createVertexBufferBinding(void)
 	{
 	{
 		VertexBufferBinding* ret = createVertexBufferBindingImpl();
 		VertexBufferBinding* ret = createVertexBufferBindingImpl();
-		OGRE_LOCK_MUTEX(mVertexBufferBindingsMutex)
+		CM_LOCK_MUTEX(mVertexBufferBindingsMutex)
 		mVertexBufferBindings.insert(ret);
 		mVertexBufferBindings.insert(ret);
 		return ret;
 		return ret;
 	}
 	}
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
 	void HardwareBufferManagerBase::destroyVertexBufferBinding(VertexBufferBinding* binding)
 	void HardwareBufferManagerBase::destroyVertexBufferBinding(VertexBufferBinding* binding)
 	{
 	{
-		OGRE_LOCK_MUTEX(mVertexBufferBindingsMutex)
+		CM_LOCK_MUTEX(mVertexBufferBindingsMutex)
 		mVertexBufferBindings.erase(binding);
 		mVertexBufferBindings.erase(binding);
 		destroyVertexBufferBindingImpl(binding);
 		destroyVertexBufferBindingImpl(binding);
 	}
 	}
@@ -125,7 +125,7 @@ namespace Ogre {
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     void HardwareBufferManagerBase::destroyAllDeclarations(void)
     void HardwareBufferManagerBase::destroyAllDeclarations(void)
     {
     {
-		OGRE_LOCK_MUTEX(mVertexDeclarationsMutex)
+		CM_LOCK_MUTEX(mVertexDeclarationsMutex)
         VertexDeclarationList::iterator decl;
         VertexDeclarationList::iterator decl;
         for (decl = mVertexDeclarations.begin(); decl != mVertexDeclarations.end(); ++decl)
         for (decl = mVertexDeclarations.begin(); decl != mVertexDeclarations.end(); ++decl)
         {
         {
@@ -136,7 +136,7 @@ namespace Ogre {
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     void HardwareBufferManagerBase::destroyAllBindings(void)
     void HardwareBufferManagerBase::destroyAllBindings(void)
     {
     {
-		OGRE_LOCK_MUTEX(mVertexBufferBindingsMutex)
+		CM_LOCK_MUTEX(mVertexBufferBindingsMutex)
         VertexBufferBindingList::iterator bind;
         VertexBufferBindingList::iterator bind;
         for (bind = mVertexBufferBindings.begin(); bind != mVertexBufferBindings.end(); ++bind)
         for (bind = mVertexBufferBindings.begin(); bind != mVertexBufferBindings.end(); ++bind)
         {
         {
@@ -154,9 +154,9 @@ namespace Ogre {
 		//  makeBufferCopy / createVertexBuffer
 		//  makeBufferCopy / createVertexBuffer
 		// this prevents a deadlock in _notifyVertexBufferDestroyed
 		// this prevents a deadlock in _notifyVertexBufferDestroyed
 		// which locks the same mutexes (via other methods) but in reverse order
 		// which locks the same mutexes (via other methods) but in reverse order
-		OGRE_LOCK_MUTEX(mVertexBuffersMutex)
+		CM_LOCK_MUTEX(mVertexBuffersMutex)
 		{
 		{
-			OGRE_LOCK_MUTEX(mTempBuffersMutex)
+			CM_LOCK_MUTEX(mTempBuffersMutex)
 			HardwareVertexBufferPtr vbuf;
 			HardwareVertexBufferPtr vbuf;
 
 
 			// Locate existing buffer copy in temporary vertex buffers
 			// Locate existing buffer copy in temporary vertex buffers
@@ -179,7 +179,7 @@ namespace Ogre {
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
 	void HardwareBufferManagerBase::_notifyVertexBufferDestroyed(HardwareVertexBuffer* buf)
 	void HardwareBufferManagerBase::_notifyVertexBufferDestroyed(HardwareVertexBuffer* buf)
 	{
 	{
-		OGRE_LOCK_MUTEX(mVertexBuffersMutex)
+		CM_LOCK_MUTEX(mVertexBuffersMutex)
 
 
 		VertexBufferList::iterator i = mVertexBuffers.find(buf);
 		VertexBufferList::iterator i = mVertexBuffers.find(buf);
 		if (i != mVertexBuffers.end())
 		if (i != mVertexBuffers.end())
@@ -191,7 +191,7 @@ namespace Ogre {
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
 	void HardwareBufferManagerBase::_notifyIndexBufferDestroyed(HardwareIndexBuffer* buf)
 	void HardwareBufferManagerBase::_notifyIndexBufferDestroyed(HardwareIndexBuffer* buf)
 	{
 	{
-		OGRE_LOCK_MUTEX(mIndexBuffersMutex)
+		CM_LOCK_MUTEX(mIndexBuffersMutex)
 
 
 		IndexBufferList::iterator i = mIndexBuffers.find(buf);
 		IndexBufferList::iterator i = mIndexBuffers.find(buf);
 		if (i != mIndexBuffers.end())
 		if (i != mIndexBuffers.end())

+ 4 - 4
CamelotRenderer/OgreHardwareBufferManager.h

@@ -74,10 +74,10 @@ namespace Ogre {
 		VertexBufferBindingList mVertexBufferBindings;
 		VertexBufferBindingList mVertexBufferBindings;
 
 
 		// Mutexes
 		// Mutexes
-		OGRE_MUTEX(mVertexBuffersMutex)
-		OGRE_MUTEX(mIndexBuffersMutex)
-		OGRE_MUTEX(mVertexDeclarationsMutex)
-		OGRE_MUTEX(mVertexBufferBindingsMutex)
+		CM_MUTEX(mVertexBuffersMutex)
+		CM_MUTEX(mIndexBuffersMutex)
+		CM_MUTEX(mVertexDeclarationsMutex)
+		CM_MUTEX(mVertexBufferBindingsMutex)
 
 
         /// Internal method for destroys all vertex declarations
         /// Internal method for destroys all vertex declarations
         virtual void destroyAllDeclarations(void);
         virtual void destroyAllDeclarations(void);

+ 1 - 1
CamelotRenderer/OgreHighLevelGpuProgram.cpp

@@ -75,7 +75,7 @@ namespace Ogre
     {
     {
 		// Lock mutex before allowing this since this is a top-level method
 		// Lock mutex before allowing this since this is a top-level method
 		// called outside of the load()
 		// called outside of the load()
-		OGRE_LOCK_AUTO_MUTEX
+		CM_LOCK_AUTO_MUTEX
 
 
         // Make sure param defs are loaded
         // Make sure param defs are loaded
         GpuProgramParametersSharedPtr params = GpuProgramParametersSharedPtr(OGRE_NEW GpuProgramParameters());
         GpuProgramParametersSharedPtr params = GpuProgramParametersSharedPtr(OGRE_NEW GpuProgramParameters());

+ 1 - 1
CamelotRenderer/OgreStdHeaders.h

@@ -112,7 +112,7 @@ extern "C" {
 }
 }
 #endif
 #endif
 
 
-#if OGRE_THREAD_SUPPORT
+#if CM_THREAD_SUPPORT
 #   include "Threading/OgreThreadHeaders.h"
 #   include "Threading/OgreThreadHeaders.h"
 #endif
 #endif
 
 

+ 31 - 34
CamelotRenderer/OgreThreadDefines.h

@@ -23,39 +23,36 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE
 THE SOFTWARE
 -------------------------------------------------------------------------*/
 -------------------------------------------------------------------------*/
-#ifndef __OgreThreadDefines_H__
-#define __OgreThreadDefines_H__
+#pragma once
 
 
-#define OGRE_AUTO_MUTEX_NAME mutex
-#define OGRE_AUTO_MUTEX
-#define OGRE_LOCK_AUTO_MUTEX
-#define OGRE_MUTEX(name)
-#define OGRE_STATIC_MUTEX(name)
-#define OGRE_STATIC_MUTEX_INSTANCE(name)
-#define OGRE_LOCK_MUTEX(name)
-#define OGRE_LOCK_MUTEX_NAMED(mutexName, lockName)
-#define OGRE_AUTO_SHARED_MUTEX
-#define OGRE_LOCK_AUTO_SHARED_MUTEX
-#define OGRE_NEW_AUTO_SHARED_MUTEX
-#define OGRE_DELETE_AUTO_SHARED_MUTEX
-#define OGRE_COPY_AUTO_SHARED_MUTEX(from)
-#define OGRE_SET_AUTO_SHARED_MUTEX_NULL
-#define OGRE_MUTEX_CONDITIONAL(name) if(true)
-#define OGRE_RW_MUTEX(name)
-#define OGRE_LOCK_RW_MUTEX_READ(name)
-#define OGRE_LOCK_RW_MUTEX_WRITE(name)
-#define OGRE_THREAD_SYNCHRONISER(sync) 
-#define OGRE_THREAD_WAIT(sync, lock) 
-#define OGRE_THREAD_NOTIFY_ONE(sync) 
-#define OGRE_THREAD_NOTIFY_ALL(sync) 
-#define OGRE_THREAD_POINTER(T, var) T* var
-#define OGRE_THREAD_POINTER_INIT(var) var(0)
-#define OGRE_THREAD_POINTER_VAR(T, var) T* var = 0
-#define OGRE_THREAD_POINTER_SET(var, expr) var = expr
-#define OGRE_THREAD_POINTER_GET(var) var
-#define OGRE_THREAD_POINTER_DELETE(var) { OGRE_DELETE var; var = 0; }
-#define OGRE_THREAD_SLEEP(ms)
-#define OGRE_THREAD_WORKER_INHERIT
-
-#endif
+#define CM_AUTO_MUTEX_NAME mutex
+#define CM_AUTO_MUTEX
+#define CM_LOCK_AUTO_MUTEX
+#define CM_MUTEX(name)
+#define CM_STATIC_MUTEX(name)
+#define CM_STATIC_MUTEX_INSTANCE(name)
+#define CM_LOCK_MUTEX(name)
+#define CM_LOCK_MUTEX_NAMED(mutexName, lockName)
+#define CM_AUTO_SHARED_MUTEX
+#define CM_LOCK_AUTO_SHARED_MUTEX
+#define CM_NEW_AUTO_SHARED_MUTEX
+#define CM_DELETE_AUTO_SHARED_MUTEX
+#define CM_COPY_AUTO_SHARED_MUTEX(from)
+#define CM_SET_AUTO_SHARED_MUTEX_NULL
+#define CM_MUTEX_CONDITIONAL(name) if(true)
+#define CM_RW_MUTEX(name)
+#define CM_LOCK_RW_MUTEX_READ(name)
+#define CM_LOCK_RW_MUTEX_WRITE(name)
+#define CM_THREAD_SYNCHRONISER(sync) 
+#define CM_THREAD_WAIT(sync, lock) 
+#define CM_THREAD_NOTIFY_ONE(sync) 
+#define CM_THREAD_NOTIFY_ALL(sync) 
+#define CM_THREAD_POINTER(T, var) T* var
+#define CM_THREAD_POINTER_INIT(var) var(0)
+#define CM_THREAD_POINTER_VAR(T, var) T* var = 0
+#define CM_THREAD_POINTER_SET(var, expr) var = expr
+#define CM_THREAD_POINTER_GET(var) var
+#define CM_THREAD_POINTER_DELETE(var) { delete var; var = 0; }
+#define CM_THREAD_SLEEP(ms)
+#define CM_THREAD_WORKER_INHERIT
 
 

+ 1 - 1
CamelotRenderer/RenderSystemGL/Include/OgreGLHardwareBufferManager.h

@@ -42,7 +42,7 @@ namespace Ogre {
     {
     {
 	protected:
 	protected:
 		char* mScratchBufferPool;
 		char* mScratchBufferPool;
-		OGRE_MUTEX(mScratchMutex)
+		CM_MUTEX(mScratchMutex)
 		size_t mMapBufferThreshold;
 		size_t mMapBufferThreshold;
 
 
     public:
     public:

+ 2 - 2
CamelotRenderer/RenderSystemGL/Include/OgreGLPrerequisites.h

@@ -44,7 +44,7 @@ namespace Ogre {
     class GLRenderBuffer;
     class GLRenderBuffer;
 }
 }
 
 
-#if OGRE_THREAD_SUPPORT == 1
+#if CM_THREAD_SUPPORT == 1
 #	define GLEW_MX
 #	define GLEW_MX
 #endif
 #endif
 
 
@@ -72,7 +72,7 @@ namespace Ogre {
 #   include <OpenGLES/ES1/glext.h>
 #   include <OpenGLES/ES1/glext.h>
 #endif
 #endif
 
 
-#if OGRE_THREAD_SUPPORT == 1
+#if CM_THREAD_SUPPORT == 1
 	// implemented in OgreGLContext.cpp
 	// implemented in OgreGLContext.cpp
 	GLEWContext * glewGetContext();
 	GLEWContext * glewGetContext();
 
 

+ 1 - 1
CamelotRenderer/RenderSystemGL/Include/OgreGLRenderSystem.h

@@ -460,7 +460,7 @@ namespace Ogre {
         Real getVerticalTexelOffset(void);
         Real getVerticalTexelOffset(void);
         Real getMinimumDepthInputValue(void);
         Real getMinimumDepthInputValue(void);
         Real getMaximumDepthInputValue(void);
         Real getMaximumDepthInputValue(void);
-		OGRE_MUTEX(mThreadInitMutex)
+		CM_MUTEX(mThreadInitMutex)
 		void registerThread();
 		void registerThread();
 		void unregisterThread();
 		void unregisterThread();
 		void preExtraThreadsStarted();
 		void preExtraThreadsStarted();

+ 4 - 4
CamelotRenderer/RenderSystemGL/Source/OgreGLContext.cpp

@@ -42,19 +42,19 @@ namespace Ogre {
     
     
 }
 }
 
 
-#if OGRE_THREAD_SUPPORT == 1
+#if CM_THREAD_SUPPORT == 1
 
 
 // declared in OgreGLPrerequisites.h 
 // declared in OgreGLPrerequisites.h 
 GLEWContext * glewGetContext()
 GLEWContext * glewGetContext()
 {
 {
 	using namespace Ogre;
 	using namespace Ogre;
-	static OGRE_THREAD_POINTER_VAR(GLEWContext, GLEWContextsPtr);
+	static CM_THREAD_POINTER_VAR(GLEWContext, GLEWContextsPtr);
 
 
-	GLEWContext * currentGLEWContextsPtr =  OGRE_THREAD_POINTER_GET(GLEWContextsPtr);
+	GLEWContext * currentGLEWContextsPtr =  CM_THREAD_POINTER_GET(GLEWContextsPtr);
 	if (currentGLEWContextsPtr == NULL)
 	if (currentGLEWContextsPtr == NULL)
 	{
 	{
 		currentGLEWContextsPtr = new GLEWContext();
 		currentGLEWContextsPtr = new GLEWContext();
-		OGRE_THREAD_POINTER_SET(GLEWContextsPtr, currentGLEWContextsPtr);
+		CM_THREAD_POINTER_SET(GLEWContextsPtr, currentGLEWContextsPtr);
 		memset(currentGLEWContextsPtr, 0, sizeof(GLEWContext));
 		memset(currentGLEWContextsPtr, 0, sizeof(GLEWContext));
 		glewInit();
 		glewInit();
 	}
 	}

+ 4 - 4
CamelotRenderer/RenderSystemGL/Source/OgreGLHardwareBufferManager.cpp

@@ -88,7 +88,7 @@ namespace Ogre {
 		GLHardwareVertexBuffer* buf = 
 		GLHardwareVertexBuffer* buf = 
 			new GLHardwareVertexBuffer(this, vertexSize, numVerts, usage, useShadowBuffer);
 			new GLHardwareVertexBuffer(this, vertexSize, numVerts, usage, useShadowBuffer);
 		{
 		{
-			OGRE_LOCK_MUTEX(mVertexBuffersMutex)
+			CM_LOCK_MUTEX(mVertexBuffersMutex)
 			mVertexBuffers.insert(buf);
 			mVertexBuffers.insert(buf);
 		}
 		}
 		return HardwareVertexBufferPtr(buf);
 		return HardwareVertexBufferPtr(buf);
@@ -102,7 +102,7 @@ namespace Ogre {
 		GLHardwareIndexBuffer* buf = 
 		GLHardwareIndexBuffer* buf = 
 			new GLHardwareIndexBuffer(this, itype, numIndexes, usage, useShadowBuffer);
 			new GLHardwareIndexBuffer(this, itype, numIndexes, usage, useShadowBuffer);
 		{
 		{
-			OGRE_LOCK_MUTEX(mIndexBuffersMutex)
+			CM_LOCK_MUTEX(mIndexBuffersMutex)
 			mIndexBuffers.insert(buf);
 			mIndexBuffers.insert(buf);
 		}
 		}
 		return HardwareIndexBufferPtr(buf);
 		return HardwareIndexBufferPtr(buf);
@@ -155,7 +155,7 @@ namespace Ogre {
 		// simple forward link search based on alloc sizes
 		// simple forward link search based on alloc sizes
 		// not that fast but the list should never get that long since not many
 		// not that fast but the list should never get that long since not many
 		// locks at once (hopefully)
 		// locks at once (hopefully)
-		OGRE_LOCK_MUTEX(mScratchMutex)
+		CM_LOCK_MUTEX(mScratchMutex)
 
 
 
 
 		// Alignment - round up the size to 32 bits
 		// Alignment - round up the size to 32 bits
@@ -205,7 +205,7 @@ namespace Ogre {
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
 	void GLHardwareBufferManagerBase::deallocateScratch(void* ptr)
 	void GLHardwareBufferManagerBase::deallocateScratch(void* ptr)
 	{
 	{
-		OGRE_LOCK_MUTEX(mScratchMutex)
+		CM_LOCK_MUTEX(mScratchMutex)
 
 
 		// Simple linear search dealloc
 		// Simple linear search dealloc
 		uint32 bufferPos = 0;
 		uint32 bufferPos = 0;

+ 5 - 5
CamelotRenderer/RenderSystemGL/Source/OgreGLRenderSystem.cpp

@@ -52,7 +52,7 @@ THE SOFTWARE.s
 // Convenience macro from ARB_vertex_buffer_object spec
 // Convenience macro from ARB_vertex_buffer_object spec
 #define VBO_BUFFER_OFFSET(i) ((char *)NULL + (i))
 #define VBO_BUFFER_OFFSET(i) ((char *)NULL + (i))
 
 
-#if OGRE_THREAD_SUPPORT != 1
+#if CM_THREAD_SUPPORT != 1
 GLenum glewContextInit (Ogre::GLSupport *glSupport);
 GLenum glewContextInit (Ogre::GLSupport *glSupport);
 #endif
 #endif
 
 
@@ -1022,7 +1022,7 @@ namespace Ogre {
 		mGLSupport->initialiseExtensions();
 		mGLSupport->initialiseExtensions();
 
 
 		// Get extension function pointers
 		// Get extension function pointers
-#if OGRE_THREAD_SUPPORT != 1
+#if CM_THREAD_SUPPORT != 1
 		glewContextInit(mGLSupport);
 		glewContextInit(mGLSupport);
 #endif
 #endif
 	}
 	}
@@ -3382,7 +3382,7 @@ GL_RGB_SCALE : GL_ALPHA_SCALE, 1);
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
 	void GLRenderSystem::registerThread()
 	void GLRenderSystem::registerThread()
 	{
 	{
-		OGRE_LOCK_MUTEX(mThreadInitMutex)
+		CM_LOCK_MUTEX(mThreadInitMutex)
 		// This is only valid once we've created the main context
 		// This is only valid once we've created the main context
 		if (!mMainContext)
 		if (!mMainContext)
 		{
 		{
@@ -3418,14 +3418,14 @@ GL_RGB_SCALE : GL_ALPHA_SCALE, 1);
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
 	void GLRenderSystem::preExtraThreadsStarted()
 	void GLRenderSystem::preExtraThreadsStarted()
 	{
 	{
-		OGRE_LOCK_MUTEX(mThreadInitMutex)
+		CM_LOCK_MUTEX(mThreadInitMutex)
 		// free context, we'll need this to share lists
 		// free context, we'll need this to share lists
 		mCurrentContext->endCurrent();
 		mCurrentContext->endCurrent();
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
 	void GLRenderSystem::postExtraThreadsStarted()
 	void GLRenderSystem::postExtraThreadsStarted()
 	{
 	{
-		OGRE_LOCK_MUTEX(mThreadInitMutex)
+		CM_LOCK_MUTEX(mThreadInitMutex)
 		// reacquire context
 		// reacquire context
 		mCurrentContext->setCurrent();
 		mCurrentContext->setCurrent();
 	}
 	}

+ 2 - 2
CamelotRenderer/RenderSystemGL/Source/OgreWin32GLSupport.cpp

@@ -11,7 +11,7 @@
 
 
 using namespace Ogre;
 using namespace Ogre;
 
 
-#if OGRE_THREAD_SUPPORT != 1
+#if CM_THREAD_SUPPORT != 1
 GLenum wglewContextInit (Ogre::GLSupport *glSupport);
 GLenum wglewContextInit (Ogre::GLSupport *glSupport);
 #endif
 #endif
 
 
@@ -397,7 +397,7 @@ namespace Ogre {
 		// First, initialise the normal extensions
 		// First, initialise the normal extensions
 		GLSupport::initialiseExtensions();
 		GLSupport::initialiseExtensions();
 		// wglew init
 		// wglew init
-#if OGRE_THREAD_SUPPORT != 1
+#if CM_THREAD_SUPPORT != 1
 		wglewContextInit(this);
 		wglewContextInit(this);
 #endif
 #endif
 
 

+ 4 - 4
CamelotRenderer/RenderSystemGL/Source/win32/OgreWin32Context.cpp

@@ -99,19 +99,19 @@ namespace Ogre {
 	}
 	}
 }
 }
 
 
-#if OGRE_THREAD_SUPPORT == 1
+#if CM_THREAD_SUPPORT == 1
 
 
 // declared in OgreGLPrerequisites.h 
 // declared in OgreGLPrerequisites.h 
 WGLEWContext * wglewGetContext()
 WGLEWContext * wglewGetContext()
 {
 {
 	using namespace Ogre;
 	using namespace Ogre;
-	static OGRE_THREAD_POINTER_VAR(WGLEWContext, WGLEWContextsPtr);
+	static CM_THREAD_POINTER_VAR(WGLEWContext, WGLEWContextsPtr);
 
 
-	WGLEWContext * currentWGLEWContextsPtr = OGRE_THREAD_POINTER_GET(WGLEWContextsPtr);
+	WGLEWContext * currentWGLEWContextsPtr = CM_THREAD_POINTER_GET(WGLEWContextsPtr);
 	if (currentWGLEWContextsPtr == NULL)
 	if (currentWGLEWContextsPtr == NULL)
 	{
 	{
 		currentWGLEWContextsPtr = new WGLEWContext();
 		currentWGLEWContextsPtr = new WGLEWContext();
-		OGRE_THREAD_POINTER_SET(WGLEWContextsPtr, currentWGLEWContextsPtr);
+		CM_THREAD_POINTER_SET(WGLEWContextsPtr, currentWGLEWContextsPtr);
 		ZeroMemory(currentWGLEWContextsPtr, sizeof(WGLEWContext));
 		ZeroMemory(currentWGLEWContextsPtr, sizeof(WGLEWContext));
 		wglewInit();
 		wglewInit();
 
 

+ 2 - 0
CamelotUtility/Include/CmPrerequisitesUtil.h

@@ -27,6 +27,8 @@ THE SOFTWARE
 
 
 #include <assert.h>
 #include <assert.h>
 
 
+#define CM_THREAD_SUPPORT 0 // No thread support for now
+
 // Platform-specific stuff
 // Platform-specific stuff
 #include "CmPlatform.h"
 #include "CmPlatform.h"
 
 

+ 30 - 30
CamelotUtility/Include/CmThreadDefines.h

@@ -25,33 +25,33 @@ THE SOFTWARE
 -------------------------------------------------------------------------*/
 -------------------------------------------------------------------------*/
 #pragma once
 #pragma once
 
 
-#define OGRE_AUTO_MUTEX_NAME mutex
-#define OGRE_AUTO_MUTEX
-#define OGRE_LOCK_AUTO_MUTEX
-#define OGRE_MUTEX(name)
-#define OGRE_STATIC_MUTEX(name)
-#define OGRE_STATIC_MUTEX_INSTANCE(name)
-#define OGRE_LOCK_MUTEX(name)
-#define OGRE_LOCK_MUTEX_NAMED(mutexName, lockName)
-#define OGRE_AUTO_SHARED_MUTEX
-#define OGRE_LOCK_AUTO_SHARED_MUTEX
-#define OGRE_NEW_AUTO_SHARED_MUTEX
-#define OGRE_DELETE_AUTO_SHARED_MUTEX
-#define OGRE_COPY_AUTO_SHARED_MUTEX(from)
-#define OGRE_SET_AUTO_SHARED_MUTEX_NULL
-#define OGRE_MUTEX_CONDITIONAL(name) if(true)
-#define OGRE_RW_MUTEX(name)
-#define OGRE_LOCK_RW_MUTEX_READ(name)
-#define OGRE_LOCK_RW_MUTEX_WRITE(name)
-#define OGRE_THREAD_SYNCHRONISER(sync) 
-#define OGRE_THREAD_WAIT(sync, lock) 
-#define OGRE_THREAD_NOTIFY_ONE(sync) 
-#define OGRE_THREAD_NOTIFY_ALL(sync) 
-#define OGRE_THREAD_POINTER(T, var) T* var
-#define OGRE_THREAD_POINTER_INIT(var) var(0)
-#define OGRE_THREAD_POINTER_VAR(T, var) T* var = 0
-#define OGRE_THREAD_POINTER_SET(var, expr) var = expr
-#define OGRE_THREAD_POINTER_GET(var) var
-#define OGRE_THREAD_POINTER_DELETE(var) { OGRE_DELETE var; var = 0; }
-#define OGRE_THREAD_SLEEP(ms)
-#define OGRE_THREAD_WORKER_INHERIT
+#define CM_AUTO_MUTEX_NAME mutex
+#define CM_AUTO_MUTEX
+#define CM_LOCK_AUTO_MUTEX
+#define CM_MUTEX(name)
+#define CM_STATIC_MUTEX(name)
+#define CM_STATIC_MUTEX_INSTANCE(name)
+#define CM_LOCK_MUTEX(name)
+#define CM_LOCK_MUTEX_NAMED(mutexName, lockName)
+#define CM_AUTO_SHARED_MUTEX
+#define CM_LOCK_AUTO_SHARED_MUTEX
+#define CM_NEW_AUTO_SHARED_MUTEX
+#define CM_DELETE_AUTO_SHARED_MUTEX
+#define CM_COPY_AUTO_SHARED_MUTEX(from)
+#define CM_SET_AUTO_SHARED_MUTEX_NULL
+#define CM_MUTEX_CONDITIONAL(name) if(true)
+#define CM_RW_MUTEX(name)
+#define CM_LOCK_RW_MUTEX_READ(name)
+#define CM_LOCK_RW_MUTEX_WRITE(name)
+#define CM_THREAD_SYNCHRONISER(sync) 
+#define CM_THREAD_WAIT(sync, lock) 
+#define CM_THREAD_NOTIFY_ONE(sync) 
+#define CM_THREAD_NOTIFY_ALL(sync) 
+#define CM_THREAD_POINTER(T, var) T* var
+#define CM_THREAD_POINTER_INIT(var) var(0)
+#define CM_THREAD_POINTER_VAR(T, var) T* var = 0
+#define CM_THREAD_POINTER_SET(var, expr) var = expr
+#define CM_THREAD_POINTER_GET(var) var
+#define CM_THREAD_POINTER_DELETE(var) { delete var; var = 0; }
+#define CM_THREAD_SLEEP(ms)
+#define CM_THREAD_WORKER_INHERIT