Browse Source

Ported Renderer to x64

Marko Pintera 13 years ago
parent
commit
43d1b87b50
54 changed files with 517 additions and 436 deletions
  1. 2 2
      CamelotD3D9Renderer/Include/CmD3D9HardwareBufferManager.h
  2. 6 6
      CamelotD3D9Renderer/Include/CmD3D9HardwareIndexBuffer.h
  3. 2 2
      CamelotD3D9Renderer/Include/CmD3D9HardwarePixelBuffer.h
  4. 7 7
      CamelotD3D9Renderer/Include/CmD3D9HardwareVertexBuffer.h
  5. 2 2
      CamelotD3D9Renderer/Include/CmD3D9Texture.h
  6. 2 2
      CamelotD3D9Renderer/Source/CmD3D9HardwareBufferManager.cpp
  7. 6 6
      CamelotD3D9Renderer/Source/CmD3D9HardwareIndexBuffer.cpp
  8. 6 6
      CamelotD3D9Renderer/Source/CmD3D9HardwarePixelBuffer.cpp
  9. 7 7
      CamelotD3D9Renderer/Source/CmD3D9HardwareVertexBuffer.cpp
  10. 9 9
      CamelotD3D9Renderer/Source/CmD3D9Texture.cpp
  11. 15 15
      CamelotGLRenderer/Include/CmGLDefaultHardwareBufferManager.h
  12. 8 8
      CamelotGLRenderer/Include/CmGLHardwareBufferManager.h
  13. 6 6
      CamelotGLRenderer/Include/CmGLHardwareIndexBuffer.h
  14. 8 8
      CamelotGLRenderer/Include/CmGLHardwarePixelBuffer.h
  15. 6 6
      CamelotGLRenderer/Include/CmGLHardwareVertexBuffer.h
  16. 1 1
      CamelotGLRenderer/Include/CmGLTexture.h
  17. 14 14
      CamelotGLRenderer/Source/CmGLDefaultHardwareBufferManager.cpp
  18. 4 4
      CamelotGLRenderer/Source/CmGLHardwareBufferManager.cpp
  19. 5 5
      CamelotGLRenderer/Source/CmGLHardwareIndexBuffer.cpp
  20. 10 10
      CamelotGLRenderer/Source/CmGLHardwarePixelBuffer.cpp
  21. 6 6
      CamelotGLRenderer/Source/CmGLHardwareVertexBuffer.cpp
  22. 10 10
      CamelotGLRenderer/Source/CmGLTexture.cpp
  23. 1 1
      CamelotRenderer.sln
  24. 77 0
      CamelotRenderer/CamelotRenderer.vcxproj
  25. 1 1
      CamelotRenderer/Include/CmCgProgram.h
  26. 13 13
      CamelotRenderer/Include/CmDefaultHardwareBufferManager.h
  27. 1 1
      CamelotRenderer/Include/CmGameObject.h
  28. 64 64
      CamelotRenderer/Include/CmGpuProgramParams.h
  29. 11 11
      CamelotRenderer/Include/CmHardwareBuffer.h
  30. 4 4
      CamelotRenderer/Include/CmHardwareBufferManager.h
  31. 5 5
      CamelotRenderer/Include/CmHardwareIndexBuffer.h
  32. 12 12
      CamelotRenderer/Include/CmHardwarePixelBuffer.h
  33. 16 16
      CamelotRenderer/Include/CmHardwareVertexBuffer.h
  34. 5 5
      CamelotRenderer/Include/CmMaterialRTTI.h
  35. 2 2
      CamelotRenderer/Include/CmMeshDataRTTI.h
  36. 1 1
      CamelotRenderer/Include/CmShader.h
  37. 1 1
      CamelotRenderer/Include/CmShaderRTTI.h
  38. 1 1
      CamelotRenderer/Include/CmTechnique.h
  39. 1 1
      CamelotRenderer/Include/CmTechniqueRTTI.h
  40. 12 12
      CamelotRenderer/Include/CmTexture.h
  41. 4 4
      CamelotRenderer/Include/CmTextureRTTI.h
  42. 2 2
      CamelotRenderer/Include/CmVertexDeclarationRTTI.h
  43. 4 4
      CamelotRenderer/Include/CmVertexIndexData.h
  44. 3 3
      CamelotRenderer/Source/CmCgProgram.cpp
  45. 14 14
      CamelotRenderer/Source/CmDefaultHardwareBufferManager.cpp
  46. 74 74
      CamelotRenderer/Source/CmGpuProgramParams.cpp
  47. 1 1
      CamelotRenderer/Source/CmHardwareIndexBuffer.cpp
  48. 7 7
      CamelotRenderer/Source/CmHardwarePixelBuffer.cpp
  49. 10 10
      CamelotRenderer/Source/CmHardwareVertexBuffer.cpp
  50. 2 2
      CamelotRenderer/Source/CmMaterialRTTI.cpp
  51. 2 2
      CamelotRenderer/Source/CmSceneManager.cpp
  52. 3 3
      CamelotRenderer/Source/CmTexture.cpp
  53. 13 13
      CamelotRenderer/Source/CmVertexIndexData.cpp
  54. 8 4
      CamelotUtility/CamelotUtility.vcxproj

+ 2 - 2
CamelotD3D9Renderer/Include/CmD3D9HardwareBufferManager.h

@@ -47,10 +47,10 @@ namespace CamelotEngine {
         ~D3D9HardwareBufferManagerBase();
         ~D3D9HardwareBufferManagerBase();
         /// Creates a vertex buffer
         /// Creates a vertex buffer
 		HardwareVertexBufferPtr 
 		HardwareVertexBufferPtr 
-            createVertexBuffer(size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer = false);
+            createVertexBuffer(UINT32 vertexSize, UINT32 numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer = false);
 		/// Create a hardware vertex buffer
 		/// Create a hardware vertex buffer
 		HardwareIndexBufferPtr 
 		HardwareIndexBufferPtr 
-            createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer = false);
+            createIndexBuffer(HardwareIndexBuffer::IndexType itype, UINT32 numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer = false);
     };
     };
 
 
 	/// D3D9HardwareBufferManagerBase as a Singleton
 	/// D3D9HardwareBufferManagerBase as a Singleton

+ 6 - 6
CamelotD3D9Renderer/Include/CmD3D9HardwareIndexBuffer.h

@@ -39,13 +39,13 @@ namespace CamelotEngine {
     {
     {
   
   
     public:
     public:
-		D3D9HardwareIndexBuffer(HardwareBufferManagerBase* mgr, IndexType idxType, size_t numIndexes, 
+		D3D9HardwareIndexBuffer(HardwareBufferManagerBase* mgr, IndexType idxType, UINT32 numIndexes, 
 			HardwareBuffer::Usage usage, bool useSystemMem, bool useShadowBuffer);
 			HardwareBuffer::Usage usage, bool useSystemMem, bool useShadowBuffer);
         ~D3D9HardwareIndexBuffer();
         ~D3D9HardwareIndexBuffer();
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void readData(size_t offset, size_t length, void* pDest);
+        void readData(UINT32 offset, UINT32 length, void* pDest);
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void writeData(size_t offset, size_t length, const void* pSource,
+        void writeData(UINT32 offset, UINT32 length, const void* pSource,
 				bool discardWholeBuffer = false);
 				bool discardWholeBuffer = false);
 
 
 		// Called immediately after the Direct3D device has been created.
 		// Called immediately after the Direct3D device has been created.
@@ -71,15 +71,15 @@ namespace CamelotEngine {
 		{
 		{
 			IDirect3DIndexBuffer9*		mBuffer;
 			IDirect3DIndexBuffer9*		mBuffer;
 			bool						mOutOfDate;
 			bool						mOutOfDate;
-			size_t						mLockOffset;
-			size_t						mLockLength;
+			UINT32						mLockOffset;
+			UINT32						mLockLength;
 			LockOptions					mLockOptions;
 			LockOptions					mLockOptions;
 			UINT32						mLastUsedFrame;
 			UINT32						mLastUsedFrame;
 		};
 		};
 
 
 	protected:
 	protected:
 		/** See HardwareBuffer. */
 		/** See HardwareBuffer. */
-		void* lockImpl(size_t offset, size_t length, LockOptions options);
+		void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);
 		/** See HardwareBuffer. */
 		/** See HardwareBuffer. */
 		void unlockImpl(void);
 		void unlockImpl(void);
 		// updates buffer resources from system memory buffer.
 		// updates buffer resources from system memory buffer.

+ 2 - 2
CamelotD3D9Renderer/Include/CmD3D9HardwarePixelBuffer.h

@@ -128,7 +128,7 @@ namespace CamelotEngine {
 		
 		
 		
 		
 		/// Get rendertarget for z slice
 		/// Get rendertarget for z slice
-		RenderTexture *getRenderTarget(size_t zoffset);
+		RenderTexture *getRenderTarget(UINT32 zoffset);
 
 
 		/// Accessor for surface
 		/// Accessor for surface
 		IDirect3DSurface9 *getSurface(IDirect3DDevice9* d3d9Device);
 		IDirect3DSurface9 *getSurface(IDirect3DDevice9* d3d9Device);
@@ -137,7 +137,7 @@ namespace CamelotEngine {
 		IDirect3DSurface9 *getFSAASurface(IDirect3DDevice9* d3d9Device);
 		IDirect3DSurface9 *getFSAASurface(IDirect3DDevice9* d3d9Device);
 
 
 		/// Notify TextureBuffer of destruction of render target
 		/// Notify TextureBuffer of destruction of render target
-        virtual void _clearSliceRTT(size_t zoffset);
+        virtual void _clearSliceRTT(UINT32 zoffset);
 
 
 		/// Release surfaces held by this pixel buffer.
 		/// Release surfaces held by this pixel buffer.
 		void releaseSurfaces(IDirect3DDevice9* d3d9Device);
 		void releaseSurfaces(IDirect3DDevice9* d3d9Device);

+ 7 - 7
CamelotD3D9Renderer/Include/CmD3D9HardwareVertexBuffer.h

@@ -39,13 +39,13 @@ namespace CamelotEngine {
     {   
     {   
 
 
     public:
     public:
-		D3D9HardwareVertexBuffer(HardwareBufferManagerBase* mgr, size_t vertexSize, 
-			size_t numVertices, HardwareBuffer::Usage usage, bool useSystemMem, bool useShadowBuffer);
+		D3D9HardwareVertexBuffer(HardwareBufferManagerBase* mgr, UINT32 vertexSize, 
+			UINT32 numVertices, HardwareBuffer::Usage usage, bool useSystemMem, bool useShadowBuffer);
         ~D3D9HardwareVertexBuffer();
         ~D3D9HardwareVertexBuffer();
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void readData(size_t offset, size_t length, void* pDest);
+        void readData(UINT32 offset, UINT32 length, void* pDest);
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void writeData(size_t offset, size_t length, const void* pSource,
+        void writeData(UINT32 offset, UINT32 length, const void* pSource,
 				bool discardWholeBuffer = false);
 				bool discardWholeBuffer = false);
 	
 	
 		// Called immediately after the Direct3D device has been created.
 		// Called immediately after the Direct3D device has been created.
@@ -71,15 +71,15 @@ namespace CamelotEngine {
 		{
 		{
 			IDirect3DVertexBuffer9*		mBuffer;
 			IDirect3DVertexBuffer9*		mBuffer;
 			bool						mOutOfDate;
 			bool						mOutOfDate;
-			size_t						mLockOffset;
-			size_t						mLockLength;
+			UINT32						mLockOffset;
+			UINT32						mLockLength;
 			LockOptions					mLockOptions;
 			LockOptions					mLockOptions;
 			UINT32						mLastUsedFrame;
 			UINT32						mLastUsedFrame;
 		};
 		};
 
 
 	protected:		
 	protected:		
 		/** See HardwareBuffer. */
 		/** See HardwareBuffer. */
-		void* lockImpl(size_t offset, size_t length, LockOptions options);		
+		void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);		
 		/** See HardwareBuffer. */
 		/** See HardwareBuffer. */
 		void unlockImpl(void);			
 		void unlockImpl(void);			
 		// updates buffer resources from system memory buffer.
 		// updates buffer resources from system memory buffer.

+ 2 - 2
CamelotD3D9Renderer/Include/CmD3D9Texture.h

@@ -46,7 +46,7 @@ namespace CamelotEngine {
 		void copy_internal( TexturePtr& target );
 		void copy_internal( TexturePtr& target );
 
 
 		/// @copydoc Texture::getBuffer
 		/// @copydoc Texture::getBuffer
-		HardwarePixelBufferPtr getBuffer_internal(size_t face, size_t mipmap);
+		HardwarePixelBufferPtr getBuffer_internal(UINT32 face, UINT32 mipmap);
 		
 		
 		/// retrieves a pointer to the actual texture
 		/// retrieves a pointer to the actual texture
 		IDirect3DBaseTexture9 *getTexture_internal();		
 		IDirect3DBaseTexture9 *getTexture_internal();		
@@ -136,7 +136,7 @@ namespace CamelotEngine {
 		D3DFORMAT _chooseD3DFormat(IDirect3DDevice9* d3d9Device);
 		D3DFORMAT _chooseD3DFormat(IDirect3DDevice9* d3d9Device);
 
 
 		/// @copydoc Resource::calculateSize
 		/// @copydoc Resource::calculateSize
-		size_t calculateSize(void) const;
+		UINT32 calculateSize(void) const;
 		/// @copydoc Texture::createInternalResourcesImpl
 		/// @copydoc Texture::createInternalResourcesImpl
 		void createInternalResourcesImpl(void);
 		void createInternalResourcesImpl(void);
 		/// Creates this texture resources on the specified device.
 		/// Creates this texture resources on the specified device.

+ 2 - 2
CamelotD3D9Renderer/Source/CmD3D9HardwareBufferManager.cpp

@@ -44,7 +44,7 @@ namespace CamelotEngine {
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     HardwareVertexBufferPtr 
     HardwareVertexBufferPtr 
     D3D9HardwareBufferManagerBase::
     D3D9HardwareBufferManagerBase::
-    createVertexBuffer(size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage,
+    createVertexBuffer(UINT32 vertexSize, UINT32 numVerts, HardwareBuffer::Usage usage,
 		bool useShadowBuffer)
 		bool useShadowBuffer)
     {
     {
 		assert (numVerts > 0);
 		assert (numVerts > 0);
@@ -78,7 +78,7 @@ namespace CamelotEngine {
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
 	HardwareIndexBufferPtr 
 	HardwareIndexBufferPtr 
     D3D9HardwareBufferManagerBase::
     D3D9HardwareBufferManagerBase::
-    createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+    createIndexBuffer(HardwareIndexBuffer::IndexType itype, UINT32 numIndexes, 
         HardwareBuffer::Usage usage, bool useShadowBuffer)
         HardwareBuffer::Usage usage, bool useShadowBuffer)
     {
     {
 		assert (numIndexes > 0);
 		assert (numIndexes > 0);

+ 6 - 6
CamelotD3D9Renderer/Source/CmD3D9HardwareIndexBuffer.cpp

@@ -37,7 +37,7 @@ namespace CamelotEngine {
 
 
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
     D3D9HardwareIndexBuffer::D3D9HardwareIndexBuffer(HardwareBufferManagerBase* mgr, HardwareIndexBuffer::IndexType idxType, 
     D3D9HardwareIndexBuffer::D3D9HardwareIndexBuffer(HardwareBufferManagerBase* mgr, HardwareIndexBuffer::IndexType idxType, 
-        size_t numIndexes, HardwareBuffer::Usage usage,
+        UINT32 numIndexes, HardwareBuffer::Usage usage,
         bool useSystemMemory, bool useShadowBuffer)
         bool useSystemMemory, bool useShadowBuffer)
         : HardwareIndexBuffer(mgr, idxType, numIndexes, usage, useSystemMemory, useShadowBuffer)
         : HardwareIndexBuffer(mgr, idxType, numIndexes, usage, useSystemMemory, useShadowBuffer)
     {
     {
@@ -89,8 +89,8 @@ namespace CamelotEngine {
 		SAFE_DELETE_ARRAY(mSystemMemoryBuffer);
 		SAFE_DELETE_ARRAY(mSystemMemoryBuffer);
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-    void* D3D9HardwareIndexBuffer::lockImpl(size_t offset, 
-        size_t length, LockOptions options)
+    void* D3D9HardwareIndexBuffer::lockImpl(UINT32 offset, 
+        UINT32 length, LockOptions options)
     {		
     {		
 		D3D9_DEVICE_ACCESS_CRITICAL_SECTION
 		D3D9_DEVICE_ACCESS_CRITICAL_SECTION
 
 
@@ -106,7 +106,7 @@ namespace CamelotEngine {
 
 
 				if(bufferResources->mLockLength > 0)
 				if(bufferResources->mLockLength > 0)
 				{
 				{
-					size_t highPoint = std::max( offset + length, 
+					UINT32 highPoint = std::max( offset + length, 
 						bufferResources->mLockOffset + bufferResources->mLockLength );
 						bufferResources->mLockOffset + bufferResources->mLockLength );
 					bufferResources->mLockOffset = std::min( bufferResources->mLockOffset, offset );
 					bufferResources->mLockOffset = std::min( bufferResources->mLockOffset, offset );
 					bufferResources->mLockLength = highPoint - bufferResources->mLockOffset;
 					bufferResources->mLockLength = highPoint - bufferResources->mLockOffset;
@@ -151,7 +151,7 @@ namespace CamelotEngine {
 		}			
 		}			
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-    void D3D9HardwareIndexBuffer::readData(size_t offset, size_t length, 
+    void D3D9HardwareIndexBuffer::readData(UINT32 offset, UINT32 length, 
         void* pDest)
         void* pDest)
     {
     {
        // There is no functional interface in D3D, just do via manual 
        // There is no functional interface in D3D, just do via manual 
@@ -162,7 +162,7 @@ namespace CamelotEngine {
 
 
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-    void D3D9HardwareIndexBuffer::writeData(size_t offset, size_t length, 
+    void D3D9HardwareIndexBuffer::writeData(UINT32 offset, UINT32 length, 
             const void* pSource,
             const void* pSource,
 			bool discardWholeBuffer)
 			bool discardWholeBuffer)
     {
     {

+ 6 - 6
CamelotD3D9Renderer/Source/CmD3D9HardwarePixelBuffer.cpp

@@ -238,7 +238,7 @@ void D3D9HardwarePixelBuffer::unlockDeviceAccess()
 // Util functions to convert a D3D locked box to a pixel box
 // Util functions to convert a D3D locked box to a pixel box
 void fromD3DLock(PixelData &rval, const D3DLOCKED_RECT &lrect)
 void fromD3DLock(PixelData &rval, const D3DLOCKED_RECT &lrect)
 {
 {
-	size_t bpp = PixelUtil::getNumElemBytes(rval.format);
+	UINT32 bpp = PixelUtil::getNumElemBytes(rval.format);
 	if (bpp != 0)
 	if (bpp != 0)
 	{
 	{
 		rval.rowPitch = lrect.Pitch / bpp;
 		rval.rowPitch = lrect.Pitch / bpp;
@@ -259,7 +259,7 @@ void fromD3DLock(PixelData &rval, const D3DLOCKED_RECT &lrect)
 }
 }
 void fromD3DLock(PixelData &rval, const D3DLOCKED_BOX &lbox)
 void fromD3DLock(PixelData &rval, const D3DLOCKED_BOX &lbox)
 {
 {
-	size_t bpp = PixelUtil::getNumElemBytes(rval.format);
+	UINT32 bpp = PixelUtil::getNumElemBytes(rval.format);
 	if (bpp != 0)
 	if (bpp != 0)
 	{
 	{
 		rval.rowPitch = lbox.RowPitch / bpp;
 		rval.rowPitch = lbox.RowPitch / bpp;
@@ -611,7 +611,7 @@ void D3D9HardwarePixelBuffer::blitFromMemory(const PixelData &src, const Box &ds
 		PixelUtil::bulkPixelConversion(src, converted);
 		PixelUtil::bulkPixelConversion(src, converted);
 	}
 	}
 
 
-	size_t rowWidth;
+	UINT32 rowWidth;
 	if (PixelUtil::isCompressed(converted.format))
 	if (PixelUtil::isCompressed(converted.format))
 	{
 	{
 		// D3D wants the width of one row of cells in bytes
 		// D3D wants the width of one row of cells in bytes
@@ -651,7 +651,7 @@ void D3D9HardwarePixelBuffer::blitFromMemory(const PixelData &src, const Box &ds
 		D3DBOX destBox, srcBox;
 		D3DBOX destBox, srcBox;
 		srcBox = toD3DBOX(converted);
 		srcBox = toD3DBOX(converted);
 		destBox = toD3DBOX(dstBox);
 		destBox = toD3DBOX(dstBox);
-		size_t sliceWidth;
+		UINT32 sliceWidth;
 		if (PixelUtil::isCompressed(converted.format))
 		if (PixelUtil::isCompressed(converted.format))
 		{
 		{
 			// D3D wants the width of one slice of cells in bytes
 			// D3D wants the width of one slice of cells in bytes
@@ -883,7 +883,7 @@ void D3D9HardwarePixelBuffer::_setMipmapping(bool doMipmapGen,
 	mHWMipmaps = HWMipmaps;	
 	mHWMipmaps = HWMipmaps;	
 }
 }
 //-----------------------------------------------------------------------------   
 //-----------------------------------------------------------------------------   
-void D3D9HardwarePixelBuffer::_clearSliceRTT(size_t zoffset)
+void D3D9HardwarePixelBuffer::_clearSliceRTT(UINT32 zoffset)
 {
 {
 	mRenderTexture = NULL;
 	mRenderTexture = NULL;
 }
 }
@@ -926,7 +926,7 @@ IDirect3DSurface9* D3D9HardwarePixelBuffer::getFSAASurface(IDirect3DDevice9* d3d
 	return bufferResources->fSAASurface;
 	return bufferResources->fSAASurface;
 }
 }
 //-----------------------------------------------------------------------------    
 //-----------------------------------------------------------------------------    
-RenderTexture *D3D9HardwarePixelBuffer::getRenderTarget(size_t zoffset)
+RenderTexture *D3D9HardwarePixelBuffer::getRenderTarget(UINT32 zoffset)
 {
 {
     assert(mUsage & TU_RENDERTARGET);
     assert(mUsage & TU_RENDERTARGET);
 	assert(mRenderTexture != NULL);   
 	assert(mRenderTexture != NULL);   

+ 7 - 7
CamelotD3D9Renderer/Source/CmD3D9HardwareVertexBuffer.cpp

@@ -36,8 +36,8 @@ THE SOFTWARE.
 namespace CamelotEngine {
 namespace CamelotEngine {
 
 
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-    D3D9HardwareVertexBuffer::D3D9HardwareVertexBuffer(HardwareBufferManagerBase* mgr, size_t vertexSize, 
-        size_t numVertices, HardwareBuffer::Usage usage, 
+    D3D9HardwareVertexBuffer::D3D9HardwareVertexBuffer(HardwareBufferManagerBase* mgr, UINT32 vertexSize, 
+        UINT32 numVertices, HardwareBuffer::Usage usage, 
         bool useSystemMemory, bool useShadowBuffer)
         bool useSystemMemory, bool useShadowBuffer)
         : HardwareVertexBuffer(mgr, vertexSize, numVertices, usage, useSystemMemory, useShadowBuffer)
         : HardwareVertexBuffer(mgr, vertexSize, numVertices, usage, useSystemMemory, useShadowBuffer)
     {
     {
@@ -89,8 +89,8 @@ namespace CamelotEngine {
 		SAFE_DELETE_ARRAY(mSystemMemoryBuffer);
 		SAFE_DELETE_ARRAY(mSystemMemoryBuffer);
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-    void* D3D9HardwareVertexBuffer::lockImpl(size_t offset, 
-        size_t length, LockOptions options)
+    void* D3D9HardwareVertexBuffer::lockImpl(UINT32 offset, 
+        UINT32 length, LockOptions options)
     {		
     {		
 		D3D9_DEVICE_ACCESS_CRITICAL_SECTION
 		D3D9_DEVICE_ACCESS_CRITICAL_SECTION
 
 
@@ -106,7 +106,7 @@ namespace CamelotEngine {
 
 
 				if(bufferResources->mLockLength > 0)
 				if(bufferResources->mLockLength > 0)
 				{
 				{
-					size_t highPoint = std::max( offset + length, 
+					UINT32 highPoint = std::max( offset + length, 
 						bufferResources->mLockOffset + bufferResources->mLockLength );
 						bufferResources->mLockOffset + bufferResources->mLockLength );
 					bufferResources->mLockOffset = std::min( bufferResources->mLockOffset, offset );
 					bufferResources->mLockOffset = std::min( bufferResources->mLockOffset, offset );
 					bufferResources->mLockLength = highPoint - bufferResources->mLockOffset;
 					bufferResources->mLockLength = highPoint - bufferResources->mLockOffset;
@@ -151,7 +151,7 @@ namespace CamelotEngine {
 		}			
 		}			
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-    void D3D9HardwareVertexBuffer::readData(size_t offset, size_t length, 
+    void D3D9HardwareVertexBuffer::readData(UINT32 offset, UINT32 length, 
         void* pDest)
         void* pDest)
     {
     {
         // There is no functional interface in D3D, just do via manual 
         // There is no functional interface in D3D, just do via manual 
@@ -162,7 +162,7 @@ namespace CamelotEngine {
 
 
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-	void D3D9HardwareVertexBuffer::writeData(size_t offset, size_t length, 
+	void D3D9HardwareVertexBuffer::writeData(UINT32 offset, UINT32 length, 
 		const void* pSource,
 		const void* pSource,
 		bool discardWholeBuffer)
 		bool discardWholeBuffer)
 	{
 	{

+ 9 - 9
CamelotD3D9Renderer/Source/CmD3D9Texture.cpp

@@ -148,7 +148,7 @@ namespace CamelotEngine
 				dstTextureResource->pCubeTex)
 				dstTextureResource->pCubeTex)
 			{				
 			{				
 				// blit to 6 cube faces
 				// blit to 6 cube faces
-				for (size_t face = 0; face < 6; face++)
+				for (UINT32 face = 0; face < 6; face++)
 				{
 				{
 					// get our source surface
 					// get our source surface
 					IDirect3DSurface9 *pSrcSurface = 0;
 					IDirect3DSurface9 *pSrcSurface = 0;
@@ -289,9 +289,9 @@ namespace CamelotEngine
 		SAFE_RELEASE(textureResources->pFSAASurface);
 		SAFE_RELEASE(textureResources->pFSAASurface);
 	}
 	}
 	/****************************************************************************************/
 	/****************************************************************************************/
-	size_t D3D9Texture::calculateSize(void) const
+	UINT32 D3D9Texture::calculateSize(void) const
 	{
 	{
-		size_t instanceSize = getNumFaces() * PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
+		UINT32 instanceSize = getNumFaces() * PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
 
 
 		return instanceSize * mMapDeviceToTextureResources.size();
 		return instanceSize * mMapDeviceToTextureResources.size();
 	}
 	}
@@ -916,13 +916,13 @@ namespace CamelotEngine
 		IDirect3DSurface9 *surface;
 		IDirect3DSurface9 *surface;
 		IDirect3DVolume9 *volume;
 		IDirect3DVolume9 *volume;
 		D3D9HardwarePixelBuffer *buffer;				
 		D3D9HardwarePixelBuffer *buffer;				
-		size_t mip, face;
+		UINT32 mip, face;
 
 
 		
 		
 		assert(textureResources != NULL);
 		assert(textureResources != NULL);
 		assert(textureResources->pBaseTex);
 		assert(textureResources->pBaseTex);
 		// Make sure number of mips is right
 		// Make sure number of mips is right
-		size_t numCreatedMips = textureResources->pBaseTex->GetLevelCount() - 1;
+		UINT32 numCreatedMips = textureResources->pBaseTex->GetLevelCount() - 1;
 
 
 		if(numCreatedMips != mNumMipmaps)
 		if(numCreatedMips != mNumMipmaps)
 		{
 		{
@@ -951,9 +951,9 @@ namespace CamelotEngine
 		{			
 		{			
 			// Create new list of surfaces	
 			// Create new list of surfaces	
 			mSurfaceList.clear();
 			mSurfaceList.clear();
-			for(size_t face=0; face<getNumFaces(); ++face)
+			for(UINT32 face=0; face<getNumFaces(); ++face)
 			{
 			{
-				for(size_t mip=0; mip<=mNumMipmaps; ++mip)
+				for(UINT32 mip=0; mip<=mNumMipmaps; ++mip)
 				{
 				{
 					buffer = new D3D9HardwarePixelBuffer((HardwareBuffer::Usage)bufusage, this);
 					buffer = new D3D9HardwarePixelBuffer((HardwareBuffer::Usage)bufusage, this);
 					mSurfaceList.push_back(HardwarePixelBufferPtr(buffer));
 					mSurfaceList.push_back(HardwarePixelBufferPtr(buffer));
@@ -1026,7 +1026,7 @@ namespace CamelotEngine
 	}
 	}
 	#undef GETLEVEL
 	#undef GETLEVEL
 	/****************************************************************************************/
 	/****************************************************************************************/
-	HardwarePixelBufferPtr D3D9Texture::getBuffer_internal(size_t face, size_t mipmap) 
+	HardwarePixelBufferPtr D3D9Texture::getBuffer_internal(UINT32 face, UINT32 mipmap) 
 	{
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 		THROW_IF_NOT_RENDER_THREAD;
 
 
@@ -1034,7 +1034,7 @@ namespace CamelotEngine
 			CM_EXCEPT(InvalidParametersException, "A three dimensional cube has six faces");
 			CM_EXCEPT(InvalidParametersException, "A three dimensional cube has six faces");
 		if(mipmap > mNumMipmaps)
 		if(mipmap > mNumMipmaps)
 			CM_EXCEPT(InvalidParametersException, "Mipmap index out of range");
 			CM_EXCEPT(InvalidParametersException, "Mipmap index out of range");
-		size_t idx = face*(mNumMipmaps+1) + mipmap;
+		UINT32 idx = face*(mNumMipmaps+1) + mipmap;
 
 
 		IDirect3DDevice9* d3d9Device = D3D9RenderSystem::getActiveD3D9Device();
 		IDirect3DDevice9* d3d9Device = D3D9RenderSystem::getActiveD3D9Device();
 		TextureResources* textureResources = getTextureResources(d3d9Device);
 		TextureResources* textureResources = getTextureResources(d3d9Device);

+ 15 - 15
CamelotGLRenderer/Include/CmGLDefaultHardwareBufferManager.h

@@ -42,28 +42,28 @@ namespace CamelotEngine {
 	protected:
 	protected:
 		unsigned char* mpData;
 		unsigned char* mpData;
         /// @copydoc HardwareBuffer::lock
         /// @copydoc HardwareBuffer::lock
-        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);
         /// @copydoc HardwareBuffer::unlock
         /// @copydoc HardwareBuffer::unlock
         void unlockImpl(void);
         void unlockImpl(void);
 
 
     public:
     public:
-		GLDefaultHardwareVertexBuffer(size_t vertexSize, size_t numVertices, HardwareBuffer::Usage usage);
-		GLDefaultHardwareVertexBuffer(HardwareBufferManagerBase* mgr, size_t vertexSize, size_t numVertices, 
+		GLDefaultHardwareVertexBuffer(UINT32 vertexSize, UINT32 numVertices, HardwareBuffer::Usage usage);
+		GLDefaultHardwareVertexBuffer(HardwareBufferManagerBase* mgr, UINT32 vertexSize, UINT32 numVertices, 
             HardwareBuffer::Usage usage);
             HardwareBuffer::Usage usage);
         ~GLDefaultHardwareVertexBuffer();
         ~GLDefaultHardwareVertexBuffer();
         /// @copydoc HardwareBuffer::readData
         /// @copydoc HardwareBuffer::readData
-        void readData(size_t offset, size_t length, void* pDest);
+        void readData(UINT32 offset, UINT32 length, void* pDest);
         /// @copydoc HardwareBuffer::writeData
         /// @copydoc HardwareBuffer::writeData
 
 
-        void writeData(size_t offset, size_t length, const void* pSource,
+        void writeData(UINT32 offset, UINT32 length, const void* pSource,
 				bool discardWholeBuffer = false);
 				bool discardWholeBuffer = false);
         /** Override HardwareBuffer to turn off all shadowing. */
         /** Override HardwareBuffer to turn off all shadowing. */
-        void* lock(size_t offset, size_t length, LockOptions options);
+        void* lock(UINT32 offset, UINT32 length, LockOptions options);
         /** Override HardwareBuffer to turn off all shadowing. */
         /** Override HardwareBuffer to turn off all shadowing. */
 		void unlock(void);
 		void unlock(void);
 
 
         //void* getDataPtr(void) const { return (void*)mpData; }
         //void* getDataPtr(void) const { return (void*)mpData; }
-        void* getDataPtr(size_t offset) const { return (void*)(mpData + offset); }
+        void* getDataPtr(UINT32 offset) const { return (void*)(mpData + offset); }
     };
     };
 
 
 	/// Specialisation of HardwareIndexBuffer for emulation
 	/// Specialisation of HardwareIndexBuffer for emulation
@@ -72,23 +72,23 @@ namespace CamelotEngine {
 	protected:
 	protected:
 		unsigned char* mpData;
 		unsigned char* mpData;
         /// @copydoc HardwareBuffer::lock
         /// @copydoc HardwareBuffer::lock
-        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);
         /// @copydoc HardwareBuffer::unlock
         /// @copydoc HardwareBuffer::unlock
         void unlockImpl(void);
         void unlockImpl(void);
     public:
     public:
-		GLDefaultHardwareIndexBuffer(IndexType idxType, size_t numIndexes, HardwareBuffer::Usage usage);
+		GLDefaultHardwareIndexBuffer(IndexType idxType, UINT32 numIndexes, HardwareBuffer::Usage usage);
         ~GLDefaultHardwareIndexBuffer();
         ~GLDefaultHardwareIndexBuffer();
         /// @copydoc HardwareBuffer::readData
         /// @copydoc HardwareBuffer::readData
-        void readData(size_t offset, size_t length, void* pDest);
+        void readData(UINT32 offset, UINT32 length, void* pDest);
         /// @copydoc HardwareBuffer::writeData
         /// @copydoc HardwareBuffer::writeData
-        void writeData(size_t offset, size_t length, const void* pSource,
+        void writeData(UINT32 offset, UINT32 length, const void* pSource,
 				bool discardWholeBuffer = false);
 				bool discardWholeBuffer = false);
         /** Override HardwareBuffer to turn off all shadowing. */
         /** Override HardwareBuffer to turn off all shadowing. */
-        void* lock(size_t offset, size_t length, LockOptions options);
+        void* lock(UINT32 offset, UINT32 length, LockOptions options);
         /** Override HardwareBuffer to turn off all shadowing. */
         /** Override HardwareBuffer to turn off all shadowing. */
         void unlock(void);
         void unlock(void);
 
 
-        void* getDataPtr(size_t offset) const { return (void*)(mpData + offset); }
+        void* getDataPtr(UINT32 offset) const { return (void*)(mpData + offset); }
     };
     };
 
 
 	/** Specialisation of HardwareBufferManager to emulate hardware buffers.
 	/** Specialisation of HardwareBufferManager to emulate hardware buffers.
@@ -105,11 +105,11 @@ namespace CamelotEngine {
         ~GLDefaultHardwareBufferManagerBase();
         ~GLDefaultHardwareBufferManagerBase();
         /// Creates a vertex buffer
         /// Creates a vertex buffer
 		HardwareVertexBufferPtr 
 		HardwareVertexBufferPtr 
-            createVertexBuffer(size_t vertexSize, size_t numVerts, 
+            createVertexBuffer(UINT32 vertexSize, UINT32 numVerts, 
 				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
 				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
 		/// Create a hardware vertex buffer
 		/// Create a hardware vertex buffer
 		HardwareIndexBufferPtr 
 		HardwareIndexBufferPtr 
-            createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+            createIndexBuffer(HardwareIndexBuffer::IndexType itype, UINT32 numIndexes, 
 				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
 				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
 
 
     };
     };

+ 8 - 8
CamelotGLRenderer/Include/CmGLHardwareBufferManager.h

@@ -43,17 +43,17 @@ namespace CamelotEngine {
 	protected:
 	protected:
 		char* mScratchBufferPool;
 		char* mScratchBufferPool;
 		CM_MUTEX(mScratchMutex)
 		CM_MUTEX(mScratchMutex)
-		size_t mMapBufferThreshold;
+		UINT32 mMapBufferThreshold;
 
 
     public:
     public:
         GLHardwareBufferManagerBase();
         GLHardwareBufferManagerBase();
         ~GLHardwareBufferManagerBase();
         ~GLHardwareBufferManagerBase();
         /// Creates a vertex buffer
         /// Creates a vertex buffer
-        HardwareVertexBufferPtr createVertexBuffer(size_t vertexSize, 
-            size_t numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer = false);
+        HardwareVertexBufferPtr createVertexBuffer(UINT32 vertexSize, 
+            UINT32 numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer = false);
         /// Create a hardware vertex buffer
         /// Create a hardware vertex buffer
         HardwareIndexBufferPtr createIndexBuffer(
         HardwareIndexBufferPtr createIndexBuffer(
-            HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+            HardwareIndexBuffer::IndexType itype, UINT32 numIndexes, 
             HardwareBuffer::Usage usage, bool useShadowBuffer = false);
             HardwareBuffer::Usage usage, bool useShadowBuffer = false);
         /// Utility function to get the correct GL usage based on HBU's
         /// Utility function to get the correct GL usage based on HBU's
         static GLenum getGLUsage(unsigned int usage);
         static GLenum getGLUsage(unsigned int usage);
@@ -75,8 +75,8 @@ namespace CamelotEngine {
 
 
 		/** Threshold after which glMapBuffer is used and not glBufferSubData
 		/** Threshold after which glMapBuffer is used and not glBufferSubData
 		*/
 		*/
-		const size_t getGLMapBufferThreshold() const;
-		void setGLMapBufferThreshold( const size_t value );
+		const UINT32 getGLMapBufferThreshold() const;
+		void setGLMapBufferThreshold( const UINT32 value );
     };
     };
 
 
 	/// GLHardwareBufferManagerBase as a Singleton
 	/// GLHardwareBufferManagerBase as a Singleton
@@ -123,11 +123,11 @@ namespace CamelotEngine {
 
 
 		/** Threshold after which glMapBuffer is used and not glBufferSubData
 		/** Threshold after which glMapBuffer is used and not glBufferSubData
 		*/
 		*/
-		const size_t getGLMapBufferThreshold() const
+		const UINT32 getGLMapBufferThreshold() const
 		{
 		{
 			return static_cast<GLHardwareBufferManagerBase*>(mImpl)->getGLMapBufferThreshold();
 			return static_cast<GLHardwareBufferManagerBase*>(mImpl)->getGLMapBufferThreshold();
 		}
 		}
-		void setGLMapBufferThreshold( const size_t value )
+		void setGLMapBufferThreshold( const UINT32 value )
 		{
 		{
 			static_cast<GLHardwareBufferManagerBase*>(mImpl)->setGLMapBufferThreshold(value);
 			static_cast<GLHardwareBufferManagerBase*>(mImpl)->setGLMapBufferThreshold(value);
 		}
 		}

+ 6 - 6
CamelotGLRenderer/Include/CmGLHardwareIndexBuffer.h

@@ -40,23 +40,23 @@ namespace CamelotEngine {
         GLuint mBufferId;
         GLuint mBufferId;
 		// Scratch buffer handling
 		// Scratch buffer handling
 		bool mLockedToScratch;
 		bool mLockedToScratch;
-		size_t mScratchOffset;
-		size_t mScratchSize;
+		UINT32 mScratchOffset;
+		UINT32 mScratchSize;
 		void* mScratchPtr;
 		void* mScratchPtr;
 		bool mScratchUploadOnUnlock;
 		bool mScratchUploadOnUnlock;
     protected:
     protected:
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
         void unlockImpl(void);
         void unlockImpl(void);
     public:
     public:
-        GLHardwareIndexBuffer(HardwareBufferManagerBase* mgr, IndexType idxType, size_t numIndexes, 
+        GLHardwareIndexBuffer(HardwareBufferManagerBase* mgr, IndexType idxType, UINT32 numIndexes, 
             HardwareBuffer::Usage usage, bool useShadowBuffer); 
             HardwareBuffer::Usage usage, bool useShadowBuffer); 
         ~GLHardwareIndexBuffer();
         ~GLHardwareIndexBuffer();
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void readData(size_t offset, size_t length, void* pDest);
+        void readData(UINT32 offset, UINT32 length, void* pDest);
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void writeData(size_t offset, size_t length, 
+        void writeData(UINT32 offset, UINT32 length, 
             const void* pSource, bool discardWholeBuffer = false);
             const void* pSource, bool discardWholeBuffer = false);
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
         void _updateFromShadow(void);
         void _updateFromShadow(void);

+ 8 - 8
CamelotGLRenderer/Include/CmGLHardwarePixelBuffer.h

@@ -56,7 +56,7 @@ namespace CamelotEngine {
 		virtual void download(const PixelData &data);
 		virtual void download(const PixelData &data);
 	public:
 	public:
         /// Should be called by HardwareBufferManager
         /// Should be called by HardwareBufferManager
-        GLHardwarePixelBuffer(size_t mWidth, size_t mHeight, size_t mDepth,
+        GLHardwarePixelBuffer(UINT32 mWidth, UINT32 mHeight, UINT32 mDepth,
                 PixelFormat mFormat,
                 PixelFormat mFormat,
                 HardwareBuffer::Usage usage);
                 HardwareBuffer::Usage usage);
 		
 		
@@ -70,7 +70,7 @@ namespace CamelotEngine {
         
         
         /** Bind surface to frame buffer. Needs FBO extension.
         /** Bind surface to frame buffer. Needs FBO extension.
         */
         */
-        virtual void bindToFramebuffer(GLenum attachment, size_t zoffset);
+        virtual void bindToFramebuffer(GLenum attachment, UINT32 zoffset);
         GLenum getGLFormat() { return mGLInternalFormat; }
         GLenum getGLFormat() { return mGLInternalFormat; }
 	};
 	};
 
 
@@ -85,9 +85,9 @@ namespace CamelotEngine {
         ~GLTextureBuffer();
         ~GLTextureBuffer();
         
         
         /// @copydoc HardwarePixelBuffer::bindToFramebuffer
         /// @copydoc HardwarePixelBuffer::bindToFramebuffer
-        virtual void bindToFramebuffer(GLenum attachment, size_t zoffset);
+        virtual void bindToFramebuffer(GLenum attachment, UINT32 zoffset);
         /// @copydoc HardwarePixelBuffer::getRenderTarget
         /// @copydoc HardwarePixelBuffer::getRenderTarget
-        RenderTexture* getRenderTarget(size_t);
+        RenderTexture* getRenderTarget(UINT32);
         /// Upload a box of pixels to this buffer on the card
         /// Upload a box of pixels to this buffer on the card
 		virtual void upload(const PixelData &data, const Box &dest);
 		virtual void upload(const PixelData &data, const Box &dest);
 		// Download a box of pixels from the card
 		// Download a box of pixels from the card
@@ -97,12 +97,12 @@ namespace CamelotEngine {
         virtual void blitFromMemory(const PixelData &src_orig, const Box &dstBox);
         virtual void blitFromMemory(const PixelData &src_orig, const Box &dstBox);
         
         
         /// Notify TextureBuffer of destruction of render target
         /// Notify TextureBuffer of destruction of render target
-        void _clearSliceRTT(size_t zoffset)
+        void _clearSliceRTT(UINT32 zoffset)
         {
         {
             mSliceTRT[zoffset] = 0;
             mSliceTRT[zoffset] = 0;
         }
         }
         /// Copy from framebuffer
         /// Copy from framebuffer
-        void copyFromFramebuffer(size_t zoffset);
+        void copyFromFramebuffer(UINT32 zoffset);
         /// @copydoc HardwarePixelBuffer::blit
         /// @copydoc HardwarePixelBuffer::blit
         void blit(const HardwarePixelBufferPtr &src, const Box &srcBox, const Box &dstBox);
         void blit(const HardwarePixelBufferPtr &src, const Box &srcBox, const Box &dstBox);
         // Blitting implementation
         // Blitting implementation
@@ -124,11 +124,11 @@ namespace CamelotEngine {
     class CM_RSGL_EXPORT GLRenderBuffer: public GLHardwarePixelBuffer
     class CM_RSGL_EXPORT GLRenderBuffer: public GLHardwarePixelBuffer
 	{
 	{
     public:
     public:
-        GLRenderBuffer(GLenum format, size_t width, size_t height, GLsizei numSamples);
+        GLRenderBuffer(GLenum format, UINT32 width, UINT32 height, GLsizei numSamples);
         ~GLRenderBuffer();
         ~GLRenderBuffer();
         
         
         /// @copydoc GLHardwarePixelBuffer::bindToFramebuffer
         /// @copydoc GLHardwarePixelBuffer::bindToFramebuffer
-        virtual void bindToFramebuffer(GLenum attachment, size_t zoffset);
+        virtual void bindToFramebuffer(GLenum attachment, UINT32 zoffset);
     protected:
     protected:
         // In case this is a render buffer
         // In case this is a render buffer
         GLuint mRenderbufferID;
         GLuint mRenderbufferID;

+ 6 - 6
CamelotGLRenderer/Include/CmGLHardwareVertexBuffer.h

@@ -40,24 +40,24 @@ namespace CamelotEngine {
         GLuint mBufferId;
         GLuint mBufferId;
 		// Scratch buffer handling
 		// Scratch buffer handling
 		bool mLockedToScratch;
 		bool mLockedToScratch;
-		size_t mScratchOffset;
-		size_t mScratchSize;
+		UINT32 mScratchOffset;
+		UINT32 mScratchSize;
 		void* mScratchPtr;
 		void* mScratchPtr;
 		bool mScratchUploadOnUnlock;
 		bool mScratchUploadOnUnlock;
 
 
     protected:
     protected:
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
         void unlockImpl(void);
         void unlockImpl(void);
     public:
     public:
-        GLHardwareVertexBuffer(HardwareBufferManagerBase* mgr, size_t vertexSize, size_t numVertices, 
+        GLHardwareVertexBuffer(HardwareBufferManagerBase* mgr, UINT32 vertexSize, UINT32 numVertices, 
             HardwareBuffer::Usage usage, bool useShadowBuffer); 
             HardwareBuffer::Usage usage, bool useShadowBuffer); 
         ~GLHardwareVertexBuffer();
         ~GLHardwareVertexBuffer();
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void readData(size_t offset, size_t length, void* pDest);
+        void readData(UINT32 offset, UINT32 length, void* pDest);
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void writeData(size_t offset, size_t length, 
+        void writeData(UINT32 offset, UINT32 length, 
             const void* pSource, bool discardWholeBuffer = false);
             const void* pSource, bool discardWholeBuffer = false);
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
         void _updateFromShadow(void);
         void _updateFromShadow(void);

+ 1 - 1
CamelotGLRenderer/Include/CmGLTexture.h

@@ -43,7 +43,7 @@ namespace CamelotEngine {
         virtual ~GLTexture();      
         virtual ~GLTexture();      
 
 
 		/// @copydoc Texture::getBuffer
 		/// @copydoc Texture::getBuffer
-		HardwarePixelBufferPtr getBuffer_internal(size_t face, size_t mipmap);
+		HardwarePixelBufferPtr getBuffer_internal(UINT32 face, UINT32 mipmap);
 
 
         // Takes the OGRE texture type (1d/2d/3d/cube) and returns the appropriate GL one
         // Takes the OGRE texture type (1d/2d/3d/cube) and returns the appropriate GL one
         GLenum getGLTextureTarget_internal(void) const;
         GLenum getGLTextureTarget_internal(void) const;

+ 14 - 14
CamelotGLRenderer/Source/CmGLDefaultHardwareBufferManager.cpp

@@ -30,14 +30,14 @@ THE SOFTWARE.
 
 
 namespace CamelotEngine {
 namespace CamelotEngine {
 
 
-	GLDefaultHardwareVertexBuffer::GLDefaultHardwareVertexBuffer(size_t vertexSize, size_t numVertices, 
+	GLDefaultHardwareVertexBuffer::GLDefaultHardwareVertexBuffer(UINT32 vertexSize, UINT32 numVertices, 
 																 HardwareBuffer::Usage usage)
 																 HardwareBuffer::Usage usage)
 	: HardwareVertexBuffer(0, vertexSize, numVertices, usage, true, false) // always software, never shadowed
 	: HardwareVertexBuffer(0, vertexSize, numVertices, usage, true, false) // always software, never shadowed
 	{
 	{
 		mpData = static_cast<unsigned char*>(_aligned_malloc(mSizeInBytes, CM_SIMD_ALIGNMENT));
 		mpData = static_cast<unsigned char*>(_aligned_malloc(mSizeInBytes, CM_SIMD_ALIGNMENT));
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-	GLDefaultHardwareVertexBuffer::GLDefaultHardwareVertexBuffer(HardwareBufferManagerBase* mgr, size_t vertexSize, size_t numVertices, 
+	GLDefaultHardwareVertexBuffer::GLDefaultHardwareVertexBuffer(HardwareBufferManagerBase* mgr, UINT32 vertexSize, UINT32 numVertices, 
 		HardwareBuffer::Usage usage)
 		HardwareBuffer::Usage usage)
         : HardwareVertexBuffer(mgr, vertexSize, numVertices, usage, true, false) // always software, never shadowed
         : HardwareVertexBuffer(mgr, vertexSize, numVertices, usage, true, false) // always software, never shadowed
 	{
 	{
@@ -49,7 +49,7 @@ namespace CamelotEngine {
 		_aligned_free(mpData);
 		_aligned_free(mpData);
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void* GLDefaultHardwareVertexBuffer::lockImpl(size_t offset, size_t length, LockOptions options)
+    void* GLDefaultHardwareVertexBuffer::lockImpl(UINT32 offset, UINT32 length, LockOptions options)
 	{
 	{
         // Only for use internally, no 'locking' as such
         // Only for use internally, no 'locking' as such
 		return mpData + offset;
 		return mpData + offset;
@@ -60,7 +60,7 @@ namespace CamelotEngine {
         // Nothing to do
         // Nothing to do
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void* GLDefaultHardwareVertexBuffer::lock(size_t offset, size_t length, LockOptions options)
+    void* GLDefaultHardwareVertexBuffer::lock(UINT32 offset, UINT32 length, LockOptions options)
 	{
 	{
         mIsLocked = true;
         mIsLocked = true;
 		return mpData + offset;
 		return mpData + offset;
@@ -72,13 +72,13 @@ namespace CamelotEngine {
         // Nothing to do
         // Nothing to do
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void GLDefaultHardwareVertexBuffer::readData(size_t offset, size_t length, void* pDest)
+    void GLDefaultHardwareVertexBuffer::readData(UINT32 offset, UINT32 length, void* pDest)
 	{
 	{
 		assert((offset + length) <= mSizeInBytes);
 		assert((offset + length) <= mSizeInBytes);
 		memcpy(pDest, mpData + offset, length);
 		memcpy(pDest, mpData + offset, length);
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void GLDefaultHardwareVertexBuffer::writeData(size_t offset, size_t length, const void* pSource,
+    void GLDefaultHardwareVertexBuffer::writeData(UINT32 offset, UINT32 length, const void* pSource,
 			bool discardWholeBuffer)
 			bool discardWholeBuffer)
 	{
 	{
 		assert((offset + length) <= mSizeInBytes);
 		assert((offset + length) <= mSizeInBytes);
@@ -89,7 +89,7 @@ namespace CamelotEngine {
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
 
 
 	GLDefaultHardwareIndexBuffer::GLDefaultHardwareIndexBuffer(IndexType idxType, 
 	GLDefaultHardwareIndexBuffer::GLDefaultHardwareIndexBuffer(IndexType idxType, 
-		size_t numIndexes, HardwareBuffer::Usage usage) 
+		UINT32 numIndexes, HardwareBuffer::Usage usage) 
 		: HardwareIndexBuffer(0, idxType, numIndexes, usage, true, false) // always software, never shadowed
 		: HardwareIndexBuffer(0, idxType, numIndexes, usage, true, false) // always software, never shadowed
 	{
 	{
 		mpData = new unsigned char[mSizeInBytes];
 		mpData = new unsigned char[mSizeInBytes];
@@ -100,7 +100,7 @@ namespace CamelotEngine {
 		delete [] mpData;
 		delete [] mpData;
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void* GLDefaultHardwareIndexBuffer::lockImpl(size_t offset, size_t length, LockOptions options)
+    void* GLDefaultHardwareIndexBuffer::lockImpl(UINT32 offset, UINT32 length, LockOptions options)
 	{
 	{
         // Only for use internally, no 'locking' as such
         // Only for use internally, no 'locking' as such
 		return mpData + offset;
 		return mpData + offset;
@@ -111,7 +111,7 @@ namespace CamelotEngine {
         // Nothing to do
         // Nothing to do
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void* GLDefaultHardwareIndexBuffer::lock(size_t offset, size_t length, LockOptions options)
+    void* GLDefaultHardwareIndexBuffer::lock(UINT32 offset, UINT32 length, LockOptions options)
 	{
 	{
         mIsLocked = true;
         mIsLocked = true;
 		return mpData + offset;
 		return mpData + offset;
@@ -123,13 +123,13 @@ namespace CamelotEngine {
         // Nothing to do
         // Nothing to do
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void GLDefaultHardwareIndexBuffer::readData(size_t offset, size_t length, void* pDest)
+    void GLDefaultHardwareIndexBuffer::readData(UINT32 offset, UINT32 length, void* pDest)
 	{
 	{
 		assert((offset + length) <= mSizeInBytes);
 		assert((offset + length) <= mSizeInBytes);
 		memcpy(pDest, mpData + offset, length);
 		memcpy(pDest, mpData + offset, length);
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void GLDefaultHardwareIndexBuffer::writeData(size_t offset, size_t length, const void* pSource,
+    void GLDefaultHardwareIndexBuffer::writeData(UINT32 offset, UINT32 length, const void* pSource,
 			bool discardWholeBuffer)
 			bool discardWholeBuffer)
 	{
 	{
 		assert((offset + length) <= mSizeInBytes);
 		assert((offset + length) <= mSizeInBytes);
@@ -151,8 +151,8 @@ namespace CamelotEngine {
 	}
 	}
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
 	HardwareVertexBufferPtr 
 	HardwareVertexBufferPtr 
-        GLDefaultHardwareBufferManagerBase::createVertexBuffer(size_t vertexSize, 
-		size_t numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer)
+        GLDefaultHardwareBufferManagerBase::createVertexBuffer(UINT32 vertexSize, 
+		UINT32 numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer)
 	{
 	{
 		return HardwareVertexBufferPtr(
 		return HardwareVertexBufferPtr(
 			new GLDefaultHardwareVertexBuffer(this, vertexSize, numVerts, usage));
 			new GLDefaultHardwareVertexBuffer(this, vertexSize, numVerts, usage));
@@ -160,7 +160,7 @@ namespace CamelotEngine {
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
 	HardwareIndexBufferPtr 
 	HardwareIndexBufferPtr 
         GLDefaultHardwareBufferManagerBase::createIndexBuffer(HardwareIndexBuffer::IndexType itype, 
         GLDefaultHardwareBufferManagerBase::createIndexBuffer(HardwareIndexBuffer::IndexType itype, 
-		size_t numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer)
+		UINT32 numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer)
 	{
 	{
 		return HardwareIndexBufferPtr(
 		return HardwareIndexBufferPtr(
 			new GLDefaultHardwareIndexBuffer(itype, numIndexes, usage) );
 			new GLDefaultHardwareIndexBuffer(itype, numIndexes, usage) );

+ 4 - 4
CamelotGLRenderer/Source/CmGLHardwareBufferManager.cpp

@@ -82,7 +82,7 @@ namespace CamelotEngine {
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     HardwareVertexBufferPtr GLHardwareBufferManagerBase::createVertexBuffer(
     HardwareVertexBufferPtr GLHardwareBufferManagerBase::createVertexBuffer(
-        size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer)
+        UINT32 vertexSize, UINT32 numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer)
     {
     {
 		GLHardwareVertexBuffer* buf = 
 		GLHardwareVertexBuffer* buf = 
 			new GLHardwareVertexBuffer(this, vertexSize, numVerts, usage, useShadowBuffer);
 			new GLHardwareVertexBuffer(this, vertexSize, numVerts, usage, useShadowBuffer);
@@ -95,7 +95,7 @@ namespace CamelotEngine {
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     HardwareIndexBufferPtr 
     HardwareIndexBufferPtr 
     GLHardwareBufferManagerBase::createIndexBuffer(
     GLHardwareBufferManagerBase::createIndexBuffer(
-        HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+        HardwareIndexBuffer::IndexType itype, UINT32 numIndexes, 
         HardwareBuffer::Usage usage, bool useShadowBuffer)
         HardwareBuffer::Usage usage, bool useShadowBuffer)
     {
     {
 		GLHardwareIndexBuffer* buf = 
 		GLHardwareIndexBuffer* buf = 
@@ -257,12 +257,12 @@ namespace CamelotEngine {
 
 
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-	const size_t GLHardwareBufferManagerBase::getGLMapBufferThreshold() const
+	const UINT32 GLHardwareBufferManagerBase::getGLMapBufferThreshold() const
 	{
 	{
 		return mMapBufferThreshold;
 		return mMapBufferThreshold;
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-	void GLHardwareBufferManagerBase::setGLMapBufferThreshold( const size_t value )
+	void GLHardwareBufferManagerBase::setGLMapBufferThreshold( const UINT32 value )
 	{
 	{
 		mMapBufferThreshold = value;
 		mMapBufferThreshold = value;
 	}
 	}

+ 5 - 5
CamelotGLRenderer/Source/CmGLHardwareIndexBuffer.cpp

@@ -33,7 +33,7 @@ namespace CamelotEngine {
 
 
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
     GLHardwareIndexBuffer::GLHardwareIndexBuffer(HardwareBufferManagerBase* mgr, IndexType idxType,
     GLHardwareIndexBuffer::GLHardwareIndexBuffer(HardwareBufferManagerBase* mgr, IndexType idxType,
-        size_t numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer)
+        UINT32 numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer)
         : HardwareIndexBuffer(mgr, idxType, numIndexes, usage, false, useShadowBuffer)
         : HardwareIndexBuffer(mgr, idxType, numIndexes, usage, false, useShadowBuffer)
     {
     {
         glGenBuffersARB( 1, &mBufferId );
         glGenBuffersARB( 1, &mBufferId );
@@ -58,8 +58,8 @@ namespace CamelotEngine {
         glDeleteBuffersARB(1, &mBufferId);
         glDeleteBuffersARB(1, &mBufferId);
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-    void* GLHardwareIndexBuffer::lockImpl(size_t offset, 
-        size_t length, LockOptions options)
+    void* GLHardwareIndexBuffer::lockImpl(UINT32 offset, 
+        UINT32 length, LockOptions options)
     {
     {
         GLenum access = 0;
         GLenum access = 0;
 
 
@@ -162,7 +162,7 @@ namespace CamelotEngine {
         mIsLocked = false;
         mIsLocked = false;
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-    void GLHardwareIndexBuffer::readData(size_t offset, size_t length, 
+    void GLHardwareIndexBuffer::readData(UINT32 offset, UINT32 length, 
         void* pDest)
         void* pDest)
     {
     {
         if(mUseShadowBuffer)
         if(mUseShadowBuffer)
@@ -179,7 +179,7 @@ namespace CamelotEngine {
         }
         }
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-    void GLHardwareIndexBuffer::writeData(size_t offset, size_t length, 
+    void GLHardwareIndexBuffer::writeData(UINT32 offset, UINT32 length, 
             const void* pSource, bool discardWholeBuffer)
             const void* pSource, bool discardWholeBuffer)
     {
     {
         glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, mBufferId );
         glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, mBufferId );

+ 10 - 10
CamelotGLRenderer/Source/CmGLHardwarePixelBuffer.cpp

@@ -36,7 +36,7 @@ THE SOFTWARE.
 
 
 namespace CamelotEngine {
 namespace CamelotEngine {
 //----------------------------------------------------------------------------- 
 //----------------------------------------------------------------------------- 
-GLHardwarePixelBuffer::GLHardwarePixelBuffer(size_t inWidth, size_t inHeight, size_t inDepth,
+GLHardwarePixelBuffer::GLHardwarePixelBuffer(UINT32 inWidth, UINT32 inHeight, UINT32 inDepth,
                 PixelFormat inFormat,
                 PixelFormat inFormat,
                 HardwareBuffer::Usage usage):
                 HardwareBuffer::Usage usage):
       HardwarePixelBuffer(inWidth, inHeight, inDepth, inFormat, usage, false, false),
       HardwarePixelBuffer(inWidth, inHeight, inDepth, inFormat, usage, false, false),
@@ -182,7 +182,7 @@ void GLHardwarePixelBuffer::download(const PixelData &data)
     CM_EXCEPT(RenderingAPIException, "Download not possible for this pixelbuffer type");
     CM_EXCEPT(RenderingAPIException, "Download not possible for this pixelbuffer type");
 }
 }
 //-----------------------------------------------------------------------------  
 //-----------------------------------------------------------------------------  
-void GLHardwarePixelBuffer::bindToFramebuffer(GLenum attachment, size_t zoffset)
+void GLHardwarePixelBuffer::bindToFramebuffer(GLenum attachment, UINT32 zoffset)
 {
 {
     CM_EXCEPT(RenderingAPIException, "Framebuffer bind not possible for this pixelbuffer type");
     CM_EXCEPT(RenderingAPIException, "Framebuffer bind not possible for this pixelbuffer type");
 }
 }
@@ -257,10 +257,10 @@ GLTextureBuffer::GLTextureBuffer(const String &baseName, GLenum target, GLuint i
     {
     {
         // Create render target for each slice
         // Create render target for each slice
         mSliceTRT.reserve(mDepth);
         mSliceTRT.reserve(mDepth);
-        for(size_t zoffset=0; zoffset<mDepth; ++zoffset)
+        for(UINT32 zoffset=0; zoffset<mDepth; ++zoffset)
         {
         {
             String name;
             String name;
-			name = "rtt/" + toString((size_t)this) + "/" + baseName;
+			name = "rtt/" + toString((UINT32)this) + "/" + baseName;
             GLSurfaceDesc surface;
             GLSurfaceDesc surface;
             surface.buffer = this;
             surface.buffer = this;
             surface.zoffset = zoffset;
             surface.zoffset = zoffset;
@@ -496,7 +496,7 @@ void GLTextureBuffer::download(const PixelData &data)
 	}
 	}
 }
 }
 //-----------------------------------------------------------------------------  
 //-----------------------------------------------------------------------------  
-void GLTextureBuffer::bindToFramebuffer(GLenum attachment, size_t zoffset)
+void GLTextureBuffer::bindToFramebuffer(GLenum attachment, UINT32 zoffset)
 {
 {
     assert(zoffset < mDepth);
     assert(zoffset < mDepth);
     switch(mTarget)
     switch(mTarget)
@@ -517,7 +517,7 @@ void GLTextureBuffer::bindToFramebuffer(GLenum attachment, size_t zoffset)
     }
     }
 }
 }
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-void GLTextureBuffer::copyFromFramebuffer(size_t zoffset)
+void GLTextureBuffer::copyFromFramebuffer(UINT32 zoffset)
 {
 {
     glBindTexture(mTarget, mTextureID);
     glBindTexture(mTarget, mTextureID);
     switch(mTarget)
     switch(mTarget)
@@ -666,7 +666,7 @@ void GLTextureBuffer::blitFromTexture(GLTextureBuffer *src, const Box &srcBox, c
     }
     }
     
     
     /// Process each destination slice
     /// Process each destination slice
-    for(size_t slice=dstBox.front; slice<dstBox.back; ++slice)
+    for(UINT32 slice=dstBox.front; slice<dstBox.back; ++slice)
     {
     {
         if(!tempTex)
         if(!tempTex)
         {
         {
@@ -825,7 +825,7 @@ void GLTextureBuffer::blitFromMemory(const PixelData &src_orig, const Box &dstBo
 }
 }
 //-----------------------------------------------------------------------------    
 //-----------------------------------------------------------------------------    
 
 
-RenderTexture *GLTextureBuffer::getRenderTarget(size_t zoffset)
+RenderTexture *GLTextureBuffer::getRenderTarget(UINT32 zoffset)
 {
 {
     assert(mUsage & TU_RENDERTARGET);
     assert(mUsage & TU_RENDERTARGET);
     assert(zoffset < mDepth);
     assert(zoffset < mDepth);
@@ -833,7 +833,7 @@ RenderTexture *GLTextureBuffer::getRenderTarget(size_t zoffset)
 }
 }
 //********* GLRenderBuffer
 //********* GLRenderBuffer
 //----------------------------------------------------------------------------- 
 //----------------------------------------------------------------------------- 
-GLRenderBuffer::GLRenderBuffer(GLenum format, size_t width, size_t height, GLsizei numSamples):
+GLRenderBuffer::GLRenderBuffer(GLenum format, UINT32 width, UINT32 height, GLsizei numSamples):
     GLHardwarePixelBuffer(width, height, 1, GLPixelUtil::getClosestOGREFormat(format),HBU_WRITE_ONLY),
     GLHardwarePixelBuffer(width, height, 1, GLPixelUtil::getClosestOGREFormat(format),HBU_WRITE_ONLY),
     mRenderbufferID(0)
     mRenderbufferID(0)
 {
 {
@@ -862,7 +862,7 @@ GLRenderBuffer::~GLRenderBuffer()
     glDeleteRenderbuffersEXT(1, &mRenderbufferID);
     glDeleteRenderbuffersEXT(1, &mRenderbufferID);
 }
 }
 //-----------------------------------------------------------------------------  
 //-----------------------------------------------------------------------------  
-void GLRenderBuffer::bindToFramebuffer(GLenum attachment, size_t zoffset)
+void GLRenderBuffer::bindToFramebuffer(GLenum attachment, UINT32 zoffset)
 {
 {
     assert(zoffset < mDepth);
     assert(zoffset < mDepth);
     glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, attachment,
     glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, attachment,

+ 6 - 6
CamelotGLRenderer/Source/CmGLHardwareVertexBuffer.cpp

@@ -32,8 +32,8 @@ THE SOFTWARE.
 namespace CamelotEngine {
 namespace CamelotEngine {
 
 
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-    GLHardwareVertexBuffer::GLHardwareVertexBuffer(HardwareBufferManagerBase* mgr, size_t vertexSize, 
-        size_t numVertices, HardwareBuffer::Usage usage, bool useShadowBuffer)
+    GLHardwareVertexBuffer::GLHardwareVertexBuffer(HardwareBufferManagerBase* mgr, UINT32 vertexSize, 
+        UINT32 numVertices, HardwareBuffer::Usage usage, bool useShadowBuffer)
         : HardwareVertexBuffer(mgr, vertexSize, numVertices, usage, false, useShadowBuffer)
         : HardwareVertexBuffer(mgr, vertexSize, numVertices, usage, false, useShadowBuffer)
     {
     {
         glGenBuffersARB( 1, &mBufferId );
         glGenBuffersARB( 1, &mBufferId );
@@ -58,8 +58,8 @@ namespace CamelotEngine {
         glDeleteBuffersARB(1, &mBufferId);
         glDeleteBuffersARB(1, &mBufferId);
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-    void* GLHardwareVertexBuffer::lockImpl(size_t offset, 
-        size_t length, LockOptions options)
+    void* GLHardwareVertexBuffer::lockImpl(UINT32 offset, 
+        UINT32 length, LockOptions options)
     {
     {
         GLenum access = 0;
         GLenum access = 0;
 
 
@@ -163,7 +163,7 @@ namespace CamelotEngine {
         mIsLocked = false;
         mIsLocked = false;
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-    void GLHardwareVertexBuffer::readData(size_t offset, size_t length, 
+    void GLHardwareVertexBuffer::readData(UINT32 offset, UINT32 length, 
         void* pDest)
         void* pDest)
     {
     {
         if(mUseShadowBuffer)
         if(mUseShadowBuffer)
@@ -182,7 +182,7 @@ namespace CamelotEngine {
         }
         }
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-    void GLHardwareVertexBuffer::writeData(size_t offset, size_t length, 
+    void GLHardwareVertexBuffer::writeData(UINT32 offset, UINT32 length, 
             const void* pSource, bool discardWholeBuffer)
             const void* pSource, bool discardWholeBuffer)
     {
     {
         glBindBufferARB(GL_ARRAY_BUFFER_ARB, mBufferId);
         glBindBufferARB(GL_ARRAY_BUFFER_ARB, mBufferId);

+ 10 - 10
CamelotGLRenderer/Source/CmGLTexture.cpp

@@ -124,7 +124,7 @@ namespace CamelotEngine {
 		mFormat = TextureManager::instance().getNativeFormat(mTextureType, mFormat, mUsage);
 		mFormat = TextureManager::instance().getNativeFormat(mTextureType, mFormat, mUsage);
 		
 		
 		// Check requested number of mipmaps
 		// Check requested number of mipmaps
-		size_t maxMips = GLPixelUtil::getMaxMipmaps(mWidth, mHeight, mDepth, mFormat);
+		UINT32 maxMips = GLPixelUtil::getMaxMipmaps(mWidth, mHeight, mDepth, mFormat);
 		if(mNumMipmaps>maxMips)
 		if(mNumMipmaps>maxMips)
 			mNumMipmaps = maxMips;
 			mNumMipmaps = maxMips;
 		
 		
@@ -150,21 +150,21 @@ namespace CamelotEngine {
 		// Allocate internal buffer so that glTexSubImageXD can be used
 		// Allocate internal buffer so that glTexSubImageXD can be used
 		// Internal format
 		// Internal format
 		GLenum format = GLPixelUtil::getClosestGLInternalFormat(mFormat, mHwGamma);
 		GLenum format = GLPixelUtil::getClosestGLInternalFormat(mFormat, mHwGamma);
-		size_t width = mWidth;
-		size_t height = mHeight;
-		size_t depth = mDepth;
+		UINT32 width = mWidth;
+		UINT32 height = mHeight;
+		UINT32 depth = mDepth;
 
 
 		if(PixelUtil::isCompressed(mFormat))
 		if(PixelUtil::isCompressed(mFormat))
 		{
 		{
 			// Compressed formats
 			// Compressed formats
-			size_t size = PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
+			UINT32 size = PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
 			// Provide temporary buffer filled with zeroes as glCompressedTexImageXD does not
 			// Provide temporary buffer filled with zeroes as glCompressedTexImageXD does not
 			// accept a 0 pointer like normal glTexImageXD
 			// accept a 0 pointer like normal glTexImageXD
 			// Run through this process for every mipmap to pregenerate mipmap piramid
 			// Run through this process for every mipmap to pregenerate mipmap piramid
 			UINT8 *tmpdata = new UINT8[size];
 			UINT8 *tmpdata = new UINT8[size];
 			memset(tmpdata, 0, size);
 			memset(tmpdata, 0, size);
 			
 			
-			for(size_t mip=0; mip<=mNumMipmaps; mip++)
+			for(UINT32 mip=0; mip<=mNumMipmaps; mip++)
 			{
 			{
 				size = PixelUtil::getMemorySize(width, height, depth, mFormat);
 				size = PixelUtil::getMemorySize(width, height, depth, mFormat);
 				switch(mTextureType)
 				switch(mTextureType)
@@ -201,7 +201,7 @@ namespace CamelotEngine {
 		else
 		else
 		{
 		{
 			// Run through this process to pregenerate mipmap piramid
 			// Run through this process to pregenerate mipmap piramid
-			for(size_t mip=0; mip<=mNumMipmaps; mip++)
+			for(UINT32 mip=0; mip<=mNumMipmaps; mip++)
 			{
 			{
 				// Normal formats
 				// Normal formats
 				switch(mTextureType)
 				switch(mTextureType)
@@ -260,9 +260,9 @@ namespace CamelotEngine {
 	{
 	{
 		mSurfaceList.clear();
 		mSurfaceList.clear();
 		
 		
-		for(size_t face=0; face<getNumFaces(); face++)
+		for(UINT32 face=0; face<getNumFaces(); face++)
 		{
 		{
-			for(size_t mip=0; mip<=getNumMipmaps(); mip++)
+			for(UINT32 mip=0; mip<=getNumMipmaps(); mip++)
 			{
 			{
                 GLHardwarePixelBuffer *buf = new GLTextureBuffer("", getGLTextureTarget_internal(), mTextureID, face, mip,
                 GLHardwarePixelBuffer *buf = new GLTextureBuffer("", getGLTextureTarget_internal(), mTextureID, face, mip,
 						static_cast<HardwareBuffer::Usage>(mUsage), false, mHwGamma, mFSAA);
 						static_cast<HardwareBuffer::Usage>(mUsage), false, mHwGamma, mFSAA);
@@ -282,7 +282,7 @@ namespace CamelotEngine {
 	}
 	}
 	
 	
 	//---------------------------------------------------------------------------------------------
 	//---------------------------------------------------------------------------------------------
-	HardwarePixelBufferPtr GLTexture::getBuffer_internal(size_t face, size_t mipmap)
+	HardwarePixelBufferPtr GLTexture::getBuffer_internal(UINT32 face, UINT32 mipmap)
 	{
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 		THROW_IF_NOT_RENDER_THREAD;
 
 

+ 1 - 1
CamelotRenderer.sln

@@ -77,7 +77,7 @@ Global
 		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Debug|Mixed Platforms.Build.0 = Debug|Win32
 		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Debug|Mixed Platforms.Build.0 = Debug|Win32
 		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Debug|Win32.ActiveCfg = Debug|Win32
 		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Debug|Win32.ActiveCfg = Debug|Win32
 		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Debug|Win32.Build.0 = Debug|Win32
 		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Debug|Win32.Build.0 = Debug|Win32
-		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Debug|x64.ActiveCfg = Debug|Win32
+		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Debug|x64.ActiveCfg = Debug|x64
 		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Release|Any CPU.ActiveCfg = Release|Win32
 		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Release|Any CPU.ActiveCfg = Release|Win32
 		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Release|Mixed Platforms.ActiveCfg = Release|Win32
 		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Release|Mixed Platforms.ActiveCfg = Release|Win32
 		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Release|Mixed Platforms.Build.0 = Release|Win32
 		{9B21D41C-516B-43BF-9B10-E99B599C7589}.Release|Mixed Platforms.Build.0 = Release|Win32

+ 77 - 0
CamelotRenderer/CamelotRenderer.vcxproj

@@ -5,10 +5,18 @@
       <Configuration>Debug</Configuration>
       <Configuration>Debug</Configuration>
       <Platform>Win32</Platform>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
     <ProjectConfiguration Include="Release|Win32">
     <ProjectConfiguration Include="Release|Win32">
       <Configuration>Release</Configuration>
       <Configuration>Release</Configuration>
       <Platform>Win32</Platform>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
   </ItemGroup>
   </ItemGroup>
   <PropertyGroup Label="Globals">
   <PropertyGroup Label="Globals">
     <ProjectGuid>{9B21D41C-516B-43BF-9B10-E99B599C7589}</ProjectGuid>
     <ProjectGuid>{9B21D41C-516B-43BF-9B10-E99B599C7589}</ProjectGuid>
@@ -22,6 +30,12 @@
     <PlatformToolset>v110</PlatformToolset>
     <PlatformToolset>v110</PlatformToolset>
     <CharacterSet>NotSet</CharacterSet>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v110</PlatformToolset>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <UseDebugLibraries>false</UseDebugLibraries>
@@ -29,15 +43,28 @@
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>NotSet</CharacterSet>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v110</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
   </ImportGroup>
   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
     <LinkIncremental>true</LinkIncremental>
@@ -45,12 +72,24 @@
     <LibraryPath>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath)</LibraryPath>
     <LibraryPath>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath)</LibraryPath>
     <OutDir>..\bin\$(Configuration)\</OutDir>
     <OutDir>..\bin\$(Configuration)\</OutDir>
   </PropertyGroup>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <IncludePath>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath)</IncludePath>
+    <LibraryPath>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x64;$(LibraryPath)</LibraryPath>
+    <OutDir>..\bin\$(Platform)\$(Configuration)\</OutDir>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
     <LinkIncremental>false</LinkIncremental>
     <IncludePath>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath)</IncludePath>
     <IncludePath>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath)</IncludePath>
     <LibraryPath>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath)</LibraryPath>
     <LibraryPath>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath)</LibraryPath>
     <OutDir>..\bin\$(Configuration)\</OutDir>
     <OutDir>..\bin\$(Configuration)\</OutDir>
   </PropertyGroup>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+    <IncludePath>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath)</IncludePath>
+    <LibraryPath>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x64;$(LibraryPath)</LibraryPath>
+    <OutDir>..\bin\$(Platform)\$(Configuration)\</OutDir>
+  </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
     <ClCompile>
       <PrecompiledHeader>
       <PrecompiledHeader>
@@ -68,6 +107,23 @@
       <ImportLibrary>..\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
       <ImportLibrary>..\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
     </Link>
     </Link>
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;CM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>./Include;../CamelotUtility/Include;../Dependencies/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>NotSet</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>CamelotUtility.lib;cg.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>../lib/$(Platform)/$(Configuration);../Dependencies/lib/x64/Debug</AdditionalLibraryDirectories>
+      <ImportLibrary>..\lib\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
+    </Link>
+  </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <WarningLevel>Level3</WarningLevel>
@@ -89,6 +145,27 @@
       <ImportLibrary>..\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
       <ImportLibrary>..\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
     </Link>
     </Link>
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;CM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>./Include;../CamelotUtility/Include;../Dependencies/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>NotSet</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>CamelotUtility.lib;cg.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>../lib/$(Platform)/$(Configuration);../Dependencies/lib/x64/Release</AdditionalLibraryDirectories>
+      <ImportLibrary>..\lib\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
+    </Link>
+  </ItemDefinitionGroup>
   <ItemGroup>
   <ItemGroup>
     <Text Include="..\TODODoc.txt" />
     <Text Include="..\TODODoc.txt" />
     <Text Include="HighLevelTODO.txt" />
     <Text Include="HighLevelTODO.txt" />

+ 1 - 1
CamelotRenderer/Include/CmCgProgram.h

@@ -84,7 +84,7 @@ namespace CamelotEngine {
         void buildConstantDefinitions() const;
         void buildConstantDefinitions() const;
 
 
 		/// Recurse down structures getting data on parameters
 		/// Recurse down structures getting data on parameters
-		void recurseParams(CGparameter param, size_t contextArraySize = 1) const;
+		void recurseParams(CGparameter param, UINT32 contextArraySize = 1) const;
 		/// Turn a Cg type into a GpuConstantType and number of elements
 		/// Turn a Cg type into a GpuConstantType and number of elements
 		void mapTypeAndElementSize(CGtype cgType, bool isRegisterCombiner, GpuConstantDefinition& def) const;
 		void mapTypeAndElementSize(CGtype cgType, bool isRegisterCombiner, GpuConstantDefinition& def) const;
 
 

+ 13 - 13
CamelotRenderer/Include/CmDefaultHardwareBufferManager.h

@@ -48,21 +48,21 @@ namespace CamelotEngine {
 	protected:
 	protected:
 		unsigned char* mpData;
 		unsigned char* mpData;
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
 		void unlockImpl(void);
 		void unlockImpl(void);
     public:
     public:
-		DefaultHardwareVertexBuffer(size_t vertexSize, size_t numVertices, HardwareBuffer::Usage usage);
-		DefaultHardwareVertexBuffer(HardwareBufferManagerBase* mgr, size_t vertexSize, size_t numVertices, 
+		DefaultHardwareVertexBuffer(UINT32 vertexSize, UINT32 numVertices, HardwareBuffer::Usage usage);
+		DefaultHardwareVertexBuffer(HardwareBufferManagerBase* mgr, UINT32 vertexSize, UINT32 numVertices, 
             HardwareBuffer::Usage usage);
             HardwareBuffer::Usage usage);
         ~DefaultHardwareVertexBuffer();
         ~DefaultHardwareVertexBuffer();
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void readData(size_t offset, size_t length, void* pDest);
+        void readData(UINT32 offset, UINT32 length, void* pDest);
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void writeData(size_t offset, size_t length, const void* pSource,
+        void writeData(UINT32 offset, UINT32 length, const void* pSource,
 				bool discardWholeBuffer = false);
 				bool discardWholeBuffer = false);
         /** Override HardwareBuffer to turn off all shadowing. */
         /** Override HardwareBuffer to turn off all shadowing. */
-        void* lock(size_t offset, size_t length, LockOptions options);
+        void* lock(UINT32 offset, UINT32 length, LockOptions options);
         /** Override HardwareBuffer to turn off all shadowing. */
         /** Override HardwareBuffer to turn off all shadowing. */
 		void unlock(void);
 		void unlock(void);
 
 
@@ -75,19 +75,19 @@ namespace CamelotEngine {
 	protected:
 	protected:
 		unsigned char* mpData;
 		unsigned char* mpData;
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
 		void unlockImpl(void);
 		void unlockImpl(void);
     public:
     public:
-		DefaultHardwareIndexBuffer(IndexType idxType, size_t numIndexes, HardwareBuffer::Usage usage);
+		DefaultHardwareIndexBuffer(IndexType idxType, UINT32 numIndexes, HardwareBuffer::Usage usage);
         ~DefaultHardwareIndexBuffer();
         ~DefaultHardwareIndexBuffer();
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void readData(size_t offset, size_t length, void* pDest);
+        void readData(UINT32 offset, UINT32 length, void* pDest);
         /** See HardwareBuffer. */
         /** See HardwareBuffer. */
-        void writeData(size_t offset, size_t length, const void* pSource,
+        void writeData(UINT32 offset, UINT32 length, const void* pSource,
 				bool discardWholeBuffer = false);
 				bool discardWholeBuffer = false);
         /** Override HardwareBuffer to turn off all shadowing. */
         /** Override HardwareBuffer to turn off all shadowing. */
-        void* lock(size_t offset, size_t length, LockOptions options);
+        void* lock(UINT32 offset, UINT32 length, LockOptions options);
         /** Override HardwareBuffer to turn off all shadowing. */
         /** Override HardwareBuffer to turn off all shadowing. */
 		void unlock(void);
 		void unlock(void);
 
 
@@ -107,11 +107,11 @@ namespace CamelotEngine {
         ~DefaultHardwareBufferManagerBase();
         ~DefaultHardwareBufferManagerBase();
         /// Creates a vertex buffer
         /// Creates a vertex buffer
 		HardwareVertexBufferPtr 
 		HardwareVertexBufferPtr 
-            createVertexBuffer(size_t vertexSize, size_t numVerts, 
+            createVertexBuffer(UINT32 vertexSize, UINT32 numVerts, 
 				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
 				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
 		/// Create a hardware vertex buffer
 		/// Create a hardware vertex buffer
 		HardwareIndexBufferPtr 
 		HardwareIndexBufferPtr 
-            createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+            createIndexBuffer(HardwareIndexBuffer::IndexType itype, UINT32 numIndexes, 
 				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
 				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
     };
     };
 
 

+ 1 - 1
CamelotRenderer/Include/CmGameObject.h

@@ -184,7 +184,7 @@ namespace CamelotEngine
 		/**
 		/**
 		 * @brief	Gets the number of all child GameObjects.
 		 * @brief	Gets the number of all child GameObjects.
 		 */
 		 */
-		int getNumChildren() const { return mChildren.size(); }
+		UINT32 getNumChildren() const { return (UINT32)mChildren.size(); }
 
 
 	private:
 	private:
 		std::weak_ptr<GameObject> mParent;
 		std::weak_ptr<GameObject> mParent;

+ 64 - 64
CamelotRenderer/Include/CmGpuProgramParams.h

@@ -100,14 +100,14 @@ namespace CamelotEngine {
 		/// Data type
 		/// Data type
 		GpuConstantType constType;
 		GpuConstantType constType;
 		/// Physical start index in buffer (either float or int buffer)
 		/// Physical start index in buffer (either float or int buffer)
-		size_t physicalIndex;
+		UINT32 physicalIndex;
 		/// Logical index - used to communicate this constant to the rendersystem
 		/// Logical index - used to communicate this constant to the rendersystem
-		size_t logicalIndex;
+		UINT32 logicalIndex;
 		/** Number of raw buffer slots per element 
 		/** Number of raw buffer slots per element 
 		(some programs pack each array element to float4, some do not) */
 		(some programs pack each array element to float4, some do not) */
-		size_t elementSize;
+		UINT32 elementSize;
 		/// Length of array
 		/// Length of array
-		size_t arraySize;
+		UINT32 arraySize;
 		/// How this parameter varies (bitwise combination of GpuProgramVariability)
 		/// How this parameter varies (bitwise combination of GpuProgramVariability)
 		mutable UINT16 variability;
 		mutable UINT16 variability;
 
 
@@ -163,7 +163,7 @@ namespace CamelotEngine {
 		/** Get the element size of a given type, including whether to pad the 
 		/** Get the element size of a given type, including whether to pad the 
 			elements into multiples of 4 (e.g. SM1 and D3D does, GLSL doesn't)
 			elements into multiples of 4 (e.g. SM1 and D3D does, GLSL doesn't)
 		*/
 		*/
-		static size_t getElementSize(GpuConstantType ctype, bool padToMultiplesOf4)
+		static UINT32 getElementSize(GpuConstantType ctype, bool padToMultiplesOf4)
 		{
 		{
 			if (padToMultiplesOf4)
 			if (padToMultiplesOf4)
 			{
 			{
@@ -246,7 +246,7 @@ namespace CamelotEngine {
 
 
 		GpuConstantDefinition()
 		GpuConstantDefinition()
 			: constType(GCT_UNKNOWN)
 			: constType(GCT_UNKNOWN)
-			, physicalIndex((std::numeric_limits<size_t>::max)())
+			, physicalIndex((std::numeric_limits<UINT32>::max)())
 			, elementSize(0)
 			, elementSize(0)
 			, arraySize(1)
 			, arraySize(1)
 			, variability(GPV_GLOBAL) {}
 			, variability(GPV_GLOBAL) {}
@@ -258,11 +258,11 @@ namespace CamelotEngine {
 	struct CM_EXPORT GpuNamedConstants
 	struct CM_EXPORT GpuNamedConstants
 	{
 	{
 		/// Total size of the float buffer required
 		/// Total size of the float buffer required
-		size_t floatBufferSize;
+		UINT32 floatBufferSize;
 		/// Total size of the int buffer required
 		/// Total size of the int buffer required
-		size_t intBufferSize;
+		UINT32 intBufferSize;
 		/// Total number of samplers referenced
 		/// Total number of samplers referenced
-		size_t samplerCount;
+		UINT32 samplerCount;
 		/// Map of parameter names to GpuConstantDefinition
 		/// Map of parameter names to GpuConstantDefinition
 		GpuConstantDefinitionMap map;
 		GpuConstantDefinitionMap map;
 
 
@@ -310,18 +310,18 @@ namespace CamelotEngine {
 	struct CM_EXPORT GpuLogicalIndexUse
 	struct CM_EXPORT GpuLogicalIndexUse
 	{
 	{
 		/// Physical buffer index
 		/// Physical buffer index
-		size_t physicalIndex;
+		UINT32 physicalIndex;
 		/// Current physical size allocation
 		/// Current physical size allocation
-		size_t currentSize;
+		UINT32 currentSize;
 		/// How the contents of this slot vary
 		/// How the contents of this slot vary
 		mutable UINT16 variability;
 		mutable UINT16 variability;
 
 
 		GpuLogicalIndexUse() 
 		GpuLogicalIndexUse() 
 			: physicalIndex(99999), currentSize(0), variability(GPV_GLOBAL) {}
 			: physicalIndex(99999), currentSize(0), variability(GPV_GLOBAL) {}
-		GpuLogicalIndexUse(size_t bufIdx, size_t curSz, UINT16 v) 
+		GpuLogicalIndexUse(UINT32 bufIdx, UINT32 curSz, UINT32 v) 
 			: physicalIndex(bufIdx), currentSize(curSz), variability(v) {}
 			: physicalIndex(bufIdx), currentSize(curSz), variability(v) {}
 	};
 	};
-	typedef map<size_t, GpuLogicalIndexUse>::type GpuLogicalIndexUseMap;
+	typedef map<UINT32, GpuLogicalIndexUse>::type GpuLogicalIndexUseMap;
 	/// 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 CM_EXPORT GpuLogicalBufferStruct
 	struct CM_EXPORT GpuLogicalBufferStruct
 	{
 	{
@@ -329,7 +329,7 @@ namespace CamelotEngine {
 			/// 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
-		size_t bufferSize;
+		UINT32 bufferSize;
 		GpuLogicalBufferStruct() : bufferSize(0) {}
 		GpuLogicalBufferStruct() : bufferSize(0) {}
 	};
 	};
 	typedef std::shared_ptr<GpuLogicalBufferStruct> GpuLogicalBufferStructPtr;
 	typedef std::shared_ptr<GpuLogicalBufferStruct> GpuLogicalBufferStructPtr;
@@ -440,10 +440,10 @@ namespace CamelotEngine {
 
 
 		/** Gets the low-level structure for a logical index. 
 		/** Gets the low-level structure for a logical index. 
 		*/
 		*/
-		GpuLogicalIndexUse* _getFloatConstantLogicalIndexUse(size_t logicalIndex, size_t requestedSize, UINT16 variability);
+		GpuLogicalIndexUse* _getFloatConstantLogicalIndexUse(UINT32 logicalIndex, UINT32 requestedSize, UINT16 variability);
 		/** Gets the physical buffer index associated with a logical int constant index. 
 		/** Gets the physical buffer index associated with a logical int constant index. 
 		*/
 		*/
-		GpuLogicalIndexUse* _getIntConstantLogicalIndexUse(size_t logicalIndex, size_t requestedSize, UINT16 variability);
+		GpuLogicalIndexUse* _getIntConstantLogicalIndexUse(UINT32 logicalIndex, UINT32 requestedSize, UINT16 variability);
 
 
 	public:
 	public:
 		GpuProgramParameters();
 		GpuProgramParameters();
@@ -476,7 +476,7 @@ namespace CamelotEngine {
 		(each constant is a 4D float)
 		(each constant is a 4D float)
 		@param vec The value to set
 		@param vec The value to set
 		*/
 		*/
-		void setConstant(size_t index, const Vector4& vec);
+		void setConstant(UINT32 index, const Vector4& vec);
 		/** Sets a single floating-point parameter to the program.
 		/** Sets a single floating-point parameter to the program.
 		@note This is actually equivalent to calling 
 		@note This is actually equivalent to calling 
 		setConstant(index Vector4(val, 0, 0, 0)) since all constants are 4D.
 		setConstant(index Vector4(val, 0, 0, 0)) since all constants are 4D.
@@ -484,7 +484,7 @@ namespace CamelotEngine {
 		a 4D float)
 		a 4D float)
 		@param val The value to set
 		@param val The value to set
 		*/
 		*/
-		void setConstant(size_t index, float val);
+		void setConstant(UINT32 index, float val);
 		/** Sets a 4-element floating-point parameter to the program via Vector3.
 		/** Sets a 4-element floating-point parameter to the program via Vector3.
 		@param index The logical constant index at which to place the parameter (each constant is
 		@param index The logical constant index at which to place the parameter (each constant is
 		a 4D float).
 		a 4D float).
@@ -492,14 +492,14 @@ namespace CamelotEngine {
 		value will be set to 1 (a homogeneous vector)
 		value will be set to 1 (a homogeneous vector)
 		@param vec The value to set
 		@param vec The value to set
 		*/
 		*/
-		void setConstant(size_t index, const Vector3& vec);
+		void setConstant(UINT32 index, const Vector3& vec);
 		/** Sets a Matrix4 parameter to the program.
 		/** Sets a Matrix4 parameter to the program.
 		@param index The logical constant index at which to place the parameter (each constant is
 		@param index The logical constant index at which to place the parameter (each constant is
 		a 4D float).
 		a 4D float).
 		NB since a Matrix4 is 16 floats long, this parameter will take up 4 indexes.
 		NB since a Matrix4 is 16 floats long, this parameter will take up 4 indexes.
 		@param m The value to set
 		@param m The value to set
 		*/
 		*/
-		void setConstant(size_t index, const Matrix4& m);
+		void setConstant(UINT32 index, const Matrix4& m);
 		/** Sets a list of Matrix4 parameters to the program.
 		/** Sets a list of Matrix4 parameters to the program.
 		@param index The logical constant index at which to start placing the parameter (each constant is
 		@param index The logical constant index at which to start placing the parameter (each constant is
 		a 4D float).
 		a 4D float).
@@ -507,27 +507,27 @@ namespace CamelotEngine {
 		@param m Pointer to an array of matrices to set
 		@param m Pointer to an array of matrices to set
 		@param numEntries Number of Matrix4 entries
 		@param numEntries Number of Matrix4 entries
 		*/
 		*/
-		void setConstant(size_t index, const Matrix4* m, size_t numEntries);
+		void setConstant(UINT32 index, const Matrix4* m, UINT32 numEntries);
 		/** Sets a multiple value constant floating-point parameter to the program.
 		/** Sets a multiple value constant floating-point parameter to the program.
 		@param index The logical constant index at which to start placing parameters (each constant is
 		@param index The logical constant index at which to start placing parameters (each constant is
 		a 4D float)
 		a 4D float)
 		@param val Pointer to the values to write, must contain 4*count floats
 		@param val Pointer to the values to write, must contain 4*count floats
 		@param count The number of groups of 4 floats to write
 		@param count The number of groups of 4 floats to write
 		*/
 		*/
-		void setConstant(size_t index, const float *val, size_t count);
+		void setConstant(UINT32 index, const float *val, UINT32 count);
 		/** Sets a multiple value constant floating-point parameter to the program.
 		/** Sets a multiple value constant floating-point parameter to the program.
 		@param index The logical constant index at which to start placing parameters (each constant is
 		@param index The logical constant index at which to start placing parameters (each constant is
 		a 4D float)
 		a 4D float)
 		@param val Pointer to the values to write, must contain 4*count floats
 		@param val Pointer to the values to write, must contain 4*count floats
 		@param count The number of groups of 4 floats to write
 		@param count The number of groups of 4 floats to write
 		*/
 		*/
-		void setConstant(size_t index, const double *val, size_t count);
+		void setConstant(UINT32 index, const double *val, UINT32 count);
 		/** Sets a ColourValue parameter to the program.
 		/** Sets a ColourValue parameter to the program.
 		@param index The logical constant index at which to place the parameter (each constant is
 		@param index The logical constant index at which to place the parameter (each constant is
 		a 4D float)
 		a 4D float)
 		@param colour The value to set
 		@param colour The value to set
 		*/
 		*/
-		void setConstant(size_t index, const Color& colour);
+		void setConstant(UINT32 index, const Color& colour);
 
 
 		/** Sets a multiple value constant integer parameter to the program.
 		/** Sets a multiple value constant integer parameter to the program.
 		@remarks
 		@remarks
@@ -543,7 +543,7 @@ namespace CamelotEngine {
 		@param val Pointer to the values to write, must contain 4*count ints
 		@param val Pointer to the values to write, must contain 4*count ints
 		@param count The number of groups of 4 ints to write
 		@param count The number of groups of 4 ints to write
 		*/
 		*/
-		void setConstant(size_t index, const int *val, size_t count);
+		void setConstant(UINT32 index, const int *val, UINT32 count);
 
 
 		/** Write a series of floating point values into the underlying float 
 		/** Write a series of floating point values into the underlying float 
 		constant buffer at the given physical index.
 		constant buffer at the given physical index.
@@ -551,41 +551,41 @@ namespace CamelotEngine {
 		@param val Pointer to a list of values to write
 		@param val Pointer to a list of values to write
 		@param count The number of floats to write
 		@param count The number of floats to write
 		*/
 		*/
-		void _writeRawConstants(size_t physicalIndex, const float* val, size_t count);
+		void _writeRawConstants(UINT32 physicalIndex, const float* val, UINT32 count);
 		/** Write a series of floating point values into the underlying float 
 		/** Write a series of floating point values into the underlying float 
 		constant buffer at the given physical index.
 		constant buffer at the given physical index.
 		@param physicalIndex The buffer position to start writing
 		@param physicalIndex The buffer position to start writing
 		@param val Pointer to a list of values to write
 		@param val Pointer to a list of values to write
 		@param count The number of floats to write
 		@param count The number of floats to write
 		*/
 		*/
-		void _writeRawConstants(size_t physicalIndex, const double* val, size_t count);
+		void _writeRawConstants(UINT32 physicalIndex, const double* val, UINT32 count);
 		/** Write a series of integer values into the underlying integer
 		/** Write a series of integer values into the underlying integer
 		constant buffer at the given physical index.
 		constant buffer at the given physical index.
 		@param physicalIndex The buffer position to start writing
 		@param physicalIndex The buffer position to start writing
 		@param val Pointer to a list of values to write
 		@param val Pointer to a list of values to write
 		@param count The number of ints to write
 		@param count The number of ints to write
 		*/
 		*/
-		void _writeRawConstants(size_t physicalIndex, const int* val, size_t count);
+		void _writeRawConstants(UINT32 physicalIndex, const int* val, UINT32 count);
 		/** Read a series of floating point values from the underlying float 
 		/** Read a series of floating point values from the underlying float 
 		constant buffer at the given physical index.
 		constant buffer at the given physical index.
 		@param physicalIndex The buffer position to start reading
 		@param physicalIndex The buffer position to start reading
 		@param count The number of floats to read
 		@param count The number of floats to read
 		@param dest Pointer to a buffer to receive the values
 		@param dest Pointer to a buffer to receive the values
 		*/
 		*/
-		void _readRawConstants(size_t physicalIndex, size_t count, float* dest);
+		void _readRawConstants(UINT32 physicalIndex, UINT32 count, float* dest);
 		/** Read a series of integer values from the underlying integer 
 		/** Read a series of integer values from the underlying integer 
 		constant buffer at the given physical index.
 		constant buffer at the given physical index.
 		@param physicalIndex The buffer position to start reading
 		@param physicalIndex The buffer position to start reading
 		@param count The number of ints to read
 		@param count The number of ints to read
 		@param dest Pointer to a buffer to receive the values
 		@param dest Pointer to a buffer to receive the values
 		*/
 		*/
-		void _readRawConstants(size_t physicalIndex, size_t count, int* dest);
+		void _readRawConstants(UINT32 physicalIndex, UINT32 count, int* dest);
 		/** Read a texture from the underlying texture 
 		/** Read a texture from the underlying texture 
 		array at the given physical index.
 		array at the given physical index.
 		@param physicalIndex The array position of the texture
 		@param physicalIndex The array position of the texture
 		@param dest Reference of the texture to store
 		@param dest Reference of the texture to store
 		*/
 		*/
-		void _readTexture(size_t physicalIndex, TextureHandle& dest);
+		void _readTexture(UINT32 physicalIndex, TextureHandle& dest);
 		/** Write a 4-element floating-point parameter to the program directly to 
 		/** Write a 4-element floating-point parameter to the program directly to 
 		the underlying constants buffer.
 		the underlying constants buffer.
 		@note You can use these methods if you have already derived the physical
 		@note You can use these methods if you have already derived the physical
@@ -596,8 +596,8 @@ namespace CamelotEngine {
 		@param count The number of floats to write; if for example
 		@param count The number of floats to write; if for example
 		the uniform constant 'slot' is smaller than a Vector4
 		the uniform constant 'slot' is smaller than a Vector4
 		*/
 		*/
-		void _writeRawConstant(size_t physicalIndex, const Vector4& vec, 
-			size_t count = 4);
+		void _writeRawConstant(UINT32 physicalIndex, const Vector4& vec, 
+			UINT32 count = 4);
 		/** Write a single floating-point parameter to the program.
 		/** Write a single floating-point parameter to the program.
 		@note You can use these methods if you have already derived the physical
 		@note You can use these methods if you have already derived the physical
 		constant buffer location, for a slight speed improvement over using
 		constant buffer location, for a slight speed improvement over using
@@ -605,7 +605,7 @@ namespace CamelotEngine {
 		@param physicalIndex The physical buffer index at which to place the parameter 
 		@param physicalIndex The physical buffer index at which to place the parameter 
 		@param val The value to set
 		@param val The value to set
 		*/
 		*/
-		void _writeRawConstant(size_t physicalIndex, float val);
+		void _writeRawConstant(UINT32 physicalIndex, float val);
 		/** Write a single integer parameter to the program.
 		/** Write a single integer parameter to the program.
 		@note You can use these methods if you have already derived the physical
 		@note You can use these methods if you have already derived the physical
 		constant buffer location, for a slight speed improvement over using
 		constant buffer location, for a slight speed improvement over using
@@ -613,7 +613,7 @@ namespace CamelotEngine {
 		@param physicalIndex The physical buffer index at which to place the parameter 
 		@param physicalIndex The physical buffer index at which to place the parameter 
 		@param val The value to set
 		@param val The value to set
 		*/
 		*/
-		void _writeRawConstant(size_t physicalIndex, int val);
+		void _writeRawConstant(UINT32 physicalIndex, int val);
 		/** Write a 3-element floating-point parameter to the program via Vector3.
 		/** Write a 3-element floating-point parameter to the program via Vector3.
 		@note You can use these methods if you have already derived the physical
 		@note You can use these methods if you have already derived the physical
 		constant buffer location, for a slight speed improvement over using
 		constant buffer location, for a slight speed improvement over using
@@ -621,7 +621,7 @@ namespace CamelotEngine {
 		@param physicalIndex The physical buffer index at which to place the parameter 
 		@param physicalIndex The physical buffer index at which to place the parameter 
 		@param vec The value to set
 		@param vec The value to set
 		*/
 		*/
-		void _writeRawConstant(size_t physicalIndex, const Vector3& vec);
+		void _writeRawConstant(UINT32 physicalIndex, const Vector3& vec);
 		/** Write a 2-element floating-point parameter to the program via Vector2.
 		/** Write a 2-element floating-point parameter to the program via Vector2.
 		@note You can use these methods if you have already derived the physical
 		@note You can use these methods if you have already derived the physical
 		constant buffer location, for a slight speed improvement over using
 		constant buffer location, for a slight speed improvement over using
@@ -629,7 +629,7 @@ namespace CamelotEngine {
 		@param physicalIndex The physical buffer index at which to place the parameter 
 		@param physicalIndex The physical buffer index at which to place the parameter 
 		@param vec The value to set
 		@param vec The value to set
 		*/
 		*/
-		void _writeRawConstant(size_t physicalIndex, const Vector2& vec);
+		void _writeRawConstant(UINT32 physicalIndex, const Vector2& vec);
 		/** Write a Matrix4 parameter to the program.
 		/** Write a Matrix4 parameter to the program.
 		@note You can use these methods if you have already derived the physical
 		@note You can use these methods if you have already derived the physical
 		constant buffer location, for a slight speed improvement over using
 		constant buffer location, for a slight speed improvement over using
@@ -638,7 +638,7 @@ namespace CamelotEngine {
 		@param m The value to set
 		@param m The value to set
 		@param elementCount actual element count used with shader
 		@param elementCount actual element count used with shader
 		*/
 		*/
-		void _writeRawConstant(size_t physicalIndex, const Matrix4& m, size_t elementCount);
+		void _writeRawConstant(UINT32 physicalIndex, const Matrix4& m, UINT32 elementCount);
 		/** Write a list of Matrix4 parameters to the program.
 		/** Write a list of Matrix4 parameters to the program.
 		@note You can use these methods if you have already derived the physical
 		@note You can use these methods if you have already derived the physical
 		constant buffer location, for a slight speed improvement over using
 		constant buffer location, for a slight speed improvement over using
@@ -646,7 +646,7 @@ namespace CamelotEngine {
 		@param physicalIndex The physical buffer index at which to place the parameter 
 		@param physicalIndex The physical buffer index at which to place the parameter 
 		@param numEntries Number of Matrix4 entries
 		@param numEntries Number of Matrix4 entries
 		*/
 		*/
-		void _writeRawConstant(size_t physicalIndex, const Matrix4* m, size_t numEntries);
+		void _writeRawConstant(UINT32 physicalIndex, const Matrix4* m, UINT32 numEntries);
 		/** Write a Matrix3 parameter to the program.
 		/** Write a Matrix3 parameter to the program.
 		@note You can use these methods if you have already derived the physical
 		@note You can use these methods if you have already derived the physical
 		constant buffer location, for a slight speed improvement over using
 		constant buffer location, for a slight speed improvement over using
@@ -655,7 +655,7 @@ namespace CamelotEngine {
 		@param m The value to set
 		@param m The value to set
 		@param elementCount actual element count used with shader
 		@param elementCount actual element count used with shader
 		*/
 		*/
-		void _writeRawConstant(size_t physicalIndex, const Matrix3& m, size_t elementCount);
+		void _writeRawConstant(UINT32 physicalIndex, const Matrix3& m, UINT32 elementCount);
 		/** Write a ColourValue parameter to the program.
 		/** Write a ColourValue parameter to the program.
 		@note You can use these methods if you have already derived the physical
 		@note You can use these methods if you have already derived the physical
 		constant buffer location, for a slight speed improvement over using
 		constant buffer location, for a slight speed improvement over using
@@ -665,8 +665,8 @@ namespace CamelotEngine {
 		@param count The number of floats to write; if for example
 		@param count The number of floats to write; if for example
 		the uniform constant 'slot' is smaller than a Vector4
 		the uniform constant 'slot' is smaller than a Vector4
 		*/
 		*/
-		void _writeRawConstant(size_t physicalIndex, const Color& colour, 
-			size_t count = 4);
+		void _writeRawConstant(UINT32 physicalIndex, const Color& colour, 
+			UINT32 count = 4);
 
 
 
 
 		/** Gets an iterator over the named GpuConstantDefinition instances as defined
 		/** Gets an iterator over the named GpuConstantDefinition instances as defined
@@ -698,15 +698,15 @@ namespace CamelotEngine {
 		/** Retrieves the logical index relating to a physical index in the float
 		/** Retrieves the logical index relating to a physical index in the float
 		buffer, for programs which support that (low-level programs and 
 		buffer, for programs which support that (low-level programs and 
 		high-level programs which use logical parameter indexes).
 		high-level programs which use logical parameter indexes).
-		@returns std::numeric_limits<size_t>::max() if not found
+		@returns std::numeric_limits<UINT32>::max() if not found
 		*/
 		*/
-		size_t getFloatLogicalIndexForPhysicalIndex(size_t physicalIndex);
+		UINT32 getFloatLogicalIndexForPhysicalIndex(UINT32 physicalIndex);
 		/** Retrieves the logical index relating to a physical index in the int
 		/** Retrieves the logical index relating to a physical index in the int
 		buffer, for programs which support that (low-level programs and 
 		buffer, for programs which support that (low-level programs and 
 		high-level programs which use logical parameter indexes).
 		high-level programs which use logical parameter indexes).
-		@returns std::numeric_limits<size_t>::max() if not found
+		@returns std::numeric_limits<UINT32>::max() if not found
 		*/
 		*/
-		size_t getIntLogicalIndexForPhysicalIndex(size_t physicalIndex);
+		UINT32 getIntLogicalIndexForPhysicalIndex(UINT32 physicalIndex);
 
 
 		/** Get the current list of mappings from low-level logical param indexes
 		/** Get the current list of mappings from low-level logical param indexes
 		to physical buffer locations in the integer buffer.
 		to physical buffer locations in the integer buffer.
@@ -717,21 +717,21 @@ namespace CamelotEngine {
 		/// Get a reference to the list of float constants
 		/// Get a reference to the list of float constants
 		const FloatConstantList& getFloatConstantList() const { return mFloatConstants; }
 		const FloatConstantList& getFloatConstantList() const { return mFloatConstants; }
 		/// Get a pointer to the 'nth' item in the float buffer
 		/// Get a pointer to the 'nth' item in the float buffer
-		float* getFloatPointer(size_t pos) { return &mFloatConstants[pos]; }
+		float* getFloatPointer(UINT32 pos) { return &mFloatConstants[pos]; }
 		/// Get a pointer to the 'nth' item in the float buffer
 		/// Get a pointer to the 'nth' item in the float buffer
-		const float* getFloatPointer(size_t pos) const { return &mFloatConstants[pos]; }
+		const float* getFloatPointer(UINT32 pos) const { return &mFloatConstants[pos]; }
 		/// Get a reference to the list of int constants
 		/// Get a reference to the list of int constants
 		const IntConstantList& getIntConstantList() const { return mIntConstants; }
 		const IntConstantList& getIntConstantList() const { return mIntConstants; }
 		/// Get a pointer to the 'nth' item in the int buffer
 		/// Get a pointer to the 'nth' item in the int buffer
-		int* getIntPointer(size_t pos) { return &mIntConstants[pos]; }
+		int* getIntPointer(UINT32 pos) { return &mIntConstants[pos]; }
 		/// Get a pointer to the 'nth' item in the int buffer
 		/// Get a pointer to the 'nth' item in the int buffer
-		const int* getIntPointer(size_t pos) const { return &mIntConstants[pos]; }
+		const int* getIntPointer(UINT32 pos) const { return &mIntConstants[pos]; }
 		const GpuLogicalBufferStructPtr& getSamplerLogicalBufferStruct() const { return mSamplerLogicalToPhysical; }
 		const GpuLogicalBufferStructPtr& getSamplerLogicalBufferStruct() const { return mSamplerLogicalToPhysical; }
-		TextureHandle getTexture(size_t pos) const;
-		const SamplerState& getSamplerState(size_t pos) const;
+		TextureHandle getTexture(UINT32 pos) const;
+		const SamplerState& getSamplerState(UINT32 pos) const;
 		/// Get a reference to the list of textures
 		/// Get a reference to the list of textures
 		const TextureList& getTextureList() const { return mTextures; }
 		const TextureList& getTextureList() const { return mTextures; }
-		UINT32 getNumTextures() const { return mTextures.size(); }
+		UINT32 getNumTextures() const { return (UINT32)mTextures.size(); }
 
 
 		/** Tells the program whether to ignore missing parameters or not.
 		/** Tells the program whether to ignore missing parameters or not.
 		*/
 		*/
@@ -857,7 +857,7 @@ namespace CamelotEngine {
 		@param m Pointer to an array of matrices to set
 		@param m Pointer to an array of matrices to set
 		@param numEntries Number of Matrix4 entries
 		@param numEntries Number of Matrix4 entries
 		*/
 		*/
-		void setNamedConstant(const String& name, const Matrix4* m, size_t numEntries);
+		void setNamedConstant(const String& name, const Matrix4* m, UINT32 numEntries);
 		/** Sets a Matrix3 parameter to the program.
 		/** Sets a Matrix3 parameter to the program.
 		@param name The name of the parameter
 		@param name The name of the parameter
 		@param m The value to set
 		@param m The value to set
@@ -879,8 +879,8 @@ namespace CamelotEngine {
 		@param multiple The number of raw entries in each element to write, 
 		@param multiple The number of raw entries in each element to write, 
 		the default is 4 so count = 1 would write 4 floats.
 		the default is 4 so count = 1 would write 4 floats.
 		*/
 		*/
-		void setNamedConstant(const String& name, const float *val, size_t count, 
-			size_t multiple = 4);
+		void setNamedConstant(const String& name, const float *val, UINT32 count, 
+			UINT32 multiple = 4);
 		/** Sets a multiple value constant floating-point parameter to the program.
 		/** Sets a multiple value constant floating-point parameter to the program.
 		@par
 		@par
 		Some systems only allow constants to be set on certain boundaries, 
 		Some systems only allow constants to be set on certain boundaries, 
@@ -897,8 +897,8 @@ namespace CamelotEngine {
 		@param multiple The number of raw entries in each element to write, 
 		@param multiple The number of raw entries in each element to write, 
 		the default is 4 so count = 1 would write 4 floats.
 		the default is 4 so count = 1 would write 4 floats.
 		*/
 		*/
-		void setNamedConstant(const String& name, const double *val, size_t count, 
-			size_t multiple = 4);
+		void setNamedConstant(const String& name, const double *val, UINT32 count, 
+			UINT32 multiple = 4);
 		/** Sets a ColourValue parameter to the program.
 		/** Sets a ColourValue parameter to the program.
 		@param name The name of the parameter
 		@param name The name of the parameter
 		@param colour The value to set
 		@param colour The value to set
@@ -921,8 +921,8 @@ namespace CamelotEngine {
 		@param multiple The number of raw entries in each element to write, 
 		@param multiple The number of raw entries in each element to write, 
 		the default is 4 so count = 1 would write 4 floats.
 		the default is 4 so count = 1 would write 4 floats.
 		*/
 		*/
-		void setNamedConstant(const String& name, const int *val, size_t count, 
-			size_t multiple = 4);
+		void setNamedConstant(const String& name, const int *val, UINT32 count, 
+			UINT32 multiple = 4);
 
 
 		/**
 		/**
 		 * @brief	Returns true if a named constant with the specified name exists.
 		 * @brief	Returns true if a named constant with the specified name exists.
@@ -944,16 +944,16 @@ namespace CamelotEngine {
 		@note Only applicable to low-level programs.
 		@note Only applicable to low-level programs.
 		@param logicalIndex The logical parameter index
 		@param logicalIndex The logical parameter index
 		@param requestedSize The requested size - pass 0 to ignore missing entries
 		@param requestedSize The requested size - pass 0 to ignore missing entries
-		and return std::numeric_limits<size_t>::max() 
+		and return std::numeric_limits<UINT32>::max() 
 		*/
 		*/
-		size_t _getFloatConstantPhysicalIndex(size_t logicalIndex, size_t requestedSize, UINT16 variability);
+		UINT32 _getFloatConstantPhysicalIndex(UINT32 logicalIndex, UINT32 requestedSize, UINT16 variability);
 		/** Gets the physical buffer index associated with a logical int constant index. 
 		/** Gets the physical buffer index associated with a logical int constant index. 
 		@note Only applicable to low-level programs.
 		@note Only applicable to low-level programs.
 		@param logicalIndex The logical parameter index
 		@param logicalIndex The logical parameter index
 		@param requestedSize The requested size - pass 0 to ignore missing entries
 		@param requestedSize The requested size - pass 0 to ignore missing entries
-		and return std::numeric_limits<size_t>::max() 
+		and return std::numeric_limits<UINT32>::max() 
 		*/
 		*/
-		size_t _getIntConstantPhysicalIndex(size_t logicalIndex, size_t requestedSize, UINT16 variability);
+		UINT32 _getIntConstantPhysicalIndex(UINT32 logicalIndex, UINT32 requestedSize, UINT16 variability);
 
 
 		/** Sets whether or not we need to transpose the matrices passed in from the rest of OGRE.
 		/** Sets whether or not we need to transpose the matrices passed in from the rest of OGRE.
 		@remarks
 		@remarks

+ 11 - 11
CamelotRenderer/Include/CmHardwareBuffer.h

@@ -137,11 +137,11 @@ namespace CamelotEngine {
     			
     			
 		    };
 		    };
 	    protected:
 	    protected:
-		    size_t mSizeInBytes;
+		    UINT32 mSizeInBytes;
 		    Usage mUsage;
 		    Usage mUsage;
 		    bool mIsLocked;
 		    bool mIsLocked;
-			size_t mLockStart;
-			size_t mLockSize;
+			UINT32 mLockStart;
+			UINT32 mLockSize;
 			bool mSystemMemory;
 			bool mSystemMemory;
             bool mUseShadowBuffer;
             bool mUseShadowBuffer;
             HardwareBuffer* mpShadowBuffer;
             HardwareBuffer* mpShadowBuffer;
@@ -149,7 +149,7 @@ namespace CamelotEngine {
             bool mSuppressHardwareUpdate;
             bool mSuppressHardwareUpdate;
     		
     		
             /// Internal implementation of lock()
             /// Internal implementation of lock()
-		    virtual void* lockImpl(size_t offset, size_t length, LockOptions options) = 0;
+		    virtual void* lockImpl(UINT32 offset, UINT32 length, LockOptions options) = 0;
             /// Internal implementation of unlock()
             /// Internal implementation of unlock()
 		    virtual void unlockImpl(void) = 0;
 		    virtual void unlockImpl(void) = 0;
 
 
@@ -177,7 +177,7 @@ namespace CamelotEngine {
 		    @param options Locking options
 		    @param options Locking options
 		    @returns Pointer to the locked memory
 		    @returns Pointer to the locked memory
 		    */
 		    */
-		    virtual void* lock(size_t offset, size_t length, LockOptions options)
+		    virtual void* lock(UINT32 offset, UINT32 length, LockOptions options)
             {
             {
                 assert(!isLocked() && "Cannot lock this buffer, it is already locked!");
                 assert(!isLocked() && "Cannot lock this buffer, it is already locked!");
                 void* ret;
                 void* ret;
@@ -249,7 +249,7 @@ namespace CamelotEngine {
             @param pDest The area of memory in which to place the data, must be large enough to 
             @param pDest The area of memory in which to place the data, must be large enough to 
                 accommodate the data!
                 accommodate the data!
             */
             */
-            virtual void readData(size_t offset, size_t length, void* pDest) = 0;
+            virtual void readData(UINT32 offset, UINT32 length, void* pDest) = 0;
             /** Writes data to the buffer from an area of system memory; note that you must
             /** Writes data to the buffer from an area of system memory; note that you must
                 ensure that your buffer is big enough.
                 ensure that your buffer is big enough.
 		    @param offset The byte offset from the start of the buffer to start writing
 		    @param offset The byte offset from the start of the buffer to start writing
@@ -258,7 +258,7 @@ namespace CamelotEngine {
 			@param discardWholeBuffer If true, this allows the driver to discard the entire buffer when writing,
 			@param discardWholeBuffer If true, this allows the driver to discard the entire buffer when writing,
 				such that DMA stalls can be avoided; use if you can.
 				such that DMA stalls can be avoided; use if you can.
             */
             */
-            virtual void writeData(size_t offset, size_t length, const void* pSource,
+            virtual void writeData(UINT32 offset, UINT32 length, const void* pSource,
 					bool discardWholeBuffer = false) = 0;
 					bool discardWholeBuffer = false) = 0;
 
 
 			/** Copy data from another buffer into this one.
 			/** Copy data from another buffer into this one.
@@ -271,8 +271,8 @@ namespace CamelotEngine {
 			@param length Length of the data to copy, in bytes.
 			@param length Length of the data to copy, in bytes.
 			@param discardWholeBuffer If true, will discard the entire contents of this buffer before copying
 			@param discardWholeBuffer If true, will discard the entire contents of this buffer before copying
 			*/
 			*/
-			virtual void copyData(HardwareBuffer& srcBuffer, size_t srcOffset, 
-				size_t dstOffset, size_t length, bool discardWholeBuffer = false)
+			virtual void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, 
+				UINT32 dstOffset, UINT32 length, bool discardWholeBuffer = false)
 			{
 			{
 				const void *srcData = srcBuffer.lock(
 				const void *srcData = srcBuffer.lock(
 					srcOffset, length, HBL_READ_ONLY);
 					srcOffset, length, HBL_READ_ONLY);
@@ -287,7 +287,7 @@ namespace CamelotEngine {
 			*/
 			*/
 			virtual void copyData(HardwareBuffer& srcBuffer)
 			virtual void copyData(HardwareBuffer& srcBuffer)
 			{
 			{
-				size_t sz = std::min(getSizeInBytes(), srcBuffer.getSizeInBytes()); 
+				UINT32 sz = std::min(getSizeInBytes(), srcBuffer.getSizeInBytes()); 
 				copyData(srcBuffer, 0, 0, sz, true);
 				copyData(srcBuffer, 0, 0, sz, true);
 			}
 			}
 			
 			
@@ -317,7 +317,7 @@ namespace CamelotEngine {
             }
             }
 
 
             /// Returns the size of this buffer in bytes
             /// Returns the size of this buffer in bytes
-            size_t getSizeInBytes(void) const { return mSizeInBytes; }
+            UINT32 getSizeInBytes(void) const { return mSizeInBytes; }
             /// Returns the Usage flags with which this buffer was created
             /// Returns the Usage flags with which this buffer was created
             Usage getUsage(void) const { return mUsage; }
             Usage getUsage(void) const { return mUsage; }
 			/// Returns whether this buffer is held in system memory
 			/// Returns whether this buffer is held in system memory

+ 4 - 4
CamelotRenderer/Include/CmHardwareBufferManager.h

@@ -126,7 +126,7 @@ namespace CamelotEngine {
             be synchronised with the real buffer at an appropriate time.
             be synchronised with the real buffer at an appropriate time.
         */
         */
 		virtual HardwareVertexBufferPtr 
 		virtual HardwareVertexBufferPtr 
-            createVertexBuffer(size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage, 
+            createVertexBuffer(UINT32 vertexSize, UINT32 numVerts, HardwareBuffer::Usage usage, 
 			bool useShadowBuffer = false) = 0;
 			bool useShadowBuffer = false) = 0;
 		/** Create a hardware index buffer.
 		/** Create a hardware index buffer.
         @remarks Note that because buffers can be shared, they are reference
         @remarks Note that because buffers can be shared, they are reference
@@ -145,7 +145,7 @@ namespace CamelotEngine {
             be synchronised with the real buffer at an appropriate time.
             be synchronised with the real buffer at an appropriate time.
         */
         */
 		virtual HardwareIndexBufferPtr 
 		virtual HardwareIndexBufferPtr 
-            createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+            createIndexBuffer(HardwareIndexBuffer::IndexType itype, UINT32 numIndexes, 
 			HardwareBuffer::Usage usage, bool useShadowBuffer = false) = 0;
 			HardwareBuffer::Usage usage, bool useShadowBuffer = false) = 0;
 
 
         /** Creates a new vertex declaration. */
         /** Creates a new vertex declaration. */
@@ -194,14 +194,14 @@ namespace CamelotEngine {
 
 
 		/** @copydoc HardwareBufferManagerInterface::createVertexBuffer */
 		/** @copydoc HardwareBufferManagerInterface::createVertexBuffer */
 		HardwareVertexBufferPtr 
 		HardwareVertexBufferPtr 
-            createVertexBuffer(size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage, 
+            createVertexBuffer(UINT32 vertexSize, UINT32 numVerts, HardwareBuffer::Usage usage, 
 			bool useShadowBuffer = false)
 			bool useShadowBuffer = false)
 		{
 		{
 			return mImpl->createVertexBuffer(vertexSize, numVerts, usage, useShadowBuffer);
 			return mImpl->createVertexBuffer(vertexSize, numVerts, usage, useShadowBuffer);
 		}
 		}
 		/** @copydoc HardwareBufferManagerInterface::createIndexBuffer */
 		/** @copydoc HardwareBufferManagerInterface::createIndexBuffer */
 		HardwareIndexBufferPtr 
 		HardwareIndexBufferPtr 
-            createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+            createIndexBuffer(HardwareIndexBuffer::IndexType itype, UINT32 numIndexes, 
 			HardwareBuffer::Usage usage, bool useShadowBuffer = false)
 			HardwareBuffer::Usage usage, bool useShadowBuffer = false)
 		{
 		{
 			return mImpl->createIndexBuffer(itype, numIndexes, usage, useShadowBuffer);
 			return mImpl->createIndexBuffer(itype, numIndexes, usage, useShadowBuffer);

+ 5 - 5
CamelotRenderer/Include/CmHardwareIndexBuffer.h

@@ -53,12 +53,12 @@ namespace CamelotEngine {
 	    protected:
 	    protected:
 			HardwareBufferManagerBase* mMgr;
 			HardwareBufferManagerBase* mMgr;
 		    IndexType mIndexType;
 		    IndexType mIndexType;
-		    size_t mNumIndexes;
-            size_t mIndexSize;
+		    UINT32 mNumIndexes;
+            UINT32 mIndexSize;
 
 
 	    public:
 	    public:
 		    /// Should be called by HardwareBufferManager
 		    /// Should be called by HardwareBufferManager
-		    HardwareIndexBuffer(HardwareBufferManagerBase* mgr, IndexType idxType, size_t numIndexes, HardwareBuffer::Usage usage,
+		    HardwareIndexBuffer(HardwareBufferManagerBase* mgr, IndexType idxType, UINT32 numIndexes, HardwareBuffer::Usage usage,
                 bool useSystemMemory, bool useShadowBuffer);
                 bool useSystemMemory, bool useShadowBuffer);
             ~HardwareIndexBuffer();
             ~HardwareIndexBuffer();
 			/// Return the manager of this buffer, if any
 			/// Return the manager of this buffer, if any
@@ -66,9 +66,9 @@ namespace CamelotEngine {
     		/// Get the type of indexes used in this buffer
     		/// Get the type of indexes used in this buffer
             IndexType getType(void) const { return mIndexType; }
             IndexType getType(void) const { return mIndexType; }
             /// Get the number of indexes in this buffer
             /// Get the number of indexes in this buffer
-            size_t getNumIndexes(void) const { return mNumIndexes; }
+            UINT32 getNumIndexes(void) const { return mNumIndexes; }
             /// Get the size in bytes of each index
             /// Get the size in bytes of each index
-            size_t getIndexSize(void) const { return mIndexSize; }
+            UINT32 getIndexSize(void) const { return mIndexSize; }
 
 
 		    // NB subclasses should override lock, unlock, readData, writeData
 		    // NB subclasses should override lock, unlock, readData, writeData
     };
     };

+ 12 - 12
CamelotRenderer/Include/CmHardwarePixelBuffer.h

@@ -51,9 +51,9 @@ namespace CamelotEngine {
     {
     {
     protected: 
     protected: 
         // Extents
         // Extents
-        size_t mWidth, mHeight, mDepth;
+        UINT32 mWidth, mHeight, mDepth;
         // Pitches (offsets between rows and slices)
         // Pitches (offsets between rows and slices)
-        size_t mRowPitch, mSlicePitch;
+        UINT32 mRowPitch, mSlicePitch;
         // Internal format
         // Internal format
         PixelFormat mFormat;
         PixelFormat mFormat;
         // Currently locked region (local coords)
         // Currently locked region (local coords)
@@ -67,7 +67,7 @@ namespace CamelotEngine {
 
 
         /// Internal implementation of lock(), do not OVERRIDE or CALL this
         /// Internal implementation of lock(), do not OVERRIDE or CALL this
         /// for HardwarePixelBuffer implementations, but override the previous method
         /// for HardwarePixelBuffer implementations, but override the previous method
-        virtual void* lockImpl(size_t offset, size_t length, LockOptions options);
+        virtual void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);
 
 
         /// Internal implementation of unlock(), must be overridden in subclasses
         /// Internal implementation of unlock(), must be overridden in subclasses
         // virtual void unlockImpl(void) = 0;
         // virtual void unlockImpl(void) = 0;
@@ -75,11 +75,11 @@ namespace CamelotEngine {
 		/** Notify TextureBuffer of destruction of render target.
 		/** Notify TextureBuffer of destruction of render target.
 			Called by RenderTexture when destroyed.
 			Called by RenderTexture when destroyed.
 		*/
 		*/
-		virtual void _clearSliceRTT(size_t zoffset);
+		virtual void _clearSliceRTT(UINT32 zoffset);
 		friend class RenderTexture;
 		friend class RenderTexture;
     public:
     public:
         /// Should be called by HardwareBufferManager
         /// Should be called by HardwareBufferManager
-        HardwarePixelBuffer(size_t mWidth, size_t mHeight, size_t mDepth,
+        HardwarePixelBuffer(UINT32 mWidth, UINT32 mHeight, UINT32 mDepth,
                 PixelFormat mFormat,
                 PixelFormat mFormat,
                 HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer);
                 HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer);
         ~HardwarePixelBuffer();
         ~HardwarePixelBuffer();
@@ -97,7 +97,7 @@ namespace CamelotEngine {
 		*/
 		*/
 		virtual const PixelData& lock(const Box& lockBox, LockOptions options);
 		virtual const PixelData& lock(const Box& lockBox, LockOptions options);
 		/// @copydoc HardwareBuffer::lock
 		/// @copydoc HardwareBuffer::lock
-        virtual void* lock(size_t offset, size_t length, LockOptions options);
+        virtual void* lock(UINT32 offset, UINT32 length, LockOptions options);
 
 
 		/** Get the current locked region. This is the same value as returned
 		/** Get the current locked region. This is the same value as returned
 		    by lock(const Image::Box, LockOptions)
 		    by lock(const Image::Box, LockOptions)
@@ -106,9 +106,9 @@ namespace CamelotEngine {
         const PixelData& getCurrentLock();
         const PixelData& getCurrentLock();
 		
 		
 		/// @copydoc HardwareBuffer::readData
 		/// @copydoc HardwareBuffer::readData
-		virtual void readData(size_t offset, size_t length, void* pDest);
+		virtual void readData(UINT32 offset, UINT32 length, void* pDest);
 		/// @copydoc HardwareBuffer::writeData
 		/// @copydoc HardwareBuffer::writeData
-		virtual void writeData(size_t offset, size_t length, const void* pSource,
+		virtual void writeData(UINT32 offset, UINT32 length, const void* pSource,
 				bool discardWholeBuffer = false);
 				bool discardWholeBuffer = false);
         
         
         /** Copies a box from another PixelBuffer to a region of the 
         /** Copies a box from another PixelBuffer to a region of the 
@@ -177,14 +177,14 @@ namespace CamelotEngine {
             @returns A pointer to the render target. This pointer has the lifespan of this
             @returns A pointer to the render target. This pointer has the lifespan of this
             PixelBuffer.
             PixelBuffer.
         */
         */
-        virtual RenderTexture *getRenderTarget(size_t slice=0);
+        virtual RenderTexture *getRenderTarget(UINT32 slice=0);
         
         
         /// Gets the width of this buffer
         /// Gets the width of this buffer
-        size_t getWidth() const { return mWidth; }
+        UINT32 getWidth() const { return mWidth; }
         /// Gets the height of this buffer
         /// Gets the height of this buffer
-        size_t getHeight() const { return mHeight; }
+        UINT32 getHeight() const { return mHeight; }
         /// Gets the depth of this buffer
         /// Gets the depth of this buffer
-        size_t getDepth() const { return mDepth; }
+        UINT32 getDepth() const { return mDepth; }
         /// Gets the native pixel format of this buffer
         /// Gets the native pixel format of this buffer
         PixelFormat getFormat() const { return mFormat; }
         PixelFormat getFormat() const { return mFormat; }
     };
     };

+ 16 - 16
CamelotRenderer/Include/CmHardwareVertexBuffer.h

@@ -49,20 +49,20 @@ namespace CamelotEngine {
 	    protected:
 	    protected:
 
 
 			HardwareBufferManagerBase* mMgr;
 			HardwareBufferManagerBase* mMgr;
-		    size_t mNumVertices;
-            size_t mVertexSize;
+		    UINT32 mNumVertices;
+            UINT32 mVertexSize;
 
 
 	    public:
 	    public:
 		    /// Should be called by HardwareBufferManager
 		    /// Should be called by HardwareBufferManager
-		    HardwareVertexBuffer(HardwareBufferManagerBase* mgr, size_t vertexSize, size_t numVertices,
+		    HardwareVertexBuffer(HardwareBufferManagerBase* mgr, UINT32 vertexSize, UINT32 numVertices,
                 HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer);
                 HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer);
             ~HardwareVertexBuffer();
             ~HardwareVertexBuffer();
 			/// Return the manager of this buffer, if any
 			/// Return the manager of this buffer, if any
 			HardwareBufferManagerBase* getManager() const { return mMgr; }
 			HardwareBufferManagerBase* getManager() const { return mMgr; }
             /// Gets the size in bytes of a single vertex in this buffer
             /// Gets the size in bytes of a single vertex in this buffer
-            size_t getVertexSize(void) const { return mVertexSize; }
+            UINT32 getVertexSize(void) const { return mVertexSize; }
             /// Get the number of vertices in this buffer
             /// Get the number of vertices in this buffer
-            size_t getNumVertices(void) const { return mNumVertices; }
+            UINT32 getNumVertices(void) const { return mNumVertices; }
 
 
 
 
 
 
@@ -130,7 +130,7 @@ namespace CamelotEngine {
         /// The source vertex buffer, as bound to an index using VertexBufferBinding
         /// The source vertex buffer, as bound to an index using VertexBufferBinding
         unsigned short mSource;
         unsigned short mSource;
         /// The offset in the buffer that this element starts at
         /// The offset in the buffer that this element starts at
-        size_t mOffset;
+        UINT32 mOffset;
         /// The type of element
         /// The type of element
         VertexElementType mType;
         VertexElementType mType;
         /// The meaning of the element
         /// The meaning of the element
@@ -141,12 +141,12 @@ namespace CamelotEngine {
 		/// Constructor, should not be called directly, only needed because of list
 		/// Constructor, should not be called directly, only needed because of list
 		VertexElement() {}
 		VertexElement() {}
         /// Constructor, should not be called directly, call VertexDeclaration::addElement
         /// Constructor, should not be called directly, call VertexDeclaration::addElement
-        VertexElement(unsigned short source, size_t offset, VertexElementType theType,
+        VertexElement(unsigned short source, UINT32 offset, VertexElementType theType,
             VertexElementSemantic semantic, unsigned short index = 0);
             VertexElementSemantic semantic, unsigned short index = 0);
         /// Gets the vertex buffer index from where this element draws it's values
         /// Gets the vertex buffer index from where this element draws it's values
         unsigned short getSource(void) const { return mSource; }
         unsigned short getSource(void) const { return mSource; }
         /// Gets the offset into the buffer where this element starts
         /// Gets the offset into the buffer where this element starts
-        size_t getOffset(void) const { return mOffset; }
+        UINT32 getOffset(void) const { return mOffset; }
         /// Gets the data format of this element
         /// Gets the data format of this element
         VertexElementType getType(void) const { return mType; }
         VertexElementType getType(void) const { return mType; }
         /// Gets the meaning of this element
         /// Gets the meaning of this element
@@ -154,9 +154,9 @@ namespace CamelotEngine {
         /// Gets the index of this element, only applicable for repeating elements
         /// Gets the index of this element, only applicable for repeating elements
         unsigned short getIndex(void) const { return mIndex; }
         unsigned short getIndex(void) const { return mIndex; }
 		/// Gets the size of this element in bytes
 		/// Gets the size of this element in bytes
-		size_t getSize(void) const;
+		UINT32 getSize(void) const;
 		/// Utility method for helping to calculate offsets
 		/// Utility method for helping to calculate offsets
-		static size_t getTypeSize(VertexElementType etype);
+		static UINT32 getTypeSize(VertexElementType etype);
 		/// Utility method which returns the count of values in a given type
 		/// Utility method which returns the count of values in a given type
 		static unsigned short getTypeCount(VertexElementType etype);
 		static unsigned short getTypeCount(VertexElementType etype);
 		/** Simple converter function which will turn a single-value type into a
 		/** Simple converter function which will turn a single-value type into a
@@ -309,7 +309,7 @@ namespace CamelotEngine {
         virtual ~VertexDeclaration();
         virtual ~VertexDeclaration();
 
 
         /** Get the number of elements in the declaration. */
         /** Get the number of elements in the declaration. */
-        size_t getElementCount(void) { return mElementList.size(); }
+        UINT32 getElementCount(void) { return (UINT32)mElementList.size(); }
         /** Gets read-only access to the list of vertex elements. */
         /** Gets read-only access to the list of vertex elements. */
         const VertexElementList& getElements(void) const;
         const VertexElementList& getElements(void) const;
         /** Get a single element. */
         /** Get a single element. */
@@ -355,7 +355,7 @@ namespace CamelotEngine {
         @param index Optional index for multi-input elements like texture coordinates
         @param index Optional index for multi-input elements like texture coordinates
 		@returns A reference to the VertexElement added.
 		@returns A reference to the VertexElement added.
         */
         */
-        virtual const VertexElement& addElement(unsigned short source, size_t offset, VertexElementType theType,
+        virtual const VertexElement& addElement(unsigned short source, UINT32 offset, VertexElementType theType,
             VertexElementSemantic semantic, unsigned short index = 0);
             VertexElementSemantic semantic, unsigned short index = 0);
         /** Inserts a new VertexElement at a given position in this declaration.
         /** Inserts a new VertexElement at a given position in this declaration.
         @remarks
         @remarks
@@ -371,7 +371,7 @@ namespace CamelotEngine {
         @returns A reference to the VertexElement added.
         @returns A reference to the VertexElement added.
         */
         */
         virtual const VertexElement& insertElement(unsigned short atPosition,
         virtual const VertexElement& insertElement(unsigned short atPosition,
-            unsigned short source, size_t offset, VertexElementType theType,
+            unsigned short source, UINT32 offset, VertexElementType theType,
             VertexElementSemantic semantic, unsigned short index = 0);
             VertexElementSemantic semantic, unsigned short index = 0);
 
 
         /** Remove the element at the given index from this declaration. */
         /** Remove the element at the given index from this declaration. */
@@ -393,7 +393,7 @@ namespace CamelotEngine {
 	   <b>Please read the information in VertexDeclaration about
 	   <b>Please read the information in VertexDeclaration about
 	    the importance of ordering and structure for compatibility with older D3D drivers</b>.
 	    the importance of ordering and structure for compatibility with older D3D drivers</b>.
 	 */
 	 */
-        virtual void modifyElement(unsigned short elem_index, unsigned short source, size_t offset, VertexElementType theType,
+        virtual void modifyElement(unsigned short elem_index, unsigned short source, UINT32 offset, VertexElementType theType,
             VertexElementSemantic semantic, unsigned short index = 0);
             VertexElementSemantic semantic, unsigned short index = 0);
 
 
 		/** Finds a VertexElement with the given semantic, and index if there is more than
 		/** Finds a VertexElement with the given semantic, and index if there is more than
@@ -414,7 +414,7 @@ namespace CamelotEngine {
 		virtual VertexElementList findElementsBySource(unsigned short source);
 		virtual VertexElementList findElementsBySource(unsigned short source);
 
 
 		/** Gets the vertex size defined by this declaration for a given source. */
 		/** Gets the vertex size defined by this declaration for a given source. */
-        virtual size_t getVertexSize(unsigned short source);
+        virtual UINT32 getVertexSize(unsigned short source);
 
 
         /** Clones this declaration. 
         /** Clones this declaration. 
 		@param mgr Optional HardwareBufferManager to use for creating the clone
 		@param mgr Optional HardwareBufferManager to use for creating the clone
@@ -501,7 +501,7 @@ namespace CamelotEngine {
 		/// Gets whether a buffer is bound to the given source index
 		/// Gets whether a buffer is bound to the given source index
 		virtual bool isBufferBound(unsigned short index) const;
 		virtual bool isBufferBound(unsigned short index) const;
 
 
-        virtual size_t getBufferCount(void) const { return mBindingMap.size(); }
+        virtual UINT32 getBufferCount(void) const { return (UINT32)mBindingMap.size(); }
 
 
 		/** Gets the highest index which has already been set, plus 1.
 		/** Gets the highest index which has already been set, plus 1.
 		@remarks
 		@remarks

+ 5 - 5
CamelotRenderer/Include/CmMaterialRTTI.h

@@ -210,7 +210,7 @@ namespace CamelotEngine
 
 
 			UINT32 getNumFloatParams(MaterialParams* obj)
 			UINT32 getNumFloatParams(MaterialParams* obj)
 			{
 			{
-				return obj->mFloatParams.size();
+				return (UINT32)obj->mFloatParams.size();
 			}
 			}
 
 
 			std::shared_ptr<TexParamKVP> getTexParam(MaterialParams* obj, UINT32 idx)
 			std::shared_ptr<TexParamKVP> getTexParam(MaterialParams* obj, UINT32 idx)
@@ -242,7 +242,7 @@ namespace CamelotEngine
 
 
 			UINT32 getNumTexParams(MaterialParams* obj)
 			UINT32 getNumTexParams(MaterialParams* obj)
 			{
 			{
-				return obj->mTextureParams.size();
+				return (UINT32)obj->mTextureParams.size();
 			}
 			}
 
 
 			std::shared_ptr<SamplerStateKVP> getSamplerStateParam(MaterialParams* obj, UINT32 idx)
 			std::shared_ptr<SamplerStateKVP> getSamplerStateParam(MaterialParams* obj, UINT32 idx)
@@ -274,15 +274,15 @@ namespace CamelotEngine
 
 
 			UINT32 getNumSamplerStateParams(MaterialParams* obj)
 			UINT32 getNumSamplerStateParams(MaterialParams* obj)
 			{
 			{
-				return obj->mSamplerStateParams.size();
+				return (UINT32)obj->mSamplerStateParams.size();
 			}
 			}
 
 
 			ManagedDataBlock getFloatBuffer(MaterialParams* obj)
 			ManagedDataBlock getFloatBuffer(MaterialParams* obj)
 			{
 			{
-				size_t bufferSize = obj->mFloatBuffer.size();
+				UINT32 bufferSize = (UINT32)obj->mFloatBuffer.size();
 				float* buffer = new float[bufferSize];
 				float* buffer = new float[bufferSize];
 
 
-				for(size_t i = 0; i < bufferSize; i++)
+				for(UINT32 i = 0; i < bufferSize; i++)
 					buffer[i] = obj->mFloatBuffer[i];
 					buffer[i] = obj->mFloatBuffer[i];
 
 
 				return ManagedDataBlock((UINT8*)buffer, bufferSize, true);
 				return ManagedDataBlock((UINT8*)buffer, bufferSize, true);

+ 2 - 2
CamelotRenderer/Include/CmMeshDataRTTI.h

@@ -89,7 +89,7 @@ namespace CamelotEngine
 
 
 		UINT32 getSubmeshArraySize(MeshData* obj)
 		UINT32 getSubmeshArraySize(MeshData* obj)
 		{
 		{
-			return obj->subMeshes.size();
+			return (UINT32)obj->subMeshes.size();
 		}
 		}
 
 
 		void setSubmeshArraySize(MeshData* obj, UINT32 size)
 		void setSubmeshArraySize(MeshData* obj, UINT32 size)
@@ -128,7 +128,7 @@ namespace CamelotEngine
 
 
 		UINT32 getVertexDataArraySize(MeshData* obj)
 		UINT32 getVertexDataArraySize(MeshData* obj)
 		{
 		{
-			return obj->vertexBuffers.size();
+			return (UINT32)obj->vertexBuffers.size();
 		}
 		}
 
 
 		void setVertexDataArraySize(MeshData* obj, UINT32 size)
 		void setVertexDataArraySize(MeshData* obj, UINT32 size)

+ 1 - 1
CamelotRenderer/Include/CmShader.h

@@ -29,7 +29,7 @@ namespace CamelotEngine
 		void removeTechnique(UINT32 idx);
 		void removeTechnique(UINT32 idx);
 		void removeTechnique(TechniquePtr technique);
 		void removeTechnique(TechniquePtr technique);
 
 
-		UINT32 getNumTechniques() const { return mTechniques.size(); }
+		UINT32 getNumTechniques() const { return (UINT32)mTechniques.size(); }
 
 
 		/**
 		/**
 		 * @brief	Gets the best supported technique based on current render and other systems.
 		 * @brief	Gets the best supported technique based on current render and other systems.

+ 1 - 1
CamelotRenderer/Include/CmShaderRTTI.h

@@ -21,7 +21,7 @@ namespace CamelotEngine
 
 
 		UINT32 getTechniqueArraySize(Shader* obj)
 		UINT32 getTechniqueArraySize(Shader* obj)
 		{
 		{
-			return obj->mTechniques.size();
+			return (UINT32)obj->mTechniques.size();
 		}
 		}
 
 
 		void setTechniqueArraySize(Shader* obj, UINT32 size)
 		void setTechniqueArraySize(Shader* obj, UINT32 size)

+ 1 - 1
CamelotRenderer/Include/CmTechnique.h

@@ -14,7 +14,7 @@ namespace CamelotEngine
 		void removePass(UINT32 idx);
 		void removePass(UINT32 idx);
 		PassPtr getPass(UINT32 idx) const;
 		PassPtr getPass(UINT32 idx) const;
 
 
-		UINT32 getNumPasses() const { return mPasses.size(); }
+		UINT32 getNumPasses() const { return (UINT32)mPasses.size(); }
 
 
 		bool isSupported() const;
 		bool isSupported() const;
 
 

+ 1 - 1
CamelotRenderer/Include/CmTechniqueRTTI.h

@@ -27,7 +27,7 @@ namespace CamelotEngine
 
 
 		UINT32 getPassArraySize(Technique* obj)
 		UINT32 getPassArraySize(Technique* obj)
 		{
 		{
-			return obj->mPasses.size();
+			return (UINT32)obj->mPasses.size();
 		}
 		}
 
 
 		void setPassArraySize(Technique* obj, UINT32 size)
 		void setPassArraySize(Technique* obj, UINT32 size)

+ 12 - 12
CamelotRenderer/Include/CmTexture.h

@@ -100,7 +100,7 @@ namespace CamelotEngine {
 
 
         /** Gets the number of mipmaps to be used for this texture.
         /** Gets the number of mipmaps to be used for this texture.
         */
         */
-        virtual size_t getNumMipmaps(void) const {return mNumMipmaps;}
+        virtual UINT32 getNumMipmaps(void) const {return mNumMipmaps;}
 
 
 		/** Gets whether this texture will be set up so that on sampling it, 
 		/** Gets whether this texture will be set up so that on sampling it, 
 		hardware gamma correction is applied.
 		hardware gamma correction is applied.
@@ -118,15 +118,15 @@ namespace CamelotEngine {
 
 
 		/** Returns the height of the texture.
 		/** Returns the height of the texture.
         */
         */
-        virtual size_t getHeight(void) const { return mHeight; }
+        virtual UINT32 getHeight(void) const { return mHeight; }
 
 
         /** Returns the width of the texture.
         /** Returns the width of the texture.
         */
         */
-        virtual size_t getWidth(void) const { return mWidth; }
+        virtual UINT32 getWidth(void) const { return mWidth; }
 
 
         /** Returns the depth of the texture (only applicable for 3D textures).
         /** Returns the depth of the texture (only applicable for 3D textures).
         */
         */
-        virtual size_t getDepth(void) const { return mDepth; }
+        virtual UINT32 getDepth(void) const { return mDepth; }
 
 
         /** Returns the TextureUsage indentifier for this Texture
         /** Returns the TextureUsage indentifier for this Texture
         */
         */
@@ -141,7 +141,7 @@ namespace CamelotEngine {
         /** Return the number of faces this texture has. This will be 6 for a cubemap
         /** Return the number of faces this texture has. This will be 6 for a cubemap
         	texture and 1 for a 1D, 2D or 3D one.
         	texture and 1 for a 1D, 2D or 3D one.
         */
         */
-        virtual size_t getNumFaces() const;
+        virtual UINT32 getNumFaces() const;
 
 
 		/** Return hardware pixel buffer for a surface. This buffer can then
 		/** Return hardware pixel buffer for a surface. This buffer can then
 			be used to copy data from and to a particular level of the texture.
 			be used to copy data from and to a particular level of the texture.
@@ -155,7 +155,7 @@ namespace CamelotEngine {
 			@remarks	The buffer is invalidated when the resource is unloaded or destroyed.
 			@remarks	The buffer is invalidated when the resource is unloaded or destroyed.
 						Do not use it after the lifetime of the containing texture.
 						Do not use it after the lifetime of the containing texture.
 		*/
 		*/
-		virtual HardwarePixelBufferPtr getBuffer_internal(size_t face=0, size_t mipmap=0) = 0;
+		virtual HardwarePixelBufferPtr getBuffer_internal(UINT32 face=0, UINT32 mipmap=0) = 0;
 		
 		
 		/** Retrieve a platform or API-specific piece of information from this texture.
 		/** Retrieve a platform or API-specific piece of information from this texture.
 		 This method of retrieving information should only be used if you know what you're doing.
 		 This method of retrieving information should only be used if you know what you're doing.
@@ -226,11 +226,11 @@ namespace CamelotEngine {
     protected:
     protected:
 		friend class TextureManager;
 		friend class TextureManager;
 
 
-        size_t mHeight;
-        size_t mWidth;
-        size_t mDepth;
+        UINT32 mHeight;
+        UINT32 mWidth;
+        UINT32 mDepth;
 
 
-		size_t mNumMipmaps;
+		UINT32 mNumMipmaps;
 		bool mHwGamma;
 		bool mHwGamma;
 		UINT32 mFSAA;
 		UINT32 mFSAA;
 		String mFSAAHint;
 		String mFSAAHint;
@@ -247,7 +247,7 @@ namespace CamelotEngine {
 		 * 			
 		 * 			
 		 * @note	Initialization is not done immediately, and is instead just scheduled on the render thread.
 		 * @note	Initialization is not done immediately, and is instead just scheduled on the render thread.
 		 */
 		 */
-		void initialize(TextureType textureType, size_t width, size_t height, size_t depth, size_t numMipmaps, 
+		void initialize(TextureType textureType, UINT32 width, UINT32 height, UINT32 depth, UINT32 numMipmaps, 
 			PixelFormat format, int usage, bool hwGamma, UINT32 fsaa, const String& fsaaHint);
 			PixelFormat format, int usage, bool hwGamma, UINT32 fsaa, const String& fsaaHint);
 		
 		
 		/**
 		/**
@@ -256,7 +256,7 @@ namespace CamelotEngine {
 		virtual void initialize_internal() = 0;
 		virtual void initialize_internal() = 0;
 
 
 		/// @copydoc Resource::calculateSize
 		/// @copydoc Resource::calculateSize
-		size_t calculateSize(void) const;
+		UINT32 calculateSize(void) const;
 
 
         /** Creates the internal texture resources for this texture. 
         /** Creates the internal texture resources for this texture. 
         @remarks
         @remarks

+ 4 - 4
CamelotRenderer/Include/CmTextureRTTI.h

@@ -29,8 +29,8 @@ namespace CamelotEngine
 
 
 		PixelDataPtr getPixelData(Texture* obj, UINT32 idx)
 		PixelDataPtr getPixelData(Texture* obj, UINT32 idx)
 		{
 		{
-			size_t face = (size_t)Math::Floor(idx / (float)(obj->getNumMipmaps() + 1));
-			size_t mipmap = idx % (obj->getNumMipmaps() + 1);
+			UINT32 face = (size_t)Math::Floor(idx / (float)(obj->getNumMipmaps() + 1));
+			UINT32 mipmap = idx % (obj->getNumMipmaps() + 1);
 
 
 			return obj->getRawPixels(face, mipmap);
 			return obj->getRawPixels(face, mipmap);
 		}
 		}
@@ -97,8 +97,8 @@ namespace CamelotEngine
 			vector<PixelDataPtr>::type* pixelData = boost::any_cast<vector<PixelDataPtr>::type*>(texture->mRTTIData);
 			vector<PixelDataPtr>::type* pixelData = boost::any_cast<vector<PixelDataPtr>::type*>(texture->mRTTIData);
 			for(size_t i = 0; i < pixelData->size(); i++)
 			for(size_t i = 0; i < pixelData->size(); i++)
 			{
 			{
-				size_t face = (size_t)Math::Floor(i / (float)(texture->getNumMipmaps() + 1));
-				size_t mipmap = i % (texture->getNumMipmaps() + 1);
+				UINT32 face = (size_t)Math::Floor(i / (float)(texture->getNumMipmaps() + 1));
+				UINT32 mipmap = i % (texture->getNumMipmaps() + 1);
 
 
 				texture->setRawPixels_async(*pixelData->at(i), face, mipmap);
 				texture->setRawPixels_async(*pixelData->at(i), face, mipmap);
 			}
 			}

+ 2 - 2
CamelotRenderer/Include/CmVertexDeclarationRTTI.h

@@ -29,12 +29,12 @@ namespace CamelotEngine
 
 
 		UINT32 getElementArraySize(VertexDeclaration* obj)
 		UINT32 getElementArraySize(VertexDeclaration* obj)
 		{
 		{
-			return obj->mElementList.size();
+			return (UINT32)obj->mElementList.size();
 		}
 		}
 
 
 		void setElementArraySize(VertexDeclaration* obj, UINT32 size)
 		void setElementArraySize(VertexDeclaration* obj, UINT32 size)
 		{
 		{
-			for(UINT32 i = obj->mElementList.size(); i < size; i++)
+			for(size_t i = obj->mElementList.size(); i < size; i++)
 				obj->mElementList.push_back(VertexElement());
 				obj->mElementList.push_back(VertexElement());
 		}
 		}
 
 

+ 4 - 4
CamelotRenderer/Include/CmVertexIndexData.h

@@ -84,9 +84,9 @@ namespace CamelotEngine {
 		/// Whether this class should delete the declaration and binding
 		/// Whether this class should delete the declaration and binding
 		bool mDeleteDclBinding;
 		bool mDeleteDclBinding;
 		/// The base vertex index to start from
 		/// The base vertex index to start from
-		size_t vertexStart;
+		UINT32 vertexStart;
 		/// The number of vertices used in this operation
 		/// The number of vertices used in this operation
-		size_t vertexCount;
+		UINT32 vertexCount;
 		
 		
 		/** Clones this vertex data, potentially including replicating any vertex buffers.
 		/** Clones this vertex data, potentially including replicating any vertex buffers.
 		@param copyData Whether to create new vertex buffers too or just reference the existing ones
 		@param copyData Whether to create new vertex buffers too or just reference the existing ones
@@ -218,10 +218,10 @@ namespace CamelotEngine {
 		HardwareIndexBufferPtr indexBuffer;
 		HardwareIndexBufferPtr indexBuffer;
 
 
 		/// index in the buffer to start from for this operation
 		/// index in the buffer to start from for this operation
-		size_t indexStart;
+		UINT32 indexStart;
 
 
 		/// The number of indexes to use from the buffer
 		/// The number of indexes to use from the buffer
-		size_t indexCount;
+		UINT32 indexCount;
 
 
 		/** Clones this index data, potentially including replicating the index buffer.
 		/** Clones this index data, potentially including replicating the index buffer.
 		@param copyData Whether to create new buffers too or just reference the existing ones
 		@param copyData Whether to create new buffers too or just reference the existing ones

+ 3 - 3
CamelotRenderer/Source/CmCgProgram.cpp

@@ -216,7 +216,7 @@ namespace CamelotEngine {
         recurseParams(cgGetFirstParameter(mCgProgram, CG_GLOBAL));
         recurseParams(cgGetFirstParameter(mCgProgram, CG_GLOBAL));
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-	void CgProgram::recurseParams(CGparameter parameter, size_t contextArraySize) const
+	void CgProgram::recurseParams(CGparameter parameter, UINT32 contextArraySize) const
 	{
 	{
 		while (parameter != 0)
 		while (parameter != 0)
         {
         {
@@ -245,12 +245,12 @@ namespace CamelotEngine {
 				default:
 				default:
 					// Normal path (leaf)
 					// Normal path (leaf)
 					String paramName = cgGetParameterName(parameter);
 					String paramName = cgGetParameterName(parameter);
-					size_t logicalIndex = cgGetParameterResourceIndex(parameter);
+					UINT32 logicalIndex = (UINT32)cgGetParameterResourceIndex(parameter);
 
 
 					// Get the parameter resource, to calculate the physical index
 					// Get the parameter resource, to calculate the physical index
 					CGresource res = cgGetParameterResource(parameter);
 					CGresource res = cgGetParameterResource(parameter);
 					bool isRegisterCombiner = false;
 					bool isRegisterCombiner = false;
-					size_t regCombinerPhysicalIndex = 0;
+					UINT32 regCombinerPhysicalIndex = 0;
 					switch (res)
 					switch (res)
 					{
 					{
 					case CG_COMBINER_STAGE_CONST0:
 					case CG_COMBINER_STAGE_CONST0:

+ 14 - 14
CamelotRenderer/Source/CmDefaultHardwareBufferManager.cpp

@@ -30,7 +30,7 @@ THE SOFTWARE.
 
 
 namespace CamelotEngine {
 namespace CamelotEngine {
 
 
-	DefaultHardwareVertexBuffer::DefaultHardwareVertexBuffer(size_t vertexSize, size_t numVertices, 
+	DefaultHardwareVertexBuffer::DefaultHardwareVertexBuffer(UINT32 vertexSize, UINT32 numVertices, 
 															 HardwareBuffer::Usage usage)
 															 HardwareBuffer::Usage usage)
 	: HardwareVertexBuffer(0, vertexSize, numVertices, usage, true, false) // always software, never shadowed
 	: HardwareVertexBuffer(0, vertexSize, numVertices, usage, true, false) // always software, never shadowed
 	{
 	{
@@ -38,7 +38,7 @@ namespace CamelotEngine {
         mpData = static_cast<unsigned char*>(_aligned_malloc(mSizeInBytes, CM_SIMD_ALIGNMENT));
         mpData = static_cast<unsigned char*>(_aligned_malloc(mSizeInBytes, CM_SIMD_ALIGNMENT));
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-	DefaultHardwareVertexBuffer::DefaultHardwareVertexBuffer(HardwareBufferManagerBase* mgr, size_t vertexSize, size_t numVertices, 
+	DefaultHardwareVertexBuffer::DefaultHardwareVertexBuffer(HardwareBufferManagerBase* mgr, UINT32 vertexSize, UINT32 numVertices, 
 		HardwareBuffer::Usage usage)
 		HardwareBuffer::Usage usage)
         : HardwareVertexBuffer(mgr, vertexSize, numVertices, usage, true, false) // always software, never shadowed
         : HardwareVertexBuffer(mgr, vertexSize, numVertices, usage, true, false) // always software, never shadowed
 	{
 	{
@@ -51,7 +51,7 @@ namespace CamelotEngine {
 		_aligned_free(mpData);
 		_aligned_free(mpData);
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void* DefaultHardwareVertexBuffer::lockImpl(size_t offset, size_t length, LockOptions options)
+    void* DefaultHardwareVertexBuffer::lockImpl(UINT32 offset, UINT32 length, LockOptions options)
 	{
 	{
         // Only for use internally, no 'locking' as such
         // Only for use internally, no 'locking' as such
 		return mpData + offset;
 		return mpData + offset;
@@ -62,7 +62,7 @@ namespace CamelotEngine {
         // Nothing to do
         // Nothing to do
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void* DefaultHardwareVertexBuffer::lock(size_t offset, size_t length, LockOptions options)
+    void* DefaultHardwareVertexBuffer::lock(UINT32 offset, UINT32 length, LockOptions options)
 	{
 	{
         mIsLocked = true;
         mIsLocked = true;
 		return mpData + offset;
 		return mpData + offset;
@@ -74,13 +74,13 @@ namespace CamelotEngine {
         // Nothing to do
         // Nothing to do
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void DefaultHardwareVertexBuffer::readData(size_t offset, size_t length, void* pDest)
+    void DefaultHardwareVertexBuffer::readData(UINT32 offset, UINT32 length, void* pDest)
 	{
 	{
 		assert((offset + length) <= mSizeInBytes);
 		assert((offset + length) <= mSizeInBytes);
 		memcpy(pDest, mpData + offset, length);
 		memcpy(pDest, mpData + offset, length);
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void DefaultHardwareVertexBuffer::writeData(size_t offset, size_t length, const void* pSource,
+    void DefaultHardwareVertexBuffer::writeData(UINT32 offset, UINT32 length, const void* pSource,
 			bool discardWholeBuffer)
 			bool discardWholeBuffer)
 	{
 	{
 		assert((offset + length) <= mSizeInBytes);
 		assert((offset + length) <= mSizeInBytes);
@@ -91,7 +91,7 @@ namespace CamelotEngine {
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
 
 
 	DefaultHardwareIndexBuffer::DefaultHardwareIndexBuffer(IndexType idxType, 
 	DefaultHardwareIndexBuffer::DefaultHardwareIndexBuffer(IndexType idxType, 
-		size_t numIndexes, HardwareBuffer::Usage usage) 
+		UINT32 numIndexes, HardwareBuffer::Usage usage) 
 		: HardwareIndexBuffer(0, idxType, numIndexes, usage, true, false) // always software, never shadowed
 		: HardwareIndexBuffer(0, idxType, numIndexes, usage, true, false) // always software, never shadowed
 	{
 	{
 		mpData = (unsigned char*)malloc(sizeof(unsigned char) * mSizeInBytes);
 		mpData = (unsigned char*)malloc(sizeof(unsigned char) * mSizeInBytes);
@@ -102,7 +102,7 @@ namespace CamelotEngine {
 		free(mpData);
 		free(mpData);
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void* DefaultHardwareIndexBuffer::lockImpl(size_t offset, size_t length, LockOptions options)
+    void* DefaultHardwareIndexBuffer::lockImpl(UINT32 offset, UINT32 length, LockOptions options)
 	{
 	{
         // Only for use internally, no 'locking' as such
         // Only for use internally, no 'locking' as such
 		return mpData + offset;
 		return mpData + offset;
@@ -113,7 +113,7 @@ namespace CamelotEngine {
         // Nothing to do
         // Nothing to do
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void* DefaultHardwareIndexBuffer::lock(size_t offset, size_t length, LockOptions options)
+    void* DefaultHardwareIndexBuffer::lock(UINT32 offset, UINT32 length, LockOptions options)
 	{
 	{
         mIsLocked = true;
         mIsLocked = true;
 		return mpData + offset;
 		return mpData + offset;
@@ -125,13 +125,13 @@ namespace CamelotEngine {
         // Nothing to do
         // Nothing to do
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void DefaultHardwareIndexBuffer::readData(size_t offset, size_t length, void* pDest)
+    void DefaultHardwareIndexBuffer::readData(UINT32 offset, UINT32 length, void* pDest)
 	{
 	{
 		assert((offset + length) <= mSizeInBytes);
 		assert((offset + length) <= mSizeInBytes);
 		memcpy(pDest, mpData + offset, length);
 		memcpy(pDest, mpData + offset, length);
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    void DefaultHardwareIndexBuffer::writeData(size_t offset, size_t length, const void* pSource,
+    void DefaultHardwareIndexBuffer::writeData(UINT32 offset, UINT32 length, const void* pSource,
 			bool discardWholeBuffer)
 			bool discardWholeBuffer)
 	{
 	{
 		assert((offset + length) <= mSizeInBytes);
 		assert((offset + length) <= mSizeInBytes);
@@ -151,8 +151,8 @@ namespace CamelotEngine {
 	}
 	}
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
 	HardwareVertexBufferPtr 
 	HardwareVertexBufferPtr 
-        DefaultHardwareBufferManagerBase::createVertexBuffer(size_t vertexSize, 
-		size_t numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer)
+        DefaultHardwareBufferManagerBase::createVertexBuffer(UINT32 vertexSize, 
+		UINT32 numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer)
 	{
 	{
         DefaultHardwareVertexBuffer* vb = new DefaultHardwareVertexBuffer(this, vertexSize, numVerts, usage);
         DefaultHardwareVertexBuffer* vb = new DefaultHardwareVertexBuffer(this, vertexSize, numVerts, usage);
         return HardwareVertexBufferPtr(vb);
         return HardwareVertexBufferPtr(vb);
@@ -160,7 +160,7 @@ namespace CamelotEngine {
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
 	HardwareIndexBufferPtr 
 	HardwareIndexBufferPtr 
         DefaultHardwareBufferManagerBase::createIndexBuffer(HardwareIndexBuffer::IndexType itype, 
         DefaultHardwareBufferManagerBase::createIndexBuffer(HardwareIndexBuffer::IndexType itype, 
-		size_t numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer)
+		UINT32 numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer)
 	{
 	{
         DefaultHardwareIndexBuffer* ib = new DefaultHardwareIndexBuffer(itype, numIndexes, usage);
         DefaultHardwareIndexBuffer* ib = new DefaultHardwareIndexBuffer(itype, numIndexes, usage);
 		return HardwareIndexBufferPtr(ib);
 		return HardwareIndexBufferPtr(ib);

+ 74 - 74
CamelotRenderer/Source/CmGpuProgramParams.cpp

@@ -56,11 +56,11 @@ namespace CamelotEngine
 		// unless the system has been explicitly configured to allow all the parameters to be added
 		// unless the system has been explicitly configured to allow all the parameters to be added
 
 
 		// paramName[0] version will always exist 
 		// paramName[0] version will always exist 
-		size_t maxArrayIndex = 1;
+		UINT32 maxArrayIndex = 1;
 		if (baseDef.arraySize <= 16 || msGenerateAllConstantDefinitionArrayEntries)
 		if (baseDef.arraySize <= 16 || msGenerateAllConstantDefinitionArrayEntries)
 			maxArrayIndex = baseDef.arraySize;
 			maxArrayIndex = baseDef.arraySize;
 
 
-		for (size_t i = 0; i < maxArrayIndex; i++)
+		for (UINT32 i = 0; i < maxArrayIndex; i++)
 		{
 		{
 			arrayName = paramName + "[" + toString(i) + "]";
 			arrayName = paramName + "[" + toString(i) + "]";
 			map.insert(GpuConstantDefinitionMap::value_type(arrayName, arrayDef));
 			map.insert(GpuConstantDefinitionMap::value_type(arrayName, arrayDef));
@@ -175,22 +175,22 @@ namespace CamelotEngine
 		}
 		}
 	}
 	}
 	//---------------------------------------------------------------------()
 	//---------------------------------------------------------------------()
-	void GpuProgramParameters::setConstant(size_t index, const Vector4& vec)
+	void GpuProgramParameters::setConstant(UINT32 index, const Vector4& vec)
 	{
 	{
 		setConstant(index, vec.ptr(), 1);
 		setConstant(index, vec.ptr(), 1);
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::setConstant(size_t index, float val)
+	void GpuProgramParameters::setConstant(UINT32 index, float val)
 	{
 	{
 		setConstant(index, Vector4(val, 0.0f, 0.0f, 0.0f));
 		setConstant(index, Vector4(val, 0.0f, 0.0f, 0.0f));
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::setConstant(size_t index, const Vector3& vec)
+	void GpuProgramParameters::setConstant(UINT32 index, const Vector3& vec)
 	{
 	{
 		setConstant(index, Vector4(vec.x, vec.y, vec.z, 1.0f));
 		setConstant(index, Vector4(vec.x, vec.y, vec.z, 1.0f));
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::setConstant(size_t index, const Matrix4& m)
+	void GpuProgramParameters::setConstant(UINT32 index, const Matrix4& m)
 	{
 	{
 		// set as 4x 4-element floats
 		// set as 4x 4-element floats
 		if (mTransposeMatrices)
 		if (mTransposeMatrices)
@@ -205,12 +205,12 @@ namespace CamelotEngine
 
 
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::setConstant(size_t index, const Matrix4* pMatrix, 
-		size_t numEntries)
+	void GpuProgramParameters::setConstant(UINT32 index, const Matrix4* pMatrix, 
+		UINT32 numEntries)
 	{
 	{
 		if (mTransposeMatrices)
 		if (mTransposeMatrices)
 		{
 		{
-			for (size_t i = 0; i < numEntries; ++i)
+			for (UINT32 i = 0; i < numEntries; ++i)
 			{
 			{
 				Matrix4 t = pMatrix[i].transpose();
 				Matrix4 t = pMatrix[i].transpose();
 				GpuProgramParameters::setConstant(index, t[0], 4);
 				GpuProgramParameters::setConstant(index, t[0], 4);
@@ -224,36 +224,36 @@ namespace CamelotEngine
 
 
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::setConstant(size_t index, const Color& colour)
+	void GpuProgramParameters::setConstant(UINT32 index, const Color& colour)
 	{
 	{
 		setConstant(index, colour.ptr(), 1);
 		setConstant(index, colour.ptr(), 1);
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::setConstant(size_t index, const float *val, size_t count)
+	void GpuProgramParameters::setConstant(UINT32 index, const float *val, UINT32 count)
 	{
 	{
 		// Raw buffer size is 4x count
 		// Raw buffer size is 4x count
-		size_t rawCount = count * 4;
+		UINT32 rawCount = count * 4;
 		// get physical index
 		// get physical index
 		assert((mFloatLogicalToPhysical != nullptr) && "GpuProgram hasn't set up the logical -> physical map!");
 		assert((mFloatLogicalToPhysical != nullptr) && "GpuProgram hasn't set up the logical -> physical map!");
 
 
-		size_t physicalIndex = _getFloatConstantPhysicalIndex(index, rawCount, GPV_GLOBAL);
+		UINT32 physicalIndex = _getFloatConstantPhysicalIndex(index, rawCount, GPV_GLOBAL);
 
 
 		// Copy 
 		// Copy 
 		_writeRawConstants(physicalIndex, val, rawCount);
 		_writeRawConstants(physicalIndex, val, rawCount);
 
 
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::setConstant(size_t index, const double *val, size_t count)
+	void GpuProgramParameters::setConstant(UINT32 index, const double *val, UINT32 count)
 	{
 	{
 		// Raw buffer size is 4x count
 		// Raw buffer size is 4x count
-		size_t rawCount = count * 4;
+		UINT32 rawCount = count * 4;
 		// get physical index
 		// get physical index
 		assert((mFloatLogicalToPhysical != nullptr) && "GpuProgram hasn't set up the logical -> physical map!");
 		assert((mFloatLogicalToPhysical != nullptr) && "GpuProgram hasn't set up the logical -> physical map!");
 
 
-		size_t physicalIndex = _getFloatConstantPhysicalIndex(index, rawCount, GPV_GLOBAL);
+		UINT32 physicalIndex = _getFloatConstantPhysicalIndex(index, rawCount, GPV_GLOBAL);
 		assert(physicalIndex + rawCount <= mFloatConstants.size());
 		assert(physicalIndex + rawCount <= mFloatConstants.size());
 		// Copy manually since cast required
 		// Copy manually since cast required
-		for (size_t i = 0; i < rawCount; ++i)
+		for (UINT32 i = 0; i < rawCount; ++i)
 		{
 		{
 			mFloatConstants[physicalIndex + i] = 
 			mFloatConstants[physicalIndex + i] = 
 				static_cast<float>(val[i]);
 				static_cast<float>(val[i]);
@@ -261,47 +261,47 @@ namespace CamelotEngine
 
 
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::setConstant(size_t index, const int *val, size_t count)
+	void GpuProgramParameters::setConstant(UINT32 index, const int *val, UINT32 count)
 	{
 	{
 		// Raw buffer size is 4x count
 		// Raw buffer size is 4x count
-		size_t rawCount = count * 4;
+		UINT32 rawCount = count * 4;
 		// get physical index
 		// get physical index
 		assert((mIntLogicalToPhysical != nullptr) && "GpuProgram hasn't set up the logical -> physical map!");
 		assert((mIntLogicalToPhysical != nullptr) && "GpuProgram hasn't set up the logical -> physical map!");
 
 
-		size_t physicalIndex = _getIntConstantPhysicalIndex(index, rawCount, GPV_GLOBAL);
+		UINT32 physicalIndex = _getIntConstantPhysicalIndex(index, rawCount, GPV_GLOBAL);
 		// Copy 
 		// Copy 
 		_writeRawConstants(physicalIndex, val, rawCount);
 		_writeRawConstants(physicalIndex, val, rawCount);
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, const Vector4& vec,
-		size_t count)
+	void GpuProgramParameters::_writeRawConstant(UINT32 physicalIndex, const Vector4& vec,
+		UINT32 count)
 	{
 	{
 		// remember, raw content access uses raw float count rather than float4
 		// remember, raw content access uses raw float count rather than float4
 		// write either the number requested (for packed types) or up to 4
 		// write either the number requested (for packed types) or up to 4
-		_writeRawConstants(physicalIndex, vec.ptr(), std::min(count, (size_t)4));
+		_writeRawConstants(physicalIndex, vec.ptr(), std::min(count, (UINT32)4));
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, float val)
+	void GpuProgramParameters::_writeRawConstant(UINT32 physicalIndex, float val)
 	{
 	{
 		_writeRawConstants(physicalIndex, &val, 1);
 		_writeRawConstants(physicalIndex, &val, 1);
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, int val)
+	void GpuProgramParameters::_writeRawConstant(UINT32 physicalIndex, int val)
 	{
 	{
 		_writeRawConstants(physicalIndex, &val, 1);
 		_writeRawConstants(physicalIndex, &val, 1);
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, const Vector3& vec)
+	void GpuProgramParameters::_writeRawConstant(UINT32 physicalIndex, const Vector3& vec)
 	{
 	{
 		_writeRawConstants(physicalIndex, vec.ptr(), 3);		
 		_writeRawConstants(physicalIndex, vec.ptr(), 3);		
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, const Vector2& vec)
+	void GpuProgramParameters::_writeRawConstant(UINT32 physicalIndex, const Vector2& vec)
 	{
 	{
 		_writeRawConstants(physicalIndex, vec.ptr(), 2);		
 		_writeRawConstants(physicalIndex, vec.ptr(), 2);		
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, const Matrix4& m,size_t elementCount)
+	void GpuProgramParameters::_writeRawConstant(UINT32 physicalIndex, const Matrix4& m, UINT32 elementCount)
 	{
 	{
 
 
 		// remember, raw content access uses raw float count rather than float4
 		// remember, raw content access uses raw float count rather than float4
@@ -317,12 +317,12 @@ namespace CamelotEngine
 
 
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, const Matrix4* pMatrix, size_t numEntries)
+	void GpuProgramParameters::_writeRawConstant(UINT32 physicalIndex, const Matrix4* pMatrix, UINT32 numEntries)
 	{
 	{
 		// remember, raw content access uses raw float count rather than float4
 		// remember, raw content access uses raw float count rather than float4
 		if (mTransposeMatrices)
 		if (mTransposeMatrices)
 		{
 		{
-			for (size_t i = 0; i < numEntries; ++i)
+			for (UINT32 i = 0; i < numEntries; ++i)
 			{
 			{
 				Matrix4 t = pMatrix[i].transpose();
 				Matrix4 t = pMatrix[i].transpose();
 				_writeRawConstants(physicalIndex, t[0], 16);
 				_writeRawConstants(physicalIndex, t[0], 16);
@@ -337,7 +337,7 @@ namespace CamelotEngine
 
 
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, const Matrix3& m,size_t elementCount)
+	void GpuProgramParameters::_writeRawConstant(UINT32 physicalIndex, const Matrix3& m, UINT32 elementCount)
 	{
 	{
 		// remember, raw content access uses raw float count rather than float4
 		// remember, raw content access uses raw float count rather than float4
 		if (mTransposeMatrices)
 		if (mTransposeMatrices)
@@ -352,54 +352,54 @@ namespace CamelotEngine
 
 
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, 
-		const Color& colour, size_t count)
+	void GpuProgramParameters::_writeRawConstant(UINT32 physicalIndex, 
+		const Color& colour, UINT32 count)
 	{
 	{
 		// write either the number requested (for packed types) or up to 4
 		// write either the number requested (for packed types) or up to 4
-		_writeRawConstants(physicalIndex, colour.ptr(), std::min(count, (size_t)4));
+		_writeRawConstants(physicalIndex, colour.ptr(), std::min(count, (UINT32)4));
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstants(size_t physicalIndex, const double* val, size_t count)
+	void GpuProgramParameters::_writeRawConstants(UINT32 physicalIndex, const double* val, UINT32 count)
 	{
 	{
 		assert(physicalIndex + count <= mFloatConstants.size());
 		assert(physicalIndex + count <= mFloatConstants.size());
-		for (size_t i = 0; i < count; ++i)
+		for (UINT32 i = 0; i < count; ++i)
 		{
 		{
 			mFloatConstants[physicalIndex+i] = static_cast<float>(val[i]);
 			mFloatConstants[physicalIndex+i] = static_cast<float>(val[i]);
 		}
 		}
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstants(size_t physicalIndex, const float* val, size_t count)
+	void GpuProgramParameters::_writeRawConstants(UINT32 physicalIndex, const float* val, UINT32 count)
 	{
 	{
 		assert(physicalIndex + count <= mFloatConstants.size());
 		assert(physicalIndex + count <= mFloatConstants.size());
 		memcpy(&mFloatConstants[physicalIndex], val, sizeof(float) * count);
 		memcpy(&mFloatConstants[physicalIndex], val, sizeof(float) * count);
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstants(size_t physicalIndex, const int* val, size_t count)
+	void GpuProgramParameters::_writeRawConstants(UINT32 physicalIndex, const int* val, UINT32 count)
 	{
 	{
 		assert(physicalIndex + count <= mIntConstants.size());
 		assert(physicalIndex + count <= mIntConstants.size());
 		memcpy(&mIntConstants[physicalIndex], val, sizeof(int) * count);
 		memcpy(&mIntConstants[physicalIndex], val, sizeof(int) * count);
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_readRawConstants(size_t physicalIndex, size_t count, float* dest)
+	void GpuProgramParameters::_readRawConstants(UINT32 physicalIndex, UINT32 count, float* dest)
 	{
 	{
 		assert(physicalIndex + count <= mFloatConstants.size());
 		assert(physicalIndex + count <= mFloatConstants.size());
 		memcpy(dest, &mFloatConstants[physicalIndex], sizeof(float) * count);
 		memcpy(dest, &mFloatConstants[physicalIndex], sizeof(float) * count);
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_readRawConstants(size_t physicalIndex, size_t count, int* dest)
+	void GpuProgramParameters::_readRawConstants(UINT32 physicalIndex, UINT32 count, int* dest)
 	{
 	{
 		assert(physicalIndex + count <= mIntConstants.size());
 		assert(physicalIndex + count <= mIntConstants.size());
 		memcpy(dest, &mIntConstants[physicalIndex], sizeof(int) * count);
 		memcpy(dest, &mIntConstants[physicalIndex], sizeof(int) * count);
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_readTexture(size_t physicalIndex, TextureHandle& dest)
+	void GpuProgramParameters::_readTexture(UINT32 physicalIndex, TextureHandle& dest)
 	{
 	{
 		assert(physicalIndex < mTextures.size());
 		assert(physicalIndex < mTextures.size());
 		dest = mTextures[physicalIndex]->texture;
 		dest = mTextures[physicalIndex]->texture;
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
 	GpuLogicalIndexUse* GpuProgramParameters::_getFloatConstantLogicalIndexUse(
 	GpuLogicalIndexUse* GpuProgramParameters::_getFloatConstantLogicalIndexUse(
-		size_t logicalIndex, size_t requestedSize, UINT16 variability)
+		UINT32 logicalIndex, UINT32 requestedSize, UINT16 variability)
 	{
 	{
 		if (mFloatLogicalToPhysical == nullptr)
 		if (mFloatLogicalToPhysical == nullptr)
 			return 0;
 			return 0;
@@ -412,24 +412,24 @@ namespace CamelotEngine
 		{
 		{
 			if (requestedSize)
 			if (requestedSize)
 			{
 			{
-				size_t physicalIndex = mFloatConstants.size();
+				UINT32 physicalIndex = (UINT32)mFloatConstants.size();
 
 
 				// Expand at buffer end
 				// Expand at buffer end
 				mFloatConstants.insert(mFloatConstants.end(), requestedSize, 0.0f);
 				mFloatConstants.insert(mFloatConstants.end(), requestedSize, 0.0f);
 
 
 				// Record extended size for future GPU params re-using this information
 				// Record extended size for future GPU params re-using this information
-				mFloatLogicalToPhysical->bufferSize = mFloatConstants.size();
+				mFloatLogicalToPhysical->bufferSize = (UINT32)mFloatConstants.size();
 
 
 				// low-level programs will not know about mapping ahead of time, so 
 				// low-level programs will not know about mapping ahead of time, so 
 				// populate it. Other params objects will be able to just use this
 				// populate it. Other params objects will be able to just use this
 				// accepted mapping since the constant structure will be the same
 				// accepted mapping since the constant structure will be the same
 
 
 				// Set up a mapping for all items in the count
 				// Set up a mapping for all items in the count
-				size_t currPhys = physicalIndex;
-				size_t count = requestedSize / 4;
+				UINT32 currPhys = physicalIndex;
+				UINT32 count = requestedSize / 4;
 				GpuLogicalIndexUseMap::iterator insertedIterator;
 				GpuLogicalIndexUseMap::iterator insertedIterator;
 
 
-				for (size_t logicalNum = 0; logicalNum < count; ++logicalNum)
+				for (UINT32 logicalNum = 0; logicalNum < count; ++logicalNum)
 				{
 				{
 					GpuLogicalIndexUseMap::iterator it = 
 					GpuLogicalIndexUseMap::iterator it = 
 						mFloatLogicalToPhysical->map.insert(
 						mFloatLogicalToPhysical->map.insert(
@@ -453,7 +453,7 @@ namespace CamelotEngine
 		}
 		}
 		else
 		else
 		{
 		{
-			size_t physicalIndex = logi->second.physicalIndex;
+			UINT32 physicalIndex = logi->second.physicalIndex;
 			indexUse = &(logi->second);
 			indexUse = &(logi->second);
 			// check size
 			// check size
 			if (logi->second.currentSize < requestedSize)
 			if (logi->second.currentSize < requestedSize)
@@ -461,7 +461,7 @@ namespace CamelotEngine
 				// init buffer entry wasn't big enough; could be a mistake on the part
 				// init buffer entry wasn't big enough; could be a mistake on the part
 				// of the original use, or perhaps a variable length we can't predict
 				// of the original use, or perhaps a variable length we can't predict
 				// until first actual runtime use e.g. world matrix array
 				// until first actual runtime use e.g. world matrix array
-				size_t insertCount = requestedSize - logi->second.currentSize;
+				UINT32 insertCount = requestedSize - logi->second.currentSize;
 				FloatConstantList::iterator insertPos = mFloatConstants.begin();
 				FloatConstantList::iterator insertPos = mFloatConstants.begin();
 				std::advance(insertPos, physicalIndex);
 				std::advance(insertPos, physicalIndex);
 				mFloatConstants.insert(insertPos, insertCount, 0.0f);
 				mFloatConstants.insert(insertPos, insertCount, 0.0f);
@@ -495,7 +495,7 @@ namespace CamelotEngine
 
 
 	}
 	}
 	//---------------------------------------------------------------------()
 	//---------------------------------------------------------------------()
-	GpuLogicalIndexUse* GpuProgramParameters::_getIntConstantLogicalIndexUse(size_t logicalIndex, size_t requestedSize, UINT16 variability)
+	GpuLogicalIndexUse* GpuProgramParameters::_getIntConstantLogicalIndexUse(UINT32 logicalIndex, UINT32 requestedSize, UINT16 variability)
 	{
 	{
 		if (mIntLogicalToPhysical == nullptr)
 		if (mIntLogicalToPhysical == nullptr)
 		{
 		{
@@ -511,23 +511,23 @@ namespace CamelotEngine
 		{
 		{
 			if (requestedSize)
 			if (requestedSize)
 			{
 			{
-				size_t physicalIndex = mIntConstants.size();
+				UINT32 physicalIndex = (UINT32)mIntConstants.size();
 
 
 				// Expand at buffer end
 				// Expand at buffer end
 				mIntConstants.insert(mIntConstants.end(), requestedSize, 0);
 				mIntConstants.insert(mIntConstants.end(), requestedSize, 0);
 
 
 				// Record extended size for future GPU params re-using this information
 				// Record extended size for future GPU params re-using this information
-				mIntLogicalToPhysical->bufferSize = mIntConstants.size();
+				mIntLogicalToPhysical->bufferSize = (UINT32)mIntConstants.size();
 
 
 				// low-level programs will not know about mapping ahead of time, so 
 				// low-level programs will not know about mapping ahead of time, so 
 				// populate it. Other params objects will be able to just use this
 				// populate it. Other params objects will be able to just use this
 				// accepted mapping since the constant structure will be the same
 				// accepted mapping since the constant structure will be the same
 
 
 				// Set up a mapping for all items in the count
 				// Set up a mapping for all items in the count
-				size_t currPhys = physicalIndex;
-				size_t count = requestedSize / 4;
+				UINT32 currPhys = physicalIndex;
+				UINT32 count = requestedSize / 4;
 				GpuLogicalIndexUseMap::iterator insertedIterator;
 				GpuLogicalIndexUseMap::iterator insertedIterator;
-				for (size_t logicalNum = 0; logicalNum < count; ++logicalNum)
+				for (UINT32 logicalNum = 0; logicalNum < count; ++logicalNum)
 				{
 				{
 					GpuLogicalIndexUseMap::iterator it = 
 					GpuLogicalIndexUseMap::iterator it = 
 						mIntLogicalToPhysical->map.insert(
 						mIntLogicalToPhysical->map.insert(
@@ -550,7 +550,7 @@ namespace CamelotEngine
 		}
 		}
 		else
 		else
 		{
 		{
-			size_t physicalIndex = logi->second.physicalIndex;
+			UINT32 physicalIndex = logi->second.physicalIndex;
 			indexUse = &(logi->second);
 			indexUse = &(logi->second);
 
 
 			// check size
 			// check size
@@ -559,7 +559,7 @@ namespace CamelotEngine
 				// init buffer entry wasn't big enough; could be a mistake on the part
 				// init buffer entry wasn't big enough; could be a mistake on the part
 				// of the original use, or perhaps a variable length we can't predict
 				// of the original use, or perhaps a variable length we can't predict
 				// until first actual runtime use e.g. world matrix array
 				// until first actual runtime use e.g. world matrix array
-				size_t insertCount = requestedSize - logi->second.currentSize;
+				UINT32 insertCount = requestedSize - logi->second.currentSize;
 				IntConstantList::iterator insertPos = mIntConstants.begin();
 				IntConstantList::iterator insertPos = mIntConstants.begin();
 				std::advance(insertPos, physicalIndex);
 				std::advance(insertPos, physicalIndex);
 				mIntConstants.insert(insertPos, insertCount, 0);
 				mIntConstants.insert(insertPos, insertCount, 0);
@@ -593,21 +593,21 @@ namespace CamelotEngine
 
 
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	size_t GpuProgramParameters::_getFloatConstantPhysicalIndex(
-		size_t logicalIndex, size_t requestedSize, UINT16 variability) 
+	UINT32 GpuProgramParameters::_getFloatConstantPhysicalIndex(
+		UINT32 logicalIndex, UINT32 requestedSize, UINT16 variability) 
 	{
 	{
 		GpuLogicalIndexUse* indexUse = _getFloatConstantLogicalIndexUse(logicalIndex, requestedSize, variability);
 		GpuLogicalIndexUse* indexUse = _getFloatConstantLogicalIndexUse(logicalIndex, requestedSize, variability);
 		return indexUse ? indexUse->physicalIndex : 0;
 		return indexUse ? indexUse->physicalIndex : 0;
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	size_t GpuProgramParameters::_getIntConstantPhysicalIndex(
-		size_t logicalIndex, size_t requestedSize, UINT16 variability)
+	UINT32 GpuProgramParameters::_getIntConstantPhysicalIndex(
+		UINT32 logicalIndex, UINT32 requestedSize, UINT16 variability)
 	{
 	{
 		GpuLogicalIndexUse* indexUse = _getIntConstantLogicalIndexUse(logicalIndex, requestedSize, variability);
 		GpuLogicalIndexUse* indexUse = _getIntConstantLogicalIndexUse(logicalIndex, requestedSize, variability);
 		return indexUse ? indexUse->physicalIndex : 0;
 		return indexUse ? indexUse->physicalIndex : 0;
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	size_t GpuProgramParameters::getFloatLogicalIndexForPhysicalIndex(size_t physicalIndex)
+	UINT32 GpuProgramParameters::getFloatLogicalIndexForPhysicalIndex(UINT32 physicalIndex)
 	{
 	{
 		// perhaps build a reverse map of this sometime (shared in GpuProgram)
 		// perhaps build a reverse map of this sometime (shared in GpuProgram)
 		for (GpuLogicalIndexUseMap::iterator i = mFloatLogicalToPhysical->map.begin();
 		for (GpuLogicalIndexUseMap::iterator i = mFloatLogicalToPhysical->map.begin();
@@ -616,11 +616,11 @@ namespace CamelotEngine
 			if (i->second.physicalIndex == physicalIndex)
 			if (i->second.physicalIndex == physicalIndex)
 				return i->first;
 				return i->first;
 		}
 		}
-		return std::numeric_limits<size_t>::max();
+		return std::numeric_limits<UINT32>::max();
 
 
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	size_t GpuProgramParameters::getIntLogicalIndexForPhysicalIndex(size_t physicalIndex)
+	UINT32 GpuProgramParameters::getIntLogicalIndexForPhysicalIndex(UINT32 physicalIndex)
 	{
 	{
 		// perhaps build a reverse map of this sometime (shared in GpuProgram)
 		// perhaps build a reverse map of this sometime (shared in GpuProgram)
 		for (GpuLogicalIndexUseMap::iterator i = mIntLogicalToPhysical->map.begin();
 		for (GpuLogicalIndexUseMap::iterator i = mIntLogicalToPhysical->map.begin();
@@ -629,7 +629,7 @@ namespace CamelotEngine
 			if (i->second.physicalIndex == physicalIndex)
 			if (i->second.physicalIndex == physicalIndex)
 				return i->first;
 				return i->first;
 		}
 		}
-		return std::numeric_limits<size_t>::max();
+		return std::numeric_limits<UINT32>::max();
 
 
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
@@ -671,7 +671,7 @@ namespace CamelotEngine
 		return *def;
 		return *def;
 	}
 	}
 	//----------------------------------------------------------------------------
 	//----------------------------------------------------------------------------
-	TextureHandle GpuProgramParameters::getTexture(size_t pos) const 
+	TextureHandle GpuProgramParameters::getTexture(UINT32 pos) const 
 	{ 
 	{ 
 		if(mTextures[pos] == nullptr)
 		if(mTextures[pos] == nullptr)
 		{
 		{
@@ -681,7 +681,7 @@ namespace CamelotEngine
 		return mTextures[pos]->texture; 
 		return mTextures[pos]->texture; 
 	}
 	}
 	//----------------------------------------------------------------------------
 	//----------------------------------------------------------------------------
-	const SamplerState& GpuProgramParameters::getSamplerState(size_t pos) const 
+	const SamplerState& GpuProgramParameters::getSamplerState(UINT32 pos) const 
 	{ 
 	{ 
 		if(mTextures[pos] == nullptr)
 		if(mTextures[pos] == nullptr)
 		{
 		{
@@ -813,7 +813,7 @@ namespace CamelotEngine
 	}
 	}
 	//---------------------------------------------------------------------------
 	//---------------------------------------------------------------------------
 	void GpuProgramParameters::setNamedConstant(const String& name, const Matrix4* m, 
 	void GpuProgramParameters::setNamedConstant(const String& name, const Matrix4* m, 
-		size_t numEntries)
+		UINT32 numEntries)
 	{
 	{
 		// look up, and throw an exception if we're not ignoring missing
 		// look up, and throw an exception if we're not ignoring missing
 		const GpuConstantDefinition* def = 
 		const GpuConstantDefinition* def = 
@@ -832,9 +832,9 @@ namespace CamelotEngine
 	}
 	}
 	//---------------------------------------------------------------------------
 	//---------------------------------------------------------------------------
 	void GpuProgramParameters::setNamedConstant(const String& name, 
 	void GpuProgramParameters::setNamedConstant(const String& name, 
-		const float *val, size_t count, size_t multiple)
+		const float *val, UINT32 count, UINT32 multiple)
 	{
 	{
-		size_t rawCount = count * multiple;
+		UINT32 rawCount = count * multiple;
 		// look up, and throw an exception if we're not ignoring missing
 		// look up, and throw an exception if we're not ignoring missing
 		const GpuConstantDefinition* def = 
 		const GpuConstantDefinition* def = 
 			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
 			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
@@ -843,9 +843,9 @@ namespace CamelotEngine
 	}
 	}
 	//---------------------------------------------------------------------------
 	//---------------------------------------------------------------------------
 	void GpuProgramParameters::setNamedConstant(const String& name, 
 	void GpuProgramParameters::setNamedConstant(const String& name, 
-		const double *val, size_t count, size_t multiple)
+		const double *val, UINT32 count, UINT32 multiple)
 	{
 	{
-		size_t rawCount = count * multiple;
+		UINT32 rawCount = count * multiple;
 		// look up, and throw an exception if we're not ignoring missing
 		// look up, and throw an exception if we're not ignoring missing
 		const GpuConstantDefinition* def = 
 		const GpuConstantDefinition* def = 
 			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
 			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
@@ -863,9 +863,9 @@ namespace CamelotEngine
 	}
 	}
 	//---------------------------------------------------------------------------
 	//---------------------------------------------------------------------------
 	void GpuProgramParameters::setNamedConstant(const String& name, 
 	void GpuProgramParameters::setNamedConstant(const String& name, 
-		const int *val, size_t count, size_t multiple)
+		const int *val, UINT32 count, UINT32 multiple)
 	{
 	{
-		size_t rawCount = count * multiple;
+		UINT32 rawCount = count * multiple;
 		// look up, and throw an exception if we're not ignoring missing
 		// look up, and throw an exception if we're not ignoring missing
 		const GpuConstantDefinition* def = 
 		const GpuConstantDefinition* def = 
 			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
 			_findNamedConstantDefinition(name, !mIgnoreMissingParams);

+ 1 - 1
CamelotRenderer/Source/CmHardwareIndexBuffer.cpp

@@ -35,7 +35,7 @@ namespace CamelotEngine {
 
 
     //-----------------------------------------------------------------------------
     //-----------------------------------------------------------------------------
     HardwareIndexBuffer::HardwareIndexBuffer(HardwareBufferManagerBase* mgr, IndexType idxType, 
     HardwareIndexBuffer::HardwareIndexBuffer(HardwareBufferManagerBase* mgr, IndexType idxType, 
-        size_t numIndexes, HardwareBuffer::Usage usage, 
+        UINT32 numIndexes, HardwareBuffer::Usage usage, 
         bool useSystemMemory, bool useShadowBuffer) 
         bool useSystemMemory, bool useShadowBuffer) 
         : HardwareBuffer(usage, useSystemMemory, useShadowBuffer)
         : HardwareBuffer(usage, useSystemMemory, useShadowBuffer)
 		, mMgr(mgr)
 		, mMgr(mgr)

+ 7 - 7
CamelotRenderer/Source/CmHardwarePixelBuffer.cpp

@@ -32,7 +32,7 @@ namespace CamelotEngine
 {
 {
   
   
     //-----------------------------------------------------------------------------    
     //-----------------------------------------------------------------------------    
-    HardwarePixelBuffer::HardwarePixelBuffer(size_t width, size_t height, size_t depth,
+    HardwarePixelBuffer::HardwarePixelBuffer(UINT32 width, UINT32 height, UINT32 depth,
             PixelFormat format,
             PixelFormat format,
             HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer):
             HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer):
         HardwareBuffer(usage, useSystemMemory, useShadowBuffer),
         HardwareBuffer(usage, useSystemMemory, useShadowBuffer),
@@ -51,7 +51,7 @@ namespace CamelotEngine
     }
     }
     
     
     //-----------------------------------------------------------------------------    
     //-----------------------------------------------------------------------------    
-    void* HardwarePixelBuffer::lock(size_t offset, size_t length, LockOptions options)
+    void* HardwarePixelBuffer::lock(UINT32 offset, UINT32 length, LockOptions options)
     {
     {
         assert(!isLocked() && "Cannot lock this buffer, it is already locked!");
         assert(!isLocked() && "Cannot lock this buffer, it is already locked!");
         assert(offset == 0 && length == mSizeInBytes && "Cannot lock memory region, most lock box or entire buffer");
         assert(offset == 0 && length == mSizeInBytes && "Cannot lock memory region, most lock box or entire buffer");
@@ -95,7 +95,7 @@ namespace CamelotEngine
     
     
     //-----------------------------------------------------------------------------    
     //-----------------------------------------------------------------------------    
     /// Internal implementation of lock()
     /// Internal implementation of lock()
-    void* HardwarePixelBuffer::lockImpl(size_t offset, size_t length, LockOptions options)
+    void* HardwarePixelBuffer::lockImpl(UINT32 offset, UINT32 length, LockOptions options)
     {
     {
 		CM_EXCEPT(InternalErrorException, "lockImpl(offset,length) is not valid for PixelBuffers and should never be called");
 		CM_EXCEPT(InternalErrorException, "lockImpl(offset,length) is not valid for PixelBuffers and should never be called");
     }
     }
@@ -149,7 +149,7 @@ namespace CamelotEngine
         );
         );
     }
     }
     //-----------------------------------------------------------------------------    
     //-----------------------------------------------------------------------------    
-	void HardwarePixelBuffer::readData(size_t offset, size_t length, void* pDest)
+	void HardwarePixelBuffer::readData(UINT32 offset, UINT32 length, void* pDest)
 	{
 	{
 		// TODO
 		// TODO
 		CM_EXCEPT(NotImplementedException,
 		CM_EXCEPT(NotImplementedException,
@@ -157,7 +157,7 @@ namespace CamelotEngine
 	}
 	}
 	//-----------------------------------------------------------------------------    
 	//-----------------------------------------------------------------------------    
 
 
-	void HardwarePixelBuffer::writeData(size_t offset, size_t length, const void* pSource,
+	void HardwarePixelBuffer::writeData(UINT32 offset, UINT32 length, const void* pSource,
 			bool discardWholeBuffer)
 			bool discardWholeBuffer)
 	{
 	{
 		// TODO
 		// TODO
@@ -166,7 +166,7 @@ namespace CamelotEngine
 	}
 	}
     //-----------------------------------------------------------------------------    
     //-----------------------------------------------------------------------------    
     
     
-    RenderTexture *HardwarePixelBuffer::getRenderTarget(size_t)
+    RenderTexture *HardwarePixelBuffer::getRenderTarget(UINT32)
     {
     {
         CM_EXCEPT(NotImplementedException,
         CM_EXCEPT(NotImplementedException,
 				"Not yet implemented for this rendersystem.");
 				"Not yet implemented for this rendersystem.");
@@ -174,7 +174,7 @@ namespace CamelotEngine
 
 
 	//-----------------------------------------------------------------------------    
 	//-----------------------------------------------------------------------------    
 
 
-	void HardwarePixelBuffer::_clearSliceRTT(size_t zoffset)
+	void HardwarePixelBuffer::_clearSliceRTT(UINT32 zoffset)
 	{
 	{
 	}
 	}
 
 

+ 10 - 10
CamelotRenderer/Source/CmHardwareVertexBuffer.cpp

@@ -38,8 +38,8 @@ THE SOFTWARE.
 namespace CamelotEngine {
 namespace CamelotEngine {
 
 
     //-----------------------------------------------------------------------------
     //-----------------------------------------------------------------------------
-    HardwareVertexBuffer::HardwareVertexBuffer(HardwareBufferManagerBase* mgr, size_t vertexSize,  
-        size_t numVertices, HardwareBuffer::Usage usage, 
+    HardwareVertexBuffer::HardwareVertexBuffer(HardwareBufferManagerBase* mgr, UINT32 vertexSize,  
+        UINT32 numVertices, HardwareBuffer::Usage usage, 
         bool useSystemMemory, bool useShadowBuffer) 
         bool useSystemMemory, bool useShadowBuffer) 
         : HardwareBuffer(usage, useSystemMemory, useShadowBuffer), 
         : HardwareBuffer(usage, useSystemMemory, useShadowBuffer), 
 		  mMgr(mgr),
 		  mMgr(mgr),
@@ -70,19 +70,19 @@ namespace CamelotEngine {
         }
         }
     }
     }
     //-----------------------------------------------------------------------------
     //-----------------------------------------------------------------------------
-    VertexElement::VertexElement(unsigned short source, size_t offset, 
+    VertexElement::VertexElement(unsigned short source, UINT32 offset, 
         VertexElementType theType, VertexElementSemantic semantic, unsigned short index)
         VertexElementType theType, VertexElementSemantic semantic, unsigned short index)
         : mSource(source), mOffset(offset), mType(theType), 
         : mSource(source), mOffset(offset), mType(theType), 
         mSemantic(semantic), mIndex(index)
         mSemantic(semantic), mIndex(index)
     {
     {
     }
     }
     //-----------------------------------------------------------------------------
     //-----------------------------------------------------------------------------
-	size_t VertexElement::getSize(void) const
+	UINT32 VertexElement::getSize(void) const
 	{
 	{
 		return getTypeSize(mType);
 		return getTypeSize(mType);
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	size_t VertexElement::getTypeSize(VertexElementType etype)
+	UINT32 VertexElement::getTypeSize(VertexElementType etype)
 	{
 	{
 		switch(etype)
 		switch(etype)
 		{
 		{
@@ -274,7 +274,7 @@ namespace CamelotEngine {
     }
     }
     //-----------------------------------------------------------------------------
     //-----------------------------------------------------------------------------
     const VertexElement& VertexDeclaration::addElement(unsigned short source, 
     const VertexElement& VertexDeclaration::addElement(unsigned short source, 
-        size_t offset, VertexElementType theType,
+        UINT32 offset, VertexElementType theType,
         VertexElementSemantic semantic, unsigned short index)
         VertexElementSemantic semantic, unsigned short index)
     {
     {
 		// Refine colour type to a specific type
 		// Refine colour type to a specific type
@@ -289,7 +289,7 @@ namespace CamelotEngine {
     }
     }
     //-----------------------------------------------------------------------------
     //-----------------------------------------------------------------------------
     const VertexElement& VertexDeclaration::insertElement(unsigned short atPosition,
     const VertexElement& VertexDeclaration::insertElement(unsigned short atPosition,
-        unsigned short source, size_t offset, VertexElementType theType,
+        unsigned short source, UINT32 offset, VertexElementType theType,
         VertexElementSemantic semantic, unsigned short index)
         VertexElementSemantic semantic, unsigned short index)
     {
     {
         if (atPosition >= mElementList.size())
         if (atPosition >= mElementList.size())
@@ -348,7 +348,7 @@ namespace CamelotEngine {
 	}
 	}
     //-----------------------------------------------------------------------------
     //-----------------------------------------------------------------------------
     void VertexDeclaration::modifyElement(unsigned short elem_index, 
     void VertexDeclaration::modifyElement(unsigned short elem_index, 
-        unsigned short source, size_t offset, VertexElementType theType,
+        unsigned short source, UINT32 offset, VertexElementType theType,
         VertexElementSemantic semantic, unsigned short index)
         VertexElementSemantic semantic, unsigned short index)
     {
     {
         assert(elem_index < mElementList.size() && "Index out of bounds");
         assert(elem_index < mElementList.size() && "Index out of bounds");
@@ -393,11 +393,11 @@ namespace CamelotEngine {
 	}
 	}
 
 
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	size_t VertexDeclaration::getVertexSize(unsigned short source)
+	UINT32 VertexDeclaration::getVertexSize(unsigned short source)
 	{
 	{
 		VertexElementList::const_iterator i, iend;
 		VertexElementList::const_iterator i, iend;
 		iend = mElementList.end();
 		iend = mElementList.end();
-		size_t sz = 0;
+		UINT32 sz = 0;
 
 
 		for (i = mElementList.begin(); i != iend; ++i)
 		for (i = mElementList.begin(); i != iend; ++i)
 		{
 		{

+ 2 - 2
CamelotRenderer/Source/CmMaterialRTTI.cpp

@@ -73,9 +73,9 @@ namespace CamelotEngine
 					auto iterFind = params->mFloatParams.find(iter->first);
 					auto iterFind = params->mFloatParams.find(iter->first);
 					if(iterFind == params->mFloatParams.end())
 					if(iterFind == params->mFloatParams.end())
 					{
 					{
-						params->mFloatParams[iter->first] = FloatParam(params->mFloatBuffer.size(), def.constType, fieldSize);
+						params->mFloatParams[iter->first] = FloatParam((UINT32)params->mFloatBuffer.size(), def.constType, fieldSize);
 
 
-						for(size_t j = 0; j < fieldSize; j++)
+						for(UINT32 j = 0; j < fieldSize; j++)
 							params->mFloatBuffer.push_back(tempValue[j]);
 							params->mFloatBuffer.push_back(tempValue[j]);
 					}
 					}
 					else
 					else

+ 2 - 2
CamelotRenderer/Source/CmSceneManager.cpp

@@ -34,7 +34,7 @@ namespace CamelotEngine
 				(*iter)->update();
 				(*iter)->update();
 			}
 			}
 
 
-			for(int i = 0; i < currentGO->getNumChildren(); i++)
+			for(UINT32 i = 0; i < currentGO->getNumChildren(); i++)
 				todo.push(currentGO->getChild(i));
 				todo.push(currentGO->getChild(i));
 		}
 		}
 	}
 	}
@@ -57,7 +57,7 @@ namespace CamelotEngine
 			if(curRenderable != nullptr)
 			if(curRenderable != nullptr)
 				renderables.push_back(curRenderable);
 				renderables.push_back(curRenderable);
 
 
-			for(int i = 0; i < currentGO->getNumChildren(); i++)
+			for(UINT32 i = 0; i < currentGO->getNumChildren(); i++)
 				todo.push(currentGO->getChild(i));
 				todo.push(currentGO->getChild(i));
 		}
 		}
 
 

+ 3 - 3
CamelotRenderer/Source/CmTexture.cpp

@@ -58,7 +58,7 @@ namespace CamelotEngine {
         
         
     }
     }
 	//-------------------------------------------------------------------------
 	//-------------------------------------------------------------------------
-	void Texture::initialize(TextureType textureType, size_t width, size_t height, size_t depth, size_t numMipmaps, 
+	void Texture::initialize(TextureType textureType, UINT32 width, UINT32 height, UINT32 depth, UINT32 numMipmaps, 
 		PixelFormat format, int usage, bool hwGamma, UINT32 fsaa, const String& fsaaHint)
 		PixelFormat format, int usage, bool hwGamma, UINT32 fsaa, const String& fsaaHint)
 	{
 	{
 		mTextureType = textureType;
 		mTextureType = textureType;
@@ -82,12 +82,12 @@ namespace CamelotEngine {
         return PixelUtil::hasAlpha(mFormat);
         return PixelUtil::hasAlpha(mFormat);
     }
     }
     //--------------------------------------------------------------------------
     //--------------------------------------------------------------------------
-	size_t Texture::calculateSize(void) const
+	UINT32 Texture::calculateSize(void) const
 	{
 	{
         return getNumFaces() * PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
         return getNumFaces() * PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
 	}
 	}
 	//--------------------------------------------------------------------------
 	//--------------------------------------------------------------------------
-	size_t Texture::getNumFaces(void) const
+	UINT32 Texture::getNumFaces(void) const
 	{
 	{
 		return getTextureType() == TEX_TYPE_CUBE_MAP ? 6 : 1;
 		return getTextureType() == TEX_TYPE_CUBE_MAP ? 6 : 1;
 	}
 	}

+ 13 - 13
CamelotRenderer/Source/CmVertexIndexData.cpp

@@ -156,7 +156,7 @@ namespace CamelotEngine {
         const VertexElement* posElem = vertexDeclaration->findElementBySemantic(VES_POSITION);
         const VertexElement* posElem = vertexDeclaration->findElementBySemantic(VES_POSITION);
         if (posElem)
         if (posElem)
         {
         {
-            size_t v;
+            UINT32 v;
             unsigned short posOldSource = posElem->getSource();
             unsigned short posOldSource = posElem->getSource();
 
 
             HardwareVertexBufferPtr vbuf = vertexBufferBinding->getBuffer(posOldSource);
             HardwareVertexBufferPtr vbuf = vertexBufferBinding->getBuffer(posOldSource);
@@ -176,8 +176,8 @@ namespace CamelotEngine {
                     vbuf->hasShadowBuffer());
                     vbuf->hasShadowBuffer());
             }
             }
             // Allocate new position buffer, will be FLOAT3 and 2x the size
             // Allocate new position buffer, will be FLOAT3 and 2x the size
-            size_t oldVertexCount = vbuf->getNumVertices();
-            size_t newVertexCount = oldVertexCount * 2;
+            UINT32 oldVertexCount = vbuf->getNumVertices();
+            UINT32 newVertexCount = oldVertexCount * 2;
             newPosBuffer = vbuf->getManager()->createVertexBuffer(
             newPosBuffer = vbuf->getManager()->createVertexBuffer(
                 VertexElement::getTypeSize(VET_FLOAT3), newVertexCount, vbuf->getUsage(), 
                 VertexElement::getTypeSize(VET_FLOAT3), newVertexCount, vbuf->getUsage(), 
                 vbuf->hasShadowBuffer());
                 vbuf->hasShadowBuffer());
@@ -192,7 +192,7 @@ namespace CamelotEngine {
             float* pDest2 = pDest + oldVertexCount * 3; 
             float* pDest2 = pDest + oldVertexCount * 3; 
 
 
             // Precalculate any dimensions of vertex areas outside the position
             // Precalculate any dimensions of vertex areas outside the position
-            size_t prePosVertexSize = 0, postPosVertexSize, postPosVertexOffset;
+            UINT32 prePosVertexSize = 0, postPosVertexSize, postPosVertexOffset;
             unsigned char *pBaseDestRem = 0;
             unsigned char *pBaseDestRem = 0;
             if (wasSharedBuffer)
             if (wasSharedBuffer)
             {
             {
@@ -328,9 +328,9 @@ namespace CamelotEngine {
 		// Build up a list of both old and new elements in each buffer
 		// Build up a list of both old and new elements in each buffer
 		unsigned short buf = 0;
 		unsigned short buf = 0;
 		vector<void*>::type oldBufferLocks;
 		vector<void*>::type oldBufferLocks;
-        vector<size_t>::type oldBufferVertexSizes;
+        vector<UINT32>::type oldBufferVertexSizes;
 		vector<void*>::type newBufferLocks;
 		vector<void*>::type newBufferLocks;
-        vector<size_t>::type newBufferVertexSizes;
+        vector<UINT32>::type newBufferVertexSizes;
 		VertexBufferBinding* newBinding = pManager->createVertexBufferBinding();
 		VertexBufferBinding* newBinding = pManager->createVertexBufferBinding();
         const VertexBufferBinding::VertexBufferBindingMap& oldBindingMap = vertexBufferBinding->getBindings();
         const VertexBufferBinding::VertexBufferBindingMap& oldBindingMap = vertexBufferBinding->getBindings();
         VertexBufferBinding::VertexBufferBindingMap::const_iterator itBinding;
         VertexBufferBinding::VertexBufferBindingMap::const_iterator itBinding;
@@ -338,7 +338,7 @@ namespace CamelotEngine {
         // Pre-allocate old buffer locks
         // Pre-allocate old buffer locks
         if (!oldBindingMap.empty())
         if (!oldBindingMap.empty())
         {
         {
-            size_t count = oldBindingMap.rbegin()->first + 1;
+            UINT32 count = oldBindingMap.rbegin()->first + 1;
             oldBufferLocks.resize(count);
             oldBufferLocks.resize(count);
             oldBufferVertexSizes.resize(count);
             oldBufferVertexSizes.resize(count);
         }
         }
@@ -358,7 +358,7 @@ namespace CamelotEngine {
 		buf = 0;
 		buf = 0;
 		while (!newDeclaration->findElementsBySource(buf).empty())
 		while (!newDeclaration->findElementsBySource(buf).empty())
 		{
 		{
-            size_t vertexSize = newDeclaration->getVertexSize(buf);
+            UINT32 vertexSize = newDeclaration->getVertexSize(buf);
 
 
 			HardwareVertexBufferPtr vbuf = 
 			HardwareVertexBufferPtr vbuf = 
 				pManager->createVertexBuffer(
 				pManager->createVertexBuffer(
@@ -395,7 +395,7 @@ namespace CamelotEngine {
 		}
 		}
 		// Now iterate over the new buffers, pulling data out of the old ones
 		// Now iterate over the new buffers, pulling data out of the old ones
 		// For each vertex
 		// For each vertex
-		for (size_t v = 0; v < vertexCount; ++v)
+		for (UINT32 v = 0; v < vertexCount; ++v)
 		{
 		{
 			// For each (new) element
 			// For each (new) element
 			for (ei = newElemList.begin(); ei != eiend; ++ei)
 			for (ei = newElemList.begin(); ei != eiend; ++ei)
@@ -607,7 +607,7 @@ namespace CamelotEngine {
 			{
 			{
 				void* pBase = bindi->second->lock(HardwareBuffer::HBL_NORMAL);
 				void* pBase = bindi->second->lock(HardwareBuffer::HBL_NORMAL);
 
 
-				for (size_t v = 0; v < bindi->second->getNumVertices(); ++v)
+				for (UINT32 v = 0; v < bindi->second->getNumVertices(); ++v)
 				{
 				{
 
 
 					for (elemi = elems.begin(); elemi != elems.end(); ++elemi)
 					for (elemi = elems.begin(); elemi != elems.end(); ++elemi)
@@ -789,9 +789,9 @@ namespace CamelotEngine {
 		Triangle* triangles;
 		Triangle* triangles;
 		UINT32 *dest;
 		UINT32 *dest;
 
 
-		size_t nIndexes = indexCount;
-		size_t nTriangles = nIndexes / 3;
-		size_t i, j;
+		UINT32 nIndexes = indexCount;
+		UINT32 nTriangles = nIndexes / 3;
+		UINT32 i, j;
 		UINT16 *source = 0;
 		UINT16 *source = 0;
 
 
 		if (indexBuffer->getType() == HardwareIndexBuffer::IT_16BIT)
 		if (indexBuffer->getType() == HardwareIndexBuffer::IT_16BIT)

+ 8 - 4
CamelotUtility/CamelotUtility.vcxproj

@@ -67,15 +67,19 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <OutDir>..\bin\$(Configuration)\</OutDir>
     <OutDir>..\bin\$(Configuration)\</OutDir>
+    <IntDir>.\Intermediate\$(Platform)\$(Configuration)\</IntDir>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <OutDir>..\bin\$(Platform)\$(Configuration)\</OutDir>
     <OutDir>..\bin\$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>.\Intermediate\$(Platform)\$(Configuration)\</IntDir>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <OutDir>..\bin\$(Configuration)\</OutDir>
     <OutDir>..\bin\$(Configuration)\</OutDir>
+    <IntDir>.\Intermediate\$(Platform)\$(Configuration)\</IntDir>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <OutDir>..\bin\$(Platform)\$(Configuration)\</OutDir>
     <OutDir>..\bin\$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>.\Intermediate\$(Platform)\$(Configuration)\</IntDir>
   </PropertyGroup>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
     <ClCompile>
@@ -104,9 +108,9 @@
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <ImportLibrary>..\lib\$(Configuration)\x64\$(TargetName).lib</ImportLibrary>
+      <ImportLibrary>..\lib\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
       <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>../Dependencies/lib/Debug/x64</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>../Dependencies/lib/x64/Debug</AdditionalLibraryDirectories>
       <SubSystem>NotSet</SubSystem>
       <SubSystem>NotSet</SubSystem>
       <NoEntryPoint>false</NoEntryPoint>
       <NoEntryPoint>false</NoEntryPoint>
       <EntryPointSymbol>
       <EntryPointSymbol>
@@ -145,9 +149,9 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <OptimizeReferences>true</OptimizeReferences>
-      <ImportLibrary>..\lib\$(Configuration)\x64\$(TargetName).lib</ImportLibrary>
+      <ImportLibrary>..\lib\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
       <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>../Dependencies/lib/Release/x64</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>../Dependencies/lib/x64/Release</AdditionalLibraryDirectories>
       <NoEntryPoint>false</NoEntryPoint>
       <NoEntryPoint>false</NoEntryPoint>
     </Link>
     </Link>
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>