Added a width and height query.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 07 May 2011 23:00:40 -0400
changeset 2 3c16e81ac188
parent 1 90603fda7444
child 3 0ec2e8d45195
Added a width and height query.
mojodds.c
--- a/mojodds.c	Sat May 07 03:58:34 2011 -0400
+++ b/mojodds.c	Sat May 07 23:00:40 2011 -0400
@@ -174,7 +174,8 @@
 
 // !!! FIXME: improve the crap out of this API later.
 int MOJODDS_getTexture(const void *_ptr, const unsigned long _len,
-                       const void **_tex, unsigned long *_texlen, int *_dxtver)
+                       const void **_tex, unsigned long *_texlen, int *_dxtver,
+                       unsigned int *_w, unsigned int *_h)
 {
     size_t len = (size_t) _len;
     const uint8 *ptr = (const uint8 *) _ptr;
@@ -183,7 +184,9 @@
         return 0;
 
     *_tex = (const void *) ptr;
-    *_texlen = (long) header.dwPitchOrLinearSize;
+    *_texlen = (unsigned long) header.dwPitchOrLinearSize;
+    *_w = (unsigned int) header.dwWidth;
+    *_h = (unsigned int) header.dwHeight;
 
     switch (header.ddspf.dwFourCC)
     {