diff src/dmimage.c @ 899:63fd1801f983

Mangle new stb_image to our purposes.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 23 Feb 2015 19:49:58 +0200
parents 2711f99b40e5
children df2a9c635175
line wrap: on
line diff
--- a/src/dmimage.c	Mon Feb 23 19:49:37 2015 +0200
+++ b/src/dmimage.c	Mon Feb 23 19:49:58 2015 +0200
@@ -7,10 +7,18 @@
 #include "dmimage.h"
 
 
+//#define STB_IMAGE_STATIC 1
+#define STB_IMAGE_IMPLEMENTATION 1
 #define STBI_INTERNAL_ZLIB 1
+#define STBI_NO_FAILURE_STRINGS 1
 #define STBI_FAILURE_USERMSG 1
 #define STBI_NO_STDIO 1
 #define STBI_NO_HDR 1
+
+#define STBI_MALLOC(sz)    dmMalloc(sz)
+#define STBI_REALLOC(p,sz) dmRealloc(p,sz)
+#define STBI_FREE(p)       dmFree(p)
+
 #include "stb_image.c"
 
 
@@ -82,7 +90,7 @@
 }
 
 
-static void dmSTBIskip(void *user, unsigned int n)
+static void dmSTBIskip(void *user, int n)
 {
     dmfseek((DMResource *) user, n, SEEK_CUR);
 }