2
0
Marko Pintera 13 жил өмнө
parent
commit
43d1b87b50
54 өөрчлөгдсөн 517 нэмэгдсэн , 436 устгасан
  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();
         /// Creates a vertex buffer
 		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
 		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

+ 6 - 6
CamelotD3D9Renderer/Include/CmD3D9HardwareIndexBuffer.h

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

+ 2 - 2
CamelotD3D9Renderer/Include/CmD3D9HardwarePixelBuffer.h

@@ -128,7 +128,7 @@ namespace CamelotEngine {
 		
 		
 		/// Get rendertarget for z slice
-		RenderTexture *getRenderTarget(size_t zoffset);
+		RenderTexture *getRenderTarget(UINT32 zoffset);
 
 		/// Accessor for surface
 		IDirect3DSurface9 *getSurface(IDirect3DDevice9* d3d9Device);
@@ -137,7 +137,7 @@ namespace CamelotEngine {
 		IDirect3DSurface9 *getFSAASurface(IDirect3DDevice9* d3d9Device);
 
 		/// 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.
 		void releaseSurfaces(IDirect3DDevice9* d3d9Device);

+ 7 - 7
CamelotD3D9Renderer/Include/CmD3D9HardwareVertexBuffer.h

@@ -39,13 +39,13 @@ namespace CamelotEngine {
     {   
 
     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();
         /** See HardwareBuffer. */
-        void readData(size_t offset, size_t length, void* pDest);
+        void readData(UINT32 offset, UINT32 length, void* pDest);
         /** 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);
 	
 		// Called immediately after the Direct3D device has been created.
@@ -71,15 +71,15 @@ namespace CamelotEngine {
 		{
 			IDirect3DVertexBuffer9*		mBuffer;
 			bool						mOutOfDate;
-			size_t						mLockOffset;
-			size_t						mLockLength;
+			UINT32						mLockOffset;
+			UINT32						mLockLength;
 			LockOptions					mLockOptions;
 			UINT32						mLastUsedFrame;
 		};
 
 	protected:		
 		/** See HardwareBuffer. */
-		void* lockImpl(size_t offset, size_t length, LockOptions options);		
+		void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);		
 		/** See HardwareBuffer. */
 		void unlockImpl(void);			
 		// updates buffer resources from system memory buffer.

+ 2 - 2
CamelotD3D9Renderer/Include/CmD3D9Texture.h

@@ -46,7 +46,7 @@ namespace CamelotEngine {
 		void copy_internal( TexturePtr& target );
 
 		/// @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
 		IDirect3DBaseTexture9 *getTexture_internal();		
@@ -136,7 +136,7 @@ namespace CamelotEngine {
 		D3DFORMAT _chooseD3DFormat(IDirect3DDevice9* d3d9Device);
 
 		/// @copydoc Resource::calculateSize
-		size_t calculateSize(void) const;
+		UINT32 calculateSize(void) const;
 		/// @copydoc Texture::createInternalResourcesImpl
 		void createInternalResourcesImpl(void);
 		/// Creates this texture resources on the specified device.

+ 2 - 2
CamelotD3D9Renderer/Source/CmD3D9HardwareBufferManager.cpp

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

+ 6 - 6
CamelotD3D9Renderer/Source/CmD3D9HardwareIndexBuffer.cpp

@@ -37,7 +37,7 @@ namespace CamelotEngine {
 
 	//---------------------------------------------------------------------
     D3D9HardwareIndexBuffer::D3D9HardwareIndexBuffer(HardwareBufferManagerBase* mgr, HardwareIndexBuffer::IndexType idxType, 
-        size_t numIndexes, HardwareBuffer::Usage usage,
+        UINT32 numIndexes, HardwareBuffer::Usage usage,
         bool useSystemMemory, bool useShadowBuffer)
         : HardwareIndexBuffer(mgr, idxType, numIndexes, usage, useSystemMemory, useShadowBuffer)
     {
@@ -89,8 +89,8 @@ namespace CamelotEngine {
 		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
 
@@ -106,7 +106,7 @@ namespace CamelotEngine {
 
 				if(bufferResources->mLockLength > 0)
 				{
-					size_t highPoint = std::max( offset + length, 
+					UINT32 highPoint = std::max( offset + length, 
 						bufferResources->mLockOffset + bufferResources->mLockLength );
 					bufferResources->mLockOffset = std::min( bufferResources->mLockOffset, offset );
 					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)
     {
        // 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,
 			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
 void fromD3DLock(PixelData &rval, const D3DLOCKED_RECT &lrect)
 {
-	size_t bpp = PixelUtil::getNumElemBytes(rval.format);
+	UINT32 bpp = PixelUtil::getNumElemBytes(rval.format);
 	if (bpp != 0)
 	{
 		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)
 {
-	size_t bpp = PixelUtil::getNumElemBytes(rval.format);
+	UINT32 bpp = PixelUtil::getNumElemBytes(rval.format);
 	if (bpp != 0)
 	{
 		rval.rowPitch = lbox.RowPitch / bpp;
@@ -611,7 +611,7 @@ void D3D9HardwarePixelBuffer::blitFromMemory(const PixelData &src, const Box &ds
 		PixelUtil::bulkPixelConversion(src, converted);
 	}
 
-	size_t rowWidth;
+	UINT32 rowWidth;
 	if (PixelUtil::isCompressed(converted.format))
 	{
 		// 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;
 		srcBox = toD3DBOX(converted);
 		destBox = toD3DBOX(dstBox);
-		size_t sliceWidth;
+		UINT32 sliceWidth;
 		if (PixelUtil::isCompressed(converted.format))
 		{
 			// D3D wants the width of one slice of cells in bytes
@@ -883,7 +883,7 @@ void D3D9HardwarePixelBuffer::_setMipmapping(bool doMipmapGen,
 	mHWMipmaps = HWMipmaps;	
 }
 //-----------------------------------------------------------------------------   
-void D3D9HardwarePixelBuffer::_clearSliceRTT(size_t zoffset)
+void D3D9HardwarePixelBuffer::_clearSliceRTT(UINT32 zoffset)
 {
 	mRenderTexture = NULL;
 }
@@ -926,7 +926,7 @@ IDirect3DSurface9* D3D9HardwarePixelBuffer::getFSAASurface(IDirect3DDevice9* d3d
 	return bufferResources->fSAASurface;
 }
 //-----------------------------------------------------------------------------    
-RenderTexture *D3D9HardwarePixelBuffer::getRenderTarget(size_t zoffset)
+RenderTexture *D3D9HardwarePixelBuffer::getRenderTarget(UINT32 zoffset)
 {
     assert(mUsage & TU_RENDERTARGET);
 	assert(mRenderTexture != NULL);   

+ 7 - 7
CamelotD3D9Renderer/Source/CmD3D9HardwareVertexBuffer.cpp

@@ -36,8 +36,8 @@ THE SOFTWARE.
 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)
         : HardwareVertexBuffer(mgr, vertexSize, numVertices, usage, useSystemMemory, useShadowBuffer)
     {
@@ -89,8 +89,8 @@ namespace CamelotEngine {
 		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
 
@@ -106,7 +106,7 @@ namespace CamelotEngine {
 
 				if(bufferResources->mLockLength > 0)
 				{
-					size_t highPoint = std::max( offset + length, 
+					UINT32 highPoint = std::max( offset + length, 
 						bufferResources->mLockOffset + bufferResources->mLockLength );
 					bufferResources->mLockOffset = std::min( bufferResources->mLockOffset, offset );
 					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)
     {
         // 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,
 		bool discardWholeBuffer)
 	{

+ 9 - 9
CamelotD3D9Renderer/Source/CmD3D9Texture.cpp

@@ -148,7 +148,7 @@ namespace CamelotEngine
 				dstTextureResource->pCubeTex)
 			{				
 				// blit to 6 cube faces
-				for (size_t face = 0; face < 6; face++)
+				for (UINT32 face = 0; face < 6; face++)
 				{
 					// get our source surface
 					IDirect3DSurface9 *pSrcSurface = 0;
@@ -289,9 +289,9 @@ namespace CamelotEngine
 		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();
 	}
@@ -916,13 +916,13 @@ namespace CamelotEngine
 		IDirect3DSurface9 *surface;
 		IDirect3DVolume9 *volume;
 		D3D9HardwarePixelBuffer *buffer;				
-		size_t mip, face;
+		UINT32 mip, face;
 
 		
 		assert(textureResources != NULL);
 		assert(textureResources->pBaseTex);
 		// Make sure number of mips is right
-		size_t numCreatedMips = textureResources->pBaseTex->GetLevelCount() - 1;
+		UINT32 numCreatedMips = textureResources->pBaseTex->GetLevelCount() - 1;
 
 		if(numCreatedMips != mNumMipmaps)
 		{
@@ -951,9 +951,9 @@ namespace CamelotEngine
 		{			
 			// Create new list of surfaces	
 			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);
 					mSurfaceList.push_back(HardwarePixelBufferPtr(buffer));
@@ -1026,7 +1026,7 @@ namespace CamelotEngine
 	}
 	#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;
 
@@ -1034,7 +1034,7 @@ namespace CamelotEngine
 			CM_EXCEPT(InvalidParametersException, "A three dimensional cube has six faces");
 		if(mipmap > mNumMipmaps)
 			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();
 		TextureResources* textureResources = getTextureResources(d3d9Device);

+ 15 - 15
CamelotGLRenderer/Include/CmGLDefaultHardwareBufferManager.h

@@ -42,28 +42,28 @@ namespace CamelotEngine {
 	protected:
 		unsigned char* mpData;
         /// @copydoc HardwareBuffer::lock
-        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);
         /// @copydoc HardwareBuffer::unlock
         void unlockImpl(void);
 
     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);
         ~GLDefaultHardwareVertexBuffer();
         /// @copydoc HardwareBuffer::readData
-        void readData(size_t offset, size_t length, void* pDest);
+        void readData(UINT32 offset, UINT32 length, void* pDest);
         /// @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);
         /** 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. */
 		void unlock(void);
 
         //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
@@ -72,23 +72,23 @@ namespace CamelotEngine {
 	protected:
 		unsigned char* mpData;
         /// @copydoc HardwareBuffer::lock
-        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);
         /// @copydoc HardwareBuffer::unlock
         void unlockImpl(void);
     public:
-		GLDefaultHardwareIndexBuffer(IndexType idxType, size_t numIndexes, HardwareBuffer::Usage usage);
+		GLDefaultHardwareIndexBuffer(IndexType idxType, UINT32 numIndexes, HardwareBuffer::Usage usage);
         ~GLDefaultHardwareIndexBuffer();
         /// @copydoc HardwareBuffer::readData
-        void readData(size_t offset, size_t length, void* pDest);
+        void readData(UINT32 offset, UINT32 length, void* pDest);
         /// @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);
         /** 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. */
         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.
@@ -105,11 +105,11 @@ namespace CamelotEngine {
         ~GLDefaultHardwareBufferManagerBase();
         /// Creates a vertex buffer
 		HardwareVertexBufferPtr 
-            createVertexBuffer(size_t vertexSize, size_t numVerts, 
+            createVertexBuffer(UINT32 vertexSize, UINT32 numVerts, 
 				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
 		/// Create a hardware vertex buffer
 		HardwareIndexBufferPtr 
-            createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+            createIndexBuffer(HardwareIndexBuffer::IndexType itype, UINT32 numIndexes, 
 				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
 
     };

+ 8 - 8
CamelotGLRenderer/Include/CmGLHardwareBufferManager.h

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

+ 6 - 6
CamelotGLRenderer/Include/CmGLHardwareIndexBuffer.h

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

+ 8 - 8
CamelotGLRenderer/Include/CmGLHardwarePixelBuffer.h

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

+ 6 - 6
CamelotGLRenderer/Include/CmGLHardwareVertexBuffer.h

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

+ 1 - 1
CamelotGLRenderer/Include/CmGLTexture.h

@@ -43,7 +43,7 @@ namespace CamelotEngine {
         virtual ~GLTexture();      
 
 		/// @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
         GLenum getGLTextureTarget_internal(void) const;

+ 14 - 14
CamelotGLRenderer/Source/CmGLDefaultHardwareBufferManager.cpp

@@ -30,14 +30,14 @@ THE SOFTWARE.
 
 namespace CamelotEngine {
 
-	GLDefaultHardwareVertexBuffer::GLDefaultHardwareVertexBuffer(size_t vertexSize, size_t numVertices, 
+	GLDefaultHardwareVertexBuffer::GLDefaultHardwareVertexBuffer(UINT32 vertexSize, UINT32 numVertices, 
 																 HardwareBuffer::Usage usage)
 	: HardwareVertexBuffer(0, vertexSize, numVertices, usage, true, false) // always software, never shadowed
 	{
 		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)
         : HardwareVertexBuffer(mgr, vertexSize, numVertices, usage, true, false) // always software, never shadowed
 	{
@@ -49,7 +49,7 @@ namespace CamelotEngine {
 		_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
 		return mpData + offset;
@@ -60,7 +60,7 @@ namespace CamelotEngine {
         // 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;
 		return mpData + offset;
@@ -72,13 +72,13 @@ namespace CamelotEngine {
         // 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);
 		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)
 	{
 		assert((offset + length) <= mSizeInBytes);
@@ -89,7 +89,7 @@ namespace CamelotEngine {
 	//-----------------------------------------------------------------------
 
 	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
 	{
 		mpData = new unsigned char[mSizeInBytes];
@@ -100,7 +100,7 @@ namespace CamelotEngine {
 		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
 		return mpData + offset;
@@ -111,7 +111,7 @@ namespace CamelotEngine {
         // 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;
 		return mpData + offset;
@@ -123,13 +123,13 @@ namespace CamelotEngine {
         // 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);
 		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)
 	{
 		assert((offset + length) <= mSizeInBytes);
@@ -151,8 +151,8 @@ namespace CamelotEngine {
 	}
     //-----------------------------------------------------------------------
 	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(
 			new GLDefaultHardwareVertexBuffer(this, vertexSize, numVerts, usage));
@@ -160,7 +160,7 @@ namespace CamelotEngine {
     //-----------------------------------------------------------------------
 	HardwareIndexBufferPtr 
         GLDefaultHardwareBufferManagerBase::createIndexBuffer(HardwareIndexBuffer::IndexType itype, 
-		size_t numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer)
+		UINT32 numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer)
 	{
 		return HardwareIndexBufferPtr(
 			new GLDefaultHardwareIndexBuffer(itype, numIndexes, usage) );

+ 4 - 4
CamelotGLRenderer/Source/CmGLHardwareBufferManager.cpp

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

+ 5 - 5
CamelotGLRenderer/Source/CmGLHardwareIndexBuffer.cpp

@@ -33,7 +33,7 @@ namespace CamelotEngine {
 
 	//---------------------------------------------------------------------
     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)
     {
         glGenBuffersARB( 1, &mBufferId );
@@ -58,8 +58,8 @@ namespace CamelotEngine {
         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;
 
@@ -162,7 +162,7 @@ namespace CamelotEngine {
         mIsLocked = false;
     }
 	//---------------------------------------------------------------------
-    void GLHardwareIndexBuffer::readData(size_t offset, size_t length, 
+    void GLHardwareIndexBuffer::readData(UINT32 offset, UINT32 length, 
         void* pDest)
     {
         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)
     {
         glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, mBufferId );

+ 10 - 10
CamelotGLRenderer/Source/CmGLHardwarePixelBuffer.cpp

@@ -36,7 +36,7 @@ THE SOFTWARE.
 
 namespace CamelotEngine {
 //----------------------------------------------------------------------------- 
-GLHardwarePixelBuffer::GLHardwarePixelBuffer(size_t inWidth, size_t inHeight, size_t inDepth,
+GLHardwarePixelBuffer::GLHardwarePixelBuffer(UINT32 inWidth, UINT32 inHeight, UINT32 inDepth,
                 PixelFormat inFormat,
                 HardwareBuffer::Usage usage):
       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");
 }
 //-----------------------------------------------------------------------------  
-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");
 }
@@ -257,10 +257,10 @@ GLTextureBuffer::GLTextureBuffer(const String &baseName, GLenum target, GLuint i
     {
         // Create render target for each slice
         mSliceTRT.reserve(mDepth);
-        for(size_t zoffset=0; zoffset<mDepth; ++zoffset)
+        for(UINT32 zoffset=0; zoffset<mDepth; ++zoffset)
         {
             String name;
-			name = "rtt/" + toString((size_t)this) + "/" + baseName;
+			name = "rtt/" + toString((UINT32)this) + "/" + baseName;
             GLSurfaceDesc surface;
             surface.buffer = this;
             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);
     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);
     switch(mTarget)
@@ -666,7 +666,7 @@ void GLTextureBuffer::blitFromTexture(GLTextureBuffer *src, const Box &srcBox, c
     }
     
     /// 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)
         {
@@ -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(zoffset < mDepth);
@@ -833,7 +833,7 @@ RenderTexture *GLTextureBuffer::getRenderTarget(size_t zoffset)
 }
 //********* 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),
     mRenderbufferID(0)
 {
@@ -862,7 +862,7 @@ GLRenderBuffer::~GLRenderBuffer()
     glDeleteRenderbuffersEXT(1, &mRenderbufferID);
 }
 //-----------------------------------------------------------------------------  
-void GLRenderBuffer::bindToFramebuffer(GLenum attachment, size_t zoffset)
+void GLRenderBuffer::bindToFramebuffer(GLenum attachment, UINT32 zoffset)
 {
     assert(zoffset < mDepth);
     glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, attachment,

+ 6 - 6
CamelotGLRenderer/Source/CmGLHardwareVertexBuffer.cpp

@@ -32,8 +32,8 @@ THE SOFTWARE.
 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)
     {
         glGenBuffersARB( 1, &mBufferId );
@@ -58,8 +58,8 @@ namespace CamelotEngine {
         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;
 
@@ -163,7 +163,7 @@ namespace CamelotEngine {
         mIsLocked = false;
     }
 	//---------------------------------------------------------------------
-    void GLHardwareVertexBuffer::readData(size_t offset, size_t length, 
+    void GLHardwareVertexBuffer::readData(UINT32 offset, UINT32 length, 
         void* pDest)
     {
         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)
     {
         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);
 		
 		// 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)
 			mNumMipmaps = maxMips;
 		
@@ -150,21 +150,21 @@ namespace CamelotEngine {
 		// Allocate internal buffer so that glTexSubImageXD can be used
 		// Internal format
 		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))
 		{
 			// 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
 			// accept a 0 pointer like normal glTexImageXD
 			// Run through this process for every mipmap to pregenerate mipmap piramid
 			UINT8 *tmpdata = new UINT8[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);
 				switch(mTextureType)
@@ -201,7 +201,7 @@ namespace CamelotEngine {
 		else
 		{
 			// 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
 				switch(mTextureType)
@@ -260,9 +260,9 @@ namespace CamelotEngine {
 	{
 		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,
 						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;
 

+ 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|Win32.ActiveCfg = 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|Mixed Platforms.ActiveCfg = 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>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
     <ProjectConfiguration Include="Release|Win32">
       <Configuration>Release</Configuration>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{9B21D41C-516B-43BF-9B10-E99B599C7589}</ProjectGuid>
@@ -22,6 +30,12 @@
     <PlatformToolset>v110</PlatformToolset>
     <CharacterSet>NotSet</CharacterSet>
   </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">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
@@ -29,15 +43,28 @@
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>NotSet</CharacterSet>
   </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" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
   <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" />
   </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'">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </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 Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
@@ -45,12 +72,24 @@
     <LibraryPath>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath)</LibraryPath>
     <OutDir>..\bin\$(Configuration)\</OutDir>
   </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'">
     <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\x86;$(LibraryPath)</LibraryPath>
     <OutDir>..\bin\$(Configuration)\</OutDir>
   </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'">
     <ClCompile>
       <PrecompiledHeader>
@@ -68,6 +107,23 @@
       <ImportLibrary>..\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
     </Link>
   </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'">
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
@@ -89,6 +145,27 @@
       <ImportLibrary>..\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
     </Link>
   </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>
     <Text Include="..\TODODoc.txt" />
     <Text Include="HighLevelTODO.txt" />

+ 1 - 1
CamelotRenderer/Include/CmCgProgram.h

@@ -84,7 +84,7 @@ namespace CamelotEngine {
         void buildConstantDefinitions() const;
 
 		/// 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
 		void mapTypeAndElementSize(CGtype cgType, bool isRegisterCombiner, GpuConstantDefinition& def) const;
 

+ 13 - 13
CamelotRenderer/Include/CmDefaultHardwareBufferManager.h

@@ -48,21 +48,21 @@ namespace CamelotEngine {
 	protected:
 		unsigned char* mpData;
         /** See HardwareBuffer. */
-        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);
         /** See HardwareBuffer. */
 		void unlockImpl(void);
     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);
         ~DefaultHardwareVertexBuffer();
         /** See HardwareBuffer. */
-        void readData(size_t offset, size_t length, void* pDest);
+        void readData(UINT32 offset, UINT32 length, void* pDest);
         /** 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);
         /** 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. */
 		void unlock(void);
 
@@ -75,19 +75,19 @@ namespace CamelotEngine {
 	protected:
 		unsigned char* mpData;
         /** See HardwareBuffer. */
-        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        void* lockImpl(UINT32 offset, UINT32 length, LockOptions options);
         /** See HardwareBuffer. */
 		void unlockImpl(void);
     public:
-		DefaultHardwareIndexBuffer(IndexType idxType, size_t numIndexes, HardwareBuffer::Usage usage);
+		DefaultHardwareIndexBuffer(IndexType idxType, UINT32 numIndexes, HardwareBuffer::Usage usage);
         ~DefaultHardwareIndexBuffer();
         /** See HardwareBuffer. */
-        void readData(size_t offset, size_t length, void* pDest);
+        void readData(UINT32 offset, UINT32 length, void* pDest);
         /** 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);
         /** 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. */
 		void unlock(void);
 
@@ -107,11 +107,11 @@ namespace CamelotEngine {
         ~DefaultHardwareBufferManagerBase();
         /// Creates a vertex buffer
 		HardwareVertexBufferPtr 
-            createVertexBuffer(size_t vertexSize, size_t numVerts, 
+            createVertexBuffer(UINT32 vertexSize, UINT32 numVerts, 
 				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
 		/// Create a hardware vertex buffer
 		HardwareIndexBufferPtr 
-            createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+            createIndexBuffer(HardwareIndexBuffer::IndexType itype, UINT32 numIndexes, 
 				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.
 		 */
-		int getNumChildren() const { return mChildren.size(); }
+		UINT32 getNumChildren() const { return (UINT32)mChildren.size(); }
 
 	private:
 		std::weak_ptr<GameObject> mParent;

+ 64 - 64
CamelotRenderer/Include/CmGpuProgramParams.h

@@ -100,14 +100,14 @@ namespace CamelotEngine {
 		/// Data type
 		GpuConstantType constType;
 		/// 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
-		size_t logicalIndex;
+		UINT32 logicalIndex;
 		/** Number of raw buffer slots per element 
 		(some programs pack each array element to float4, some do not) */
-		size_t elementSize;
+		UINT32 elementSize;
 		/// Length of array
-		size_t arraySize;
+		UINT32 arraySize;
 		/// How this parameter varies (bitwise combination of GpuProgramVariability)
 		mutable UINT16 variability;
 
@@ -163,7 +163,7 @@ namespace CamelotEngine {
 		/** 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)
 		*/
-		static size_t getElementSize(GpuConstantType ctype, bool padToMultiplesOf4)
+		static UINT32 getElementSize(GpuConstantType ctype, bool padToMultiplesOf4)
 		{
 			if (padToMultiplesOf4)
 			{
@@ -246,7 +246,7 @@ namespace CamelotEngine {
 
 		GpuConstantDefinition()
 			: constType(GCT_UNKNOWN)
-			, physicalIndex((std::numeric_limits<size_t>::max)())
+			, physicalIndex((std::numeric_limits<UINT32>::max)())
 			, elementSize(0)
 			, arraySize(1)
 			, variability(GPV_GLOBAL) {}
@@ -258,11 +258,11 @@ namespace CamelotEngine {
 	struct CM_EXPORT GpuNamedConstants
 	{
 		/// Total size of the float buffer required
-		size_t floatBufferSize;
+		UINT32 floatBufferSize;
 		/// Total size of the int buffer required
-		size_t intBufferSize;
+		UINT32 intBufferSize;
 		/// Total number of samplers referenced
-		size_t samplerCount;
+		UINT32 samplerCount;
 		/// Map of parameter names to GpuConstantDefinition
 		GpuConstantDefinitionMap map;
 
@@ -310,18 +310,18 @@ namespace CamelotEngine {
 	struct CM_EXPORT GpuLogicalIndexUse
 	{
 		/// Physical buffer index
-		size_t physicalIndex;
+		UINT32 physicalIndex;
 		/// Current physical size allocation
-		size_t currentSize;
+		UINT32 currentSize;
 		/// How the contents of this slot vary
 		mutable UINT16 variability;
 
 		GpuLogicalIndexUse() 
 			: 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) {}
 	};
-	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
 	struct CM_EXPORT GpuLogicalBufferStruct
 	{
@@ -329,7 +329,7 @@ namespace CamelotEngine {
 			/// Map from logical index to physical buffer location
 			GpuLogicalIndexUseMap map;
 		/// Shortcut to know the buffer size needs
-		size_t bufferSize;
+		UINT32 bufferSize;
 		GpuLogicalBufferStruct() : bufferSize(0) {}
 	};
 	typedef std::shared_ptr<GpuLogicalBufferStruct> GpuLogicalBufferStructPtr;
@@ -440,10 +440,10 @@ namespace CamelotEngine {
 
 		/** 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. 
 		*/
-		GpuLogicalIndexUse* _getIntConstantLogicalIndexUse(size_t logicalIndex, size_t requestedSize, UINT16 variability);
+		GpuLogicalIndexUse* _getIntConstantLogicalIndexUse(UINT32 logicalIndex, UINT32 requestedSize, UINT16 variability);
 
 	public:
 		GpuProgramParameters();
@@ -476,7 +476,7 @@ namespace CamelotEngine {
 		(each constant is a 4D float)
 		@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.
 		@note This is actually equivalent to calling 
 		setConstant(index Vector4(val, 0, 0, 0)) since all constants are 4D.
@@ -484,7 +484,7 @@ namespace CamelotEngine {
 		a 4D float)
 		@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.
 		@param index The logical constant index at which to place the parameter (each constant is
 		a 4D float).
@@ -492,14 +492,14 @@ namespace CamelotEngine {
 		value will be set to 1 (a homogeneous vector)
 		@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.
 		@param index The logical constant index at which to place the parameter (each constant is
 		a 4D float).
 		NB since a Matrix4 is 16 floats long, this parameter will take up 4 indexes.
 		@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.
 		@param index The logical constant index at which to start placing the parameter (each constant is
 		a 4D float).
@@ -507,27 +507,27 @@ namespace CamelotEngine {
 		@param m Pointer to an array of matrices to set
 		@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.
 		@param index The logical constant index at which to start placing parameters (each constant is
 		a 4D float)
 		@param val Pointer to the values to write, must contain 4*count floats
 		@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.
 		@param index The logical constant index at which to start placing parameters (each constant is
 		a 4D float)
 		@param val Pointer to the values to write, must contain 4*count floats
 		@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.
 		@param index The logical constant index at which to place the parameter (each constant is
 		a 4D float)
 		@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.
 		@remarks
@@ -543,7 +543,7 @@ namespace CamelotEngine {
 		@param val Pointer to the values to write, must contain 4*count ints
 		@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 
 		constant buffer at the given physical index.
@@ -551,41 +551,41 @@ namespace CamelotEngine {
 		@param val Pointer to a list of values 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 
 		constant buffer at the given physical index.
 		@param physicalIndex The buffer position to start writing
 		@param val Pointer to a list of values 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
 		constant buffer at the given physical index.
 		@param physicalIndex The buffer position to start writing
 		@param val Pointer to a list of values 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 
 		constant buffer at the given physical index.
 		@param physicalIndex The buffer position to start reading
 		@param count The number of floats to read
 		@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 
 		constant buffer at the given physical index.
 		@param physicalIndex The buffer position to start reading
 		@param count The number of ints to read
 		@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 
 		array at the given physical index.
 		@param physicalIndex The array position of the texture
 		@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 
 		the underlying constants buffer.
 		@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
 		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.
 		@note You can use these methods if you have already derived the physical
 		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 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.
 		@note You can use these methods if you have already derived the physical
 		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 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.
 		@note You can use these methods if you have already derived the physical
 		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 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.
 		@note You can use these methods if you have already derived the physical
 		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 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.
 		@note You can use these methods if you have already derived the physical
 		constant buffer location, for a slight speed improvement over using
@@ -638,7 +638,7 @@ namespace CamelotEngine {
 		@param m The value to set
 		@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.
 		@note You can use these methods if you have already derived the physical
 		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 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.
 		@note You can use these methods if you have already derived the physical
 		constant buffer location, for a slight speed improvement over using
@@ -655,7 +655,7 @@ namespace CamelotEngine {
 		@param m The value to set
 		@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.
 		@note You can use these methods if you have already derived the physical
 		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
 		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
@@ -698,15 +698,15 @@ namespace CamelotEngine {
 		/** Retrieves the logical index relating to a physical index in the float
 		buffer, for programs which support that (low-level programs and 
 		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
 		buffer, for programs which support that (low-level programs and 
 		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
 		to physical buffer locations in the integer buffer.
@@ -717,21 +717,21 @@ namespace CamelotEngine {
 		/// Get a reference to the list of float constants
 		const FloatConstantList& getFloatConstantList() const { return mFloatConstants; }
 		/// 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
-		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
 		const IntConstantList& getIntConstantList() const { return mIntConstants; }
 		/// 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
-		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; }
-		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
 		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.
 		*/
@@ -857,7 +857,7 @@ namespace CamelotEngine {
 		@param m Pointer to an array of matrices to set
 		@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.
 		@param name The name of the parameter
 		@param m The value to set
@@ -879,8 +879,8 @@ namespace CamelotEngine {
 		@param multiple The number of raw entries in each element to write, 
 		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.
 		@par
 		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, 
 		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.
 		@param name The name of the parameter
 		@param colour The value to set
@@ -921,8 +921,8 @@ namespace CamelotEngine {
 		@param multiple The number of raw entries in each element to write, 
 		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.
@@ -944,16 +944,16 @@ namespace CamelotEngine {
 		@note Only applicable to low-level programs.
 		@param logicalIndex The logical parameter index
 		@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. 
 		@note Only applicable to low-level programs.
 		@param logicalIndex The logical parameter index
 		@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.
 		@remarks

+ 11 - 11
CamelotRenderer/Include/CmHardwareBuffer.h

@@ -137,11 +137,11 @@ namespace CamelotEngine {
     			
 		    };
 	    protected:
-		    size_t mSizeInBytes;
+		    UINT32 mSizeInBytes;
 		    Usage mUsage;
 		    bool mIsLocked;
-			size_t mLockStart;
-			size_t mLockSize;
+			UINT32 mLockStart;
+			UINT32 mLockSize;
 			bool mSystemMemory;
             bool mUseShadowBuffer;
             HardwareBuffer* mpShadowBuffer;
@@ -149,7 +149,7 @@ namespace CamelotEngine {
             bool mSuppressHardwareUpdate;
     		
             /// 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()
 		    virtual void unlockImpl(void) = 0;
 
@@ -177,7 +177,7 @@ namespace CamelotEngine {
 		    @param options Locking options
 		    @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!");
                 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 
                 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
                 ensure that your buffer is big enough.
 		    @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,
 				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;
 
 			/** 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 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(
 					srcOffset, length, HBL_READ_ONLY);
@@ -287,7 +287,7 @@ namespace CamelotEngine {
 			*/
 			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);
 			}
 			
@@ -317,7 +317,7 @@ namespace CamelotEngine {
             }
 
             /// 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
             Usage getUsage(void) const { return mUsage; }
 			/// 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.
         */
 		virtual HardwareVertexBufferPtr 
-            createVertexBuffer(size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage, 
+            createVertexBuffer(UINT32 vertexSize, UINT32 numVerts, HardwareBuffer::Usage usage, 
 			bool useShadowBuffer = false) = 0;
 		/** Create a hardware index buffer.
         @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.
         */
 		virtual HardwareIndexBufferPtr 
-            createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+            createIndexBuffer(HardwareIndexBuffer::IndexType itype, UINT32 numIndexes, 
 			HardwareBuffer::Usage usage, bool useShadowBuffer = false) = 0;
 
         /** Creates a new vertex declaration. */
@@ -194,14 +194,14 @@ namespace CamelotEngine {
 
 		/** @copydoc HardwareBufferManagerInterface::createVertexBuffer */
 		HardwareVertexBufferPtr 
-            createVertexBuffer(size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage, 
+            createVertexBuffer(UINT32 vertexSize, UINT32 numVerts, HardwareBuffer::Usage usage, 
 			bool useShadowBuffer = false)
 		{
 			return mImpl->createVertexBuffer(vertexSize, numVerts, usage, useShadowBuffer);
 		}
 		/** @copydoc HardwareBufferManagerInterface::createIndexBuffer */
 		HardwareIndexBufferPtr 
-            createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+            createIndexBuffer(HardwareIndexBuffer::IndexType itype, UINT32 numIndexes, 
 			HardwareBuffer::Usage usage, bool useShadowBuffer = false)
 		{
 			return mImpl->createIndexBuffer(itype, numIndexes, usage, useShadowBuffer);

+ 5 - 5
CamelotRenderer/Include/CmHardwareIndexBuffer.h

@@ -53,12 +53,12 @@ namespace CamelotEngine {
 	    protected:
 			HardwareBufferManagerBase* mMgr;
 		    IndexType mIndexType;
-		    size_t mNumIndexes;
-            size_t mIndexSize;
+		    UINT32 mNumIndexes;
+            UINT32 mIndexSize;
 
 	    public:
 		    /// 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);
             ~HardwareIndexBuffer();
 			/// Return the manager of this buffer, if any
@@ -66,9 +66,9 @@ namespace CamelotEngine {
     		/// Get the type of indexes used in this buffer
             IndexType getType(void) const { return mIndexType; }
             /// 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
-            size_t getIndexSize(void) const { return mIndexSize; }
+            UINT32 getIndexSize(void) const { return mIndexSize; }
 
 		    // NB subclasses should override lock, unlock, readData, writeData
     };

+ 12 - 12
CamelotRenderer/Include/CmHardwarePixelBuffer.h

@@ -51,9 +51,9 @@ namespace CamelotEngine {
     {
     protected: 
         // Extents
-        size_t mWidth, mHeight, mDepth;
+        UINT32 mWidth, mHeight, mDepth;
         // Pitches (offsets between rows and slices)
-        size_t mRowPitch, mSlicePitch;
+        UINT32 mRowPitch, mSlicePitch;
         // Internal format
         PixelFormat mFormat;
         // Currently locked region (local coords)
@@ -67,7 +67,7 @@ namespace CamelotEngine {
 
         /// Internal implementation of lock(), do not OVERRIDE or CALL this
         /// 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
         // virtual void unlockImpl(void) = 0;
@@ -75,11 +75,11 @@ namespace CamelotEngine {
 		/** Notify TextureBuffer of destruction of render target.
 			Called by RenderTexture when destroyed.
 		*/
-		virtual void _clearSliceRTT(size_t zoffset);
+		virtual void _clearSliceRTT(UINT32 zoffset);
 		friend class RenderTexture;
     public:
         /// Should be called by HardwareBufferManager
-        HardwarePixelBuffer(size_t mWidth, size_t mHeight, size_t mDepth,
+        HardwarePixelBuffer(UINT32 mWidth, UINT32 mHeight, UINT32 mDepth,
                 PixelFormat mFormat,
                 HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer);
         ~HardwarePixelBuffer();
@@ -97,7 +97,7 @@ namespace CamelotEngine {
 		*/
 		virtual const PixelData& lock(const Box& lockBox, LockOptions options);
 		/// @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
 		    by lock(const Image::Box, LockOptions)
@@ -106,9 +106,9 @@ namespace CamelotEngine {
         const PixelData& getCurrentLock();
 		
 		/// @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
-		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);
         
         /** 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
             PixelBuffer.
         */
-        virtual RenderTexture *getRenderTarget(size_t slice=0);
+        virtual RenderTexture *getRenderTarget(UINT32 slice=0);
         
         /// Gets the width of this buffer
-        size_t getWidth() const { return mWidth; }
+        UINT32 getWidth() const { return mWidth; }
         /// Gets the height of this buffer
-        size_t getHeight() const { return mHeight; }
+        UINT32 getHeight() const { return mHeight; }
         /// 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
         PixelFormat getFormat() const { return mFormat; }
     };

+ 16 - 16
CamelotRenderer/Include/CmHardwareVertexBuffer.h

@@ -49,20 +49,20 @@ namespace CamelotEngine {
 	    protected:
 
 			HardwareBufferManagerBase* mMgr;
-		    size_t mNumVertices;
-            size_t mVertexSize;
+		    UINT32 mNumVertices;
+            UINT32 mVertexSize;
 
 	    public:
 		    /// 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);
             ~HardwareVertexBuffer();
 			/// Return the manager of this buffer, if any
 			HardwareBufferManagerBase* getManager() const { return mMgr; }
             /// 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
-            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
         unsigned short mSource;
         /// The offset in the buffer that this element starts at
-        size_t mOffset;
+        UINT32 mOffset;
         /// The type of element
         VertexElementType mType;
         /// The meaning of the element
@@ -141,12 +141,12 @@ namespace CamelotEngine {
 		/// Constructor, should not be called directly, only needed because of list
 		VertexElement() {}
         /// 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);
         /// Gets the vertex buffer index from where this element draws it's values
         unsigned short getSource(void) const { return mSource; }
         /// 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
         VertexElementType getType(void) const { return mType; }
         /// Gets the meaning of this element
@@ -154,9 +154,9 @@ namespace CamelotEngine {
         /// Gets the index of this element, only applicable for repeating elements
         unsigned short getIndex(void) const { return mIndex; }
 		/// Gets the size of this element in bytes
-		size_t getSize(void) const;
+		UINT32 getSize(void) const;
 		/// 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
 		static unsigned short getTypeCount(VertexElementType etype);
 		/** Simple converter function which will turn a single-value type into a
@@ -309,7 +309,7 @@ namespace CamelotEngine {
         virtual ~VertexDeclaration();
 
         /** 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. */
         const VertexElementList& getElements(void) const;
         /** Get a single element. */
@@ -355,7 +355,7 @@ namespace CamelotEngine {
         @param index Optional index for multi-input elements like texture coordinates
 		@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);
         /** Inserts a new VertexElement at a given position in this declaration.
         @remarks
@@ -371,7 +371,7 @@ namespace CamelotEngine {
         @returns A reference to the VertexElement added.
         */
         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);
 
         /** Remove the element at the given index from this declaration. */
@@ -393,7 +393,7 @@ namespace CamelotEngine {
 	   <b>Please read the information in VertexDeclaration about
 	    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);
 
 		/** 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);
 
 		/** 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. 
 		@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
 		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.
 		@remarks

+ 5 - 5
CamelotRenderer/Include/CmMaterialRTTI.h

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

+ 2 - 2
CamelotRenderer/Include/CmMeshDataRTTI.h

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

+ 1 - 1
CamelotRenderer/Include/CmShaderRTTI.h

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

+ 1 - 1
CamelotRenderer/Include/CmTechnique.h

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

+ 1 - 1
CamelotRenderer/Include/CmTechniqueRTTI.h

@@ -27,7 +27,7 @@ namespace CamelotEngine
 
 		UINT32 getPassArraySize(Technique* obj)
 		{
-			return obj->mPasses.size();
+			return (UINT32)obj->mPasses.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.
         */
-        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, 
 		hardware gamma correction is applied.
@@ -118,15 +118,15 @@ namespace CamelotEngine {
 
 		/** 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.
         */
-        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).
         */
-        virtual size_t getDepth(void) const { return mDepth; }
+        virtual UINT32 getDepth(void) const { return mDepth; }
 
         /** 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
         	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
 			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.
 						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.
 		 This method of retrieving information should only be used if you know what you're doing.
@@ -226,11 +226,11 @@ namespace CamelotEngine {
     protected:
 		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;
 		UINT32 mFSAA;
 		String mFSAAHint;
@@ -247,7 +247,7 @@ namespace CamelotEngine {
 		 * 			
 		 * @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);
 		
 		/**
@@ -256,7 +256,7 @@ namespace CamelotEngine {
 		virtual void initialize_internal() = 0;
 
 		/// @copydoc Resource::calculateSize
-		size_t calculateSize(void) const;
+		UINT32 calculateSize(void) const;
 
         /** Creates the internal texture resources for this texture. 
         @remarks

+ 4 - 4
CamelotRenderer/Include/CmTextureRTTI.h

@@ -29,8 +29,8 @@ namespace CamelotEngine
 
 		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);
 		}
@@ -97,8 +97,8 @@ namespace CamelotEngine
 			vector<PixelDataPtr>::type* pixelData = boost::any_cast<vector<PixelDataPtr>::type*>(texture->mRTTIData);
 			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);
 			}

+ 2 - 2
CamelotRenderer/Include/CmVertexDeclarationRTTI.h

@@ -29,12 +29,12 @@ namespace CamelotEngine
 
 		UINT32 getElementArraySize(VertexDeclaration* obj)
 		{
-			return obj->mElementList.size();
+			return (UINT32)obj->mElementList.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());
 		}
 

+ 4 - 4
CamelotRenderer/Include/CmVertexIndexData.h

@@ -84,9 +84,9 @@ namespace CamelotEngine {
 		/// Whether this class should delete the declaration and binding
 		bool mDeleteDclBinding;
 		/// The base vertex index to start from
-		size_t vertexStart;
+		UINT32 vertexStart;
 		/// The number of vertices used in this operation
-		size_t vertexCount;
+		UINT32 vertexCount;
 		
 		/** 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
@@ -218,10 +218,10 @@ namespace CamelotEngine {
 		HardwareIndexBufferPtr indexBuffer;
 
 		/// index in the buffer to start from for this operation
-		size_t indexStart;
+		UINT32 indexStart;
 
 		/// The number of indexes to use from the buffer
-		size_t indexCount;
+		UINT32 indexCount;
 
 		/** Clones this index data, potentially including replicating the index buffer.
 		@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));
 	}
 	//---------------------------------------------------------------------
-	void CgProgram::recurseParams(CGparameter parameter, size_t contextArraySize) const
+	void CgProgram::recurseParams(CGparameter parameter, UINT32 contextArraySize) const
 	{
 		while (parameter != 0)
         {
@@ -245,12 +245,12 @@ namespace CamelotEngine {
 				default:
 					// Normal path (leaf)
 					String paramName = cgGetParameterName(parameter);
-					size_t logicalIndex = cgGetParameterResourceIndex(parameter);
+					UINT32 logicalIndex = (UINT32)cgGetParameterResourceIndex(parameter);
 
 					// Get the parameter resource, to calculate the physical index
 					CGresource res = cgGetParameterResource(parameter);
 					bool isRegisterCombiner = false;
-					size_t regCombinerPhysicalIndex = 0;
+					UINT32 regCombinerPhysicalIndex = 0;
 					switch (res)
 					{
 					case CG_COMBINER_STAGE_CONST0:

+ 14 - 14
CamelotRenderer/Source/CmDefaultHardwareBufferManager.cpp

@@ -30,7 +30,7 @@ THE SOFTWARE.
 
 namespace CamelotEngine {
 
-	DefaultHardwareVertexBuffer::DefaultHardwareVertexBuffer(size_t vertexSize, size_t numVertices, 
+	DefaultHardwareVertexBuffer::DefaultHardwareVertexBuffer(UINT32 vertexSize, UINT32 numVertices, 
 															 HardwareBuffer::Usage usage)
 	: 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));
 	}
 	//-----------------------------------------------------------------------
-	DefaultHardwareVertexBuffer::DefaultHardwareVertexBuffer(HardwareBufferManagerBase* mgr, size_t vertexSize, size_t numVertices, 
+	DefaultHardwareVertexBuffer::DefaultHardwareVertexBuffer(HardwareBufferManagerBase* mgr, UINT32 vertexSize, UINT32 numVertices, 
 		HardwareBuffer::Usage usage)
         : HardwareVertexBuffer(mgr, vertexSize, numVertices, usage, true, false) // always software, never shadowed
 	{
@@ -51,7 +51,7 @@ namespace CamelotEngine {
 		_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
 		return mpData + offset;
@@ -62,7 +62,7 @@ namespace CamelotEngine {
         // 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;
 		return mpData + offset;
@@ -74,13 +74,13 @@ namespace CamelotEngine {
         // 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);
 		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)
 	{
 		assert((offset + length) <= mSizeInBytes);
@@ -91,7 +91,7 @@ namespace CamelotEngine {
 	//-----------------------------------------------------------------------
 
 	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
 	{
 		mpData = (unsigned char*)malloc(sizeof(unsigned char) * mSizeInBytes);
@@ -102,7 +102,7 @@ namespace CamelotEngine {
 		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
 		return mpData + offset;
@@ -113,7 +113,7 @@ namespace CamelotEngine {
         // 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;
 		return mpData + offset;
@@ -125,13 +125,13 @@ namespace CamelotEngine {
         // 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);
 		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)
 	{
 		assert((offset + length) <= mSizeInBytes);
@@ -151,8 +151,8 @@ namespace CamelotEngine {
 	}
     //-----------------------------------------------------------------------
 	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);
         return HardwareVertexBufferPtr(vb);
@@ -160,7 +160,7 @@ namespace CamelotEngine {
     //-----------------------------------------------------------------------
 	HardwareIndexBufferPtr 
         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);
 		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
 
 		// paramName[0] version will always exist 
-		size_t maxArrayIndex = 1;
+		UINT32 maxArrayIndex = 1;
 		if (baseDef.arraySize <= 16 || msGenerateAllConstantDefinitionArrayEntries)
 			maxArrayIndex = baseDef.arraySize;
 
-		for (size_t i = 0; i < maxArrayIndex; i++)
+		for (UINT32 i = 0; i < maxArrayIndex; i++)
 		{
 			arrayName = paramName + "[" + toString(i) + "]";
 			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);
 	}
 	//-----------------------------------------------------------------------------
-	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));
 	}
 	//-----------------------------------------------------------------------------
-	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));
 	}
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::setConstant(size_t index, const Matrix4& m)
+	void GpuProgramParameters::setConstant(UINT32 index, const Matrix4& m)
 	{
 		// set as 4x 4-element floats
 		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)
 		{
-			for (size_t i = 0; i < numEntries; ++i)
+			for (UINT32 i = 0; i < numEntries; ++i)
 			{
 				Matrix4 t = pMatrix[i].transpose();
 				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);
 	}
 	//-----------------------------------------------------------------------------
-	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
-		size_t rawCount = count * 4;
+		UINT32 rawCount = count * 4;
 		// get physical index
 		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 
 		_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
-		size_t rawCount = count * 4;
+		UINT32 rawCount = count * 4;
 		// get physical index
 		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());
 		// Copy manually since cast required
-		for (size_t i = 0; i < rawCount; ++i)
+		for (UINT32 i = 0; i < rawCount; ++i)
 		{
 			mFloatConstants[physicalIndex + 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
-		size_t rawCount = count * 4;
+		UINT32 rawCount = count * 4;
 		// get physical index
 		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 
 		_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
 		// 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);
 	}
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, int val)
+	void GpuProgramParameters::_writeRawConstant(UINT32 physicalIndex, int val)
 	{
 		_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);		
 	}
 	//-----------------------------------------------------------------------------
-	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, const Vector2& vec)
+	void GpuProgramParameters::_writeRawConstant(UINT32 physicalIndex, const Vector2& vec)
 	{
 		_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
@@ -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
 		if (mTransposeMatrices)
 		{
-			for (size_t i = 0; i < numEntries; ++i)
+			for (UINT32 i = 0; i < numEntries; ++i)
 			{
 				Matrix4 t = pMatrix[i].transpose();
 				_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
 		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
-		_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());
-		for (size_t i = 0; i < count; ++i)
+		for (UINT32 i = 0; i < count; ++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());
 		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());
 		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());
 		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());
 		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());
 		dest = mTextures[physicalIndex]->texture;
 	}
 	//---------------------------------------------------------------------
 	GpuLogicalIndexUse* GpuProgramParameters::_getFloatConstantLogicalIndexUse(
-		size_t logicalIndex, size_t requestedSize, UINT16 variability)
+		UINT32 logicalIndex, UINT32 requestedSize, UINT16 variability)
 	{
 		if (mFloatLogicalToPhysical == nullptr)
 			return 0;
@@ -412,24 +412,24 @@ namespace CamelotEngine
 		{
 			if (requestedSize)
 			{
-				size_t physicalIndex = mFloatConstants.size();
+				UINT32 physicalIndex = (UINT32)mFloatConstants.size();
 
 				// Expand at buffer end
 				mFloatConstants.insert(mFloatConstants.end(), requestedSize, 0.0f);
 
 				// 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 
 				// populate it. Other params objects will be able to just use this
 				// accepted mapping since the constant structure will be the same
 
 				// 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;
 
-				for (size_t logicalNum = 0; logicalNum < count; ++logicalNum)
+				for (UINT32 logicalNum = 0; logicalNum < count; ++logicalNum)
 				{
 					GpuLogicalIndexUseMap::iterator it = 
 						mFloatLogicalToPhysical->map.insert(
@@ -453,7 +453,7 @@ namespace CamelotEngine
 		}
 		else
 		{
-			size_t physicalIndex = logi->second.physicalIndex;
+			UINT32 physicalIndex = logi->second.physicalIndex;
 			indexUse = &(logi->second);
 			// check size
 			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
 				// of the original use, or perhaps a variable length we can't predict
 				// 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();
 				std::advance(insertPos, physicalIndex);
 				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)
 		{
@@ -511,23 +511,23 @@ namespace CamelotEngine
 		{
 			if (requestedSize)
 			{
-				size_t physicalIndex = mIntConstants.size();
+				UINT32 physicalIndex = (UINT32)mIntConstants.size();
 
 				// Expand at buffer end
 				mIntConstants.insert(mIntConstants.end(), requestedSize, 0);
 
 				// 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 
 				// populate it. Other params objects will be able to just use this
 				// accepted mapping since the constant structure will be the same
 
 				// 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;
-				for (size_t logicalNum = 0; logicalNum < count; ++logicalNum)
+				for (UINT32 logicalNum = 0; logicalNum < count; ++logicalNum)
 				{
 					GpuLogicalIndexUseMap::iterator it = 
 						mIntLogicalToPhysical->map.insert(
@@ -550,7 +550,7 @@ namespace CamelotEngine
 		}
 		else
 		{
-			size_t physicalIndex = logi->second.physicalIndex;
+			UINT32 physicalIndex = logi->second.physicalIndex;
 			indexUse = &(logi->second);
 
 			// check size
@@ -559,7 +559,7 @@ namespace CamelotEngine
 				// 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
 				// 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();
 				std::advance(insertPos, physicalIndex);
 				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);
 		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);
 		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)
 		for (GpuLogicalIndexUseMap::iterator i = mFloatLogicalToPhysical->map.begin();
@@ -616,11 +616,11 @@ namespace CamelotEngine
 			if (i->second.physicalIndex == physicalIndex)
 				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)
 		for (GpuLogicalIndexUseMap::iterator i = mIntLogicalToPhysical->map.begin();
@@ -629,7 +629,7 @@ namespace CamelotEngine
 			if (i->second.physicalIndex == physicalIndex)
 				return i->first;
 		}
-		return std::numeric_limits<size_t>::max();
+		return std::numeric_limits<UINT32>::max();
 
 	}
 	//-----------------------------------------------------------------------------
@@ -671,7 +671,7 @@ namespace CamelotEngine
 		return *def;
 	}
 	//----------------------------------------------------------------------------
-	TextureHandle GpuProgramParameters::getTexture(size_t pos) const 
+	TextureHandle GpuProgramParameters::getTexture(UINT32 pos) const 
 	{ 
 		if(mTextures[pos] == nullptr)
 		{
@@ -681,7 +681,7 @@ namespace CamelotEngine
 		return mTextures[pos]->texture; 
 	}
 	//----------------------------------------------------------------------------
-	const SamplerState& GpuProgramParameters::getSamplerState(size_t pos) const 
+	const SamplerState& GpuProgramParameters::getSamplerState(UINT32 pos) const 
 	{ 
 		if(mTextures[pos] == nullptr)
 		{
@@ -813,7 +813,7 @@ namespace CamelotEngine
 	}
 	//---------------------------------------------------------------------------
 	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
 		const GpuConstantDefinition* def = 
@@ -832,9 +832,9 @@ namespace CamelotEngine
 	}
 	//---------------------------------------------------------------------------
 	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
 		const GpuConstantDefinition* def = 
 			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
@@ -843,9 +843,9 @@ namespace CamelotEngine
 	}
 	//---------------------------------------------------------------------------
 	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
 		const GpuConstantDefinition* def = 
 			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
@@ -863,9 +863,9 @@ namespace CamelotEngine
 	}
 	//---------------------------------------------------------------------------
 	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
 		const GpuConstantDefinition* def = 
 			_findNamedConstantDefinition(name, !mIgnoreMissingParams);

+ 1 - 1
CamelotRenderer/Source/CmHardwareIndexBuffer.cpp

@@ -35,7 +35,7 @@ namespace CamelotEngine {
 
     //-----------------------------------------------------------------------------
     HardwareIndexBuffer::HardwareIndexBuffer(HardwareBufferManagerBase* mgr, IndexType idxType, 
-        size_t numIndexes, HardwareBuffer::Usage usage, 
+        UINT32 numIndexes, HardwareBuffer::Usage usage, 
         bool useSystemMemory, bool useShadowBuffer) 
         : HardwareBuffer(usage, useSystemMemory, useShadowBuffer)
 		, 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,
             HardwareBuffer::Usage usage, bool useSystemMemory, bool 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(offset == 0 && length == mSizeInBytes && "Cannot lock memory region, most lock box or entire buffer");
@@ -95,7 +95,7 @@ namespace CamelotEngine
     
     //-----------------------------------------------------------------------------    
     /// 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");
     }
@@ -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
 		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)
 	{
 		// TODO
@@ -166,7 +166,7 @@ namespace CamelotEngine
 	}
     //-----------------------------------------------------------------------------    
     
-    RenderTexture *HardwarePixelBuffer::getRenderTarget(size_t)
+    RenderTexture *HardwarePixelBuffer::getRenderTarget(UINT32)
     {
         CM_EXCEPT(NotImplementedException,
 				"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 {
 
     //-----------------------------------------------------------------------------
-    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) 
         : HardwareBuffer(usage, useSystemMemory, useShadowBuffer), 
 		  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)
         : mSource(source), mOffset(offset), mType(theType), 
         mSemantic(semantic), mIndex(index)
     {
     }
     //-----------------------------------------------------------------------------
-	size_t VertexElement::getSize(void) const
+	UINT32 VertexElement::getSize(void) const
 	{
 		return getTypeSize(mType);
 	}
 	//-----------------------------------------------------------------------------
-	size_t VertexElement::getTypeSize(VertexElementType etype)
+	UINT32 VertexElement::getTypeSize(VertexElementType etype)
 	{
 		switch(etype)
 		{
@@ -274,7 +274,7 @@ namespace CamelotEngine {
     }
     //-----------------------------------------------------------------------------
     const VertexElement& VertexDeclaration::addElement(unsigned short source, 
-        size_t offset, VertexElementType theType,
+        UINT32 offset, VertexElementType theType,
         VertexElementSemantic semantic, unsigned short index)
     {
 		// Refine colour type to a specific type
@@ -289,7 +289,7 @@ namespace CamelotEngine {
     }
     //-----------------------------------------------------------------------------
     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)
     {
         if (atPosition >= mElementList.size())
@@ -348,7 +348,7 @@ namespace CamelotEngine {
 	}
     //-----------------------------------------------------------------------------
     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)
     {
         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;
 		iend = mElementList.end();
-		size_t sz = 0;
+		UINT32 sz = 0;
 
 		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);
 					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]);
 					}
 					else

+ 2 - 2
CamelotRenderer/Source/CmSceneManager.cpp

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

+ 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)
 	{
 		mTextureType = textureType;
@@ -82,12 +82,12 @@ namespace CamelotEngine {
         return PixelUtil::hasAlpha(mFormat);
     }
     //--------------------------------------------------------------------------
-	size_t Texture::calculateSize(void) const
+	UINT32 Texture::calculateSize(void) const
 	{
         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;
 	}

+ 13 - 13
CamelotRenderer/Source/CmVertexIndexData.cpp

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

+ 8 - 4
CamelotUtility/CamelotUtility.vcxproj

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