Skip to content

Commit

Permalink
Added MOJODDS_isDDS().
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed May 9, 2011
1 parent 786dff6 commit 2d963a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mojodds.c
Expand Up @@ -173,6 +173,13 @@ static int parse_dds(MOJODDS_Header *header, const uint8 **ptr, size_t *len)


// !!! FIXME: improve the crap out of this API later.
int MOJODDS_isDDS(const void *_ptr, const unsigned long _len)
{
size_t len = (size_t) _len;
const uint8 *ptr = (const uint8 *) _ptr;
return (readui32(&ptr, &len) == DDS_MAGIC);
}

int MOJODDS_getTexture(const void *_ptr, const unsigned long _len,
const void **_tex, unsigned long *_texlen, int *_dxtver,
unsigned int *_w, unsigned int *_h)
Expand Down
1 change: 1 addition & 0 deletions mojodds.h
Expand Up @@ -3,6 +3,7 @@

/* !!! FIXME: flesh this file out. */

int MOJODDS_isDDS(const void *_ptr, const unsigned long _len);
int MOJODDS_getTexture(const void *_ptr, const unsigned long _len,
const void **_tex, unsigned long *_texlen, int *_dxtver,
unsigned int *_w, unsigned int *_h);
Expand Down

0 comments on commit 2d963a8

Please sign in to comment.