IMG_pcx.c
changeset 117 e613cf987897
parent 98 9f94c4674cc9
child 118 c5e736a47ad2
     1.1 --- a/IMG_pcx.c	Sat Feb 04 04:53:36 2006 +0000
     1.2 +++ b/IMG_pcx.c	Sat Feb 04 20:37:17 2006 +0000
     1.3 @@ -64,12 +64,14 @@
     1.4  /* See if an image is contained in a data source */
     1.5  int IMG_isPCX(SDL_RWops *src)
     1.6  {
     1.7 +	int start;
     1.8  	int is_PCX;
     1.9  	const int ZSoft_Manufacturer = 10;
    1.10  	const int PC_Paintbrush_Version = 5;
    1.11  	const int PCX_RunLength_Encoding = 1;
    1.12  	struct PCXheader pcxh;
    1.13  
    1.14 +	start = SDL_RWtell(src);
    1.15  	is_PCX = 0;
    1.16  	if ( SDL_RWread(src, &pcxh, sizeof(pcxh), 1) == 1 ) {
    1.17  		if ( (pcxh.Manufacturer == ZSoft_Manufacturer) &&
    1.18 @@ -78,6 +80,7 @@
    1.19  			is_PCX = 1;
    1.20  		}
    1.21  	}
    1.22 +	SDL_RWseek(src, start, SEEK_SET);
    1.23  	return(is_PCX);
    1.24  }
    1.25