diff --git a/Examples/Core/StorageValues.cs b/Examples/Core/StorageValues.cs
index 554b01a..5aee738 100644
--- a/Examples/Core/StorageValues.cs
+++ b/Examples/Core/StorageValues.cs
@@ -93,13 +93,13 @@ public class StorageValues
// Save integer value to storage file (to defined position)
// NOTE: Storage positions is directly related to file memory layout (4 bytes each integer)
- private static unsafe bool SaveStorageValue(string fileName, uint position, int value)
+ private static unsafe bool SaveStorageValue(string fileName, int position, int value)
{
using var fileNameBuffer = fileName.ToUtf8Buffer();
bool success = false;
- uint dataSize = 0;
- uint newDataSize = 0;
+ int dataSize = 0;
+ int newDataSize = 0;
byte* fileData = LoadFileData(fileNameBuffer.AsPointer(), &dataSize);
byte* newFileData = null;
@@ -110,7 +110,7 @@ public class StorageValues
{
// Increase data size up to position and store value
newDataSize = (position + 1) * sizeof(int);
- newFileData = (byte*)MemRealloc(fileData, (int)newDataSize);
+ newFileData = (byte*)MemRealloc(fileData, (uint)newDataSize);
if (newFileData != null)
{
@@ -121,7 +121,7 @@ public class StorageValues
else
{
// RL_REALLOC failed
- uint positionInBytes = position * sizeof(int);
+ int positionInBytes = position * sizeof(int);
TraceLog(
TraceLogLevel.Warning,
@$"FILEIO: [{fileName}] Failed to realloc data ({dataSize}),
@@ -154,7 +154,7 @@ public class StorageValues
TraceLog(TraceLogLevel.Info, $"FILEIO: [{fileName}] File created successfully");
dataSize = (position + 1) * sizeof(int);
- fileData = (byte*)MemAlloc((int)dataSize);
+ fileData = (byte*)MemAlloc((uint)dataSize);
int* dataPtr = (int*)fileData;
dataPtr[position] = value;
@@ -174,7 +174,7 @@ public class StorageValues
using var fileNameBuffer = fileName.ToUtf8Buffer();
int value = 0;
- uint dataSize = 0;
+ int dataSize = 0;
byte* fileData = LoadFileData(fileNameBuffer.AsPointer(), &dataSize);
if (fileData != null)
diff --git a/Examples/Models/AnimationDemo.cs b/Examples/Models/AnimationDemo.cs
index 8ef9674..708f753 100644
--- a/Examples/Models/AnimationDemo.cs
+++ b/Examples/Models/AnimationDemo.cs
@@ -47,7 +47,7 @@ public class AnimationDemo
Vector3 position = new(0.0f, 0.0f, 0.0f);
// Load animation data
- uint animsCount = 0;
+ int animsCount = 0;
var anims = LoadModelAnimations("resources/models/iqm/guyanim.iqm", ref animsCount);
int animFrameCounter = 0;
diff --git a/Examples/Text/FontSdf.cs b/Examples/Text/FontSdf.cs
index 4959349..fb1ca29 100644
--- a/Examples/Text/FontSdf.cs
+++ b/Examples/Text/FontSdf.cs
@@ -31,7 +31,7 @@ public class FontSdf
string msg = "Signed Distance Fields";
// Loading file to memory
- uint fileSize = 0;
+ int fileSize = 0;
byte* fileData = LoadFileData("resources/fonts/anonymous_pro_bold.ttf", ref fileSize);
// Default font generation from TTF font
diff --git a/Examples/Textures/RawData.cs b/Examples/Textures/RawData.cs
index e1b162e..40470c3 100644
--- a/Examples/Textures/RawData.cs
+++ b/Examples/Textures/RawData.cs
@@ -44,7 +44,7 @@ public class RawData
int height = 480;
// Store pixel data
- Color* pixels = (Color*)Raylib.MemAlloc(width * height * sizeof(Color));
+ Color* pixels = (Color*)Raylib.MemAlloc((uint)(width * height * sizeof(Color)));
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
diff --git a/Raylib-cs/interop/Raylib.cs b/Raylib-cs/interop/Raylib.cs
index 662ee7d..517edcf 100644
--- a/Raylib-cs/interop/Raylib.cs
+++ b/Raylib-cs/interop/Raylib.cs
@@ -464,11 +464,11 @@ public static unsafe partial class Raylib
/// Load random values sequence, no values repeated
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern int* LoadRandomSequence(int count, int min, int max);
+ public static extern int* LoadRandomSequence(uint count, int min, int max);
/// Unload random values sequence
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern void UnloadRandomSequence(int *sequence);
+ public static extern void UnloadRandomSequence(int* sequence);
/// Takes a screenshot of current screen (saved a .png)
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -488,11 +488,11 @@ public static unsafe partial class Raylib
/// Internal memory allocator
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern void* MemAlloc(int size);
+ public static extern void* MemAlloc(uint size);
/// Internal memory reallocator
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern void* MemRealloc(void* ptr, int size);
+ public static extern void* MemRealloc(void* ptr, uint size);
/// Internal memory free
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -508,12 +508,12 @@ public static unsafe partial class Raylib
/// Set custom file binary data loader
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern void SetLoadFileDataCallback(delegate* unmanaged[Cdecl] callback);
+ public static extern void SetLoadFileDataCallback(delegate* unmanaged[Cdecl] callback);
/// Set custom file binary data saver
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetSaveFileDataCallback(
- delegate* unmanaged[Cdecl] callback
+ delegate* unmanaged[Cdecl] callback
);
/// Set custom file text data loader
@@ -529,7 +529,7 @@ public static unsafe partial class Raylib
/// Load file data as byte array (read)
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern byte* LoadFileData(sbyte* fileName, uint* bytesRead);
+ public static extern byte* LoadFileData(sbyte* fileName, int* dataSize);
/// Unload file data allocated by LoadFileData()
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -537,11 +537,11 @@ public static unsafe partial class Raylib
/// Save data to file from byte array (write), returns true on success
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern CBool SaveFileData(sbyte* fileName, void* data, uint bytesToWrite);
+ public static extern CBool SaveFileData(sbyte* fileName, void* data, int dataSize);
/// Export data to code (.h), returns true on success
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern CBool ExportDataAsCode(byte* data, uint size, sbyte* fileName);
+ public static extern CBool ExportDataAsCode(byte* data, int dataSize, sbyte* fileName);
// Load text data from file (read), returns a '\0' terminated string
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -1195,23 +1195,23 @@ public static unsafe partial class Raylib
/// Draw spline: Linear, minimum 2 points
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color);
+ public static extern void DrawSplineLinear(Vector2* points, int pointCount, float thick, Color color);
/// Draw spline: B-Spline, minimum 4 points
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern void DrawSplineBasis(Vector2 *points, int pointCount, float thick, Color color);
+ public static extern void DrawSplineBasis(Vector2* points, int pointCount, float thick, Color color);
/// Draw spline: Catmull-Rom, minimum 4 points
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern void DrawSplineCatmullRom(Vector2 *points, int pointCount, float thick, Color color);
+ public static extern void DrawSplineCatmullRom(Vector2* points, int pointCount, float thick, Color color);
/// Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern void DrawSplineBezierQuadratic(Vector2 *points, int pointCount, float thick, Color color);
+ public static extern void DrawSplineBezierQuadratic(Vector2* points, int pointCount, float thick, Color color);
/// Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern void DrawSplineBezierCubic(Vector2 *points, int pointCount, float thick, Color color);
+ public static extern void DrawSplineBezierCubic(Vector2* points, int pointCount, float thick, Color color);
/// Draw spline segment: Linear, 2 points
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -1368,7 +1368,7 @@ public static unsafe partial class Raylib
/// Export image to memory buffer
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern char* ExportImageToMemory(Image image, sbyte* fileType, int *fileSize);
+ public static extern byte* ExportImageToMemory(Image image, sbyte* fileType, int* fileSize);
/// Export image as code file defining an array of bytes
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -1519,7 +1519,7 @@ public static unsafe partial class Raylib
/// Rotate image by input angle in degrees (-359 to 359)
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern void ImageRotate(Image *image, int degrees);
+ public static extern void ImageRotate(Image* image, int degrees);
/// Rotate image clockwise 90deg
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -2452,7 +2452,7 @@ public static unsafe partial class Raylib
/// Load model animations from file
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern ModelAnimation* LoadModelAnimations(sbyte* fileName, uint* animCount);
+ public static extern ModelAnimation* LoadModelAnimations(sbyte* fileName, int* animCount);
/// Update model animation pose
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -2464,7 +2464,7 @@ public static unsafe partial class Raylib
/// Unload animation array data
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern void UnloadModelAnimations(ModelAnimation* animations, uint animCount);
+ public static extern void UnloadModelAnimations(ModelAnimation* animations, int animCount);
/// Check model animation skeleton match
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
diff --git a/Raylib-cs/interop/Rlgl.cs b/Raylib-cs/interop/Rlgl.cs
index d3f0279..9f6cf7a 100644
--- a/Raylib-cs/interop/Rlgl.cs
+++ b/Raylib-cs/interop/Rlgl.cs
@@ -613,9 +613,9 @@ public static unsafe partial class Rlgl
[DllImport(NativeLibName, EntryPoint = "rlGetGlTextureFormats", CallingConvention = CallingConvention.Cdecl)]
public static extern void GetGlTextureFormats(
PixelFormat format,
- int* glInternalFormat,
- int* glFormat,
- int* glType
+ uint* glInternalFormat,
+ uint* glFormat,
+ uint* glType
);
/// Get OpenGL internal formats
diff --git a/Raylib-cs/types/Mesh.cs b/Raylib-cs/types/Mesh.cs
index ccec9d3..c128878 100644
--- a/Raylib-cs/types/Mesh.cs
+++ b/Raylib-cs/types/Mesh.cs
@@ -71,7 +71,7 @@ public unsafe partial struct Mesh
///
public void AllocVertices()
{
- Vertices = Raylib.New(3 * VertexCount);
+ Vertices = Raylib.New(3 * (uint)VertexCount);
}
///
@@ -79,7 +79,7 @@ public unsafe partial struct Mesh
///
public void AllocTexCoords()
{
- TexCoords = Raylib.New(2 * VertexCount);
+ TexCoords = Raylib.New(2 * (uint)VertexCount);
}
///
@@ -87,7 +87,7 @@ public unsafe partial struct Mesh
///
public void AllocTexCoords2()
{
- TexCoords2 = Raylib.New(2 * VertexCount);
+ TexCoords2 = Raylib.New(2 * (uint)VertexCount);
}
///
@@ -95,7 +95,7 @@ public unsafe partial struct Mesh
///
public void AllocNormals()
{
- Normals = Raylib.New(3 * VertexCount);
+ Normals = Raylib.New(3 * (uint)VertexCount);
}
///
@@ -103,7 +103,7 @@ public unsafe partial struct Mesh
///
public void AllocTangents()
{
- Tangents = Raylib.New(4 * VertexCount);
+ Tangents = Raylib.New(4 * (uint)VertexCount);
}
///
@@ -111,7 +111,7 @@ public unsafe partial struct Mesh
///
public void AllocColors()
{
- Colors = Raylib.New(4 * VertexCount);
+ Colors = Raylib.New(4 * (uint)VertexCount);
}
///
@@ -119,7 +119,7 @@ public unsafe partial struct Mesh
///
public void AllocIndices()
{
- Indices = Raylib.New(3 * TriangleCount);
+ Indices = Raylib.New(3 * (uint)TriangleCount);
}
///
diff --git a/Raylib-cs/types/Raylib.Utils.cs b/Raylib-cs/types/Raylib.Utils.cs
index 1b83b66..4f7f117 100644
--- a/Raylib-cs/types/Raylib.Utils.cs
+++ b/Raylib-cs/types/Raylib.Utils.cs
@@ -230,16 +230,16 @@ public static unsafe partial class Raylib
}
/// C++ style memory allocator
- public static T* New(int count) where T : unmanaged
+ public static T* New(uint count) where T : unmanaged
{
- return (T*)MemAlloc(count * sizeof(T));
+ return (T*)MemAlloc(count * (uint)sizeof(T));
}
/// Load file data as byte array (read)
- public static byte* LoadFileData(string fileName, ref uint bytesRead)
+ public static byte* LoadFileData(string fileName, ref int bytesRead)
{
using var str1 = fileName.ToAnsiBuffer();
- fixed (uint* p = &bytesRead)
+ fixed (int* p = &bytesRead)
{
return LoadFileData(str1.AsPointer(), p);
}
@@ -930,10 +930,10 @@ public static unsafe partial class Raylib
}
/// Load model animations from file
- public static ModelAnimation* LoadModelAnimations(string fileName, ref uint animCount)
+ public static ModelAnimation* LoadModelAnimations(string fileName, ref int animCount)
{
using var str1 = fileName.ToAnsiBuffer();
- fixed (uint* p = &animCount)
+ fixed (int* p = &animCount)
{
return LoadModelAnimations(str1.AsPointer(), p);
}
diff --git a/Raylib-cs/types/Rectangle.cs b/Raylib-cs/types/Rectangle.cs
index 9f6eb21..c870bcf 100644
--- a/Raylib-cs/types/Rectangle.cs
+++ b/Raylib-cs/types/Rectangle.cs
@@ -48,7 +48,10 @@ public partial struct Rectangle
public Vector2 Position
{
- readonly get { return new Vector2(X,Y); }
+ readonly get
+ {
+ return new Vector2(X, Y);
+ }
set
{
X = value.X;
@@ -58,7 +61,10 @@ public partial struct Rectangle
public Vector2 Size
{
- readonly get { return new Vector2(Width,Height); }
+ readonly get
+ {
+ return new Vector2(Width, Height);
+ }
set
{
Width = value.X;