Ver Fonte

Switch to uintXX_t

Daniele Bartolini há 13 anos atrás
pai
commit
c88f8d776d
100 ficheiros alterados com 730 adições e 730 exclusões
  1. 2 2
      src/Data.h
  2. 3 3
      src/Device.cpp
  3. 3 3
      src/Device.h
  4. 7 7
      src/EventBuffer.cpp
  5. 2 2
      src/EventBuffer.h
  6. 2 2
      src/Font.cpp
  7. 9 9
      src/Font.h
  8. 25 25
      src/Image.cpp
  9. 12 12
      src/Image.h
  10. 3 3
      src/IndexBuffer.h
  11. 6 6
      src/Material.cpp
  12. 3 3
      src/Material.h
  13. 12 12
      src/Mesh.cpp
  14. 4 4
      src/Mesh.h
  15. 2 2
      src/MeshChunk.cpp
  16. 7 7
      src/MeshManager.cpp
  17. 1 1
      src/MeshManager.h
  18. 1 1
      src/OcclusionQuery.h
  19. 2 2
      src/Pixel.cpp
  20. 2 2
      src/Pixel.h
  21. 12 12
      src/Renderer.h
  22. 1 1
      src/ResourceManager.cpp
  23. 8 8
      src/System.h
  24. 38 38
      src/Terrain.cpp
  25. 19 19
      src/Terrain.h
  26. 11 11
      src/TextRenderer.cpp
  27. 3 3
      src/TextRenderer.h
  28. 4 4
      src/Texture.h
  29. 4 4
      src/VertexBuffer.h
  30. 5 5
      src/World.h
  31. 6 6
      src/core/Types.h
  32. 3 3
      src/core/bv/Box.h
  33. 1 1
      src/core/bv/Frustum.cpp
  34. 1 1
      src/core/bv/Frustum.h
  35. 1 1
      src/core/bv/Rect.cpp
  36. 1 1
      src/core/bv/Rect.h
  37. 29 29
      src/core/containers/Array.h
  38. 30 30
      src/core/containers/Generic.cpp
  39. 8 8
      src/core/containers/Generic.h
  40. 16 16
      src/core/containers/List.h
  41. 60 60
      src/core/containers/Str.h
  42. 32 32
      src/core/math/Color4.h
  43. 3 3
      src/core/math/Intersection.h
  44. 4 4
      src/core/math/Mat3.cpp
  45. 3 3
      src/core/math/Mat3.h
  46. 4 4
      src/core/math/Mat4.cpp
  47. 3 3
      src/core/math/Mat4.h
  48. 4 4
      src/core/math/MathUtils.h
  49. 4 4
      src/core/math/Point2.h
  50. 4 4
      src/core/math/Vec2.h
  51. 4 4
      src/core/math/Vec3.h
  52. 4 4
      src/core/math/Vec4.h
  53. 3 3
      src/core/mem/MallocAllocator.cpp
  54. 1 1
      src/core/mem/Memory.h
  55. 3 3
      src/core/streams/FileStream.cpp
  56. 2 2
      src/core/streams/FileStream.h
  57. 3 3
      src/core/streams/FileSubStream.cpp
  58. 2 2
      src/core/streams/FileSubStream.h
  59. 9 9
      src/core/streams/MemoryStream.cpp
  60. 7 7
      src/core/streams/MemoryStream.h
  61. 4 4
      src/core/streams/NullStream.h
  62. 17 17
      src/core/streams/Stream.cpp
  63. 9 9
      src/core/streams/Stream.h
  64. 10 10
      src/input/EventDispatcher.cpp
  65. 4 4
      src/input/InputManager.cpp
  66. 1 1
      src/input/KeyCode.h
  67. 20 20
      src/loaders/BMPImageLoader.cpp
  68. 18 18
      src/loaders/TGAImageLoader.cpp
  69. 11 11
      src/loaders/TGAImageLoader.h
  70. 14 14
      src/os/OS.h
  71. 5 5
      src/os/android/AndroidRenderWindow.cpp
  72. 4 4
      src/os/android/AndroidRenderWindow.h
  73. 4 4
      src/os/android/AndroidTimer.cpp
  74. 4 4
      src/os/android/AndroidTimer.h
  75. 5 5
      src/os/linux/EGLRenderWindow.cpp
  76. 4 4
      src/os/linux/EGLRenderWindow.h
  77. 4 4
      src/os/linux/GLXRenderWindow.cpp
  78. 3 3
      src/os/linux/Input.cpp
  79. 2 2
      src/os/linux/LinuxTCPSocket.cpp
  80. 4 4
      src/os/linux/LinuxTimer.cpp
  81. 4 4
      src/os/linux/LinuxTimer.h
  82. 3 3
      src/os/linux/LinuxUDPSocket.cpp
  83. 4 4
      src/os/win/WGLRenderWindow.cpp
  84. 4 4
      src/os/win/WGLRenderWindow.h
  85. 1 1
      src/os/win/WinKeyboard.h
  86. 3 3
      src/os/win/WinMouse.cpp
  87. 1 1
      src/os/win/WinTCPSocket.cpp
  88. 12 12
      src/os/win/WinTimer.cpp
  89. 7 7
      src/os/win/WinTimer.h
  90. 3 3
      src/os/win/WinUDPSocket.cpp
  91. 4 4
      src/renderers/gl/GLIndexBuffer.cpp
  92. 5 5
      src/renderers/gl/GLIndexBuffer.h
  93. 3 3
      src/renderers/gl/GLOcclusionQuery.cpp
  94. 2 2
      src/renderers/gl/GLOcclusionQuery.h
  95. 23 23
      src/renderers/gl/GLRenderer.cpp
  96. 16 16
      src/renderers/gl/GLRenderer.h
  97. 1 1
      src/renderers/gl/GLTexture.cpp
  98. 8 8
      src/renderers/gl/GLVertexBuffer.cpp
  99. 7 7
      src/renderers/gl/GLVertexBuffer.h
  100. 4 4
      src/renderers/gles/GLESIndexBuffer.cpp

+ 2 - 2
src/Data.h

@@ -59,7 +59,7 @@ struct FaceData
 {
 	FaceData() {}
 
-	FaceData(ushort v1, ushort v2, ushort v3)
+	FaceData(uint16_t v1, uint16_t v2, uint16_t v3)
 	{
 		vertex[0] = (v1);
 		vertex[1] = (v2);
@@ -71,7 +71,7 @@ struct FaceData
 		return vertex[0] == other.vertex[0] && vertex[1] == other.vertex[1] && vertex[2] == other.vertex[2];
 	}
 
-	ushort vertex[3];
+	uint16_t vertex[3];
 };
 
 } // namespace crown

+ 3 - 3
src/Device.cpp

@@ -37,9 +37,9 @@ OTHER DEALINGS IN THE SOFTWARE.
 namespace crown
 {
 
-const ushort Device::CROWN_MAJOR = 0;
-const ushort Device::CROWN_MINOR = 1;
-const ushort Device::CROWN_MICRO = 0;
+const uint16_t Device::CROWN_MAJOR = 0;
+const uint16_t Device::CROWN_MINOR = 1;
+const uint16_t Device::CROWN_MICRO = 0;
 
 //-----------------------------------------------------------------------------
 Device::Device() :

+ 3 - 3
src/Device.h

@@ -62,9 +62,9 @@ private:
 
 	bool					ParseCommandLine(int argc, char** argv);
 
-	static const ushort		CROWN_MAJOR;
-	static const ushort		CROWN_MINOR;
-	static const ushort		CROWN_MICRO;
+	static const uint16_t		CROWN_MAJOR;
+	static const uint16_t		CROWN_MINOR;
+	static const uint16_t		CROWN_MICRO;
 
 	int						mPreferredWindowWidth;
 	int						mPreferredWindowHeight;

+ 7 - 7
src/EventBuffer.cpp

@@ -39,7 +39,7 @@ EventBuffer::~EventBuffer()
 {
 }
 
-void EventBuffer::PushEvent(uint eventType, void* eventData, size_t eventSize)
+void EventBuffer::PushEvent(uint32_t eventType, void* eventData, size_t eventSize)
 {
 	if (mBufferCount + sizeof(eventType) + eventSize > MAX_EVENT_QUEUE_SIZE)
 	{
@@ -48,7 +48,7 @@ void EventBuffer::PushEvent(uint eventType, void* eventData, size_t eventSize)
 
 	char* q = mBuffer + mBufferCount;
 
-	*(uint*) q = eventType;
+	*(uint32_t*) q = eventType;
 	*(size_t*) (q + sizeof(eventType)) = eventSize;
 	memcpy(q + sizeof(eventType) + sizeof(eventSize), eventData, eventSize);
 
@@ -68,7 +68,7 @@ void EventBuffer::PushEventBuffer(char* eventBuffer, size_t bufferSize)
 	mBufferCount += bufferSize;
 }
 
-void* EventBuffer::NextEvent(uint& eventType, size_t& size)
+void* EventBuffer::NextEvent(uint32_t& eventType, size_t& size)
 {
 	static size_t read = 0;
 
@@ -76,12 +76,12 @@ void* EventBuffer::NextEvent(uint& eventType, size_t& size)
 	{
 		char* q = mBuffer + read;
 
-		eventType = *(uint*)q;
-		size = *(size_t*)(q + sizeof(uint));
+		eventType = *(uint32_t*)q;
+		size = *(size_t*)(q + sizeof(uint32_t));
 
-		read += sizeof(uint) + sizeof(size_t) + size;
+		read += sizeof(uint32_t) + sizeof(size_t) + size;
 
-		return q + sizeof(uint) + sizeof(size_t);
+		return q + sizeof(uint32_t) + sizeof(size_t);
 	}
 
 	read = 0;

+ 2 - 2
src/EventBuffer.h

@@ -45,10 +45,10 @@ public:
 				EventBuffer();
 				~EventBuffer();
 
-	void		PushEvent(uint eventType, void* eventData, size_t eventSize);
+	void		PushEvent(uint32_t eventType, void* eventData, size_t eventSize);
 	void		PushEventBuffer(char* eventBuffer, size_t bufferSize);
 
-	void*		NextEvent(uint& eventType, size_t& size);
+	void*		NextEvent(uint32_t& eventType, size_t& size);
 
 	void		Clear();
 	void		Flush();

+ 2 - 2
src/Font.cpp

@@ -86,7 +86,7 @@ void Font::Unload(const char* name, bool reload)
 {
 }
 
-Glyph& Font::GetGlyph(uint code)
+Glyph& Font::GetGlyph(uint32_t code)
 {
 	if (mCodeGlyphDict.Contains(code))
 	{
@@ -97,7 +97,7 @@ Glyph& Font::GetGlyph(uint code)
 	return nullGlyph;
 }
 
-void Font::SetCodeGlyphMetrics(uint code, float left, float right, float bottom, float top, float width, float height, float advance, float baseline)
+void Font::SetCodeGlyphMetrics(uint32_t code, float left, float right, float bottom, float top, float width, float height, float advance, float baseline)
 {
 	if (mCodeGlyphDict.Contains(code))
 	{

+ 9 - 9
src/Font.h

@@ -44,7 +44,7 @@ class Texture;
 class Font : public Resource
 {
 
-	typedef Dictionary<uint, Glyph> CodeGlyphDict;
+	typedef Dictionary<uint32_t, Glyph> CodeGlyphDict;
 
 public:
 
@@ -56,12 +56,12 @@ public:
 
 	void					LoadFromFile(const Str& filename);
 
-	Glyph&					GetGlyph(uint code);	//! Returns the glyph for the desired point code
-	void					SetCodeGlyphMetrics(uint code, float left, float right, float bottom, float top, float width, float height, float advance, float baseline);
+	Glyph&					GetGlyph(uint32_t code);	//! Returns the glyph for the desired point code
+	void					SetCodeGlyphMetrics(uint32_t code, float left, float right, float bottom, float top, float width, float height, float advance, float baseline);
 
-	inline uint				_GetMaxTextHeight() { return mMaxTextHeight; }
-	inline uint				_GetMaxCharacterHeight() { return mMaxCharacterHeight; }
-	inline uint				_GetMaxCharacterWidth() { return mMaxCharacterWidth; }
+	inline uint32_t				_GetMaxTextHeight() { return mMaxTextHeight; }
+	inline uint32_t				_GetMaxCharacterHeight() { return mMaxCharacterHeight; }
+	inline uint32_t				_GetMaxCharacterWidth() { return mMaxCharacterWidth; }
 
 	Texture*				GetTexture() { return mTexture; }
 
@@ -69,9 +69,9 @@ private:
 
 	CodeGlyphDict			mCodeGlyphDict;
 
-	uint					mMaxTextHeight;
-	uint					mMaxCharacterHeight;
-	uint					mMaxCharacterWidth;
+	uint32_t					mMaxTextHeight;
+	uint32_t					mMaxCharacterHeight;
+	uint32_t					mMaxCharacterWidth;
 
 	Texture*				mTexture;
 };

+ 25 - 25
src/Image.cpp

@@ -39,7 +39,7 @@ Image::Image() :
 {
 }
 
-Image::Image(PixelFormat pixelFormat, uint width, uint height, uchar* data) :
+Image::Image(PixelFormat pixelFormat, uint32_t width, uint32_t height, uint8_t* data) :
 	mPixelFormat(pixelFormat),
 	mWidth(width),
 	mHeight(height),
@@ -57,7 +57,7 @@ Image::~Image()
 	DestroyImage();
 }
 
-void Image::CreateImage(PixelFormat pixelFormat, uint width, uint height, uchar* data)
+void Image::CreateImage(PixelFormat pixelFormat, uint32_t width, uint32_t height, uint8_t* data)
 {
 	mPixelFormat = pixelFormat;
 	mWidth = width;
@@ -83,14 +83,14 @@ void Image::SetUniformColorImage(Color4 color)
 	AssertRGB8();
 	int bpp = GetBytesPerPixel();
 
-	uchar red   = (uchar)(color.r * 255.0f);
-	uchar green = (uchar)(color.g * 255.0f);
-	uchar blue  = (uchar)(color.b * 255.0f);
+	uint8_t red   = (uint8_t)(color.r * 255.0f);
+	uint8_t green = (uint8_t)(color.g * 255.0f);
+	uint8_t blue  = (uint8_t)(color.b * 255.0f);
 
-	for(uint i = 0; i < mHeight; i++)
+	for(uint32_t i = 0; i < mHeight; i++)
 	{
 		int rowOffset = i * mWidth * bpp;
-		for(uint j = 0; j < mWidth; j++)
+		for(uint32_t j = 0; j < mWidth; j++)
 		{
 			int offset = rowOffset + bpp * j;
 			mBuffer[offset    ] = red;
@@ -100,12 +100,12 @@ void Image::SetUniformColorImage(Color4 color)
 	}
 }
 
-uint Image::GetWidth() const
+uint32_t Image::GetWidth() const
 {
 	return mWidth;
 }
 
-uint Image::GetHeight() const
+uint32_t Image::GetHeight() const
 {
 	return mHeight;
 }
@@ -115,22 +115,22 @@ PixelFormat Image::GetFormat() const
 	return mPixelFormat;
 }
 
-uint Image::GetBitsPerPixel() const
+uint32_t Image::GetBitsPerPixel() const
 {
 	return Pixel::GetBitsPerPixel(mPixelFormat);
 }
 
-uint Image::GetBytesPerPixel() const
+uint32_t Image::GetBytesPerPixel() const
 {
 	return Pixel::GetBytesPerPixel(mPixelFormat);
 }
 
-uchar* Image::GetBuffer()
+uint8_t* Image::GetBuffer()
 {
 	return mBuffer;
 }
 
-const uchar* Image::GetBuffer() const
+const uint8_t* Image::GetBuffer() const
 {
 	return mBuffer;
 }
@@ -139,7 +139,7 @@ void Image::ApplyColorKeying(const Color4& color)
 {
 	assert(mPixelFormat == PF_RGBA_8);
 
-	for (ulong i = 0; i < mWidth * mHeight * 4; i += 4)
+	for (uint64_t i = 0; i < mWidth * mHeight * 4; i += 4)
 	{
 		if (Color4(mBuffer[i], mBuffer[i+1], mBuffer[i+2]) == color)
 		{
@@ -177,7 +177,7 @@ void Image::ApplyGreyscaleToAlpha(Image* greyscaleImage)
 		return;
 	}
 
-	for (ulong i = 0; i < mWidth * mHeight * 4; i += 4)
+	for (uint64_t i = 0; i < mWidth * mHeight * 4; i += 4)
 	{
 		mBuffer[i+3] = greyscaleImage->mBuffer[i];
 	}
@@ -185,7 +185,7 @@ void Image::ApplyGreyscaleToAlpha(Image* greyscaleImage)
 
 void Image::AlphaToGreyscale()
 {
-	for (ulong i = 0; i < mWidth * mHeight * 4; i += 4)
+	for (uint64_t i = 0; i < mWidth * mHeight * 4; i += 4)
 	{
 		mBuffer[i]   = mBuffer[i+3];
 		mBuffer[i+1] = mBuffer[i+3];
@@ -198,7 +198,7 @@ void Image::CreateBuffer()
 {
 	if (mBuffer == NULL)
 	{
-		mBuffer = new uchar[mWidth * mHeight * GetBytesPerPixel()];
+		mBuffer = new uint8_t[mWidth * mHeight * GetBytesPerPixel()];
 	}
 }
 
@@ -207,7 +207,7 @@ void Image::AssertRGB8()
 	assert(mPixelFormat == PF_RGB_8);
 }
 
-void Image::SetPixel(uint x, uint y, Color4 color)
+void Image::SetPixel(uint32_t x, uint32_t y, Color4 color)
 {
 	/*AssertRGB8();
 	if (x >= mWidth || y >= mHeight)
@@ -217,9 +217,9 @@ void Image::SetPixel(uint x, uint y, Color4 color)
 
 	int bpp = 3;//GetBytesPerPixel();
 	int offset = (y * mWidth + x) * GetBytesPerPixel();
-	mBuffer[offset    ] = (uchar)(color.r * 255);
-	mBuffer[offset + 1] = (uchar)(color.g * 255);
-	mBuffer[offset + 2] = (uchar)(color.b * 255);
+	mBuffer[offset    ] = (uint8_t)(color.r * 255);
+	mBuffer[offset + 1] = (uint8_t)(color.g * 255);
+	mBuffer[offset + 2] = (uint8_t)(color.b * 255);
 }
 
 void Image::CopyTo(Image& dest) const
@@ -229,7 +229,7 @@ void Image::CopyTo(Image& dest) const
 	dest.mPixelFormat = mPixelFormat;
 	dest.CreateBuffer();
 
-	for (ulong i = 0; i < mWidth * mHeight * GetBytesPerPixel(); i++)
+	for (uint64_t i = 0; i < mWidth * mHeight * GetBytesPerPixel(); i++)
 	{
 		dest.mBuffer[i] = mBuffer[i];
 	}
@@ -239,10 +239,10 @@ void Image::ConvertToRGBA8()
 {
 	assert(mPixelFormat != PF_UNKNOWN);
 
-	uchar* newBuf = new uchar[mWidth * mHeight * 4];
+	uint8_t* newBuf = new uint8_t[mWidth * mHeight * 4];
 
-	uint j = 0;
-	for (uint i = 0; i < mWidth * mHeight * 2; i += 2)
+	uint32_t j = 0;
+	for (uint32_t i = 0; i < mWidth * mHeight * 2; i += 2)
 	{
 		newBuf[j + 0] = mBuffer[i + 0];
 		newBuf[j + 1] = mBuffer[i + 0];

+ 12 - 12
src/Image.h

@@ -42,37 +42,37 @@ public:
 	Image();
 
 	//! Constructor
-	Image(PixelFormat pixelFormat, uint width, uint height, uchar* data);
+	Image(PixelFormat pixelFormat, uint32_t width, uint32_t height, uint8_t* data);
 
 	//! Destructor
 	~Image();
 
 	//! Creates the image
-	void CreateImage(PixelFormat pixelFormat, uint width, uint height, uchar* data);
+	void CreateImage(PixelFormat pixelFormat, uint32_t width, uint32_t height, uint8_t* data);
 
 	//! Destroys the image
 	void DestroyImage();
 
 	//! Returns the image's width in pixels
-	uint GetWidth() const;
+	uint32_t GetWidth() const;
 
 	//! Returns the image's height in pixels
-	uint GetHeight() const;
+	uint32_t GetHeight() const;
 
 	//! Returns the image's pixel format
 	PixelFormat GetFormat() const;
 
 	//! Returns the image's bits per pixel
-	uint GetBitsPerPixel() const;
+	uint32_t GetBitsPerPixel() const;
 
 	//! Returns the image's bytes per pixel
-	uint GetBytesPerPixel() const;
+	uint32_t GetBytesPerPixel() const;
 
 	//! Returns a pointer to the image data
-	uchar* GetBuffer();
+	uint8_t* GetBuffer();
 
 	//! Returns a const pointer to the image data
-	const uchar* GetBuffer() const;
+	const uint8_t* GetBuffer() const;
 
 	//! Apply a color-keying
 	void ApplyColorKeying(const Color4& color);
@@ -87,7 +87,7 @@ public:
 	void SetUniformColorImage(Color4 color);
 
 	//! Set the pixel at location x,y to the specified color
-	void SetPixel(uint x, uint y, Color4 color);
+	void SetPixel(uint32_t x, uint32_t y, Color4 color);
 
 	void ConvertToRGBA8();
 
@@ -101,10 +101,10 @@ public:
 private:
 
 	PixelFormat	mPixelFormat;
-	uint		mWidth;
-	uint		mHeight;
+	uint32_t		mWidth;
+	uint32_t		mHeight;
 
-	uchar*		mBuffer;
+	uint8_t*		mBuffer;
 
 	void CreateBuffer();
 	void AssertRGB8();

+ 3 - 3
src/IndexBuffer.h

@@ -42,12 +42,12 @@ public:
 	virtual			~IndexBuffer() {}
 
 					//! Set the index data
-	virtual void	SetIndexData(const ushort* indexData, uint indexCount) = 0;
+	virtual void	SetIndexData(const uint16_t* indexData, uint32_t indexCount) = 0;
 					//! Replaces a subset of the index data
-	virtual void	SetIndexSubData(const ushort* indexData, uint indexOffset, uint indexCount) = 0;
+	virtual void	SetIndexSubData(const uint16_t* indexData, uint32_t indexOffset, uint32_t indexCount) = 0;
 					//! Selects the index buffer as current index buffer
 
-	virtual uint	GetIndexCount() const = 0;
+	virtual uint32_t	GetIndexCount() const = 0;
 
 	virtual void	Bind() const = 0;
 	virtual void	Unbind() const = 0;

+ 6 - 6
src/Material.cpp

@@ -66,7 +66,7 @@ Material::Material() :
 	mBlendDst(BF_ONE_MINUS_SRC_ALPHA),
 	mBlendColor(0.0f, 0.0f, 0.0f, 0.0f)
 {
-	for (uint i = 0; i < MAX_TEXTURE_LAYERS; i++)
+	for (uint32_t i = 0; i < MAX_TEXTURE_LAYERS; i++)
 	{
 		mTextureLayer[i] = 0;
 	}
@@ -422,7 +422,7 @@ void Material::SetBlendColor(const Color4& color)
 	mBlendColor = color;
 }
 
-bool Material::SetTextureLayer(uint layer, Texture* texture)
+bool Material::SetTextureLayer(uint32_t layer, Texture* texture)
 {
 	if (layer >= MAX_TEXTURE_LAYERS)
 	{
@@ -433,7 +433,7 @@ bool Material::SetTextureLayer(uint layer, Texture* texture)
 	return true;
 }
 
-Texture* Material::GetTextureLayer(uint layer) const
+Texture* Material::GetTextureLayer(uint32_t layer) const
 {
 	if (layer >= MAX_TEXTURE_LAYERS)
 	{
@@ -445,7 +445,7 @@ Texture* Material::GetTextureLayer(uint layer) const
 
 void Material::SetTextureMode(TextureMode mode)
 {
-	for (uint i = 0; i < MAX_TEXTURE_LAYERS; i++)
+	for (uint32_t i = 0; i < MAX_TEXTURE_LAYERS; i++)
 	{
 		if (mTextureLayer[i] == 0)
 			continue;
@@ -456,7 +456,7 @@ void Material::SetTextureMode(TextureMode mode)
 
 void Material::SetTextureFilter(TextureFilter filter)
 {
-	for (uint i = 0; i < MAX_TEXTURE_LAYERS; i++)
+	for (uint32_t i = 0; i < MAX_TEXTURE_LAYERS; i++)
 	{
 		if (mTextureLayer[i] == 0)
 			continue;
@@ -467,7 +467,7 @@ void Material::SetTextureFilter(TextureFilter filter)
 
 void Material::SetTextureWrap(TextureWrap wrap)
 {
-	for (uint i = 0; i < MAX_TEXTURE_LAYERS; i++)
+	for (uint32_t i = 0; i < MAX_TEXTURE_LAYERS; i++)
 	{
 		if (mTextureLayer[i] == 0)
 			continue;

+ 3 - 3
src/Material.h

@@ -35,7 +35,7 @@ namespace crown
 //! Max texture layers supported by the material.
 //! Note that the maximum number of usable layers
 //! depends on the graphic card.
-const uint MAX_TEXTURE_LAYERS = 8;
+const uint32_t MAX_TEXTURE_LAYERS = 8;
 
 enum FogMode
 {
@@ -336,10 +336,10 @@ public:
 
 	//! Sets "texture" to layer "layer"
 	//! Returns true if success
-	bool SetTextureLayer(uint layer, Texture* texture);
+	bool SetTextureLayer(uint32_t layer, Texture* texture);
 
 	//! Returns the texture at layer "layer"
-	Texture* GetTextureLayer(uint layer) const;
+	Texture* GetTextureLayer(uint32_t layer) const;
 
 	//! Sets the texture mode for all layers
 	void SetTextureMode(TextureMode mode);

+ 12 - 12
src/Mesh.cpp

@@ -51,12 +51,12 @@ Mesh::~Mesh()
 	}
 }
 
-uint Mesh::GetMeshChunkCount() const
+uint32_t Mesh::GetMeshChunkCount() const
 {
 	return mMeshChunkList.size();
 }
 
-MeshChunk* Mesh::GetMeshChunk(uint index) const
+MeshChunk* Mesh::GetMeshChunk(uint32_t index) const
 {
 	return mMeshChunkList[index];
 }
@@ -86,7 +86,7 @@ void Mesh::UpdateBoundingBox()
 {
 	mBoundingBox.zero();
 
-	for (uint i = 0; i < mMeshChunkList.size(); i++)
+	for (uint32_t i = 0; i < mMeshChunkList.size(); i++)
 	{
 		mMeshChunkList[i]->UpdateBoundingBox();
 		mBoundingBox.add_box(mMeshChunkList[i]->GetBoundingBox());
@@ -95,8 +95,8 @@ void Mesh::UpdateBoundingBox()
 
 void Mesh::RecompileMesh()
 {
-	uint count = 0;
-	uint offset = 0;
+	uint32_t count = 0;
+	uint32_t offset = 0;
 
 	if (!mVertexBuffer)
 		mVertexBuffer = GetDevice()->GetRenderer()->CreateVertexBuffer();
@@ -104,7 +104,7 @@ void Mesh::RecompileMesh()
 		mIndexBuffer = GetDevice()->GetRenderer()->CreateIndexBuffer();
 
 	count = 0;
-	for(uint i=0; i<mMeshChunkList.size(); i++)
+	for(uint32_t i=0; i<mMeshChunkList.size(); i++)
 	{
 		mMeshChunkList[i]->UpdateNormals();
 		count += mMeshChunkList[i]->mVertexList.size();
@@ -113,9 +113,9 @@ void Mesh::RecompileMesh()
 	mVertexBuffer->SetVertexData((VertexBufferMode) (VBM_NORMAL_COORDS | VBM_TEXTURE_COORDS | VBM_COLOR_COORDS), NULL, count);
 	
 	offset = 0;
-	for(uint i=0; i<mMeshChunkList.size(); i++)
+	for(uint32_t i=0; i<mMeshChunkList.size(); i++)
 	{
-		uint size = mMeshChunkList[i]->mVertexList.size() * sizeof(VertexData);
+		uint32_t size = mMeshChunkList[i]->mVertexList.size() * sizeof(VertexData);
 		mVertexBuffer->SetVertexSubData((float*) mMeshChunkList[i]->mVertexList.begin(), offset, mMeshChunkList[i]->mVertexList.size());
 
 		offset += size;
@@ -123,7 +123,7 @@ void Mesh::RecompileMesh()
 
 	//Index buffer
 	count = 0;
-	for(uint i=0; i<mMeshChunkList.size(); i++)
+	for(uint32_t i=0; i<mMeshChunkList.size(); i++)
 	{
 		count += mMeshChunkList[i]->mFaceList.size() * 3;
 	}
@@ -131,10 +131,10 @@ void Mesh::RecompileMesh()
 	mIndexBuffer->SetIndexData(NULL, count);
 	
 	offset = 0;
-	for(uint i=0; i<mMeshChunkList.size(); i++)
+	for(uint32_t i=0; i<mMeshChunkList.size(); i++)
 	{
-		uint size = mMeshChunkList[i]->mFaceList.size() * sizeof(ushort) * 3;
-		mIndexBuffer->SetIndexSubData((ushort*) mMeshChunkList[i]->mFaceList.begin(), offset, mMeshChunkList[i]->mFaceList.size() * 3);
+		uint32_t size = mMeshChunkList[i]->mFaceList.size() * sizeof(uint16_t) * 3;
+		mIndexBuffer->SetIndexSubData((uint16_t*) mMeshChunkList[i]->mFaceList.begin(), offset, mMeshChunkList[i]->mFaceList.size() * 3);
 
 		offset += size;
 	}

+ 4 - 4
src/Mesh.h

@@ -54,8 +54,8 @@ public:
 							~Mesh();	//! Destructor
 
 
-	uint					GetMeshChunkCount() const;	//! Returns the MeshChunks contained in this mesh
-	MeshChunk*				GetMeshChunk(uint index) const;
+	uint32_t					GetMeshChunkCount() const;	//! Returns the MeshChunks contained in this mesh
+	MeshChunk*				GetMeshChunk(uint32_t index) const;
 	void					AddMeshChunk(MeshChunk* chunk);	//! Adds a MeshChunk to the mesh
 	void					RemoveMeshChunk(MeshChunk* chunk);	//! Remove a MeshChunk from the mesh
 
@@ -65,7 +65,7 @@ public:
 	inline VertexBuffer*	GetVertexBuffer() const { return mVertexBuffer; }
 	inline IndexBuffer*		GetIndexBuffer() const { return mIndexBuffer; }
 
-	inline uint				GetGlobalVertexCount() const { return mGlobalVertexCount; }
+	inline uint32_t				GetGlobalVertexCount() const { return mGlobalVertexCount; }
 
 	void					RecompileMesh();
 
@@ -80,7 +80,7 @@ private:
 
 	VertexBuffer*			mVertexBuffer;
 	IndexBuffer*			mIndexBuffer;
-	uint					mGlobalVertexCount;
+	uint32_t					mGlobalVertexCount;
 };
 
 } // namespace crown

+ 2 - 2
src/MeshChunk.cpp

@@ -60,7 +60,7 @@ void MeshChunk::UpdateBoundingBox()
 {
 	mBoundingBox.zero();
 
-	for (uint i = 0; i < mVertexList.size(); i++)
+	for (uint32_t i = 0; i < mVertexList.size(); i++)
 	{
 		mBoundingBox.add_point(mVertexList[i].position);
 	}
@@ -68,7 +68,7 @@ void MeshChunk::UpdateBoundingBox()
 
 void MeshChunk::UpdateNormals()
 {
-	for (uint i = 0; i < mFaceList.size(); i++)
+	for (uint32_t i = 0; i < mFaceList.size(); i++)
 	{
 		Vec3 normal;
 		Vec3 v1;

+ 7 - 7
src/MeshManager.cpp

@@ -186,7 +186,7 @@ Mesh* MeshManager::LoadPlane(const char* name, float width, float height)
 	return mesh;
 }
 
-Mesh* MeshManager::LoadGrid(const char* name, uint size, float tileSize)
+Mesh* MeshManager::LoadGrid(const char* name, uint32_t size, float tileSize)
 {
 	if (size < 1)
 	{
@@ -219,11 +219,11 @@ Mesh* MeshManager::LoadGrid(const char* name, uint size, float tileSize)
 		// Populate vertex list (generate a grid lying on the xz-plane and facing upwards)
 		float vCoord = 0.0f;//(float)size;
 		float zPos = actual;
-		for (uint h = 0; h <= size; h++)
+		for (uint32_t h = 0; h <= size; h++)
 		{
 			float uCoord = 0.0f;
 			float xPos = -actual;
-			for (uint w = 0; w <= size; w++)
+			for (uint32_t w = 0; w <= size; w++)
 			{
 				chunk->mVertexList.push_back(VertexData(Vec3(xPos, 0.0f, zPos), Vec3::YAXIS, Vec2(uCoord, vCoord)));
 				xPos += tileSize;
@@ -234,12 +234,12 @@ Mesh* MeshManager::LoadGrid(const char* name, uint size, float tileSize)
 		}
 
 		// Generate faces
-		for (uint h = 0; h < size; h++)
+		for (uint32_t h = 0; h < size; h++)
 		{
-			for (uint w = 0; w < size; w++)
+			for (uint32_t w = 0; w < size; w++)
 			{
-				uint firstRow = (h * (size + 1)) + w;
-				uint secondRow = ((h + 1) * (size + 1)) + w;
+				uint32_t firstRow = (h * (size + 1)) + w;
+				uint32_t secondRow = ((h + 1) * (size + 1)) + w;
 				chunk->mFaceList.push_back(FaceData(firstRow, firstRow + 1, secondRow + 1));
 				chunk->mFaceList.push_back(FaceData(firstRow, secondRow + 1, secondRow));
 			}

+ 1 - 1
src/MeshManager.h

@@ -92,7 +92,7 @@ public:
 	 * @param tileSize The size of a tile in units
 	 * @return A pointer to the loaded resource
 	 */
-	Mesh* LoadGrid(const char* name, uint size = 20, float tileSize = 1.0f);
+	Mesh* LoadGrid(const char* name, uint32_t size = 20, float tileSize = 1.0f);
 
 	virtual Mesh* CreateSpecific(const char* name);
 

+ 1 - 1
src/OcclusionQuery.h

@@ -48,7 +48,7 @@ public:
 	virtual void EndQuery() = 0;
 
 	//! Returns the number of fragments visible from the last query operation
-	virtual uint GetQueryResult() = 0;
+	virtual uint32_t GetQueryResult() = 0;
 
 	//! Returns whether result for this query is available
 	virtual bool IsResultAvailable() = 0;

+ 2 - 2
src/Pixel.cpp

@@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 namespace crown
 {
 
-uint Pixel::GetBitsPerPixel(PixelFormat format)
+uint32_t Pixel::GetBitsPerPixel(PixelFormat format)
 {
 	switch (format)
 	{
@@ -108,7 +108,7 @@ uint Pixel::GetBitsPerPixel(PixelFormat format)
 	}
 }
 
-uint Pixel::GetBytesPerPixel(PixelFormat format)
+uint32_t Pixel::GetBytesPerPixel(PixelFormat format)
 {
 	return GetBitsPerPixel(format) / 8;
 }

+ 2 - 2
src/Pixel.h

@@ -105,10 +105,10 @@ class Pixel
 public:
 
 	//! Returns the format's bytes per pixel
-	static uint GetBytesPerPixel(PixelFormat format);
+	static uint32_t GetBytesPerPixel(PixelFormat format);
 
 	//! Returns the format's bits per pixel
-	static uint GetBitsPerPixel(PixelFormat format);
+	static uint32_t GetBitsPerPixel(PixelFormat format);
 
 private:
 

+ 12 - 12
src/Renderer.h

@@ -154,7 +154,7 @@ public:
 	@param texturing
 		Whether texturing is enabled or not
 	*/
-	virtual void _SetTexturing(uint unit, bool texturing) = 0;
+	virtual void _SetTexturing(uint32_t unit, bool texturing) = 0;
 
 	/**
 		Sets a texture for the given texture unit.
@@ -163,7 +163,7 @@ public:
 	@param texture
 		The texture
 	*/
-	virtual void _SetTexture(uint unit, Texture* texture) = 0;
+	virtual void _SetTexture(uint32_t unit, Texture* texture) = 0;
 
 	/**
 		Sets the texture mode for the given texture unit.
@@ -179,7 +179,7 @@ public:
 		The blend color. This parameter means only when
 		mode == TM_BLEND
 	*/
-	virtual void _SetTextureMode(uint unit, TextureMode mode, const Color4& blendColor) = 0;
+	virtual void _SetTextureMode(uint32_t unit, TextureMode mode, const Color4& blendColor) = 0;
 
 	/**
 		Sets the texture wrap parameter for the given texture unit.
@@ -188,7 +188,7 @@ public:
 	@param wrap
 		The wrap parameter
 	*/
-	virtual void _SetTextureWrap(uint unit, TextureWrap wrap) = 0;
+	virtual void _SetTextureWrap(uint32_t unit, TextureWrap wrap) = 0;
 
 	/**
 		Sets the filter for the given texture unit.
@@ -197,12 +197,12 @@ public:
 	@filter
 		The filter
 	*/
-	virtual void _SetTextureFilter(uint unit, TextureFilter filter) = 0;
+	virtual void _SetTextureFilter(uint32_t unit, TextureFilter filter) = 0;
 
-	virtual void				_SetLight(uint light, bool active) = 0;
-	virtual void				_SetLightParams(uint light, LightType type, const Vec3& position) = 0;
-	virtual void				_SetLightColor(uint light, const Color4& ambient, const Color4& diffuse, const Color4& specular) = 0;
-	virtual void				_SetLightAttenuation(uint light, float constant, float linear, float quadratic) = 0;
+	virtual void				_SetLight(uint32_t light, bool active) = 0;
+	virtual void				_SetLightParams(uint32_t light, LightType type, const Vec3& position) = 0;
+	virtual void				_SetLightColor(uint32_t light, const Color4& ambient, const Color4& diffuse, const Color4& specular) = 0;
+	virtual void				_SetLightAttenuation(uint32_t light, float constant, float linear, float quadratic) = 0;
 
 	/**
 		Sets whether backface-culling is enabled.
@@ -327,7 +327,7 @@ public:
 	virtual IndexBuffer* CreateIndexBuffer() = 0;
 
 	//! Sets the texture to use in the specified layer
-	virtual void SetTexture(uint layer, Texture* texture) = 0;
+	virtual void SetTexture(uint32_t layer, Texture* texture) = 0;
 
 	//! Returns the current matrix
 	virtual Mat4 GetMatrix(MatrixType type) const = 0;
@@ -345,10 +345,10 @@ public:
 	virtual void SelectMatrix(MatrixType type) = 0;
 
 	//! Sets the scissor box
-	virtual void SetScissorBox(uint x, uint y, uint width, uint height) = 0;
+	virtual void SetScissorBox(uint32_t x, uint32_t y, uint32_t width, uint32_t height) = 0;
 
 	//! Gets the scissor box params
-	virtual void GetScissorBox(uint& x, uint& y, uint& width, uint& height) = 0;
+	virtual void GetScissorBox(uint32_t& x, uint32_t& y, uint32_t& width, uint32_t& height) = 0;
 
 	virtual void RenderVertexIndexBuffer(const VertexBuffer* vertices, const IndexBuffer* indices) = 0;
 

+ 1 - 1
src/ResourceManager.cpp

@@ -90,7 +90,7 @@ void ResourceManager::Destroy(const char* name)
 
 Resource* ResourceManager::GetByName(const char* name)
 {
-	ulong nameHash = Str::Hash64(name);
+	uint64_t nameHash = Str::Hash64(name);
 
 	if (mNameToResourceDict.Contains(nameHash))
 	{

+ 8 - 8
src/System.h

@@ -42,8 +42,8 @@ namespace crown
 
 struct EntityId
 {
-	uint		innerId;
-	uint		index;
+	uint32_t		innerId;
+	uint32_t		index;
 };
 
 struct Entity
@@ -74,13 +74,13 @@ public:
 	void		DestroyEntity(EntityId id);
 	Entity&		GetEntity(EntityId id);
 
-	void		Update(uint dt);
+	void		Update(uint32_t dt);
 
 private:
 
-	uint		mNextId;					// Next available Id
-	uint		mLastIndex;					// Count of entities
-	uint		mFreelist;					// Start index of the freelist
+	uint32_t		mNextId;					// Next available Id
+	uint32_t		mLastIndex;					// Count of entities
+	uint32_t		mFreelist;					// Start index of the freelist
 	Entity		mEntities[MAX_ENTITIES];	// Entities
 
 	VertexData		mVertices[4];
@@ -148,9 +148,9 @@ inline Entity& System::GetEntity(EntityId id)
 	return mEntities[id.index];
 }
 
-void System::Update(uint dt)
+void System::Update(uint32_t dt)
 {
-	for (uint i = 0; i < mLastIndex; i++)
+	for (uint32_t i = 0; i < mLastIndex; i++)
 	{
 		if (mEntities[i].mId.innerId == MAX_ENTITIES)
 		{

+ 38 - 38
src/Terrain.cpp

@@ -64,7 +64,7 @@ Terrain::~Terrain()
 	delete[] mIndices;
 }
 
-void Terrain::CreateTerrain(uint xSize, uint zSize, uint tilePerMeter, float initialHeight)
+void Terrain::CreateTerrain(uint32_t xSize, uint32_t zSize, uint32_t tilePerMeter, float initialHeight)
 {
 	assert(xSize > 0);
 	assert(zSize > 0);
@@ -83,12 +83,12 @@ void Terrain::CreateTerrain(uint xSize, uint zSize, uint tilePerMeter, float ini
 
 	printf("Vertices in size x/z: %d %d\n", mVerticesInSizeX, mVerticesInSizeZ);
 
-	uint heightsCount = mVerticesInSizeX * mVerticesInSizeZ;
+	uint32_t heightsCount = mVerticesInSizeX * mVerticesInSizeZ;
 
 	mHeights = new float[heightsCount];
 
 	// Init heights
-	for (uint i = 0; i < heightsCount; i++)
+	for (uint32_t i = 0; i < heightsCount; i++)
 	{
 		mHeights[i] = initialHeight;
 	}
@@ -100,7 +100,7 @@ void Terrain::CreateTerrain(uint xSize, uint zSize, uint tilePerMeter, float ini
 	mNormalCount = heightsCount;
 	mTexCoords = new Vec2[heightsCount];		// Same as vertices
 	mTexCoordCount = heightsCount;
-	mIndices = new ushort[mTilesInSizeX * mTilesInSizeZ * 6];	//
+	mIndices = new uint16_t[mTilesInSizeX * mTilesInSizeZ * 6];	//
 	mIndexCount = mTilesInSizeX * mTilesInSizeZ * 6;
 
 	// Populate vertex list (generate a grid lying on the xz-plane and facing upwards)
@@ -110,13 +110,13 @@ void Terrain::CreateTerrain(uint xSize, uint zSize, uint tilePerMeter, float ini
 	mOffsetX = xStart;
 	mOffsetZ = zStart;
 
-	uint vIndex = 0;			// Just because I'm lazy
+	uint32_t vIndex = 0;			// Just because I'm lazy
 	float xCurrent;				// Keeps track of current x position
 	float zCurrent = zStart;	// Keeps track of current z position
-	for (uint z = 0; z < mVerticesInSizeZ; z++)
+	for (uint32_t z = 0; z < mVerticesInSizeZ; z++)
 	{
 		xCurrent = xStart;	
-		for (uint x = 0; x < mVerticesInSizeX; x++)
+		for (uint32_t x = 0; x < mVerticesInSizeX; x++)
 		{
 			mVertices[vIndex].x = xCurrent;
 			mVertices[vIndex].y = mHeights[vIndex];
@@ -136,13 +136,13 @@ void Terrain::CreateTerrain(uint xSize, uint zSize, uint tilePerMeter, float ini
 	}
 
 	// Populate index list
-	uint iIndex = 0;
-	for (uint z = 0; z < mTilesInSizeZ; z++)
+	uint32_t iIndex = 0;
+	for (uint32_t z = 0; z < mTilesInSizeZ; z++)
 	{
-		for (uint x = 0; x < mTilesInSizeX; x++)
+		for (uint32_t x = 0; x < mTilesInSizeX; x++)
 		{
-			uint firstRow = z * mVerticesInSizeX + x;
-			uint secondRow = (z + 1) * mVerticesInSizeX + x;
+			uint32_t firstRow = z * mVerticesInSizeX + x;
+			uint32_t secondRow = (z + 1) * mVerticesInSizeX + x;
 
 			mIndices[iIndex + 0] = firstRow;
 			mIndices[iIndex + 1] = secondRow + 1;
@@ -157,10 +157,10 @@ void Terrain::CreateTerrain(uint xSize, uint zSize, uint tilePerMeter, float ini
 
 void Terrain::UpdateVertexBuffer(bool recomputeNormals)
 {
-	uint vIndex = 0;
-	for (uint z = 0; z < mVerticesInSizeZ; z++)
+	uint32_t vIndex = 0;
+	for (uint32_t z = 0; z < mVerticesInSizeZ; z++)
 	{
-		for (uint x = 0; x < mVerticesInSizeX; x++)
+		for (uint32_t x = 0; x < mVerticesInSizeX; x++)
 		{
 			mVertices[vIndex].y = mHeights[vIndex];
 			vIndex++;
@@ -169,7 +169,7 @@ void Terrain::UpdateVertexBuffer(bool recomputeNormals)
 
 	if (recomputeNormals)
 	{
-		for (uint i = 0; i < mIndexCount; i += 3)
+		for (uint32_t i = 0; i < mIndexCount; i += 3)
 		{
 			Vec3 normal;
 			Vec3 v1;
@@ -187,7 +187,7 @@ void Terrain::UpdateVertexBuffer(bool recomputeNormals)
 	}
 }
 
-float Terrain::GetHeightAt(uint x, uint z) const
+float Terrain::GetHeightAt(uint32_t x, uint32_t z) const
 {
 	if (x > mVerticesInSizeX) return 0.0f;
 	if (z > mVerticesInSizeZ) return 0.0f;
@@ -197,14 +197,14 @@ float Terrain::GetHeightAt(uint x, uint z) const
 
 float Terrain::GetHeightAt(const Vec3& xyz) const
 {
-	uint x, z;
+	uint32_t x, z;
 
 	WorldToHeight(xyz, x, z);
 
 	return GetHeightAt(x, z);
 }
 
-void Terrain::SetHeightAt(uint x, uint z, float height)
+void Terrain::SetHeightAt(uint32_t x, uint32_t z, float height)
 {
 	if (x >= mVerticesInSizeX) return;
 	if (z >= mVerticesInSizeZ) return;
@@ -215,20 +215,20 @@ void Terrain::SetHeightAt(uint x, uint z, float height)
 
 void Terrain::SetHeightAt(const Vec3& xyz, float height)
 {
-	uint x, z;
+	uint32_t x, z;
 
 	WorldToHeight(xyz, x, z);
 
 	SetHeightAt(x + 0, z + 0, height);
 }
 
-void Terrain::WorldToHeight(const Vec3& xyz, uint& x, uint& z) const
+void Terrain::WorldToHeight(const Vec3& xyz, uint32_t& x, uint32_t& z) const
 {
 	Vec3 offsetted = xyz + Vec3(-mOffsetX, 0.0f, mOffsetZ);
 	offsetted.z = (float)mSizeZ - offsetted.z;
 
-	x = (uint)offsetted.x;
-	z = (uint)offsetted.z;
+	x = (uint32_t)offsetted.x;
+	z = (uint32_t)offsetted.z;
 }
 
 bool Terrain::TraceRay(const Ray& ray, Triangle& result, Triangle& tri2, real& dist)
@@ -236,7 +236,7 @@ bool Terrain::TraceRay(const Ray& ray, Triangle& result, Triangle& tri2, real& d
 	bool hit = false;
 	real minDist = 9999999.0f;
 
-	for (uint i = 0; i < mIndexCount; i += 3)
+	for (uint32_t i = 0; i < mIndexCount; i += 3)
 	{
 		Triangle tri;
 
@@ -262,10 +262,10 @@ bool Terrain::TraceRay(const Ray& ray, Triangle& result, Triangle& tri2, real& d
 	return hit;
 }
 
-uint Terrain::SnapToGrid(const Vec3& vertex)
+uint32_t Terrain::SnapToGrid(const Vec3& vertex)
 {
 	float minDist = 9999999.0f;
-	uint indexToSnapped;
+	uint32_t indexToSnapped;
 	// Find the snapped point to input vertex
 	for (int i = 0; i < mVertexCount; i++)
 	{
@@ -286,12 +286,12 @@ uint Terrain::SnapToGrid(const Vec3& vertex)
 void Terrain::SaveAsBmp(const char* name)
 {
 	Image image;
-	uchar* buffer = new uchar[mVertexCount * 3];
+	uint8_t* buffer = new uint8_t[mVertexCount * 3];
 
 	float scale = 255.0f / (mMaxHeight - mMinHeight);
 
-	uint j = 0;
-	for (uint i = 0; i < mVertexCount; i++)
+	uint32_t j = 0;
+	for (uint32_t i = 0; i < mVertexCount; i++)
 	{
 		buffer[j + 0] = (mHeights[i] + (-mMinHeight)) * scale;
 		buffer[j + 1] = (mHeights[i] + (-mMinHeight)) * scale;
@@ -334,7 +334,7 @@ float Terrain::GaussDist(float x, float y, float sigma)
 	return gauss * pow(e, -exponent);
 }
 
-void Terrain::BuildBrush(uint width, uint height, float smooth)
+void Terrain::BuildBrush(uint32_t width, uint32_t height, float smooth)
 {
 	assert(width < MAX_BRUSH_SIZE);
 	assert(height < MAX_BRUSH_SIZE);
@@ -346,10 +346,10 @@ void Terrain::BuildBrush(uint width, uint height, float smooth)
 	float yStart = -(float)height * 0.5f;
 
 	float xCurrent = xStart;
-	for (uint i = 0; i <= width; i++)
+	for (uint32_t i = 0; i <= width; i++)
 	{
 		float yCurrent = yStart;
-		for (uint j = 0; j <= height; j++)
+		for (uint32_t j = 0; j <= height; j++)
 		{
 			mBrush[j * MAX_BRUSH_SIZE + i] = GaussDist(xCurrent, yCurrent, smooth);
 			yCurrent += 1.0f;
@@ -391,13 +391,13 @@ void Terrain::PlotCircle(int xx, int yy, int radius, int i)
 		}
 }
 
-void Terrain::ApplyBrush(uint x, uint z, float scale)
+void Terrain::ApplyBrush(uint32_t x, uint32_t z, float scale)
 {
-	uint offsetX = mBrushWidth / 2;
-	uint offsetY = mBrushHeight / 2;
-	for (uint i = 0; i < mBrushWidth; i++)
+	uint32_t offsetX = mBrushWidth / 2;
+	uint32_t offsetY = mBrushHeight / 2;
+	for (uint32_t i = 0; i < mBrushWidth; i++)
 	{
-		for (uint j = 0; j < mBrushHeight; j++)
+		for (uint32_t j = 0; j < mBrushHeight; j++)
 		{
 			SetHeightAt((x - offsetX) + i, (z - offsetY) + j, scale * mBrush[j * MAX_BRUSH_SIZE + i]);
 		}
@@ -406,7 +406,7 @@ void Terrain::ApplyBrush(uint x, uint z, float scale)
 
 void Terrain::ApplyBrush(const Vec3& xyz, float scale)
 {
-	uint x, z;
+	uint32_t x, z;
 
 	WorldToHeight(xyz, x, z);
 

+ 19 - 19
src/Terrain.h

@@ -44,28 +44,28 @@ public:
 				Terrain();
 				~Terrain();
 
-	void		CreateTerrain(uint xSize, uint zSize, uint tilePerMeter, float initialHeight);
+	void		CreateTerrain(uint32_t xSize, uint32_t zSize, uint32_t tilePerMeter, float initialHeight);
 
-	float		GetHeightAt(uint x, uint z) const;
+	float		GetHeightAt(uint32_t x, uint32_t z) const;
 	float		GetHeightAt(const Vec3& xyz) const;
 
-	void		SetHeightAt(uint x, uint z, float height);
+	void		SetHeightAt(uint32_t x, uint32_t z, float height);
 	void		SetHeightAt(const Vec3& xyz, float height);
 
-	void		WorldToHeight(const Vec3& xyz, uint& x, uint& z) const;
+	void		WorldToHeight(const Vec3& xyz, uint32_t& x, uint32_t& z) const;
 
 	void		UpdateVertexBuffer(bool recomputeNormals);
 
 	bool		TraceRay(const Ray& ray, Triangle& result, Triangle& tri2, real& dist);
 
-	uint		SnapToGrid(const Vec3& vertex);
+	uint32_t		SnapToGrid(const Vec3& vertex);
 
 	void		SaveAsBmp(const char* name);
 
-	void		BuildBrush(uint width, uint height, float smooth);
+	void		BuildBrush(uint32_t width, uint32_t height, float smooth);
 	float		GaussDist(float x, float y, float sigma);
 
-	void		ApplyBrush(uint x, uint z, float scale);
+	void		ApplyBrush(uint32_t x, uint32_t z, float scale);
 	void		ApplyBrush(const Vec3& xyz, float scale);
 
 	void		PlotCircle(int xx, int yy, int radius, int i);
@@ -74,31 +74,31 @@ public:
 
 private:
 
-	uint		mSizeX;				// X in meters
-	uint		mSizeZ;				// Z in meters
+	uint32_t		mSizeX;				// X in meters
+	uint32_t		mSizeZ;				// Z in meters
 	float		mOffsetX;
 	float		mOffsetZ;
-	uint		mTilePerMeter;		// How many tiles per linear meter?
-	uint		mTilesInSizeX;
-	uint		mTilesInSizeZ;
-	uint		mVerticesInSizeX;
-	uint		mVerticesInSizeZ;
+	uint32_t		mTilePerMeter;		// How many tiles per linear meter?
+	uint32_t		mTilesInSizeX;
+	uint32_t		mTilesInSizeZ;
+	uint32_t		mVerticesInSizeX;
+	uint32_t		mVerticesInSizeZ;
 	float*		mHeights;			// Contains the heights
 
 	float		mMinHeight;
 	float		mMaxHeight;
 
-	uint		mVertexCount;
+	uint32_t		mVertexCount;
 	Vec3*		mVertices;
 
-	uint		mNormalCount;
+	uint32_t		mNormalCount;
 	Vec3*		mNormals;
 
-	uint		mTexCoordCount;
+	uint32_t		mTexCoordCount;
 	Vec2*		mTexCoords;
 
-	uint		mIndexCount;
-	ushort*		mIndices;
+	uint32_t		mIndexCount;
+	uint16_t*		mIndices;
 
 	int			mBrushWidth;
 	int			mBrushHeight;

+ 11 - 11
src/TextRenderer.cpp

@@ -64,8 +64,8 @@ void TextRenderer::Draw(const Str& string, int x, int y, Font* font)
 	renderer->_SetTextureFilter(0, tex->GetFilter());
 
 	Color4 mColor = Color4::BLACK;
-	uint mCharSpacing = 0;
-	uint mLineSpacing = 0;
+	uint32_t mCharSpacing = 0;
+	uint32_t mLineSpacing = 0;
 	
 
 	glColor4fv(mColor.to_float_ptr());
@@ -75,17 +75,17 @@ void TextRenderer::Draw(const Str& string, int x, int y, Font* font)
     glEnable(GL_BLEND);
     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
   
-    for (uint i = 0; i < string.GetLength(); i++)
+    for (uint32_t i = 0; i < string.GetLength(); i++)
     {
         Glyph glyph;
         float left, right, bottom, top, advance, dummy;
-        uint ttSizeX, ttSizeY;
+        uint32_t ttSizeX, ttSizeY;
   
         glyph = mFont->GetGlyph(string[i]);
   
         glyph.GetMetrics(left, right, bottom, top, dummy, dummy, advance, dummy);
-        ttSizeX = (uint)((right - left) * tex->GetWidth());
-        ttSizeY = (uint)((top - bottom) * tex->GetHeight());
+        ttSizeX = (uint32_t)((right - left) * tex->GetWidth());
+        ttSizeY = (uint32_t)((top - bottom) * tex->GetHeight());
 
         glBegin(GL_QUADS);
         glTexCoord2f(left, top);
@@ -107,7 +107,7 @@ void TextRenderer::Draw(const Str& string, int x, int y, Font* font)
 }
 
 //-----------------------------------------------------------------------------
-void TextRenderer::GetStrDimensions(const Str& string, uint start, uint end, int& width, int& height)
+void TextRenderer::GetStrDimensions(const Str& string, uint32_t start, uint32_t end, int& width, int& height)
 {
 //	if (mFont != NULL)
 //	{
@@ -119,9 +119,9 @@ void TextRenderer::GetStrDimensions(const Str& string, uint start, uint end, int
 
 //	//TODO: Should take baseline into account
 
-//	if (end == (uint)-1)
+//	if (end == (uint32_t)-1)
 //		end = string.GetLength();
-//	for (uint i = start; i < end; i++)
+//	for (uint32_t i = start; i < end; i++)
 //	{
 //		Glyph glyph;
 //		float gheight, gwidth, dummy, advance, baseline;
@@ -141,7 +141,7 @@ void TextRenderer::GetStrDimensions(const Str& string, uint start, uint end, int
 }
 
 //-----------------------------------------------------------------------------
-int TextRenderer::GetStrIndexFromDimensions(const Str& string, uint start, const Point2& position, Point2& charPosition)
+int TextRenderer::GetStrIndexFromDimensions(const Str& string, uint32_t start, const Point2& position, Point2& charPosition)
 {
 //	if (mFont == NULL)
 //	{
@@ -150,7 +150,7 @@ int TextRenderer::GetStrIndexFromDimensions(const Str& string, uint start, const
 
 //	int width = 0;
 
-//	for (uint i = start; i < string.GetLength(); i++)
+//	for (uint32_t i = start; i < string.GetLength(); i++)
 //	{
 //		Glyph glyph;
 //		float gheight, gwidth, dummy, advance;

+ 3 - 3
src/TextRenderer.h

@@ -55,9 +55,9 @@ public:
 	void	Draw(const Str& string, int x, int y, Font* font);
 
 			//! Returns the sizes in pixels of the given string, when rendered with the current font
-	void	GetStrDimensions(const Str& string, uint start, uint end, int& width, int& height);
+	void	GetStrDimensions(const Str& string, uint32_t start, uint32_t end, int& width, int& height);
 			//! Returns the character index of the character at the given position
-	int		GetStrIndexFromDimensions(const Str& string, uint start, const Point2& position, Point2& charPosition);
+	int		GetStrIndexFromDimensions(const Str& string, uint32_t start, const Point2& position, Point2& charPosition);
 			//! Returns the max height of the text in the current font
 	int		GetMaxTextHeight();
 
@@ -67,7 +67,7 @@ public:
 		GetStrDimensions(string, 0, -1, width, height);
 	}
 
-	void GetStrDimensions(const Str& string, uint start, int& width, int& height)
+	void GetStrDimensions(const Str& string, uint32_t start, int& width, int& height)
 	{
 		GetStrDimensions(string, start, -1, width, height);
 	}

+ 4 - 4
src/Texture.h

@@ -176,13 +176,13 @@ public:
 	}
 
 	//! Returns the texture's width
-	inline uint GetWidth() const
+	inline uint32_t GetWidth() const
 	{
 		return mWidth;
 	}
 
 	//! Returns the texture's height
-	inline uint GetHeight() const
+	inline uint32_t GetHeight() const
 	{
 		return mHeight;
 	}
@@ -202,8 +202,8 @@ protected:
 	TextureFilter mFilter;
 	TextureWrap mWrap;
 
-	uint mWidth;
-	uint mHeight;
+	uint32_t mWidth;
+	uint32_t mHeight;
 
 	bool mGenerateMipMaps;
 

+ 4 - 4
src/VertexBuffer.h

@@ -54,12 +54,12 @@ public:
 	inline bool			HasColorCoords() const { return (mMode & VBM_COLOR_COORDS) != 0; }
 
 						//! Set the vertex data, the order of coordinates is Vertex, [Normals], [Texture], [Color]
-	virtual void		SetVertexData(VertexBufferMode mode, const void* vertexData, uint vertexCount) = 0;
+	virtual void		SetVertexData(VertexBufferMode mode, const void* vertexData, uint32_t vertexCount) = 0;
 						//! Replaces a subset of the vertex data, the order of coordinates is Vertex, [Normals], [Texture], [Color]
-	virtual void		SetVertexSubData(const void* vertexData, uint vertexOffset, uint vertexCount) = 0;
+	virtual void		SetVertexSubData(const void* vertexData, uint32_t vertexOffset, uint32_t vertexCount) = 0;
 
-	virtual uint		GetSize() const = 0;			//!< Returns the size of the buffer
-	virtual uint		GetVertexCount() const = 0;		//!< Returns the number of vertices in the buffer
+	virtual uint32_t		GetSize() const = 0;			//!< Returns the size of the buffer
+	virtual uint32_t		GetVertexCount() const = 0;		//!< Returns the number of vertices in the buffer
 
 	virtual void		Bind() const = 0;
 	virtual void		Unbind() const = 0;

+ 5 - 5
src/World.h

@@ -42,15 +42,15 @@ public:
 				World();
 				~World();
 
-	void		SetTimeOfDay(ushort seconds);		//!< Sets the time of day in seconds
-	ushort		GetTimeOfDay() const;				//!< Returns the time of day in seconds
+	void		SetTimeOfDay(uint16_t seconds);		//!< Sets the time of day in seconds
+	uint16_t		GetTimeOfDay() const;				//!< Returns the time of day in seconds
 
-	void		Update(uint dt);
+	void		Update(uint32_t dt);
 
 private:
 
-	ushort		mTimeOfDay;			// Time of day in seconds. (60 * 60 * 24 secs)
-	ushort		mTimeOfDaySpeed;	// Speed of seconds in 1/100 of seconds. (100 = 1 game second equals 1 real second)
+	uint16_t		mTimeOfDay;			// Time of day in seconds. (60 * 60 * 24 secs)
+	uint16_t		mTimeOfDaySpeed;	// Speed of seconds in 1/100 of seconds. (100 = 1 game second equals 1 real second)
 
 	float		mGravity;			// Gravity of the world in meters/seconds
 

+ 6 - 6
src/core/Types.h

@@ -31,10 +31,10 @@ OTHER DEALINGS IN THE SOFTWARE.
 namespace crown
 {
 
-typedef unsigned char			uchar;		// 8-bit
-typedef unsigned short int		ushort;		// 16-bit
-typedef unsigned int			uint;		// 32-bit
-typedef unsigned long long int	ulong;		// 64-bit
+typedef unsigned char			uint8_t;		// 8-bit
+typedef unsigned short int		uint16_t;		// 16-bit
+typedef unsigned int			uint32_t;		// 32-bit
+typedef unsigned long long int	uint64_t;		// 64-bit
 
 #ifdef CROWN_USE_FLOAT
 typedef float					real;
@@ -42,8 +42,8 @@ typedef float					real;
 typedef double					real;
 #endif
 
-typedef uint					StrId32;	// 32-bit string hash
-typedef ulong					StrId64;	// 64-bit string hash
+typedef uint32_t					StrId32;	// 32-bit string hash
+typedef uint64_t					StrId64;	// 64-bit string hash
 
 #ifndef NULL
 #ifdef __cplusplus

+ 3 - 3
src/core/bv/Box.h

@@ -67,7 +67,7 @@ public:
 
 	bool			contains_point(const Vec3& p) const;					//!< Returns whether point "p" is contained
 
-	Vec3			get_vertex(uint index) const;							//!< Returns a box's vertex
+	Vec3			get_vertex(uint32_t index) const;							//!< Returns a box's vertex
 	void			get_transformed(const Mat4& mat, Box& result) const;	//!< Returns the box trasformed according to "mat" matrix
 
 	void			to_vertices(Vec3 v[8]) const;							//!< Returns the eight box's vertices
@@ -253,7 +253,7 @@ inline void Box::to_vertices(Vec3 v[8]) const
 }
 
 //-----------------------------------------------------------------------------
-inline Vec3 Box::get_vertex(uint index) const
+inline Vec3 Box::get_vertex(uint32_t index) const
 {
 	assert(index < 8);
 
@@ -287,7 +287,7 @@ inline void Box::get_transformed(const Mat4& mat, Box& result) const
 
 	result.min = result.max = mat * vertices[0];
 
-	for (uint i = 1; i < 8; i++)
+	for (uint32_t i = 1; i < 8; i++)
 	{
 		vertices[i] = mat * vertices[i];
 		result.add_point(vertices[i]);

+ 1 - 1
src/core/bv/Frustum.cpp

@@ -71,7 +71,7 @@ bool Frustum::contains_point(const Vec3& point) const
 }
 
 //-----------------------------------------------------------------------------
-Vec3 Frustum::get_vertex(uint index) const
+Vec3 Frustum::get_vertex(uint32_t index) const
 {
 	// 0 = Near bottom left
 	// 1 = Near bottom right

+ 1 - 1
src/core/bv/Frustum.h

@@ -58,7 +58,7 @@ public:
 				~Frustum();								//!< Destructor
 
 	bool		contains_point(const Vec3& point) const;	//!< Returns true if point intersects the frustum
-	Vec3		get_vertex(uint index) const;			//!< Returns one of the eight frustum's corners
+	Vec3		get_vertex(uint32_t index) const;			//!< Returns one of the eight frustum's corners
 
 	void		from_matrix(const Mat4& m);				//!< Builds the view frustum according to the matrix m
 

+ 1 - 1
src/core/bv/Rect.cpp

@@ -72,7 +72,7 @@ void Rect::get_vertices(Vec2 v[4]) const
 }
 
 //-----------------------------------------------------------------------------
-Vec2 Rect::get_vertex(uint index) const
+Vec2 Rect::get_vertex(uint32_t index) const
 {
 	assert(index < 4);
 

+ 1 - 1
src/core/bv/Rect.h

@@ -67,7 +67,7 @@ public:
 	bool			intersects_rect(const Rect& r) const;	//!< Returns whether intersects "r"
 	void			set_from_center_and_dimensions(Vec2 center, real width, real height);	//!< Sets the Rect from a center and a width - height
 	void			get_vertices(Vec2 v[4]) const;			//!< Returns the four rect's vertices
-	Vec2			get_vertex(uint index) const;			//!< Returns a rect's vertex
+	Vec2			get_vertex(uint32_t index) const;			//!< Returns a rect's vertex
 
 	Circle			to_circle() const;						//!< Returns the equivalent circle
 

+ 29 - 29
src/core/containers/Array.h

@@ -38,7 +38,7 @@ namespace crown
 	Does not grow in size.
 	Does not call constructors/destructors so it is not very suitable for non-POD items.
 */
-template <typename T, uint SIZE>
+template <typename T, uint32_t SIZE>
 class Array
 {
 public:
@@ -47,14 +47,14 @@ public:
 							Array(const Array<T, SIZE>& array);
 							~Array();
 
-	T&						operator[](uint index);
-	const T&				operator[](uint index) const;
+	T&						operator[](uint32_t index);
+	const T&				operator[](uint32_t index) const;
 
 	bool					empty() const;
-	uint					size() const;
-	uint					get_capacity() const;
+	uint32_t					size() const;
+	uint32_t					get_capacity() const;
 
-	uint					push_back(const T& item);
+	uint32_t					push_back(const T& item);
 	void					pop_back();
 
 	void					clear();
@@ -69,7 +69,7 @@ public:
 private:
 
 	Allocator*				m_allocator;
-	uint					m_count;			// The number of items
+	uint32_t					m_count;			// The number of items
 	T						m_array[SIZE];
 };
 
@@ -78,7 +78,7 @@ private:
 @note
 	Does not initialize array memory.
 */
-template <typename T, uint SIZE>
+template <typename T, uint32_t SIZE>
 inline Array<T, SIZE>::Array(Allocator& allocator) : m_allocator(&allocator), m_count(0)
 {
 	assert(SIZE > 0);
@@ -89,7 +89,7 @@ inline Array<T, SIZE>::Array(Allocator& allocator) : m_allocator(&allocator), m_
 /**
 	Copy constructor.
 */
-template <typename T, uint SIZE>
+template <typename T, uint32_t SIZE>
 inline Array<T, SIZE>::Array(const Array<T, SIZE>& array)
 {
 	*this = array;
@@ -98,7 +98,7 @@ inline Array<T, SIZE>::Array(const Array<T, SIZE>& array)
 /**
 	Destructor.
 */
-template <typename T, uint SIZE>
+template <typename T, uint32_t SIZE>
 inline Array<T, SIZE>::~Array()
 {
 }
@@ -108,8 +108,8 @@ inline Array<T, SIZE>::~Array()
 @note
 	The index has to be smaller than size()
 */
-template <typename T, uint SIZE>
-inline T& Array<T, SIZE>::operator[](uint index)
+template <typename T, uint32_t SIZE>
+inline T& Array<T, SIZE>::operator[](uint32_t index)
 {
 	assert(index >= 0);
 	assert(index < m_count);
@@ -122,8 +122,8 @@ inline T& Array<T, SIZE>::operator[](uint index)
 @note
 	The index has to be smaller than size()
 */
-template <typename T, uint SIZE>
-inline const T& Array<T, SIZE>::operator[](uint index) const
+template <typename T, uint32_t SIZE>
+inline const T& Array<T, SIZE>::operator[](uint32_t index) const
 {
 	assert(index >= 0);
 	assert(index < m_count);
@@ -134,7 +134,7 @@ inline const T& Array<T, SIZE>::operator[](uint index) const
 /**
 	Returns whether the array is empty.
 */
-template <typename T, uint SIZE>
+template <typename T, uint32_t SIZE>
 inline bool Array<T, SIZE>::empty() const
 {
 	return m_count == 0;
@@ -143,8 +143,8 @@ inline bool Array<T, SIZE>::empty() const
 /**
 	Returns the number of items in the array.
 */
-template <typename T, uint SIZE>
-inline uint Array<T, SIZE>::size() const
+template <typename T, uint32_t SIZE>
+inline uint32_t Array<T, SIZE>::size() const
 {
 	return m_count;
 }
@@ -152,8 +152,8 @@ inline uint Array<T, SIZE>::size() const
 /**
 	Returns the maximum number of items the array can hold.
 */
-template <typename T, uint SIZE>
-inline uint Array<T, SIZE>::get_capacity() const
+template <typename T, uint32_t SIZE>
+inline uint32_t Array<T, SIZE>::get_capacity() const
 {
 	return SIZE;
 }
@@ -161,8 +161,8 @@ inline uint Array<T, SIZE>::get_capacity() const
 /**
 	Appends an item to the array and returns its index.
 */
-template <typename T, uint SIZE>
-inline uint Array<T, SIZE>::push_back(const T& item)
+template <typename T, uint32_t SIZE>
+inline uint32_t Array<T, SIZE>::push_back(const T& item)
 {
 	assert(m_count < SIZE);
 
@@ -174,7 +174,7 @@ inline uint Array<T, SIZE>::push_back(const T& item)
 /**
 	Removes the item at the given index.
 */
-template <typename T, uint SIZE>
+template <typename T, uint32_t SIZE>
 inline void Array<T, SIZE>::pop_back()
 {
 	assert(m_count > 0);
@@ -188,7 +188,7 @@ inline void Array<T, SIZE>::pop_back()
 	Does not free memory, it only zeroes
 	the number of items in the array.
 */
-template <typename T, uint SIZE>
+template <typename T, uint32_t SIZE>
 inline void Array<T, SIZE>::clear()
 {
 	m_count = 0;
@@ -197,10 +197,10 @@ inline void Array<T, SIZE>::clear()
 /**
 	Copies the content of other list into this.
 */
-template <typename T, uint SIZE>
+template <typename T, uint32_t SIZE>
 inline const Array<T, SIZE>& Array<T, SIZE>::operator=(const Array<T, SIZE>& b)
 {
-	for (uint i = 0; i < b.m_count; i++)
+	for (uint32_t i = 0; i < b.m_count; i++)
 	{
 		m_array[i] = b.m_array[i];
 	}
@@ -211,28 +211,28 @@ inline const Array<T, SIZE>& Array<T, SIZE>::operator=(const Array<T, SIZE>& b)
 }
 
 //-----------------------------------------------------------------------------
-template <typename T, uint SIZE>
+template <typename T, uint32_t SIZE>
 inline const T* Array<T, SIZE>::begin() const
 {
 	return m_array;
 }
 
 //-----------------------------------------------------------------------------
-template <typename T, uint SIZE>
+template <typename T, uint32_t SIZE>
 inline T* Array<T, SIZE>::begin()
 {
 	return m_array;
 }
 
 //-----------------------------------------------------------------------------
-template <typename T, uint SIZE>
+template <typename T, uint32_t SIZE>
 inline const T* Array<T, SIZE>::end() const
 {
 	return m_array + (m_count - 1);
 }
 
 //-----------------------------------------------------------------------------
-template <typename T, uint SIZE>
+template <typename T, uint32_t SIZE>
 inline T* Array<T, SIZE>::end()
 {
 	return m_array + (m_count - 1);

+ 30 - 30
src/core/containers/Generic.cpp

@@ -52,15 +52,15 @@ Generic::Generic(int value) : m_type(GT_INT)
 }
 
 //-----------------------------------------------------------------------------
-Generic::Generic(uint value) : m_type(GT_UINT)
+Generic::Generic(uint32_t value) : m_type(GT_UINT)
 {
-	m_data.uint_value = value;
+	m_data.uint32_t_value = value;
 }
 
 //-----------------------------------------------------------------------------
-Generic::Generic(ushort value) : m_type(GT_USHORT)
+Generic::Generic(uint16_t value) : m_type(GT_USHORT)
 {
-	m_data.ushort_value = value;
+	m_data.uint16_t_value = value;
 }
 
 //-----------------------------------------------------------------------------
@@ -86,13 +86,13 @@ bool Generic::as_int(int& out) const
 
 	if (m_type == GT_UINT)
 	{
-		out = (int)m_data.uint_value;
+		out = (int)m_data.uint32_t_value;
 		return true;
 	}
 
 	if (m_type == GT_USHORT)
 	{
-		out = (int)m_data.ushort_value;
+		out = (int)m_data.uint16_t_value;
 		return true;
 	}
 
@@ -120,29 +120,29 @@ int Generic::as_int() const
 }
 
 //-----------------------------------------------------------------------------
-bool Generic::as_uint(uint& out) const
+bool Generic::as_uint32_t(uint32_t& out) const
 {
 	if (m_type == GT_INT)
 	{
-		out = (uint)m_data.int_value;
+		out = (uint32_t)m_data.int_value;
 		return true;
 	}
 
 	if (m_type == GT_UINT)
 	{
-		out = m_data.uint_value;
+		out = m_data.uint32_t_value;
 		return true;
 	}
 
 	if (m_type == GT_USHORT)
 	{
-		out = (uint)m_data.ushort_value;
+		out = (uint32_t)m_data.uint16_t_value;
 		return true;
 	}
 
 	if (m_type == GT_FLOAT)
 	{
-		out = (uint)m_data.float_value;
+		out = (uint32_t)m_data.float_value;
 		return true;
 	}
 
@@ -156,37 +156,37 @@ bool Generic::as_uint(uint& out) const
 }
 
 //-----------------------------------------------------------------------------
-uint Generic::as_uint() const
+uint32_t Generic::as_uint32_t() const
 {
-	uint value = 0;
-	as_uint(value);
+	uint32_t value = 0;
+	as_uint32_t(value);
 	return value;
 }
 
 //-----------------------------------------------------------------------------
-bool Generic::as_ushort(ushort& out) const
+bool Generic::as_uint16_t(uint16_t& out) const
 {
 	if (m_type == GT_INT)
 	{
-		out = (ushort)m_data.int_value;
+		out = (uint16_t)m_data.int_value;
 		return true;
 	}
 
 	if (m_type == GT_UINT)
 	{
-		out = (ushort)m_data.uint_value;
+		out = (uint16_t)m_data.uint32_t_value;
 		return true;
 	}
 
 	if (m_type == GT_USHORT)
 	{
-		out = m_data.ushort_value;
+		out = m_data.uint16_t_value;
 		return true;
 	}
 
 	if (m_type == GT_FLOAT)
 	{
-		out = (ushort)m_data.float_value;
+		out = (uint16_t)m_data.float_value;
 		return true;
 	}
 
@@ -200,10 +200,10 @@ bool Generic::as_ushort(ushort& out) const
 }
 
 //-----------------------------------------------------------------------------
-ushort Generic::as_ushort() const
+uint16_t Generic::as_uint16_t() const
 {
-	ushort value = 0;
-	as_ushort(value);
+	uint16_t value = 0;
+	as_uint16_t(value);
 	return value;
 }
 
@@ -218,13 +218,13 @@ bool Generic::as_float(float& out) const
 
 	if (m_type == GT_UINT)
 	{
-		out = (float)m_data.uint_value;
+		out = (float)m_data.uint32_t_value;
 		return true;
 	}
 
 	if (m_type == GT_USHORT)
 	{
-		out = (float)m_data.ushort_value;
+		out = (float)m_data.uint16_t_value;
 		return true;
 	}
 
@@ -262,13 +262,13 @@ bool Generic::as_bool(bool& out) const
 
 	if (m_type == GT_UINT)
 	{
-		out = m_data.uint_value==0?false:true;
+		out = m_data.uint32_t_value==0?false:true;
 		return true;
 	}
 
 	if (m_type == GT_USHORT)
 	{
-		out = m_data.ushort_value==0?false:true;
+		out = m_data.uint16_t_value==0?false:true;
 		return true;
 	}
 
@@ -310,10 +310,10 @@ bool Generic::operator==(const Generic& other)
 			return m_data.int_value == other.m_data.int_value;
 			break;
 		case GT_UINT:
-			return m_data.uint_value == other.m_data.uint_value;
+			return m_data.uint32_t_value == other.m_data.uint32_t_value;
 			break;
 		case GT_USHORT:
-			return m_data.ushort_value == other.m_data.ushort_value;
+			return m_data.uint16_t_value == other.m_data.uint16_t_value;
 			break;
 		case GT_FLOAT:
 			return m_data.float_value == other.m_data.float_value;
@@ -340,10 +340,10 @@ const Generic& Generic::operator=(const Generic& other)
 			m_data.int_value = other.m_data.int_value;
 			break;
 		case GT_UINT:
-			m_data.uint_value = other.m_data.uint_value;
+			m_data.uint32_t_value = other.m_data.uint32_t_value;
 			break;
 		case GT_USHORT:
-			m_data.ushort_value = other.m_data.ushort_value;
+			m_data.uint16_t_value = other.m_data.uint16_t_value;
 			break;
 		case GT_FLOAT:
 			m_data.float_value = other.m_data.float_value;

+ 8 - 8
src/core/containers/Generic.h

@@ -51,8 +51,8 @@ public:
 					~Generic();
 
 	explicit		Generic(int value);
-	explicit		Generic(uint value);
-	explicit		Generic(ushort value);
+	explicit		Generic(uint32_t value);
+	explicit		Generic(uint16_t value);
 	explicit		Generic(float value);
 	explicit		Generic(bool value);
 	explicit		Generic(const char* value);
@@ -62,11 +62,11 @@ public:
 	bool			as_int(int& out) const;
 	int				as_int() const;
 
-	bool			as_uint(uint& out) const;
-	uint			as_uint() const;
+	bool			as_uint32_t(uint32_t& out) const;
+	uint32_t			as_uint32_t() const;
 
-	bool			as_ushort(ushort& out) const;
-	ushort			as_ushort() const;
+	bool			as_uint16_t(uint16_t& out) const;
+	uint16_t			as_uint16_t() const;
 
 	bool			as_float(float& out) const;
 	float			as_float() const;
@@ -88,8 +88,8 @@ private:
 	union Data
 	{
 		int			int_value;
-		uint		uint_value;
-		ushort		ushort_value;
+		uint32_t		uint32_t_value;
+		uint16_t		uint16_t_value;
 		float		float_value;
 		bool		bool_value;
 	};

+ 16 - 16
src/core/containers/List.h

@@ -44,22 +44,22 @@ class List
 public:
 
 						List(Allocator& allocator);
-						List(Allocator& allocator, uint capacity);
+						List(Allocator& allocator, uint32_t capacity);
 						List(const List<T>& list);
 						~List();
 
-	T&					operator[](uint index);
-	const T&			operator[](uint index) const;
+	T&					operator[](uint32_t index);
+	const T&			operator[](uint32_t index) const;
 
 	bool				empty() const;
-	uint				size() const;
-	uint				capacity() const;
-	void				set_capacity(uint capacity);
+	uint32_t				size() const;
+	uint32_t				capacity() const;
+	void				set_capacity(uint32_t capacity);
 	void				grow();
 
 	void				condense();
 
-	uint				push_back(const T& item);
+	uint32_t				push_back(const T& item);
 	void				pop_back();
 	void				clear();
 
@@ -73,8 +73,8 @@ public:
 private:
 
 	Allocator*			m_allocator;
-	uint				m_capacity;
-	uint				m_size;
+	uint32_t				m_capacity;
+	uint32_t				m_size;
 	T*					m_array;
 };
 
@@ -98,7 +98,7 @@ inline List<T>::List(Allocator& allocator) :
 	Allocates capacity * sizeof(T) bytes.
 */
 template <typename T>
-inline List<T>::List(Allocator& allocator, uint capacity) :
+inline List<T>::List(Allocator& allocator, uint32_t capacity) :
 	m_allocator(&allocator),
 	m_capacity(0),
 	m_size(0),
@@ -137,7 +137,7 @@ inline List<T>::~List()
 	The index has to be smaller than size()
 */
 template <typename T>
-inline T& List<T>::operator[](uint index)
+inline T& List<T>::operator[](uint32_t index)
 {
 	assert(index < m_size);
 
@@ -150,7 +150,7 @@ inline T& List<T>::operator[](uint index)
 	The index has to be smaller than size()
 */
 template <typename T>
-inline const T& List<T>::operator[](uint index) const
+inline const T& List<T>::operator[](uint32_t index) const
 {
 	assert(index < m_size);
 
@@ -170,7 +170,7 @@ inline bool List<T>::empty() const
 	Returns the number of items in the array.
 */
 template <typename T>
-inline uint List<T>::size() const
+inline uint32_t List<T>::size() const
 {
 	return m_size;
 }
@@ -179,7 +179,7 @@ inline uint List<T>::size() const
 	Returns the maximum number of items the array can hold.
 */
 template <typename T>
-inline uint List<T>::capacity() const
+inline uint32_t List<T>::capacity() const
 {
 	return m_capacity;
 }
@@ -192,7 +192,7 @@ inline uint List<T>::capacity() const
 	previous array will be truncated.
 */
 template <typename T>
-inline void List<T>::set_capacity(uint capacity)
+inline void List<T>::set_capacity(uint32_t capacity)
 {
 	assert(capacity > 0);
 
@@ -239,7 +239,7 @@ inline void List<T>::condense()
 	Appends an item to the array and returns its index or -1 if full.
 */
 template <typename T>
-inline uint List<T>::push_back(const T& item)
+inline uint32_t List<T>::push_back(const T& item)
 {
 	if (m_capacity == m_size)
 	{

+ 60 - 60
src/core/containers/Str.h

@@ -53,13 +53,13 @@ public:
 	explicit Str(int n);
 
 	//! Constructor
-	explicit Str(uint n);
+	explicit Str(uint32_t n);
 
 	//! Constructor
 	explicit Str(float n);
 
 	//! Constructor
-	Str(uint count, char c);
+	Str(uint32_t count, char c);
 
 	//! Destructor
 	~Str();
@@ -68,28 +68,28 @@ public:
 	Str(const Str& Str);
 
 	//! Returns the Str's length
-	uint GetLength() const;
+	uint32_t GetLength() const;
 
 	//! Provides an interface for accessing Str's elements through an index
-	char operator[](uint index) const;
+	char operator[](uint32_t index) const;
 
 	Str& operator=(const Str& Str);
 	Str& operator=(char c);
 	Str& operator=(const char* str);
 	Str& operator=(int n);
-	Str& operator=(uint n);
+	Str& operator=(uint32_t n);
 	Str& operator=(float n);
 
 	Str operator+(const Str& b) const;
 	Str operator+(const char* str) const;
 	Str operator+(int n) const;
-	Str operator+(uint n) const;
+	Str operator+(uint32_t n) const;
 	Str operator+(float n) const;
 
 	Str& operator+=(const Str& b);
 	Str& operator+=(const char* str);
 	Str& operator+=(int n);
-	Str& operator+=(uint n);
+	Str& operator+=(uint32_t n);
 	Str& operator+=(float n);
 
 	friend Str operator+(const char* str, const Str& string);
@@ -128,10 +128,10 @@ public:
 	int Find(const Str& Str) const;
 
 	//! Returns the subStr of this Str starting at position 'start' and ending at position 'end - 1'
-	Str GetSubstring(uint start, uint end) const;
+	Str GetSubstring(uint32_t start, uint32_t end) const;
 
 	//! Returns the Str with the subStr from position 'start' to position 'end - 1' removed
-	void Remove(uint start, uint end);
+	void Remove(uint32_t start, uint32_t end);
 
 	//! Replaces all the occurencies of the given character with the new one
 	void Replace(char toFind, char toReplace);
@@ -175,14 +175,14 @@ public:
 	static int				FindLast(const char* str, char c);
 
 	bool					ParseInt(int* value) const;
-	bool					ParseUInt(uint* value) const;
+	bool					ParseUInt(uint32_t* value) const;
 	bool					ParseFloat(float* value) const;
 
 	static const char*		EMPTY;
 
 private:
 
-	uint mLength;
+	uint32_t mLength;
 	char* mText;
 
 	static Str mEmpty;
@@ -208,7 +208,7 @@ inline Str::Str(int n) : mLength(0), mText(0)
 	*this = n;
 }
 
-inline Str::Str(uint n) : mLength(0), mText(0)
+inline Str::Str(uint32_t n) : mLength(0), mText(0)
 {
 	*this = n;
 }
@@ -218,10 +218,10 @@ inline Str::Str(float n) : mLength(0), mText(0)
 	*this = n;
 }
 
-inline Str::Str(uint count, char c) : mLength(0), mText(0)
+inline Str::Str(uint32_t count, char c) : mLength(0), mText(0)
 {
 	mText = new char[count + 1];
-	uint i = 0;
+	uint32_t i = 0;
 
 	while (i < count)
 	{
@@ -245,11 +245,11 @@ inline Str::Str(const Str& Str) : mLength(0), mText(0)
 	*this = Str;
 }
 
-inline uint Str::GetLength() const
+inline uint32_t Str::GetLength() const
 {
-	uint chars = 0;
+	uint32_t chars = 0;
 
-	for (uint i = 0; i < mLength; i++)
+	for (uint32_t i = 0; i < mLength; i++)
 	{
 		if ((mText[i] & 0xC0) != 0x80)
 		{
@@ -260,7 +260,7 @@ inline uint Str::GetLength() const
 	return chars;
 }
 
-inline char Str::operator[](uint index) const
+inline char Str::operator[](uint32_t index) const
 {
 	assert(index < mLength);
 	return mText[index];
@@ -281,7 +281,7 @@ inline Str& Str::operator=(const Str& Str)
 	mLength = Str.mLength;
 	mText = new char[mLength + 1];
 
-	for (uint i = 0; i < mLength; i++)
+	for (uint32_t i = 0; i < mLength; i++)
 	{
 		mText[i] = Str.mText[i];
 	}
@@ -316,14 +316,14 @@ inline Str& Str::operator=(const char* str)
 		delete[] mText;
 	}
 
-	uint len = 0;
+	uint32_t len = 0;
 
 	while (str[len++]) ;
 
 	mLength = len - 1;
 	mText = new char[len];
 
-	for (uint i = 0; i < len; i++)
+	for (uint32_t i = 0; i < len; i++)
 	{
 		mText[i] = str[i];
 	}
@@ -335,7 +335,7 @@ inline Str& Str::operator=(int n)
 {
 	char tmp[12] = {0};
 	bool negative = false;
-	uint i = 10;
+	uint32_t i = 10;
 
 	if (n < 0)
 	{
@@ -359,10 +359,10 @@ inline Str& Str::operator=(int n)
 	return *this;
 }
 
-inline Str& Str::operator=(uint n)
+inline Str& Str::operator=(uint32_t n)
 {
 	char tmp[11] = {0};
-	uint i = 9;
+	uint32_t i = 9;
 
 	do
 	{
@@ -391,17 +391,17 @@ inline Str Str::operator+(const Str& b) const
 	}
 
 	Str tmp;
-	uint len = mLength + b.mLength;
+	uint32_t len = mLength + b.mLength;
 	tmp.mLength = len;
 	delete[] tmp.mText;
 	tmp.mText = new char[len + 1];
 
-	for (uint i = 0; i < mLength; i++)
+	for (uint32_t i = 0; i < mLength; i++)
 	{
 		tmp.mText[i] = mText[i];
 	}
 
-	for (uint i = 0; i < b.mLength; i++)
+	for (uint32_t i = 0; i < b.mLength; i++)
 	{
 		tmp.mText[i + mLength] = b.mText[i];
 	}
@@ -420,7 +420,7 @@ inline Str Str::operator+(int n) const
 	return *this + Str(n);
 }
 
-inline Str Str::operator+(uint n) const
+inline Str Str::operator+(uint32_t n) const
 {
 	return *this + Str(n);
 }
@@ -448,7 +448,7 @@ inline Str& Str::operator+=(int n)
 	return *this;
 }
 
-inline Str& Str::operator+=(uint n)
+inline Str& Str::operator+=(uint32_t n)
 {
 	*this = *this + n;
 	return *this;
@@ -467,7 +467,7 @@ inline bool Str::operator==(const Str& b) const
 		return false;
 	}
 
-	for (uint i = 0; i < mLength; i++)
+	for (uint32_t i = 0; i < mLength; i++)
 		if (mText[i] != b.mText[i])
 		{
 			return false;
@@ -479,12 +479,12 @@ inline bool Str::operator==(const Str& b) const
 inline bool Str::operator==(const char* str) const
 {
 	size_t strLength = Str::StrLen(str);
-	if (mLength != (uint)strLength)
+	if (mLength != (uint32_t)strLength)
 	{
 		return false;
 	}
 
-	for (uint i = 0; i < mLength; i++)
+	for (uint32_t i = 0; i < mLength; i++)
 		if (mText[i] != str[i])
 		{
 			return false;
@@ -520,7 +520,7 @@ inline bool Str::operator<=(const Str& b) const
 
 inline void Str::MakeLower()
 {
-	for (uint i = 0; i < mLength; i++)
+	for (uint32_t i = 0; i < mLength; i++)
 	{
 		if (Str::IsUpper(mText[i]))
 		{
@@ -531,7 +531,7 @@ inline void Str::MakeLower()
 
 inline void Str::MakeUpper()
 {
-	for (uint i = 0; i < mLength; i++)
+	for (uint32_t i = 0; i < mLength; i++)
 	{
 		if (Str::IsLower(mText[i]))
 		{
@@ -545,7 +545,7 @@ inline bool Str::StartsWith(const Str& begin) const
 	if (mLength < begin.mLength)
 		return false;
 
-	for (uint i = 0; i < begin.mLength; i++)
+	for (uint32_t i = 0; i < begin.mLength; i++)
 	{
 		if (mText[i] != begin.mText[i])
 			return false;
@@ -559,8 +559,8 @@ inline bool Str::EndsWith(const Str& end) const
 	if (mLength < end.mLength)
 		return false;
 
-	uint beginIndex = mLength - end.mLength;
-	for (uint i = beginIndex; i < mLength; i++)
+	uint32_t beginIndex = mLength - end.mLength;
+	for (uint32_t i = beginIndex; i < mLength; i++)
 	{
 		if (mText[i] != end.mText[i - beginIndex])
 			return false;
@@ -571,7 +571,7 @@ inline bool Str::EndsWith(const Str& end) const
 
 inline int Str::FindFirst(char ch) const
 {
-	for (uint i = 0; i < mLength; i++)
+	for (uint32_t i = 0; i < mLength; i++)
 	{
 		if (mText[i] == ch)
 		{
@@ -584,7 +584,7 @@ inline int Str::FindFirst(char ch) const
 
 inline int Str::FindLast(char ch) const
 {
-	for (uint i = mLength; i > 0; i--)
+	for (uint32_t i = mLength; i > 0; i--)
 	{
 		if (mText[i - 1] == ch)
 		{
@@ -599,14 +599,14 @@ inline int Str::Find(const Str& Str) const
 {
 	bool found = true;
 
-	for (uint i = 0; i < mLength; i++)
+	for (uint32_t i = 0; i < mLength; i++)
 	{
 		if (mLength - i < Str.mLength)
 		{
 			return -1;
 		}
 
-		for (uint j = 0; j < Str.mLength; j++)
+		for (uint32_t j = 0; j < Str.mLength; j++)
 		{
 			if (mText[i + j] != Str.mText[j])
 			{
@@ -625,15 +625,15 @@ inline int Str::Find(const Str& Str) const
 	return -1;
 }
 
-inline Str Str::GetSubstring(uint start, uint end) const
+inline Str Str::GetSubstring(uint32_t start, uint32_t end) const
 {
 	assert(start <= mLength);
 	assert(end <= mLength);
 	assert(start <= end);
-	uint len = end - start;
+	uint32_t len = end - start;
 	char* tmp = new char[len + 1];
 
-	for (uint i = 0; i < len; i++)
+	for (uint32_t i = 0; i < len; i++)
 	{
 		tmp[i] = mText[i + start];
 	}
@@ -644,15 +644,15 @@ inline Str Str::GetSubstring(uint start, uint end) const
 	return ret;
 }
 
-inline void Str::Remove(uint start, uint end)
+inline void Str::Remove(uint32_t start, uint32_t end)
 {
 	assert(start <= mLength);
 	assert(end <= mLength);
 	assert(start <= end);
-	uint len = end - start;
+	uint32_t len = end - start;
 	char* tmp = new char[mLength - len + 1];
 
-	uint i;
+	uint32_t i;
 	for (i = 0; i < start; i++)
 	{
 		tmp[i] = mText[i];
@@ -671,7 +671,7 @@ inline void Str::Remove(uint start, uint end)
 //! Replaces all the occurencies of the given character with the new one
 inline void Str::Replace(char toFind, char toReplace)
 {
-	for (uint i = 0; i < mLength; i++)
+	for (uint32_t i = 0; i < mLength; i++)
 	{
 		if (mText[i] == toFind)
 			mText[i] = toReplace;
@@ -687,11 +687,11 @@ inline void Str::Replace(const Str& toFind, const Str& toReplace)
 
 	List<char> tmp(get_default_allocator());
 
-	uint i;
+	uint32_t i;
 	for (i = 0; i < mLength - (toFind.mLength - 1); i++)
 	{
 		bool found = true;
-		for(uint j = 0; j < toFind.mLength; j++)
+		for(uint32_t j = 0; j < toFind.mLength; j++)
 			if (mText[i + j] != toFind.mText[j])
 			{
 				found = false;
@@ -699,7 +699,7 @@ inline void Str::Replace(const Str& toFind, const Str& toReplace)
 			}
 		if (found)
 		{
-			for(uint j = 0; j < toReplace.mLength; j++)
+			for(uint32_t j = 0; j < toReplace.mLength; j++)
 				tmp.push_back(toReplace.mText[j]);
 			i += toFind.mLength-1;
 		}
@@ -718,9 +718,9 @@ inline void Str::Replace(const Str& toFind, const Str& toReplace)
 
 inline void Str::Split(char ch, List<Str>& split) const
 {
-	uint lastChar = 0;
-	uint strPtr = 0;
-	uint charCount = 0;
+	uint32_t lastChar = 0;
+	uint32_t strPtr = 0;
+	uint32_t charCount = 0;
 
 	while (strPtr <= mLength)
 	{
@@ -764,7 +764,7 @@ inline int Str::GetOccurrenceCount(char ch) const
 {
 	int count = 0;
 
-	for (uint i = 0; i < mLength; i++)
+	for (uint32_t i = 0; i < mLength; i++)
 	{
 		if (mText[i] == ch)
 		{
@@ -795,7 +795,7 @@ inline bool Str::ParseInt(int* value) const
 	return true;
 }
 
-inline bool Str::ParseUInt(uint* value) const
+inline bool Str::ParseUInt(uint32_t* value) const
 {
 	if (sscanf(mText, "%u", value) != 1)
 	{
@@ -851,7 +851,7 @@ inline StrId32 Str::Hash32(const char* str)
 	assert(str != NULL);
 
 	// FNV-1a
-	uint hash = 2166136261u;
+	uint32_t hash = 2166136261u;
 
 	for (size_t i = 0; str[i] != '\0'; i++)
 	{
@@ -869,7 +869,7 @@ inline StrId32 Str::Hash32(const char* str, size_t len)
 	assert(len <= Str::StrLen(str));
 
 	// FNV-1a
-	uint hash = 2166136261u;
+	uint32_t hash = 2166136261u;
 
 	for (size_t i = 0; i < len; i++)
 	{
@@ -886,7 +886,7 @@ inline StrId64 Str::Hash64(const char* str)
 	assert(str != NULL);
 
 	// FNV-1a
-	ulong hash = 14695981039346656037u;
+	uint64_t hash = 14695981039346656037u;
 
 	for (size_t i = 0; str[i] != '\0'; i++)
 	{
@@ -904,7 +904,7 @@ inline StrId64 Str::Hash64(const char* str, size_t len)
 	assert(len <= Str::StrLen(str));
 
 	// FNV-1a
-	ulong hash = 14695981039346656037u;
+	uint64_t hash = 14695981039346656037u;
 
 	for (size_t i = 0; i < len; i++)
 	{

+ 32 - 32
src/core/math/Color4.h

@@ -58,15 +58,15 @@ public:
 							Color4(float r, float g, float b, float a); //!< Construct from four values
 							Color4(int r, int g, int b, int a);			//!< Construct from four values
 	explicit				Color4(float c[4]);							//!< Construct from four values
-	explicit				Color4(uint rgba);							//!< Construct from 32-bit integer (red at MSB, alpha at LSB)
+	explicit				Color4(uint32_t rgba);							//!< Construct from 32-bit integer (red at MSB, alpha at LSB)
 
-	uint					get_as_rgb() const;	//!< Returns the color as a single 32-bit packed value. (RGBA order, alpha assumed = 255)
-	uint					get_as_bgr() const;	//!< Returns the color as a single 32-bit packed value. (ABGR order, alpha assumed = 255)
-	uint					get_as_rgba() const;	//!< Returns the color as a single 32-bit packed value. (RGBA order)
-	uint					get_as_abgr() const;	//!< Returns the color as a single 32-bit packed value. (ABGR order)
+	uint32_t					get_as_rgb() const;	//!< Returns the color as a single 32-bit packed value. (RGBA order, alpha assumed = 255)
+	uint32_t					get_as_bgr() const;	//!< Returns the color as a single 32-bit packed value. (ABGR order, alpha assumed = 255)
+	uint32_t					get_as_rgba() const;	//!< Returns the color as a single 32-bit packed value. (RGBA order)
+	uint32_t					get_as_abgr() const;	//!< Returns the color as a single 32-bit packed value. (ABGR order)
 
-	float					operator[](uint i) const;					//!< Random access by index
-	float&					operator[](uint i);							//!< Random access by index
+	float					operator[](uint32_t i) const;					//!< Random access by index
+	float&					operator[](uint32_t i);							//!< Random access by index
 
 	Color4					operator+(const Color4& c) const;			//!< Addition
 	Color4&					operator+=(const Color4& c);				//!< Addition
@@ -295,7 +295,7 @@ inline Color4::Color4(float c[4])
 }
 
 //-----------------------------------------------------------------------------
-inline Color4::Color4(uint rgba)
+inline Color4::Color4(uint32_t rgba)
 {
 	r = math::ONE_OVER_255 * ((rgba & 0xFF000000) >> 24);
 	g = math::ONE_OVER_255 * ((rgba & 0x00FF0000) >> 16);
@@ -326,65 +326,65 @@ inline Str Color4::to_str() const
 }
 
 //-----------------------------------------------------------------------------
-inline uint Color4::get_as_rgb() const
+inline uint32_t Color4::get_as_rgb() const
 {
-	uint rgba;
+	uint32_t rgba;
 
-	rgba =	(uint)(255.0f * r) << 24;
-	rgba |= (uint)(255.0f * g) << 16;
-	rgba |= (uint)(255.0f * b) << 8;
+	rgba =	(uint32_t)(255.0f * r) << 24;
+	rgba |= (uint32_t)(255.0f * g) << 16;
+	rgba |= (uint32_t)(255.0f * b) << 8;
 	rgba |= 255;
 
 	return rgba;
 }
 
 //-----------------------------------------------------------------------------
-inline uint Color4::get_as_bgr() const
+inline uint32_t Color4::get_as_bgr() const
 {
-	uint abgr;
+	uint32_t abgr;
 
 	abgr =	255 << 24;
-	abgr |= (uint)(255.0f * b) << 16;
-	abgr |= (uint)(255.0f * g) << 8;
-	abgr |= (uint)(255.0f * r);
+	abgr |= (uint32_t)(255.0f * b) << 16;
+	abgr |= (uint32_t)(255.0f * g) << 8;
+	abgr |= (uint32_t)(255.0f * r);
 
 	return abgr;
 }
 
 //-----------------------------------------------------------------------------
-inline uint Color4::get_as_rgba() const
+inline uint32_t Color4::get_as_rgba() const
 {
-	uint rgba;
+	uint32_t rgba;
 
-	rgba =	(uint)(255.0f * r) << 24;
-	rgba |= (uint)(255.0f * g) << 16;
-	rgba |= (uint)(255.0f * b) << 8;
-	rgba |= (uint)(255.0f * a);
+	rgba =	(uint32_t)(255.0f * r) << 24;
+	rgba |= (uint32_t)(255.0f * g) << 16;
+	rgba |= (uint32_t)(255.0f * b) << 8;
+	rgba |= (uint32_t)(255.0f * a);
 
 	return rgba;
 }
 
 //-----------------------------------------------------------------------------
-inline uint Color4::get_as_abgr() const
+inline uint32_t Color4::get_as_abgr() const
 {
-	uint abgr;
+	uint32_t abgr;
 
-	abgr =	(uint)(255.0f * a) << 24;
-	abgr |= (uint)(255.0f * b) << 16;
-	abgr |= (uint)(255.0f * g) << 8;
-	abgr |= (uint)(255.0f * r);
+	abgr =	(uint32_t)(255.0f * a) << 24;
+	abgr |= (uint32_t)(255.0f * b) << 16;
+	abgr |= (uint32_t)(255.0f * g) << 8;
+	abgr |= (uint32_t)(255.0f * r);
 
 	return abgr;
 }
 
 //-----------------------------------------------------------------------------
-inline float Color4::operator[](uint i) const
+inline float Color4::operator[](uint32_t i) const
 {
 	return (&r)[i];
 }
 
 //-----------------------------------------------------------------------------
-inline float& Color4::operator[](uint i)
+inline float& Color4::operator[](uint32_t i)
 {
 	return (&r)[i];
 }

+ 3 - 3
src/core/math/Intersection.h

@@ -633,13 +633,13 @@ inline bool Intersection::TestFrustumSphere(const Frustum& f, const Sphere& s)
 //-----------------------------------------------------------------------------
 inline bool Intersection::TestFrustumBox(const Frustum& f, const Box& b)
 {
-	uint vertexOutCount;
+	uint32_t vertexOutCount;
 
-	for (uint i = 0; i < 6; i++)
+	for (uint32_t i = 0; i < 6; i++)
 	{
 		vertexOutCount = 0;
 
-		for (uint j = 0; j < 8; j++)
+		for (uint32_t j = 0; j < 8; j++)
 		{
 			if (f.mPlane[i].get_distance_to_point(b.get_vertex(j)) < 0.0)
 			{

+ 4 - 4
src/core/math/Mat3.cpp

@@ -108,7 +108,7 @@ Mat3& Mat3::operator=(const Mat3& a)
 }
 
 //-----------------------------------------------------------------------------
-real Mat3::operator[](uint i) const
+real Mat3::operator[](uint32_t i) const
 {
 	assert(i < 9);
 
@@ -116,7 +116,7 @@ real Mat3::operator[](uint i) const
 }
 
 //-----------------------------------------------------------------------------
-real& Mat3::operator[](uint i)
+real& Mat3::operator[](uint32_t i)
 {
 	assert(i < 9);
 
@@ -124,7 +124,7 @@ real& Mat3::operator[](uint i)
 }
 
 //-----------------------------------------------------------------------------
-real Mat3::operator()(uint row, uint column) const
+real Mat3::operator()(uint32_t row, uint32_t column) const
 {
 	assert(row < 3 && column < 3);
 
@@ -589,7 +589,7 @@ Quat Mat3::to_quat() const
 	real fourYSquaredMinusOne = -m[0] + m[4] - m[8];
 	real fourZSquaredMinusOne = -m[0] - m[4] + m[8];
 	real fourMaxSquaredMinusOne = fourWSquaredMinusOne;
-	uint index = 0;
+	uint32_t index = 0;
 
 	if (fourXSquaredMinusOne > fourMaxSquaredMinusOne)
 	{

+ 3 - 3
src/core/math/Mat3.h

@@ -74,10 +74,10 @@ public:
 
 	Mat3&				operator=(const Mat3& a);					//!< Assignment operator (copies the data)
 
-	real				operator[](uint i) const;					//!< Random access by index
-	real&				operator[](uint i);							//!< Random access by index
+	real				operator[](uint32_t i) const;					//!< Random access by index
+	real&				operator[](uint32_t i);							//!< Random access by index
 
-	real				operator()(uint row, uint column) const;	//!< Random access by row/column pair
+	real				operator()(uint32_t row, uint32_t column) const;	//!< Random access by row/column pair
 
 	Mat3				operator+(const Mat3& a) const;				//!< Addition
 	Mat3&				operator+=(const Mat3& a);					//!< Addition

+ 4 - 4
src/core/math/Mat4.cpp

@@ -137,7 +137,7 @@ Mat4& Mat4::operator=(const Mat4& a)
 }
 
 //-----------------------------------------------------------------------------
-real Mat4::operator[](uint i) const
+real Mat4::operator[](uint32_t i) const
 {
 	assert(i < 16);
 
@@ -145,7 +145,7 @@ real Mat4::operator[](uint i) const
 }
 
 //-----------------------------------------------------------------------------
-real& Mat4::operator[](uint i)
+real& Mat4::operator[](uint32_t i)
 {
 	assert(i < 16);
 
@@ -153,7 +153,7 @@ real& Mat4::operator[](uint i)
 }
 
 //-----------------------------------------------------------------------------
-real Mat4::operator()(uint row, uint column) const
+real Mat4::operator()(uint32_t row, uint32_t column) const
 {
 	assert(row < 4 && column < 4);
 
@@ -1025,7 +1025,7 @@ Quat Mat4::to_quat() const
 	real fourYSquaredMinusOne = -m[0] + m[5] - m[10];
 	real fourZSquaredMinusOne = -m[0] - m[5] + m[10];
 	real fourMaxSquaredMinusOne = fourWSquaredMinusOne;
-	uint index = 0;
+	uint32_t index = 0;
 
 	if (fourXSquaredMinusOne > fourMaxSquaredMinusOne)
 	{

+ 3 - 3
src/core/math/Mat4.h

@@ -77,10 +77,10 @@ public:
 
 	Mat4&				operator=(const Mat4& a);					//!< Assignment operator (copies the data)
 
-	real				operator[](uint i) const;					//!< Random access by index
-	real&				operator[](uint i);							//!< Random access by index
+	real				operator[](uint32_t i) const;					//!< Random access by index
+	real&				operator[](uint32_t i);							//!< Random access by index
 
-	real				operator()(uint row, uint column) const;	//!< Random access by row/column pair
+	real				operator()(uint32_t row, uint32_t column) const;	//!< Random access by row/column pair
 
 	Mat4				operator+(const Mat4& a) const;				//!< Addition
 	Mat4&				operator+=(const Mat4& a);					//!< Addition

+ 4 - 4
src/core/math/MathUtils.h

@@ -75,8 +75,8 @@ template <typename T> void	swap(T& a, T& b);				//!< Swaps @a and @b
 
 real			deg_to_rad(real deg);			//!< Returns "deg" in radians
 real			rad_to_deg(real rad);			//!< Returns "rad" in degrees
-uint			next_pow_2(uint x);				//!< Returns the nearest power of two to @x
-bool			is_pow_2(uint x);				//!< Returns whether @x is power of two
+uint32_t			next_pow_2(uint32_t x);				//!< Returns the nearest power of two to @x
+bool			is_pow_2(uint32_t x);				//!< Returns whether @x is power of two
 real			ceil(real x);					//!< Returns the smallest integral value that is not less than x
 real			floor(real x);					//!< Returns the largest integral value that is not greater than x
 real			sqrt(real x);					//!< Returns the square root of @x
@@ -186,7 +186,7 @@ inline real rad_to_deg(real rad)
 }
 
 //-----------------------------------------------------------------------------
-inline uint next_pow_2(uint x)
+inline uint32_t next_pow_2(uint32_t x)
 {
 	x--;
 
@@ -200,7 +200,7 @@ inline uint next_pow_2(uint x)
 }
 
 //-----------------------------------------------------------------------------
-inline bool is_pow_2(uint x)
+inline bool is_pow_2(uint32_t x)
 {
 	return !(x & (x - 1)) && x;
 }

+ 4 - 4
src/core/math/Point2.h

@@ -50,8 +50,8 @@ public:
 							Point2(const Point2& a);			//! Copy constructor
 							~Point2();							//! Destructor
 
-	int						operator[](uint i) const;			//! Random access by index
-	int&					operator[](uint i);					//! Random access by index
+	int						operator[](uint32_t i) const;			//! Random access by index
+	int&					operator[](uint32_t i);					//! Random access by index
 
 	Point2					operator+(const Point2& a) const;	//! Addition
 	Point2&					operator+=(const Point2& a);		//! Addition
@@ -119,7 +119,7 @@ inline Point2::~Point2()
 }
 
 //-----------------------------------------------------------------------------
-inline int Point2::operator[](uint i) const
+inline int Point2::operator[](uint32_t i) const
 {
 	assert(i < 2);
 
@@ -127,7 +127,7 @@ inline int Point2::operator[](uint i) const
 }
 
 //-----------------------------------------------------------------------------
-inline int& Point2::operator[](uint i)
+inline int& Point2::operator[](uint32_t i)
 {
 	assert(i < 2);
 

+ 4 - 4
src/core/math/Vec2.h

@@ -47,8 +47,8 @@ public:
 						Vec2(const Vec2& a);					//!< Copy constructor
 						~Vec2();								//!< Destructor
 
-	real				operator[](uint i) const;				//!< Random access by index
-	real&				operator[](uint i);						//!< Random access by index
+	real				operator[](uint32_t i) const;				//!< Random access by index
+	real&				operator[](uint32_t i);						//!< Random access by index
 
 	Vec2				operator+(const Vec2& a) const;			//!< Addition
 	Vec2&				operator+=(const Vec2& a);				//!< Addition
@@ -123,7 +123,7 @@ inline Vec2::~Vec2()
 }
 
 //-----------------------------------------------------------------------------
-inline real Vec2::operator[](uint i) const
+inline real Vec2::operator[](uint32_t i) const
 {
 	assert(i < 2);
 
@@ -131,7 +131,7 @@ inline real Vec2::operator[](uint i) const
 }
 
 //-----------------------------------------------------------------------------
-inline real& Vec2::operator[](uint i)
+inline real& Vec2::operator[](uint32_t i)
 {
 	assert(i < 2);
 

+ 4 - 4
src/core/math/Vec3.h

@@ -50,8 +50,8 @@ public:
 						Vec3(const Vec3& a);					//!< Copy constructor
 						~Vec3();								//!< Destructor
 
-	real				operator[](uint i) const;				//!< Random access by index
-	real&				operator[](uint i);						//!< Random access by index
+	real				operator[](uint32_t i) const;				//!< Random access by index
+	real&				operator[](uint32_t i);						//!< Random access by index
 
 	Vec3				operator+(const Vec3& a) const;			//!< Addition
 	Vec3&				operator+=(const Vec3& a);				//!< Addition
@@ -127,7 +127,7 @@ inline Vec3::~Vec3()
 }
 
 //-----------------------------------------------------------------------------
-inline real Vec3::operator[](uint i) const
+inline real Vec3::operator[](uint32_t i) const
 {
 	assert(i < 3);
 
@@ -135,7 +135,7 @@ inline real Vec3::operator[](uint i) const
 }
 
 //-----------------------------------------------------------------------------
-inline real& Vec3::operator[](uint i)
+inline real& Vec3::operator[](uint32_t i)
 {
 	assert(i < 3);
 

+ 4 - 4
src/core/math/Vec4.h

@@ -49,8 +49,8 @@ public:
 						Vec4(const Vec4& a);						//!< Copy constructor
 						~Vec4();									//!< Destructor
 
-	real				operator[](uint i) const;					//!< Random access by index
-	real&				operator[](uint i);							//!< Random access by index
+	real				operator[](uint32_t i) const;					//!< Random access by index
+	real&				operator[](uint32_t i);							//!< Random access by index
 
 	Vec4				operator+(const Vec4& a) const;				//!< Addition
 	Vec4&				operator+=(const Vec4& a);					//!< Addition
@@ -125,7 +125,7 @@ inline Vec4::~Vec4()
 }
 
 //-----------------------------------------------------------------------------
-inline real Vec4::operator[](uint i) const
+inline real Vec4::operator[](uint32_t i) const
 {
 	assert(i < 4);
 
@@ -133,7 +133,7 @@ inline real Vec4::operator[](uint i) const
 }
 
 //-----------------------------------------------------------------------------
-inline real& Vec4::operator[](uint i)
+inline real& Vec4::operator[](uint32_t i)
 {
 	assert(i < 4);
 

+ 3 - 3
src/core/mem/MallocAllocator.cpp

@@ -90,7 +90,7 @@ size_t MallocAllocator::actual_allocation_size(size_t size, size_t align)
 //-----------------------------------------------------------------------------
 MallocAllocator::Header* MallocAllocator::header(void* data)
 {
-	uint* ptr = (uint*)data;
+	uint32_t* ptr = (uint32_t*)data;
 	ptr--;
 
 	while (*ptr == memory::PADDING_VALUE)
@@ -110,9 +110,9 @@ void* MallocAllocator::data(Header* header, size_t align)
 //-----------------------------------------------------------------------------
 void MallocAllocator::pad(Header* header, void* data)
 {
-	uint* p = (uint*)(header + 1);
+	uint32_t* p = (uint32_t*)(header + 1);
 
-	while (p != (uint*)data)
+	while (p != (uint32_t*)data)
 	{
 		*p = memory::PADDING_VALUE;
 		p++;

+ 1 - 1
src/core/mem/Memory.h

@@ -35,7 +35,7 @@ namespace crown
 namespace memory
 {
 
-const uint		PADDING_VALUE	= 0xFFFFFFFFu;	//!< Value used to fill unused memory
+const uint32_t	PADDING_VALUE	= 0xFFFFFFFFu;	//!< Value used to fill unused memory
 const size_t	DEFAULT_ALIGN	= 4;			//!< Default memory alignment in bytes
 
 //! Returns the pointer p aligned to the desired align

+ 3 - 3
src/core/streams/FileStream.cpp

@@ -52,7 +52,7 @@ FileStream::~FileStream()
 	mFile = 0;
 }
 
-uchar FileStream::ReadByte()
+uint8_t FileStream::ReadByte()
 {
 	CheckValid();
 
@@ -62,7 +62,7 @@ uchar FileStream::ReadByte()
 		fseek(mFile->GetHandle(), 0, SEEK_CUR);
 	}
 
-	uchar buffer;
+	uint8_t buffer;
 
 	if (fread(&buffer, 1, 1, mFile->GetHandle()) != 1)
 	{
@@ -139,7 +139,7 @@ bool FileStream::EndOfStream() const
 	return GetPosition() == GetSize();
 }
 
-void FileStream::WriteByte(uchar val)
+void FileStream::WriteByte(uint8_t val)
 {
 	CheckValid();
 

+ 2 - 2
src/core/streams/FileStream.h

@@ -57,13 +57,13 @@ public:
 					/** @copydoc Stream::Seek() */
 	void			Seek(int newPos, SeekMode mode);
 					/** @copydoc Stream::ReadByte() */
-	uchar			ReadByte();
+	uint8_t			ReadByte();
 					/** @copydoc Stream::ReadDataBlock() */
 	void			ReadDataBlock(void* buffer, size_t size);
 					/** @copydoc Stream::CopyTo() */
 	bool			CopyTo(Stream* stream, size_t size = 0);
 					/** @copydoc Stream::WriteByte() */
-	void			WriteByte(uchar val);
+	void			WriteByte(uint8_t val);
 					/** @copydoc Stream::WriteDataBlock() */
 	void			WriteDataBlock(const void* buffer, size_t size);
 					/** @copydoc Stream::Flush() */

+ 3 - 3
src/core/streams/FileSubStream.cpp

@@ -52,11 +52,11 @@ FileSubStream::~FileSubStream()
 	mFile = 0;
 }
 
-uchar FileSubStream::ReadByte()
+uint8_t FileSubStream::ReadByte()
 {
 	CheckValid();
 
-	uchar buffer;
+	uint8_t buffer;
 	
 	bool error = false;
 	
@@ -153,7 +153,7 @@ bool FileSubStream::EndOfStream() const
 	return GetPosition() - mSubPosition == mSubLength;
 }
 
-void FileSubStream::WriteByte(uchar /*val*/)
+void FileSubStream::WriteByte(uint8_t /*val*/)
 {
 	Log::E("Write operation on FileSubStream not supported.");
 	throw FileIOException("Write operation on FileSubStream not supported.");

+ 2 - 2
src/core/streams/FileSubStream.h

@@ -53,7 +53,7 @@ public:
 	void Seek(int newPos, SeekMode mode);
 
 	/** @copydoc Stream::ReadByte() */
-	uchar ReadByte();
+	uint8_t ReadByte();
 
 	/** @copydoc Stream::ReadDataBlock() */
 	void ReadDataBlock(void* buffer, size_t size);
@@ -62,7 +62,7 @@ public:
 	bool CopyTo(Stream* stream, size_t size = 0);
 
 	/** @copydoc Stream::WriteByte() */
-	void WriteByte(uchar val);
+	void WriteByte(uint8_t val);
 
 	/** @copydoc Stream::WriteDataBlock() */
 	void WriteDataBlock(const void* buffer, size_t size);

+ 9 - 9
src/core/streams/MemoryStream.cpp

@@ -55,7 +55,7 @@ DynamicMemoryBuffer::~DynamicMemoryBuffer()
 void DynamicMemoryBuffer::Allocate(size_t capacity)
 {
 	Release();
-	mBuff = new uchar[capacity];
+	mBuff = new uint8_t[capacity];
 	this->mCapacity = capacity;
 	mSize = 0;
 }
@@ -74,11 +74,11 @@ void DynamicMemoryBuffer::CheckSpace(size_t offset, size_t size)
 	if (offset + size > mCapacity)
 	{
 		mCapacity = (size_t) ((offset + size) * 1.2f);
-		mBuff = (uchar*) realloc(mBuff, mCapacity);
+		mBuff = (uint8_t*) realloc(mBuff, mCapacity);
 	}
 }
 
-void DynamicMemoryBuffer::Write(uchar* src, size_t offset, size_t size)
+void DynamicMemoryBuffer::Write(uint8_t* src, size_t offset, size_t size)
 {
 	CheckSpace(offset, size);
 
@@ -135,7 +135,7 @@ void MemoryStream::Seek(int newPos, SeekMode mode)
 	}
 }
 
-uchar MemoryStream::ReadByte()
+uint8_t MemoryStream::ReadByte()
 {
 	CheckValid();
 
@@ -151,8 +151,8 @@ uchar MemoryStream::ReadByte()
 void MemoryStream::ReadDataBlock(void* buffer, size_t size)
 {
 	CheckValid();
-	uchar* src = mMem->GetData();
-	uchar* dest = (uchar*) buffer;
+	uint8_t* src = mMem->GetData();
+	uint8_t* dest = (uint8_t*) buffer;
 
 	if (mMemOffset + size > mMem->GetSize())
 	{
@@ -175,7 +175,7 @@ bool MemoryStream::CopyTo(Stream* stream, size_t size)
 	return true;
 }
 
-void MemoryStream::WriteByte(uchar val)
+void MemoryStream::WriteByte(uint8_t val)
 {
 	CheckValid();
 	mMem->Write(&val, mMemOffset, 1);
@@ -185,7 +185,7 @@ void MemoryStream::WriteByte(uchar val)
 void MemoryStream::WriteDataBlock(const void* buffer, size_t size)
 {
 	CheckValid();
-	mMem->Write((uchar*)buffer, mMemOffset, size);
+	mMem->Write((uint8_t*)buffer, mMemOffset, size);
 	mMemOffset += size;
 }
 
@@ -196,7 +196,7 @@ void MemoryStream::Flush()
 
 void MemoryStream::Dump()
 {
-	uchar* buff = mMem->GetData();
+	uint8_t* buff = mMem->GetData();
 
 	for (size_t i=0; i<mMem->GetSize(); i++)
 	{

+ 7 - 7
src/core/streams/MemoryStream.h

@@ -45,9 +45,9 @@ public:
 
 	virtual bool		IsValid() = 0;
 	virtual size_t		GetSize() = 0;
-	virtual uchar*		GetData() = 0;
+	virtual uint8_t*		GetData() = 0;
 
-	virtual void		Write(uchar* src, size_t offset, size_t size) = 0;
+	virtual void		Write(uint8_t* src, size_t offset, size_t size) = 0;
 };
 
 class DynamicMemoryBuffer: public MemoryBuffer
@@ -64,16 +64,16 @@ public:
 	inline bool		IsValid() { return mBuff != 0; }
 
 	void			CheckSpace(size_t offset, size_t space);
-	void			Write(uchar* src, size_t offset, size_t size);
+	void			Write(uint8_t* src, size_t offset, size_t size);
 
 	inline size_t	GetSize() { return mSize; }
 	inline size_t	GetCapacity() { return mCapacity; }
 
-	inline uchar*	GetData() { return mBuff; }
+	inline uint8_t*	GetData() { return mBuff; }
 
 protected:
 
-	uchar*			mBuff;
+	uint8_t*			mBuff;
 	size_t			mCapacity;
 	size_t			mSize;
 };
@@ -93,11 +93,11 @@ public:
 
 	void				Seek(int newPos, SeekMode mode);
 
-	uchar				ReadByte();
+	uint8_t				ReadByte();
 	void				ReadDataBlock(void* buffer, size_t size);
 	bool				CopyTo(Stream* stream, size_t size = 0);
 
-	void				WriteByte(uchar val);
+	void				WriteByte(uint8_t val);
 	void				WriteDataBlock(const void* buffer, size_t size);
 	void				Flush();
 

+ 4 - 4
src/core/streams/NullStream.h

@@ -46,13 +46,13 @@ public:
 				/** @copydoc Stream::~Stream() */
 	virtual		~NullStream() {}
 				/** @copydoc Stream::Seek() */
-	void		Seek(int /*newPos*/, uchar /*mode*/) {}
+	void		Seek(int /*newPos*/, uint8_t /*mode*/) {}
 				/**
 				@copydoc Stream::ReadByte()
 				@note
 					Returns always zero
 				*/
-	uchar		ReadByte() { return 0; }
+	uint8_t		ReadByte() { return 0; }
 				/**
 				@copydoc Stream::ReadDataBlock()
 				@note
@@ -62,7 +62,7 @@ public:
 				{
 					for (size_t i = 0; i < size; i++)
 					{
-						((uchar*)buffer)[i] = 0;
+						((uint8_t*)buffer)[i] = 0;
 					}
 				}
 				/**
@@ -72,7 +72,7 @@ public:
 				*/
 	bool		CopyTo(Stream* /*stream*/, size_t /*size = 0*/) { return false; }
 				/** @copydoc Stream::WriteByte() */
-	void		WriteByte(uchar /*val*/) {};
+	void		WriteByte(uint8_t /*val*/) {};
 				/** @copydoc Stream::WriteDataBlock() */
 	void		WriteDataBlock(const void* /*buffer*/, size_t /*size*/) {};
 				/** @copydoc Stream::Flush() */

+ 17 - 17
src/core/streams/Stream.cpp

@@ -155,10 +155,10 @@ BinaryReader::~BinaryReader()
 {
 }
 
-uchar BinaryReader::ReadByte()
+uint8_t BinaryReader::ReadByte()
 {
-	uchar buffer;
-	mStream->ReadDataBlock(&buffer, sizeof(uchar));
+	uint8_t buffer;
+	mStream->ReadDataBlock(&buffer, sizeof(uint8_t));
 	return buffer;
 }
 
@@ -169,10 +169,10 @@ short BinaryReader::ReadInt16()
 	return buffer;
 }
 
-ushort BinaryReader::ReadUint16()
+uint16_t BinaryReader::ReadUint16()
 {
-	ushort buffer;
-	mStream->ReadDataBlock(&buffer, sizeof(ushort));
+	uint16_t buffer;
+	mStream->ReadDataBlock(&buffer, sizeof(uint16_t));
 	return buffer;
 }
 
@@ -183,10 +183,10 @@ int BinaryReader::ReadInt32()
 	return buffer;
 }
 
-uint BinaryReader::ReadUint32()
+uint32_t BinaryReader::ReadUint32()
 {
-	uint buffer;
-	mStream->ReadDataBlock(&buffer, sizeof(uint));
+	uint32_t buffer;
+	mStream->ReadDataBlock(&buffer, sizeof(uint32_t));
 	return buffer;
 }
 
@@ -221,9 +221,9 @@ BinaryWriter::~BinaryWriter()
 {
 }
 
-void BinaryWriter::WriteByte(uchar buffer)
+void BinaryWriter::WriteByte(uint8_t buffer)
 {
-	mStream->WriteDataBlock(&buffer, sizeof(uchar));
+	mStream->WriteDataBlock(&buffer, sizeof(uint8_t));
 }
 
 void BinaryWriter::WriteInt16(short buffer)
@@ -231,9 +231,9 @@ void BinaryWriter::WriteInt16(short buffer)
 	mStream->WriteDataBlock(&buffer, sizeof(short));
 }
 
-void BinaryWriter::WriteUint16(ushort buffer)
+void BinaryWriter::WriteUint16(uint16_t buffer)
 {
-	mStream->WriteDataBlock(&buffer, sizeof(ushort));
+	mStream->WriteDataBlock(&buffer, sizeof(uint16_t));
 }
 
 void BinaryWriter::WriteInt32(int buffer)
@@ -241,9 +241,9 @@ void BinaryWriter::WriteInt32(int buffer)
 	mStream->WriteDataBlock(&buffer, sizeof(int));
 }
 
-void BinaryWriter::WriteUint32(uint buffer)
+void BinaryWriter::WriteUint32(uint32_t buffer)
 {
-	mStream->WriteDataBlock(&buffer, sizeof(uint));
+	mStream->WriteDataBlock(&buffer, sizeof(uint32_t));
 }
 
 void BinaryWriter::WriteInt64(long long buffer)
@@ -261,10 +261,10 @@ void BinaryWriter::WriteFloat(float buffer)
 	mStream->WriteDataBlock(&buffer, sizeof(float));
 }
 
-void BinaryWriter::InsertByte(uchar val, size_t offset)
+void BinaryWriter::InsertByte(uint8_t val, size_t offset)
 {
 	size_t tmpSize = mStream->GetSize() - offset;
-	uchar* tmp = new uchar[tmpSize];
+	uint8_t* tmp = new uint8_t[tmpSize];
 	mStream->Seek(offset, SM_SeekFromBegin);
 	mStream->ReadDataBlock(tmp, tmpSize);
 	mStream->Seek(offset, SM_SeekFromBegin);

+ 9 - 9
src/core/streams/Stream.h

@@ -81,7 +81,7 @@ public:
 						@return
 							The byte read
 						*/
-	virtual uchar		ReadByte() = 0;
+	virtual uint8_t		ReadByte() = 0;
 						/**
 							Reads a block of data from the stream.
 						@param buffer
@@ -123,7 +123,7 @@ public:
 						@param val
 							The byte to write
 						*/
-	virtual void		WriteByte(uchar val) = 0;
+	virtual void		WriteByte(uint8_t val) = 0;
 						/**
 							Writes a block of data to the stream.
 						@param buffer
@@ -203,11 +203,11 @@ public:
 						BinaryReader(Stream* s);
 	virtual				~BinaryReader();
 
-	uchar				ReadByte();
+	uint8_t				ReadByte();
 	short				ReadInt16();
-	ushort				ReadUint16();
+	uint16_t				ReadUint16();
 	int					ReadInt32();
-	uint				ReadUint32();
+	uint32_t				ReadUint32();
 	long long			ReadInt64();
 	double				ReadDouble();
 	float				ReadFloat();
@@ -229,16 +229,16 @@ public:
 						BinaryWriter(Stream* s);
 	virtual				~BinaryWriter();
 
-	void				WriteByte(uchar);
+	void				WriteByte(uint8_t);
 	void				WriteInt16(short);
-	void				WriteUint16(ushort);
+	void				WriteUint16(uint16_t);
 	void				WriteInt32(int);
-	void				WriteUint32(uint);
+	void				WriteUint32(uint32_t);
 	void				WriteInt64(long long);
 	void				WriteDouble(double);
 	void				WriteFloat(float);
 
-	void				InsertByte(uchar val, size_t offset);
+	void				InsertByte(uint8_t val, size_t offset);
 
 	inline Stream*		GetStream() { return mStream; }
 	inline void			SetStream(Stream* stream) { mStream = stream; }

+ 10 - 10
src/input/EventDispatcher.cpp

@@ -69,7 +69,7 @@ void EventDispatcher::AddTouchListener(TouchListener* listener)
 //-----------------------------------------------------------------------------
 void EventDispatcher::ButtonPressed(const MouseEvent& event)
 {
-	for (uint i = 0; i < mMouseListenerList.size(); i++)
+	for (uint32_t i = 0; i < mMouseListenerList.size(); i++)
 	{
 		mMouseListenerList[i]->ButtonPressed(event);
 	}
@@ -78,7 +78,7 @@ void EventDispatcher::ButtonPressed(const MouseEvent& event)
 //-----------------------------------------------------------------------------
 void EventDispatcher::ButtonReleased(const MouseEvent& event)
 {
-	for (uint i = 0; i < mMouseListenerList.size(); i++)
+	for (uint32_t i = 0; i < mMouseListenerList.size(); i++)
 	{
 		mMouseListenerList[i]->ButtonReleased(event);
 	}
@@ -87,7 +87,7 @@ void EventDispatcher::ButtonReleased(const MouseEvent& event)
 //-----------------------------------------------------------------------------
 void EventDispatcher::CursorMoved(const MouseEvent& event)
 {
-	for (uint i = 0; i < mMouseListenerList.size(); i++)
+	for (uint32_t i = 0; i < mMouseListenerList.size(); i++)
 	{
 		mMouseListenerList[i]->CursorMoved(event);
 	}
@@ -96,7 +96,7 @@ void EventDispatcher::CursorMoved(const MouseEvent& event)
 //-----------------------------------------------------------------------------
 void EventDispatcher::KeyPressed(const KeyboardEvent& event)
 {
-	for (uint i = 0; i < mKeyboardListenerList.size(); i++)
+	for (uint32_t i = 0; i < mKeyboardListenerList.size(); i++)
 	{
 		mKeyboardListenerList[i]->KeyPressed(event);
 	}
@@ -105,7 +105,7 @@ void EventDispatcher::KeyPressed(const KeyboardEvent& event)
 //-----------------------------------------------------------------------------
 void EventDispatcher::KeyReleased(const KeyboardEvent& event)
 {
-	for (uint i = 0; i < mKeyboardListenerList.size(); i++)
+	for (uint32_t i = 0; i < mKeyboardListenerList.size(); i++)
 	{
 		mKeyboardListenerList[i]->KeyReleased(event);
 	}
@@ -114,7 +114,7 @@ void EventDispatcher::KeyReleased(const KeyboardEvent& event)
 //-----------------------------------------------------------------------------
 void EventDispatcher::TextInput(const KeyboardEvent& event)
 {
-	for (uint i = 0; i < mKeyboardListenerList.size(); i++)
+	for (uint32_t i = 0; i < mKeyboardListenerList.size(); i++)
 	{
 		mKeyboardListenerList[i]->TextInput(event);
 	}
@@ -123,7 +123,7 @@ void EventDispatcher::TextInput(const KeyboardEvent& event)
 //-----------------------------------------------------------------------------
 void EventDispatcher::TouchDown(const TouchEvent& event)
 {
-	for (uint i = 0; i < mTouchListenerList.size(); i++)
+	for (uint32_t i = 0; i < mTouchListenerList.size(); i++)
 	{
 		mTouchListenerList[i]->TouchDown(event);
 	}
@@ -132,7 +132,7 @@ void EventDispatcher::TouchDown(const TouchEvent& event)
 //-----------------------------------------------------------------------------
 void EventDispatcher::TouchUp(const TouchEvent& event)
 {
-	for (uint i = 0; i < mTouchListenerList.size(); i++)
+	for (uint32_t i = 0; i < mTouchListenerList.size(); i++)
 	{
 		mTouchListenerList[i]->TouchUp(event);
 	}
@@ -141,7 +141,7 @@ void EventDispatcher::TouchUp(const TouchEvent& event)
 //-----------------------------------------------------------------------------
 void EventDispatcher::TouchMove(const TouchEvent& event)
 {
-	for (uint i = 0; i < mTouchListenerList.size(); i++)
+	for (uint32_t i = 0; i < mTouchListenerList.size(); i++)
 	{
 		mTouchListenerList[i]->TouchMove(event);
 	}
@@ -150,7 +150,7 @@ void EventDispatcher::TouchMove(const TouchEvent& event)
 //-----------------------------------------------------------------------------
 void EventDispatcher::TouchCancel(const TouchEvent& event)
 {
-	for (uint i = 0; i < mTouchListenerList.size(); i++)
+	for (uint32_t i = 0; i < mTouchListenerList.size(); i++)
 	{
 		mTouchListenerList[i]->TouchCancel(event);
 	}

+ 4 - 4
src/input/InputManager.cpp

@@ -141,8 +141,8 @@ void InputManager::set_cursor_xy(const Point2& position)
 //-----------------------------------------------------------------------------
 Vec2 InputManager::get_cursor_relative_xy() const
 {
-	uint window_width;
-	uint window_height;
+	uint32_t window_width;
+	uint32_t window_height;
 
 	os::get_render_window_metrics(window_width, window_height);
 
@@ -157,8 +157,8 @@ Vec2 InputManager::get_cursor_relative_xy() const
 //-----------------------------------------------------------------------------
 void InputManager::set_cursor_relative_xy(const Vec2& position)
 {
-	uint window_width;
-	uint window_height;
+	uint32_t window_width;
+	uint32_t window_height;
 
 	os::get_render_window_metrics(window_width, window_height);
 

+ 1 - 1
src/input/KeyCode.h

@@ -94,7 +94,7 @@ enum KeyCode
 	KC_COUNT		= 0xFF		// The last key must be <= 0xFF
 };
 
-typedef uchar Key;
+typedef uint8_t Key;
 
 } // namespace crown
 

+ 20 - 20
src/loaders/BMPImageLoader.cpp

@@ -40,26 +40,26 @@ namespace crown
 
 struct BitmapInfoHeader
 {
-	uint biSize;
+	uint32_t biSize;
 	int  biWidth;
 	int  biHeight;
-	ushort biPlanes;
-	ushort biBitCount;
-	uint biCompression;
-	uint biSizeImage;
+	uint16_t biPlanes;
+	uint16_t biBitCount;
+	uint32_t biCompression;
+	uint32_t biSizeImage;
 	int  biXPelsPerMeter;
 	int  biYPelsPerMeter;
-	uint biClrUsed;
-	uint biClrImportant;
+	uint32_t biClrUsed;
+	uint32_t biClrImportant;
 };
 
 struct BitmapFileHeader
 {
-	ushort bfType;
-	uint bfSize;
-	ushort bfReserved1;
-	ushort bfReserved2;
-	uint bfOffBits;
+	uint16_t bfType;
+	uint32_t bfSize;
+	uint16_t bfReserved1;
+	uint16_t bfReserved2;
+	uint32_t bfOffBits;
 };
 
 #pragma pack()
@@ -82,8 +82,8 @@ Image* BMPImageLoader::LoadFile(const char* relativePath)
 	short int magicNumber = 0;
 	int padSize = 0;
 	int dataSize = 0;
-	uchar* data = NULL;
-	uchar* tmpdata = NULL;
+	uint8_t* data = NULL;
+	uint8_t* tmpdata = NULL;
 	//<fp = fopen(name, "rb");
 	fileStream = GetFilesystem()->OpenStream(relativePath, SOM_READ);
 
@@ -124,11 +124,11 @@ Image* BMPImageLoader::LoadFile(const char* relativePath)
 	}
 
 	dataSize = bih.biWidth * bih.biHeight * 4;
-	data = new uchar[dataSize];
+	data = new uint8_t[dataSize];
 
 	if (bpp == 3)
 	{
-		tmpdata = new uchar[bih.biWidth*3];
+		tmpdata = new uint8_t[bih.biWidth*3];
 
 		for (int i=0; i<bih.biHeight ; i++)
 		{
@@ -184,8 +184,8 @@ void BMPImageLoader::SaveFile(const Image* image, const char* relativePath)
 		int padSize = 0;
 		int imgDataSize = 0;
 		int bmpDataSize;
-		const uchar* imgData = NULL;
-		uchar* bmpRow = NULL;
+		const uint8_t* imgData = NULL;
+		uint8_t* bmpRow = NULL;
 
 		PixelFormat format = image->GetFormat();
 		if (format != PF_LA_8 && format != PF_RGB_8 && format != PF_RGBA_8)
@@ -227,7 +227,7 @@ void BMPImageLoader::SaveFile(const Image* image, const char* relativePath)
 		imgData = image->GetBuffer();
 		imgDataSize = image->GetWidth() * image->GetHeight() * bpp;
 
-		bmpRow = new uchar[bih.biWidth*3];
+		bmpRow = new uint8_t[bih.biWidth*3];
 
 		for (int i=0; i<bih.biHeight ; i++)
 		{
@@ -252,7 +252,7 @@ void BMPImageLoader::SaveFile(const Image* image, const char* relativePath)
 				}
 			}
 
-			if (fwrite(bmpRow, 1, bih.biWidth*3, fp) != (uint)bih.biWidth*3)
+			if (fwrite(bmpRow, 1, bih.biWidth*3, fp) != (uint32_t)bih.biWidth*3)
 			{
 				throw 1;
 			}

+ 18 - 18
src/loaders/TGAImageLoader.cpp

@@ -84,19 +84,19 @@ Image* TGAImageLoader::LoadFile(const char* relativePath)
 Image* TGAImageLoader::LoadUncompressedData(Stream* fp)
 {
 	Image* image;
-	uint channels = mTGAHeader.pixel_depth / 8;
-	ulong size = mTGAHeader.width * mTGAHeader.height;
-	uchar* data;
+	uint32_t channels = mTGAHeader.pixel_depth / 8;
+	uint64_t size = mTGAHeader.width * mTGAHeader.height;
+	uint8_t* data;
 	PixelFormat format = PF_RGB_8;
 
 	if (mTGAHeader.pixel_depth == 16)
 	{
-		data = new uchar[(uint)(size * 3)];
+		data = new uint8_t[(uint32_t)(size * 3)];
 		int j = 0;
 
-		for (ulong i = 0; i < size * channels; i++)
+		for (uint64_t i = 0; i < size * channels; i++)
 		{
-			ushort pixel_data;
+			uint16_t pixel_data;
 			fp->ReadDataBlock(&pixel_data, sizeof(pixel_data));
 			data[j] = (pixel_data & 0x7c) >> 10;
 			data[j+1] = (pixel_data & 0x3e) >> 5;
@@ -106,7 +106,7 @@ Image* TGAImageLoader::LoadUncompressedData(Stream* fp)
 	}
 	else
 	{
-		data = new uchar[(uint)(size * channels)];
+		data = new uint8_t[(uint32_t)(size * channels)];
 		fp->ReadDataBlock(data, (size_t)(size * channels));
 		SwapRedBlue(data, size * channels, channels);
 	}
@@ -123,14 +123,14 @@ Image* TGAImageLoader::LoadUncompressedData(Stream* fp)
 Image* TGAImageLoader::LoadCompressedData(Stream* fp)
 {
 	Image* image;
-	uint channels = mTGAHeader.pixel_depth/8;
-	uchar rle_id = 0;
-	uint i = 0;
-	uchar* colors;
-	uint colors_read = 0;
-	ulong size = mTGAHeader.width * mTGAHeader.height;
-	uchar* data = new uchar[(uint)(size * channels)];
-	colors = new uchar[channels];
+	uint32_t channels = mTGAHeader.pixel_depth/8;
+	uint8_t rle_id = 0;
+	uint32_t i = 0;
+	uint8_t* colors;
+	uint32_t colors_read = 0;
+	uint64_t size = mTGAHeader.width * mTGAHeader.height;
+	uint8_t* data = new uint8_t[(uint32_t)(size * channels)];
+	colors = new uint8_t[channels];
 	PixelFormat format = PF_RGB_8;
 
 	if (channels == 4)
@@ -140,7 +140,7 @@ Image* TGAImageLoader::LoadCompressedData(Stream* fp)
 
 	while (i < size)
 	{
-		fp->ReadDataBlock(&rle_id, sizeof(uchar));
+		fp->ReadDataBlock(&rle_id, sizeof(uint8_t));
 
 		if (rle_id & 0x80)   // Se il bit più significativo è ad 1
 		{
@@ -191,9 +191,9 @@ Image* TGAImageLoader::LoadCompressedData(Stream* fp)
 	return image;
 }
 
-void TGAImageLoader::SwapRedBlue(uchar* data, ulong size, uint channels)
+void TGAImageLoader::SwapRedBlue(uint8_t* data, uint64_t size, uint32_t channels)
 {
-	for (ulong i = 0; i < size; i += channels)
+	for (uint64_t i = 0; i < size; i += channels)
 	{
 		data[i] ^= data[i+2];
 		data[i+2] ^= data[i];

+ 11 - 11
src/loaders/TGAImageLoader.h

@@ -40,16 +40,16 @@ class TGAImageLoader : public ImageLoader
 	struct TGAHeader_t
 	{
 
-		uchar id_length;        /* 00h  Size of Image ID field */
-		uchar color_map_type;   /* 01h  Color map type */
-		uchar image_type;       /* 02h  Image type code */
-		uchar c_map_spec[5];    /* 03h  Color map origin 05h Color map length 07h Depth of color map entries */
-		ushort x_offset;        /* 08h  X origin of image */
-		ushort y_offset;        /* 0Ah  Y origin of image */
-		ushort width;           /* 0Ch  Width of image */
-		ushort height;          /* 0Eh  Height of image */
-		uchar pixel_depth;      /* 10h  Image pixel size */
-		uchar image_descriptor; /* 11h  Image descriptor byte */
+		uint8_t id_length;        /* 00h  Size of Image ID field */
+		uint8_t color_map_type;   /* 01h  Color map type */
+		uint8_t image_type;       /* 02h  Image type code */
+		uint8_t c_map_spec[5];    /* 03h  Color map origin 05h Color map length 07h Depth of color map entries */
+		uint16_t x_offset;        /* 08h  X origin of image */
+		uint16_t y_offset;        /* 0Ah  Y origin of image */
+		uint16_t width;           /* 0Ch  Width of image */
+		uint16_t height;          /* 0Eh  Height of image */
+		uint8_t pixel_depth;      /* 10h  Image pixel size */
+		uint8_t image_descriptor; /* 11h  Image descriptor byte */
 	};
 
 public:
@@ -64,7 +64,7 @@ private:
 
 	Image* LoadUncompressedData(Stream* file);
 	Image* LoadCompressedData(Stream* file);
-	void SwapRedBlue(uchar* data, ulong size, uint channels);
+	void SwapRedBlue(uint8_t* data, uint64_t size, uint32_t channels);
 
 	TGAHeader_t mTGAHeader;
 };

+ 14 - 14
src/os/OS.h

@@ -82,9 +82,9 @@ bool			ls(const char* path, List<Str>& fileList);	//! Returns the list of filena
 //-----------------------------------------------------------------------------
 void			init_os();
 
-bool			create_render_window(uint x, uint y, uint width, uint height, bool fullscreen);
+bool			create_render_window(uint32_t x, uint32_t y, uint32_t width, uint32_t height, bool fullscreen);
 bool			destroy_render_window();
-void			get_render_window_metrics(uint& width, uint& height);
+void			get_render_window_metrics(uint32_t& width, uint32_t& height);
 void			swap_buffers();
 
 void			event_loop();
@@ -133,27 +133,27 @@ OSEvent&			pop_event();
 
 struct IPv4Address
 {
-	uchar 	address[4];
-	ushort 	port;
+	uint8_t 	address[4];
+	uint16_t 	port;
 	
-	uint get_address()
+	uint32_t get_address()
 	{
-		uint addr = address[0] << 24 | address[1] << 16 | address[2] << 8 | address[3];
+		uint32_t addr = address[0] << 24 | address[1] << 16 | address[2] << 8 | address[3];
 		
 		return addr;
 	}
 	
-	ushort get_port()
+	uint16_t get_port()
 	{
 		return port;
 	}
 	
-	void set(uint a, ushort p)
+	void set(uint32_t a, uint16_t p)
 	{
-		address[0] = (uchar) a >> 24;
-		address[1] = (uchar) a >> 16;
-		address[2] = (uchar) a >> 8;
-		address[3] = (uchar) a;
+		address[0] = (uint8_t) a >> 24;
+		address[1] = (uint8_t) a >> 16;
+		address[2] = (uint8_t) a >> 8;
+		address[3] = (uint8_t) a;
 
 		port = p;
 	}
@@ -168,7 +168,7 @@ class UDPSocket
 					// Destructor
 					~UDPSocket();
 					// Open connection
-		bool 		open(ushort port);
+		bool 		open(uint16_t port);
 					 // Send data through socket
 		bool 		send(IPv4Address &receiver, const void* data, int size );
 					// Receive data through socket
@@ -192,7 +192,7 @@ class TCPSocket
 					// Destructor
 					~TCPSocket();
 					// Open connection (server side)
-		bool 		open(ushort port);
+		bool 		open(uint16_t port);
 					// Connect (client side)
 		bool		connect(IPv4Address& destination);
 					// Close connection

+ 5 - 5
src/os/android/AndroidRenderWindow.cpp

@@ -69,7 +69,7 @@ AndroidRenderWindow::~AndroidRenderWindow()
 	}
 }
 
-bool AndroidRenderWindow::Create(uint x, uint y, uint width, uint height, uint depth, bool /*fullscreen*/)
+bool AndroidRenderWindow::Create(uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t depth, bool /*fullscreen*/)
 {
 	Log::D("AndroidRenderWindow::Create: Creating window...");
 	if (!width || !height)
@@ -84,7 +84,7 @@ bool AndroidRenderWindow::Create(uint x, uint y, uint width, uint height, uint d
 		return false;
 	}
 
-	uint bpp			= depth / 4;
+	uint32_t bpp			= depth / 4;
 
 	const EGLint attribs[] =
 	{
@@ -173,11 +173,11 @@ void AndroidRenderWindow::SetVisible(bool visible)
 	mVisible = visible;
 }
 
-void AndroidRenderWindow::Move(uint x, uint y)
+void AndroidRenderWindow::Move(uint32_t x, uint32_t y)
 {
 }
 
-void AndroidRenderWindow::Resize(uint width, uint height)
+void AndroidRenderWindow::Resize(uint32_t width, uint32_t height)
 {
 }
 
@@ -204,7 +204,7 @@ void AndroidRenderWindow::EventLoop()
 {
 }
 
-void AndroidRenderWindow::_NotifyMetricsChange(uint x, uint y, uint width, uint height)
+void AndroidRenderWindow::_NotifyMetricsChange(uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 {
 }
 

+ 4 - 4
src/os/android/AndroidRenderWindow.h

@@ -44,7 +44,7 @@ public:
 	~AndroidRenderWindow();
 
 	//! See RenderWindow
-	virtual bool Create(uint x, uint y, uint width, uint height, uint depth, bool fullscreen);
+	virtual bool Create(uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t depth, bool fullscreen);
 
 	//! See RenderWindow
 	virtual void Destroy();
@@ -53,10 +53,10 @@ public:
 	virtual void SetVisible(bool visible);
 
 	//! See RenderWindow
-	virtual void Move(uint x, uint y);
+	virtual void Move(uint32_t x, uint32_t y);
 
 	//! See RenderWindow
-	virtual void Resize(uint width, uint height);
+	virtual void Resize(uint32_t width, uint32_t height);
 
 	//! See RenderWindow
 	virtual void SetFullscreen(bool full);
@@ -78,7 +78,7 @@ public:
 private:
 
 	//! See RenderWindow
-	void _NotifyMetricsChange(uint x, uint y, uint width, uint height);
+	void _NotifyMetricsChange(uint32_t x, uint32_t y, uint32_t width, uint32_t height);
 
 	//! Sets the window's title plus the additional title text in the window
 	virtual void _SetTitleAndAdditionalTextToWindow();

+ 4 - 4
src/os/android/AndroidTimer.cpp

@@ -44,14 +44,14 @@ void Timer::Reset()
 	clock_gettime(CLOCK_MONOTONIC, &mCreationTime);
 }
 
-ulong Timer::GetMilliseconds() const
+uint64_t Timer::GetMilliseconds() const
 {
 	timespec tmp;
 	clock_gettime(CLOCK_MONOTONIC, &tmp);
 	return (tmp.tv_sec - mCreationTime.tv_sec) * 1000 + (tmp.tv_nsec - mCreationTime.tv_nsec) / 1000000;
 }
 
-ulong Timer::GetMicroseconds() const
+uint64_t Timer::GetMicroseconds() const
 {
 	timespec tmp;
 	clock_gettime(CLOCK_MONOTONIC, &tmp);
@@ -64,7 +64,7 @@ void Timer::StartMilliseconds()
 	clock_gettime(CLOCK_MONOTONIC, &mStartTime);
 }
 
-ulong Timer::StopMilliseconds() const
+uint64_t Timer::StopMilliseconds() const
 {
 	timespec tmp;
 	clock_gettime(CLOCK_MONOTONIC, &tmp);
@@ -76,7 +76,7 @@ void Timer::StartMicroseconds()
 	clock_gettime(CLOCK_MONOTONIC, &mStartTime);
 }
 
-ulong Timer::StopMicroseconds() const
+uint64_t Timer::StopMicroseconds() const
 {
 	timespec tmp;
 	clock_gettime(CLOCK_MONOTONIC, &tmp);

+ 4 - 4
src/os/android/AndroidTimer.h

@@ -43,22 +43,22 @@ public:
 	~Timer();
 
 	//! Returns the time (in milliseconds) elapsed since the instantiation of this class
-	ulong GetMilliseconds() const;
+	uint64_t GetMilliseconds() const;
 
 	//! Returns the time (in microseconds) elapsed since the instantiation of this class
-	ulong GetMicroseconds() const;
+	uint64_t GetMicroseconds() const;
 
 	//! Records the current time
 	void StartMilliseconds();
 
 	//! Returns the time (in milliseconds) elapsed since the last call to StartMilliseconds()
-	ulong StopMilliseconds() const;
+	uint64_t StopMilliseconds() const;
 
 	//! Records the current time
 	void StartMicroseconds();
 
 	//! Returns the time (in microseconds) elapsed since the last call to StartMicroseconds()
-	ulong StopMicroseconds() const;
+	uint64_t StopMicroseconds() const;
 
 private:
 

+ 5 - 5
src/os/linux/EGLRenderWindow.cpp

@@ -75,7 +75,7 @@ EGLRenderWindow::~EGLRenderWindow()
 	}
 }
 
-bool EGLRenderWindow::Create(uint x, uint y, uint width, uint height, uint depth, bool /*fullscreen*/)
+bool EGLRenderWindow::Create(uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t depth, bool /*fullscreen*/)
 {
 	Log::D("EGLRenderWindow::Create: Creating window...");
 	if (!width || !height)
@@ -119,7 +119,7 @@ bool EGLRenderWindow::Create(uint x, uint y, uint width, uint height, uint depth
 	XMapRaised(mXDisplay, mXWindow);
 	XStoreName (mXDisplay, mXWindow, "GL test" );
 
-	uint bpp			= depth / 4;
+	uint32_t bpp			= depth / 4;
 
 	const EGLint attribs[] =
 	{
@@ -202,7 +202,7 @@ void EGLRenderWindow::SetVisible(bool visible)
 	mVisible = visible;
 }
 
-void EGLRenderWindow::Move(uint x, uint y)
+void EGLRenderWindow::Move(uint32_t x, uint32_t y)
 {
 	if (x == mX && y == mY)
 	{
@@ -212,7 +212,7 @@ void EGLRenderWindow::Move(uint x, uint y)
 	XMoveWindow(mXDisplay, mXWindow, x, y);
 }
 
-void EGLRenderWindow::Resize(uint width, uint height)
+void EGLRenderWindow::Resize(uint32_t width, uint32_t height)
 {
 	if (!width || !height)
 	{
@@ -271,7 +271,7 @@ void EGLRenderWindow::EventLoop()
 	}
 }
 
-void EGLRenderWindow::_NotifyMetricsChange(uint x, uint y, uint width, uint height)
+void EGLRenderWindow::_NotifyMetricsChange(uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 {
 	if (x == mX && y == mY && width == mWidth && height == mHeight)
 	{

+ 4 - 4
src/os/linux/EGLRenderWindow.h

@@ -45,7 +45,7 @@ public:
 	~EGLRenderWindow();
 
 	//! See RenderWindow
-	virtual bool Create(uint x, uint y, uint width, uint height, uint depth, bool fullscreen);
+	virtual bool Create(uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t depth, bool fullscreen);
 
 	//! See RenderWindow
 	virtual void Destroy();
@@ -54,10 +54,10 @@ public:
 	virtual void SetVisible(bool visible);
 
 	//! See RenderWindow
-	virtual void Move(uint x, uint y);
+	virtual void Move(uint32_t x, uint32_t y);
 
 	//! See RenderWindow
-	virtual void Resize(uint width, uint height);
+	virtual void Resize(uint32_t width, uint32_t height);
 
 	//! See RenderWindow
 	virtual void SetFullscreen(bool full);
@@ -84,7 +84,7 @@ public:
 private:
 
 	//! See RenderWindow
-	void _NotifyMetricsChange(uint x, uint y, uint width, uint height);
+	void _NotifyMetricsChange(uint32_t x, uint32_t y, uint32_t width, uint32_t height);
 
 	//! Sets the window's title plus the additional title text in the window
 	virtual void _SetTitleAndAdditionalTextToWindow();

+ 4 - 4
src/os/linux/GLXRenderWindow.cpp

@@ -43,7 +43,7 @@ GLXContext		glx_context = NULL;
 GLXDrawable		glx_window = None;
 
 //-----------------------------------------------------------------------------
-bool create_render_window(uint x, uint y, uint width, uint height, bool fullscreen)
+bool create_render_window(uint32_t x, uint32_t y, uint32_t width, uint32_t height, bool fullscreen)
 {
 	assert(width != 0 && height != 0);
 
@@ -168,7 +168,7 @@ void swap_buffers()
 }
 
 //-----------------------------------------------------------------------------
-void get_render_window_metrics(uint& width, uint& height)
+void get_render_window_metrics(uint32_t& width, uint32_t& height)
 {
 	XWindowAttributes attribs;
 	XGetWindowAttributes(display, window, &attribs);
@@ -180,7 +180,7 @@ void get_render_window_metrics(uint& width, uint& height)
 }
 
 ////-----------------------------------------------------------------------------
-//void GLXRenderWindow::Move(uint x, uint y)
+//void GLXRenderWindow::Move(uint32_t x, uint32_t y)
 //{
 //	if (x == mX && y == mY)
 //	{
@@ -191,7 +191,7 @@ void get_render_window_metrics(uint& width, uint& height)
 //}
 
 ////-----------------------------------------------------------------------------
-//void GLXRenderWindow::Resize(uint width, uint height)
+//void GLXRenderWindow::Resize(uint32_t width, uint32_t height)
 //{
 //	if (!width || !height)
 //	{

+ 3 - 3
src/os/linux/Input.cpp

@@ -132,7 +132,7 @@ void get_cursor_xy(int& x, int& y)
 {
 	Window unused;
 	int pointer_x, pointer_y, dummy;
-	uint dummy2;
+	uint32_t dummy2;
 
 	XQueryPointer(display, window, &unused, &unused, &dummy, &dummy, &pointer_x, &pointer_y, &dummy2);
 
@@ -143,8 +143,8 @@ void get_cursor_xy(int& x, int& y)
 //-----------------------------------------------------------------------------
 void set_cursor_xy(int x, int y)
 {
-	uint width;
-	uint height;
+	uint32_t width;
+	uint32_t height;
 
 	get_render_window_metrics(width, height);
 

+ 2 - 2
src/os/linux/LinuxTCPSocket.cpp

@@ -24,7 +24,7 @@ TCPSocket::~TCPSocket()
 	close();
 }
 
-bool TCPSocket::open(ushort port)
+bool TCPSocket::open(uint16_t port)
 {
 	int sd = socket(AF_INET, SOCK_STREAM, 0);
 
@@ -54,7 +54,7 @@ bool TCPSocket::open(ushort port)
 	os::printf("listening on port %d\n", port);
 
 	sockaddr_in client;
-	uint client_length = sizeof(client);
+	uint32_t client_length = sizeof(client);
 
 	int asd = accept(sd, (sockaddr*)&client, &client_length);
 	if (asd < 0)

+ 4 - 4
src/os/linux/LinuxTimer.cpp

@@ -44,14 +44,14 @@ void Timer::Reset()
 	clock_gettime(CLOCK_MONOTONIC, &mCreationTime);
 }
 
-ulong Timer::GetMilliseconds() const
+uint64_t Timer::GetMilliseconds() const
 {
 	timespec tmp;
 	clock_gettime(CLOCK_MONOTONIC, &tmp);
 	return (tmp.tv_sec - mCreationTime.tv_sec) * 1000 + (tmp.tv_nsec - mCreationTime.tv_nsec) / 1000000;
 }
 
-ulong Timer::GetMicroseconds() const
+uint64_t Timer::GetMicroseconds() const
 {
 	timespec tmp;
 	clock_gettime(CLOCK_MONOTONIC, &tmp);
@@ -64,7 +64,7 @@ void Timer::StartMilliseconds()
 	clock_gettime(CLOCK_MONOTONIC, &mStartTime);
 }
 
-ulong Timer::StopMilliseconds() const
+uint64_t Timer::StopMilliseconds() const
 {
 	timespec tmp;
 	clock_gettime(CLOCK_MONOTONIC, &tmp);
@@ -76,7 +76,7 @@ void Timer::StartMicroseconds()
 	clock_gettime(CLOCK_MONOTONIC, &mStartTime);
 }
 
-ulong Timer::StopMicroseconds() const
+uint64_t Timer::StopMicroseconds() const
 {
 	timespec tmp;
 	clock_gettime(CLOCK_MONOTONIC, &tmp);

+ 4 - 4
src/os/linux/LinuxTimer.h

@@ -43,22 +43,22 @@ public:
 	~Timer();
 
 	//! Returns the time (in milliseconds) elapsed since the instantiation of this class
-	ulong GetMilliseconds() const;
+	uint64_t GetMilliseconds() const;
 
 	//! Returns the time (in microseconds) elapsed since the instantiation of this class
-	ulong GetMicroseconds() const;
+	uint64_t GetMicroseconds() const;
 
 	//! Records the current time
 	void StartMilliseconds();
 
 	//! Returns the time (in milliseconds) elapsed since the last call to StartMilliseconds()
-	ulong StopMilliseconds() const;
+	uint64_t StopMilliseconds() const;
 
 	//! Records the current time
 	void StartMicroseconds();
 
 	//! Returns the time (in microseconds) elapsed since the last call to StartMicroseconds()
-	ulong StopMicroseconds() const;
+	uint64_t StopMicroseconds() const;
 
 private:
 

+ 3 - 3
src/os/linux/LinuxUDPSocket.cpp

@@ -22,7 +22,7 @@ UDPSocket::~UDPSocket()
 	close();
 }
 
-bool UDPSocket::open(ushort port)
+bool UDPSocket::open(uint16_t port)
 {
   		assert(!is_open());
 
@@ -101,8 +101,8 @@ int UDPSocket::receive(IPv4Address &sender, void* data, int size)
 			return 0;
 	}
 
-	uint address = ntohl(from.sin_addr.s_addr);
-	ushort port = ntohs(from.sin_port);
+	uint32_t address = ntohl(from.sin_addr.s_addr);
+	uint16_t port = ntohs(from.sin_port);
 
 	sender.set(address, port);
 

+ 4 - 4
src/os/win/WGLRenderWindow.cpp

@@ -55,8 +55,8 @@ WGLRenderWindow::~WGLRenderWindow()
 	}
 }
 
-bool WGLRenderWindow::Create(uint x, uint y, uint width, uint height,
-							 uint depth, bool fullscreen)
+bool WGLRenderWindow::Create(uint32_t x, uint32_t y, uint32_t width, uint32_t height,
+							 uint32_t depth, bool fullscreen)
 {
 	if (!width || !height)
 	{
@@ -200,12 +200,12 @@ void WGLRenderWindow::SetVisible(bool visible)
 	}
 }
 
-void WGLRenderWindow::Move(uint x, uint y)
+void WGLRenderWindow::Move(uint32_t x, uint32_t y)
 {
 	SetWindowPos(mWindowHandle, NULL, x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
 }
 
-void WGLRenderWindow::Resize(uint width, uint height)
+void WGLRenderWindow::Resize(uint32_t width, uint32_t height)
 {
 	SetWindowPos(mWindowHandle, NULL, 0, 0, width, height, SWP_NOMOVE | SWP_NOZORDER);
 }

+ 4 - 4
src/os/win/WGLRenderWindow.h

@@ -44,8 +44,8 @@ public:
 	~WGLRenderWindow();
 
 	//! Creates the window
-	virtual bool Create(uint x, uint y, uint width, uint height,
-						uint depth, bool fullscreen);
+	virtual bool Create(uint32_t x, uint32_t y, uint32_t width, uint32_t height,
+						uint32_t depth, bool fullscreen);
 
 	//! Destroys the window
 	virtual void Destroy();
@@ -54,10 +54,10 @@ public:
 	virtual void SetVisible(bool visible);
 
 	//! Sets the window's position
-	virtual void Move(uint x, uint y);
+	virtual void Move(uint32_t x, uint32_t y);
 
 	//! Sets the window's width and height
-	virtual void Resize(uint width, uint height);
+	virtual void Resize(uint32_t width, uint32_t height);
 
 	//! Sets whether the window is in fullscreen mode
 	virtual void SetFullscreen(bool full);

+ 1 - 1
src/os/win/WinKeyboard.h

@@ -68,7 +68,7 @@ private:
 
 	Key TranslateKey(int winKey);
 
-	uint mModifierMask;
+	uint32_t mModifierMask;
 	bool mKeyState[MAX_KEYCODES];
 	bool mDetectableAutoRepeat;
 

+ 3 - 3
src/os/win/WinMouse.cpp

@@ -89,7 +89,7 @@ Point2 WinMouse::GetCursorXY() const
 //-----------------------------------------------------------------------------
 void WinMouse::SetCursorXY(const Point2& position)
 {
-	uint width, height;
+	uint32_t width, height;
 	RECT windowRect;
 	GetWindowRect(mWindowHandle, &windowRect);
 
@@ -123,7 +123,7 @@ void WinMouse::SetCursorXY(const Point2& position)
 //-----------------------------------------------------------------------------
 Vec2 WinMouse::GetCursorRelativeXY() const
 {
-	uint width, height;
+	uint32_t width, height;
 	RECT windowRect;
 	GetWindowRect(mWindowHandle, &windowRect);
 
@@ -141,7 +141,7 @@ Vec2 WinMouse::GetCursorRelativeXY() const
 //-----------------------------------------------------------------------------
 void WinMouse::SetCursorRelativeXY(const Vec2& position)
 {
-	uint width, height;
+	uint32_t width, height;
 	RECT windowRect;
 	GetWindowRect(mWindowHandle, &windowRect);
 

+ 1 - 1
src/os/win/WinTCPSocket.cpp

@@ -51,7 +51,7 @@ bool TCPSocket::open(unsigned short port)
 	os::printf("listening on port %d", port);
 
 	sockaddr_in client;
-	uint client_length = sizeof(client);
+	uint32_t client_length = sizeof(client);
 
 	int active_sd = accept(sd, (sockaddr*)&client, &client_length);
 	if (active_sd < 0)

+ 12 - 12
src/os/win/WinTimer.cpp

@@ -62,9 +62,9 @@ void Timer::Reset()
 	}
 }
 
-ulong Timer::GetMilliseconds() const
+uint64_t Timer::GetMilliseconds() const
 {
-	ulong currentTime;
+	uint64_t currentTime;
 
 	if (mPreciseTimer)
 	{
@@ -75,12 +75,12 @@ ulong Timer::GetMilliseconds() const
 		currentTime = timeGetTime();
 	}
 
-	return (ulong) ((currentTime - mCreationTime) / (mFrequency / 1000));
+	return (uint64_t) ((currentTime - mCreationTime) / (mFrequency / 1000));
 }
 
-ulong Timer::GetMicroseconds() const
+uint64_t Timer::GetMicroseconds() const
 {
-	ulong currentTime;
+	uint64_t currentTime;
 
 	if (mPreciseTimer)
 	{
@@ -93,7 +93,7 @@ ulong Timer::GetMicroseconds() const
 
 	//I'm using doubles here because if the timer isn't precise, it's always going to say
 	//0us because of the integer calculus.
-	return (ulong)((currentTime - mCreationTime) / (mFrequency/1000000.0));
+	return (uint64_t)((currentTime - mCreationTime) / (mFrequency/1000000.0));
 }
 
 
@@ -109,9 +109,9 @@ void Timer::StartMilliseconds()
 	}
 }
 
-ulong Timer::StopMilliseconds() const
+uint64_t Timer::StopMilliseconds() const
 {
-	ulong currentTime;
+	uint64_t currentTime;
 
 	if (mPreciseTimer)
 	{
@@ -122,7 +122,7 @@ ulong Timer::StopMilliseconds() const
 		currentTime = timeGetTime();
 	}
 
-	return (ulong) ((currentTime - mStartTime) / (mFrequency / 1000));
+	return (uint64_t) ((currentTime - mStartTime) / (mFrequency / 1000));
 }
 
 void Timer::StartMicroseconds()
@@ -137,9 +137,9 @@ void Timer::StartMicroseconds()
 	}
 }
 
-ulong Timer::StopMicroseconds() const
+uint64_t Timer::StopMicroseconds() const
 {
-	ulong currentTime;
+	uint64_t currentTime;
 
 	if (mPreciseTimer)
 	{
@@ -152,7 +152,7 @@ ulong Timer::StopMicroseconds() const
 
 	//I'm using doubles here because if the timer isn't precise, it's always going to say
 	//0us because of the integer calculus.
-	return (ulong)((currentTime - mStartTime) / (mFrequency/1000000.0));
+	return (uint64_t)((currentTime - mStartTime) / (mFrequency/1000000.0));
 }
 
 } // namespace crown

+ 7 - 7
src/os/win/WinTimer.h

@@ -42,22 +42,22 @@ public:
 	~Timer();
 
 	//! Returns the time (in milliseconds) elapsed since the instantiation of this class
-	ulong GetMilliseconds() const;
+	uint64_t GetMilliseconds() const;
 
 	//! Returns the time (in microseconds) elapsed since the instantiation of this class
-	ulong GetMicroseconds() const;
+	uint64_t GetMicroseconds() const;
 
 	//! Records the current time
 	void StartMilliseconds();
 
 	//! Returns the time (in milliseconds) elapsed since the last call to StartMilliseconds()
-	ulong StopMilliseconds() const;
+	uint64_t StopMilliseconds() const;
 
 	//! Records the current time
 	void StartMicroseconds();
 
 	//! Returns the time (in microseconds) elapsed since the last call to StartMicroseconds()
-	ulong StopMicroseconds() const;
+	uint64_t StopMicroseconds() const;
 
 private:
 
@@ -65,10 +65,10 @@ private:
 	void Reset();
 
 	// Time at instantiation
-	ulong mCreationTime;
+	uint64_t mCreationTime;
 	// Time at Start* call
-	ulong mStartTime;
-	ulong mFrequency;
+	uint64_t mStartTime;
+	uint64_t mFrequency;
 	bool mPreciseTimer;
 };
 

+ 3 - 3
src/os/win/WinUDPSocket.cpp

@@ -20,7 +20,7 @@ UDPSocket::~UDPSocket()
 	close();
 }
 
-bool UDPSocket::open(ushort port)
+bool UDPSocket::open(uint16_t port)
 {
 	assert(!is_open());
 
@@ -102,8 +102,8 @@ int UDPSocket::receive(IPv4Address &sender, void* data, int size)
 			return 0;
 	}
 
-	uint address = ntohl(from.sin_addr.s_addr);
-	ushort port = ntohs(from.sin_port);
+	uint32_t address = ntohl(from.sin_addr.s_addr);
+	uint16_t port = ntohs(from.sin_port);
 
 	sender.set(address, port);
 

+ 4 - 4
src/renderers/gl/GLIndexBuffer.cpp

@@ -40,17 +40,17 @@ GLIndexBuffer::~GLIndexBuffer()
 	glDeleteBuffers(1, &mBufferID);
 }
 
-void GLIndexBuffer::SetIndexData(const ushort* indexData, uint indexCount)
+void GLIndexBuffer::SetIndexData(const uint16_t* indexData, uint32_t indexCount)
 {
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mBufferID);
-	glBufferData(GL_ELEMENT_ARRAY_BUFFER, indexCount * sizeof(ushort), indexData, GL_DYNAMIC_DRAW);
+	glBufferData(GL_ELEMENT_ARRAY_BUFFER, indexCount * sizeof(uint16_t), indexData, GL_DYNAMIC_DRAW);
 	mCount = indexCount;
 }
 
-void GLIndexBuffer::SetIndexSubData(const ushort* indexData, uint indexOffset, uint indexCount)
+void GLIndexBuffer::SetIndexSubData(const uint16_t* indexData, uint32_t indexOffset, uint32_t indexCount)
 {
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mBufferID);
-	glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, indexOffset * sizeof(ushort), indexCount * sizeof(ushort), indexData);
+	glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, indexOffset * sizeof(uint16_t), indexCount * sizeof(uint16_t), indexData);
 }
 
 void GLIndexBuffer::Bind() const

+ 5 - 5
src/renderers/gl/GLIndexBuffer.h

@@ -40,18 +40,18 @@ public:
 				GLIndexBuffer();
 				~GLIndexBuffer();
 
-	void		SetIndexData(const ushort* indexData, uint indexCount);
-	void		SetIndexSubData(const ushort* indexData, uint indexOffset, uint indexCount);
+	void		SetIndexData(const uint16_t* indexData, uint32_t indexCount);
+	void		SetIndexSubData(const uint16_t* indexData, uint32_t indexOffset, uint32_t indexCount);
 
-	uint		GetIndexCount() const { return mCount; }
+	uint32_t	GetIndexCount() const { return mCount; }
 
 	void		Bind() const;
 	void		Unbind() const;
 
 private:
 	
-	GLuint		mBufferID;
-	uint		mCount;
+	GLuint			mBufferID;
+	uint32_t		mCount;
 };
 
 }

+ 3 - 3
src/renderers/gl/GLOcclusionQuery.cpp

@@ -50,9 +50,9 @@ void GLOcclusionQuery::EndQuery()
 	glEndQuery(GL_SAMPLES_PASSED);
 }
 
-uint GLOcclusionQuery::GetQueryResult()
+uint32_t GLOcclusionQuery::GetQueryResult()
 {
-	uint passedCount;
+	uint32_t passedCount;
 
 	glGetQueryObjectuiv(mQueryObject, GL_QUERY_RESULT, &passedCount);
 
@@ -61,7 +61,7 @@ uint GLOcclusionQuery::GetQueryResult()
 
 bool GLOcclusionQuery::IsResultAvailable()
 {
-	uint available;
+	uint32_t available;
 
 	glGetQueryObjectuiv(mQueryObject, GL_QUERY_RESULT_AVAILABLE, &available);
 

+ 2 - 2
src/renderers/gl/GLOcclusionQuery.h

@@ -48,14 +48,14 @@ public:
 	virtual void EndQuery();
 
 	//! See OcclusionQuery
-	virtual uint GetQueryResult();
+	virtual uint32_t GetQueryResult();
 
 	//! See OcclusionQuery
 	virtual bool IsResultAvailable();
 
 private:
 
-	GLuint mQueryObject;
+	GLuint	mQueryObject;
 };
 
 } // namespace crown

+ 23 - 23
src/renderers/gl/GLRenderer.cpp

@@ -77,14 +77,14 @@ GLRenderer::GLRenderer() :
 	mMinMaxLineWidth[0] = 0.0f;
 	mMinMaxLineWidth[1] = 0.0f;
 
-	for (uint i = 0; i < MAX_TEXTURE_UNITS; i++)
+	for (uint32_t i = 0; i < MAX_TEXTURE_UNITS; i++)
 	{
 		mTextureUnit[i] = 0;
 		mTextureUnitTarget[i] = GL_TEXTURE_2D;
 	}
 
 	// This code snippet initializes the matrices
-	for (uint i = 0; i < MT_COUNT; i++)
+	for (uint32_t i = 0; i < MT_COUNT; i++)
 	{
 		mMatrix[i].load_identity();
 	}
@@ -110,9 +110,9 @@ GLRenderer::GLRenderer() :
 	glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, &mMinMaxPointSize[0]);
 	glGetFloatv(GL_LINE_WIDTH_RANGE, &mMinMaxLineWidth[0]);
 
-	const uchar* gl_vendor = glGetString(GL_VENDOR);
-	const uchar* gl_renderer = glGetString(GL_RENDERER);
-	const uchar* gl_version = glGetString(GL_VERSION);
+	const uint8_t* gl_vendor = glGetString(GL_VENDOR);
+	const uint8_t* gl_renderer = glGetString(GL_RENDERER);
+	const uint8_t* gl_version = glGetString(GL_VERSION);
 
 	Log::I("OpenGL Vendor\t: %s", gl_vendor);
 	Log::I("OpenGL Renderer\t: %s", gl_renderer);
@@ -179,17 +179,17 @@ GLRenderer::GLRenderer() :
 //-----------------------------------------------------------------------------
 GLRenderer::~GLRenderer()
 {
-	for (uint i = 0; i < mOcclusionQueryList.size(); i++)
+	for (uint32_t i = 0; i < mOcclusionQueryList.size(); i++)
 	{
 		delete mOcclusionQueryList[i];
 	}
 
-	for (uint i = 0; i < mVertexBufferList.size(); i++)
+	for (uint32_t i = 0; i < mVertexBufferList.size(); i++)
 	{
 		delete mVertexBufferList[i];
 	}
 
-	for (uint i = 0; i < mIndexBufferList.size(); i++)
+	for (uint32_t i = 0; i < mIndexBufferList.size(); i++)
 	{
 		delete mIndexBufferList[i];
 	}
@@ -239,7 +239,7 @@ void GLRenderer::_SetLighting(bool lighting)
 }
 
 //-----------------------------------------------------------------------------
-void GLRenderer::_SetTexturing(uint unit, bool texturing)
+void GLRenderer::_SetTexturing(uint32_t unit, bool texturing)
 {
 	if (!ActivateTextureUnit(unit))
 		return;
@@ -255,7 +255,7 @@ void GLRenderer::_SetTexturing(uint unit, bool texturing)
 }
 
 //-----------------------------------------------------------------------------
-void GLRenderer::_SetTexture(uint unit, Texture* texture)
+void GLRenderer::_SetTexture(uint32_t unit, Texture* texture)
 {
 	if (!ActivateTextureUnit(unit))
 		return;
@@ -271,7 +271,7 @@ void GLRenderer::_SetTexture(uint unit, Texture* texture)
 }
 
 //-----------------------------------------------------------------------------
-void GLRenderer::_SetTextureMode(uint unit, TextureMode mode, const Color4& blendColor)
+void GLRenderer::_SetTextureMode(uint32_t unit, TextureMode mode, const Color4& blendColor)
 {
 	if (!ActivateTextureUnit(unit))
 		return;
@@ -287,7 +287,7 @@ void GLRenderer::_SetTextureMode(uint unit, TextureMode mode, const Color4& blen
 }
 
 //-----------------------------------------------------------------------------
-void GLRenderer::_SetTextureWrap(uint unit, TextureWrap wrap)
+void GLRenderer::_SetTextureWrap(uint32_t unit, TextureWrap wrap)
 {
 	GLenum glWrap = GL::GetTextureWrap(wrap);
 
@@ -297,7 +297,7 @@ void GLRenderer::_SetTextureWrap(uint unit, TextureWrap wrap)
 }
 
 //-----------------------------------------------------------------------------
-void GLRenderer::_SetTextureFilter(uint unit, TextureFilter filter)
+void GLRenderer::_SetTextureFilter(uint32_t unit, TextureFilter filter)
 {
 	if (!ActivateTextureUnit(unit))
 		return;
@@ -724,7 +724,7 @@ IndexBuffer*  GLRenderer::CreateIndexBuffer()
 }
 
 //-----------------------------------------------------------------------------
-void GLRenderer::SetTexture(uint layer, Texture* texture)
+void GLRenderer::SetTexture(uint32_t layer, Texture* texture)
 {
 	if (texture == NULL)
 	{
@@ -739,7 +739,7 @@ void GLRenderer::SetTexture(uint layer, Texture* texture)
 }
 
 //-----------------------------------------------------------------------------
-void GLRenderer::SetScissorBox(uint x, uint y, uint width, uint height)
+void GLRenderer::SetScissorBox(uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 {
 	int vals[4];
 	glGetIntegerv(GL_VIEWPORT, vals);
@@ -747,7 +747,7 @@ void GLRenderer::SetScissorBox(uint x, uint y, uint width, uint height)
 }
 
 //-----------------------------------------------------------------------------
-void GLRenderer::GetScissorBox(uint& x, uint& y, uint& width, uint& height)
+void GLRenderer::GetScissorBox(uint32_t& x, uint32_t& y, uint32_t& width, uint32_t& height)
 {
 	int vals[4];
 	glGetIntegerv(GL_SCISSOR_BOX, vals);
@@ -793,9 +793,9 @@ void GLRenderer::DrawRectangle(const Point2& position, const Point2& dimensions,
 }
 
 //-----------------------------------------------------------------------------
-bool GLRenderer::ActivateTextureUnit(uint unit)
+bool GLRenderer::ActivateTextureUnit(uint32_t unit)
 {
-	if (unit >= (uint) mMaxTextureUnits)
+	if (unit >= (uint32_t) mMaxTextureUnits)
 	{
 		return false;
 	}
@@ -807,9 +807,9 @@ bool GLRenderer::ActivateTextureUnit(uint unit)
 }
 
 //-----------------------------------------------------------------------------
-void GLRenderer::_SetLight(uint light, bool active)
+void GLRenderer::_SetLight(uint32_t light, bool active)
 {
-	if (light >= (uint) mMaxLights)
+	if (light >= (uint32_t) mMaxLights)
 	{
 		return;
 	}
@@ -825,7 +825,7 @@ void GLRenderer::_SetLight(uint light, bool active)
 }
 
 //-----------------------------------------------------------------------------
-void GLRenderer::_SetLightParams(uint light, LightType type, const Vec3& position)
+void GLRenderer::_SetLightParams(uint32_t light, LightType type, const Vec3& position)
 {
 	static float pos[4] =
 	{
@@ -844,7 +844,7 @@ void GLRenderer::_SetLightParams(uint light, LightType type, const Vec3& positio
 }
 
 //-----------------------------------------------------------------------------
-void GLRenderer::_SetLightColor(uint light, const Color4& ambient, const Color4& diffuse, const Color4& specular)
+void GLRenderer::_SetLightColor(uint32_t light, const Color4& ambient, const Color4& diffuse, const Color4& specular)
 {
 	glLightfv(GL_LIGHT0 + light, GL_AMBIENT, ambient.to_float_ptr());
 	glLightfv(GL_LIGHT0 + light, GL_DIFFUSE, diffuse.to_float_ptr());
@@ -852,7 +852,7 @@ void GLRenderer::_SetLightColor(uint light, const Color4& ambient, const Color4&
 }
 
 //-----------------------------------------------------------------------------
-void GLRenderer::_SetLightAttenuation(uint light, float constant, float linear, float quadratic)
+void GLRenderer::_SetLightAttenuation(uint32_t light, float constant, float linear, float quadratic)
 {
 	glLightf(GL_LIGHT0 + light, GL_CONSTANT_ATTENUATION, constant);
 	glLightf(GL_LIGHT0 + light, GL_LINEAR_ATTENUATION, linear);

+ 16 - 16
src/renderers/gl/GLRenderer.h

@@ -58,16 +58,16 @@ public:
 	void				_SetLighting(bool lighting);
 	void				_SetAmbientLight(const Color4& color);
 
-	void				_SetTexturing(uint unit, bool texturing);
-	void				_SetTexture(uint unit, Texture* texture);
-	void				_SetTextureMode(uint unit, TextureMode mode, const Color4& blendColor);
-	void				_SetTextureWrap(uint unit, TextureWrap wrap);
-	void				_SetTextureFilter(uint unit, TextureFilter filter);
+	void				_SetTexturing(uint32_t unit, bool texturing);
+	void				_SetTexture(uint32_t unit, Texture* texture);
+	void				_SetTextureMode(uint32_t unit, TextureMode mode, const Color4& blendColor);
+	void				_SetTextureWrap(uint32_t unit, TextureWrap wrap);
+	void				_SetTextureFilter(uint32_t unit, TextureFilter filter);
 
-	void				_SetLight(uint light, bool active);
-	void				_SetLightParams(uint light, LightType type, const Vec3& position);
-	void				_SetLightColor(uint light, const Color4& ambient, const Color4& diffuse, const Color4& specular);
-	void				_SetLightAttenuation(uint light, float constant, float linear, float quadratic);
+	void				_SetLight(uint32_t light, bool active);
+	void				_SetLightParams(uint32_t light, LightType type, const Vec3& position);
+	void				_SetLightColor(uint32_t light, const Color4& ambient, const Color4& diffuse, const Color4& specular);
+	void				_SetLightAttenuation(uint32_t light, float constant, float linear, float quadratic);
 
 	void				_SetBackfaceCulling(bool culling);
 
@@ -107,7 +107,7 @@ public:
 
 	OcclusionQuery*		CreateOcclusionQuery();
 
-	void				SetTexture(uint layer, Texture* texture);
+	void				SetTexture(uint32_t layer, Texture* texture);
 
 	Mat4				GetMatrix(MatrixType type) const;
 	void				SetMatrix(MatrixType type, const Mat4& matrix);
@@ -120,8 +120,8 @@ public:
 	void				RenderVertexIndexBuffer(const VertexBuffer* vertices, const IndexBuffer* indices);
 	void				RenderPointBuffer(const VertexBuffer* buffer);
 
-	void				SetScissorBox(uint x, uint y, uint width, uint height);
-	void				GetScissorBox(uint& x, uint& y, uint& width, uint& height);
+	void				SetScissorBox(uint32_t x, uint32_t y, uint32_t width, uint32_t height);
+	void				GetScissorBox(uint32_t& x, uint32_t& y, uint32_t& width, uint32_t& height);
 	void				DrawRectangle(const Point2& position, const Point2& dimensions, int drawMode,
 														 const Color4& borderColor, const Color4& fillColor);
 
@@ -130,8 +130,8 @@ public:
 
 private:
 
-	bool				ActivateTextureUnit(uint unit);		//!< Activates a texture unit and returns true if succes
-	bool				ActivateLight(uint light);
+	bool				ActivateTextureUnit(uint32_t unit);		//!< Activates a texture unit and returns true if succes
+	bool				ActivateLight(uint32_t light);
 
 	void				CheckGLErrors();
 
@@ -140,7 +140,7 @@ private:
 	Mat4				mMatrix[MT_COUNT];
 
 	Mat4				mModelMatrixStack[MAX_MODEL_MATRIX_STACK_DEPTH];
-	uint				mModelMatrixStackIndex;
+	uint32_t				mModelMatrixStackIndex;
 
 	int					mMaxLights;
 	int					mMaxTextureSize;
@@ -169,7 +169,7 @@ private:
 		Color4	c2;
 	};
 
-	uint				mLinesCount;
+	uint32_t				mLinesCount;
 	DebugLinesData		mLinesData[1024];
 };
 

+ 1 - 1
src/renderers/gl/GLTexture.cpp

@@ -175,7 +175,7 @@ Image* GLTexture::GetImage() const
 	PixelFormat format = GetTextureFormat();
 	int bytesPerPixel = Pixel::GetBytesPerPixel(format);
 
-	uchar* texData = new uchar[GetWidth() * GetHeight() * bytesPerPixel];
+	uint8_t* texData = new uint8_t[GetWidth() * GetHeight() * bytesPerPixel];
 
 	glGetTexImage(target, 0, glFormat, GL_UNSIGNED_BYTE, texData);
 	

+ 8 - 8
src/renderers/gl/GLVertexBuffer.cpp

@@ -42,11 +42,11 @@ GLVertexBuffer::~GLVertexBuffer()
 	glDeleteBuffers(1, &mBufferID);
 }
 
-void GLVertexBuffer::SetVertexData(VertexBufferMode mode, const void* vertexData, uint vertexCount)
+void GLVertexBuffer::SetVertexData(VertexBufferMode mode, const void* vertexData, uint32_t vertexCount)
 {
 	mMode = mode;
 
-	uint vertexSize = sizeof(float) * 3;
+	uint32_t vertexSize = sizeof(float) * 3;
 	if (HasNormalCoords())
 		vertexSize += sizeof(float) * 3;
 	if (HasTextureCoords())
@@ -61,9 +61,9 @@ void GLVertexBuffer::SetVertexData(VertexBufferMode mode, const void* vertexData
 	glBufferData(GL_ARRAY_BUFFER, mSize, vertexData, GL_DYNAMIC_DRAW);
 }
 
-void GLVertexBuffer::SetVertexSubData(const void* vertexData, uint vertexOffset, uint vertexCount)
+void GLVertexBuffer::SetVertexSubData(const void* vertexData, uint32_t vertexOffset, uint32_t vertexCount)
 {
-	uint vertexSize = sizeof(float) * 3;
+	uint32_t vertexSize = sizeof(float) * 3;
 	if (HasNormalCoords())
 		vertexSize += sizeof(float) * 3;
 	if (HasTextureCoords())
@@ -78,20 +78,20 @@ void GLVertexBuffer::SetVertexSubData(const void* vertexData, uint vertexOffset,
 	glBufferSubData(GL_ARRAY_BUFFER, vertexOffset * vertexSize, vertexCount * vertexSize, vertexData);
 }
 
-uint GLVertexBuffer::GetSize() const
+uint32_t GLVertexBuffer::GetSize() const
 {
 	return mSize;
 }
 
-uint GLVertexBuffer::GetVertexCount() const
+uint32_t GLVertexBuffer::GetVertexCount() const
 {
 	return mVertexCount;
 }
 
 void GLVertexBuffer::Bind() const
 {
-	uint vertexSize = sizeof(float) * 3;
-	uint offset = vertexSize;
+	uint32_t vertexSize = sizeof(float) * 3;
+	uint32_t offset = vertexSize;
 	if (HasNormalCoords())
 		vertexSize += sizeof(float) * 3;
 	if (HasTextureCoords())

+ 7 - 7
src/renderers/gl/GLVertexBuffer.h

@@ -39,20 +39,20 @@ public:
 				GLVertexBuffer();
 				~GLVertexBuffer();
 
-	void		SetVertexData(VertexBufferMode mode, const void* vertexData, uint vertexCount);
-	void		SetVertexSubData(const void* vertexData, uint vertexOffset, uint vertexCount);
+	void		SetVertexData(VertexBufferMode mode, const void* vertexData, uint32_t vertexCount);
+	void		SetVertexSubData(const void* vertexData, uint32_t vertexOffset, uint32_t vertexCount);
 
-	uint		GetSize() const;
-	uint		GetVertexCount() const;
+	uint32_t		GetSize() const;
+	uint32_t		GetVertexCount() const;
 
 	void		Bind() const;
 	void		Unbind() const;
 
 private:
 	
-	GLuint		mBufferID;
-	uint		mSize;
-	uint		mVertexCount;
+	GLuint			mBufferID;
+	uint32_t		mSize;
+	uint32_t		mVertexCount;
 };
 
 }

+ 4 - 4
src/renderers/gles/GLESIndexBuffer.cpp

@@ -40,17 +40,17 @@ GLESIndexBuffer::~GLESIndexBuffer()
 	glDeleteBuffers(1, &mBufferID);
 }
 
-void GLESIndexBuffer::SetIndexData(const ushort* indexData, uint indexCount)
+void GLESIndexBuffer::SetIndexData(const uint16_t* indexData, uint32_t indexCount)
 {
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mBufferID);
-	glBufferData(GL_ELEMENT_ARRAY_BUFFER, indexCount * sizeof(ushort), indexData, GL_DYNAMIC_DRAW);
+	glBufferData(GL_ELEMENT_ARRAY_BUFFER, indexCount * sizeof(uint16_t), indexData, GL_DYNAMIC_DRAW);
 	mCount = indexCount;
 }
 
-void GLESIndexBuffer::SetIndexSubData(const ushort* indexData, uint indexOffset, uint indexCount)
+void GLESIndexBuffer::SetIndexSubData(const uint16_t* indexData, uint32_t indexOffset, uint32_t indexCount)
 {
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mBufferID);
-	glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, indexOffset * sizeof(ushort), indexCount * sizeof(ushort), indexData);
+	glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, indexOffset * sizeof(uint16_t), indexCount * sizeof(uint16_t), indexData);
 }
 
 void GLESIndexBuffer::Bind() const

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff