*** empty log message ***
authorSam Lantinga <slouken@lokigames.com>
Wed, 31 Jan 2001 00:46:16 +0000
changeset 18a13d6443bf9c
parent 17 831ec54e9be9
child 19 346fbadf38a3
*** empty log message ***
showimage.c
     1.1 --- a/showimage.c	Tue Jan 30 22:21:40 2001 +0000
     1.2 +++ b/showimage.c	Wed Jan 31 00:46:16 2001 +0000
     1.3 @@ -100,8 +100,7 @@
     1.4  		if ( image == NULL ) {
     1.5  			fprintf(stderr, "Couldn't load %s: %s\n",
     1.6  			        argv[i], SDL_GetError());
     1.7 -			SDL_Quit();
     1.8 -			return(2);
     1.9 +			continue;
    1.10  		}
    1.11  		SDL_WM_SetCaption(argv[i], "showimage");
    1.12  
    1.13 @@ -109,6 +108,13 @@
    1.14  		depth = SDL_VideoModeOK(image->w, image->h, 32, flags);
    1.15  		/* Use the deepest native mode, except that we emulate 32bpp
    1.16  		   for viewing non-indexed images on 8bpp screens */
    1.17 +		if ( depth == 0 ) {
    1.18 +			if ( image->format->BytesPerPixel > 1 ) {
    1.19 +				depth = 32;
    1.20 +			} else {
    1.21 +				depth = 8;
    1.22 +			}
    1.23 +		} else
    1.24  		if ( (image->format->BytesPerPixel > 1) && (depth == 8) ) {
    1.25  	    		depth = 32;
    1.26  		}
    1.27 @@ -116,8 +122,7 @@
    1.28  		if ( screen == NULL ) {
    1.29  			fprintf(stderr,"Couldn't set %dx%dx%d video mode: %s\n",
    1.30  				image->w, image->h, depth, SDL_GetError());
    1.31 -			SDL_Quit();
    1.32 -			return(3);
    1.33 +			continue;
    1.34  		}
    1.35  
    1.36  		/* Set the palette, if one exists */