diff --git a/src/Bitmap.cpp b/src/Bitmap.cpp index 264a02db..589509c9 100644 --- a/src/Bitmap.cpp +++ b/src/Bitmap.cpp @@ -8,9 +8,9 @@ #define STBI_NO_LINEAR #include "stb_image.h" -unsigned char* DecodeBitmap(const unsigned char *in_buffer, size_t in_buffer_size, int *width, int *height) +unsigned char* DecodeBitmap(const unsigned char *in_buffer, size_t in_buffer_size, unsigned int *width, unsigned int *height) { - return stbi_load_from_memory(in_buffer, in_buffer_size, width, height, NULL, 3); + return stbi_load_from_memory(in_buffer, in_buffer_size, (int*)width, (int*)height, NULL, 3); } void FreeBitmap(unsigned char *buffer) diff --git a/src/Bitmap.h b/src/Bitmap.h index b8038784..c59c3d6e 100644 --- a/src/Bitmap.h +++ b/src/Bitmap.h @@ -2,5 +2,5 @@ #include -unsigned char* DecodeBitmap(const unsigned char *in_buffer, size_t in_buffer_size, int *width, int *height); +unsigned char* DecodeBitmap(const unsigned char *in_buffer, size_t in_buffer_size, unsigned int *width, unsigned int *height); void FreeBitmap(unsigned char *buffer); diff --git a/src/Draw.cpp b/src/Draw.cpp index aeb680bc..fb768a25 100644 --- a/src/Draw.cpp +++ b/src/Draw.cpp @@ -223,7 +223,7 @@ BOOL MakeSurface_Resource(const char *name, SurfaceID surf_no) if (data == NULL) return FALSE; - int width, height; + unsigned int width, height; unsigned char *image_buffer = DecodeBitmap(data, size, &width, &height); if (image_buffer == NULL) @@ -291,7 +291,7 @@ BOOL MakeSurface_File(const char *name, SurfaceID surf_no) return FALSE; } - int width, height; + unsigned int width, height; unsigned char *image_buffer = DecodeBitmap(data, size, &width, &height); free(data); @@ -339,7 +339,7 @@ BOOL ReloadBitmap_Resource(const char *name, SurfaceID surf_no) if (data == NULL) return FALSE; - int width, height; + unsigned int width, height; unsigned char *image_buffer = DecodeBitmap(data, size, &width, &height); if (!ScaleAndUploadSurface(image_buffer, width, height, surf_no)) @@ -387,7 +387,7 @@ BOOL ReloadBitmap_File(const char *name, SurfaceID surf_no) return FALSE; } - int width, height; + unsigned int width, height; unsigned char *image_buffer = DecodeBitmap(data, size, &width, &height); free(data);