Skip to content

Commit

Permalink
Mattias Engdeg?rd - Wed Dec 6 10:00:07 PST 2000
Browse files Browse the repository at this point in the history
 * Improved the XPM loading code
  • Loading branch information
Sam Lantinga committed Dec 6, 2000
1 parent 2a1f98c commit d425988
Show file tree
Hide file tree
Showing 4 changed files with 309 additions and 339 deletions.
4 changes: 4 additions & 0 deletions CHANGES
@@ -1,4 +1,8 @@

1.1.1:
Mattias Engdeg�rd - Wed Dec 6 10:00:07 PST 2000
* Improved the XPM loading code

1.1.0:
Sam Lantinga - Wed Nov 29 00:46:27 PST 2000
* Added XPM file format support
Expand Down
8 changes: 4 additions & 4 deletions IMG.c
Expand Up @@ -67,7 +67,7 @@ SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc)
}

/* Portable case-insensitive string compare function */
static int string_equals(const char *str1, const char *str2)
int IMG_string_equals(const char *str1, const char *str2)
{
while ( *str1 && *str2 ) {
if ( toupper((unsigned char)*str1) !=
Expand Down Expand Up @@ -99,11 +99,11 @@ SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type)
/* Detect the type of image being loaded */
start = SDL_RWtell(src);
image = NULL;
for ( i=0; i < ARRAYSIZE(supported) && !image; ++i ) {
for ( i=0; i < ARRAYSIZE(supported); ++i ) {
if( (supported[i].is
&& (SDL_RWseek(src, start, SEEK_SET),
supported[i].is(src)))
|| (type && string_equals(type, supported[i].type))) {
|| (type && IMG_string_equals(type, supported[i].type))) {
#ifdef DEBUG_IMGLIB
fprintf(stderr, "IMGLIB: Loading image as %s\n",
supported[i].type);
Expand All @@ -118,7 +118,7 @@ SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type)
if ( freesrc ) {
SDL_RWclose(src);
}
if ( image == NULL ) {
if ( i == ARRAYSIZE(supported) ) {
IMG_SetError("Unsupported image format");
}
return(image);
Expand Down

0 comments on commit d425988

Please sign in to comment.