From 24c032bb92a19c9cc0e1ed751d24737af5a04e23 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 7 May 2011 23:00:40 -0400 Subject: [PATCH] Added a width and height query. --- mojodds.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mojodds.c b/mojodds.c index 7bc9de8..9b45031 100644 --- a/mojodds.c +++ b/mojodds.c @@ -174,7 +174,8 @@ static int parse_dds(MOJODDS_Header *header, const uint8 **ptr, size_t *len) // !!! 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 @@ int MOJODDS_getTexture(const void *_ptr, const unsigned long _len, 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) {