test/testsprite.c
changeset 1516 4d241ea8a1cd
parent 1214 31103dbf1c26
child 1662 782fd950bd46
child 1895 c121d94672cb
equal deleted inserted replaced
1515:1e18097b1d7a 1516:4d241ea8a1cd
    26 {
    26 {
    27 	SDL_Quit();
    27 	SDL_Quit();
    28 	exit(rc);
    28 	exit(rc);
    29 }
    29 }
    30 
    30 
    31 int LoadSprite(SDL_Surface *screen, char *file)
    31 int LoadSprite(char *file)
    32 {
    32 {
    33 	SDL_Surface *temp;
    33 	SDL_Surface *temp;
    34 
    34 
    35 	/* Load the sprite image */
    35 	/* Load the sprite image */
    36 	sprite = SDL_LoadBMP(file);
    36 	sprite = SDL_LoadBMP(file);
   219 					width, height, SDL_GetError());
   219 					width, height, SDL_GetError());
   220 		quit(2);
   220 		quit(2);
   221 	}
   221 	}
   222 
   222 
   223 	/* Load the sprite */
   223 	/* Load the sprite */
   224 	if ( LoadSprite(screen, "icon.bmp") < 0 ) {
   224 	if ( LoadSprite("icon.bmp") < 0 ) {
   225 		quit(1);
   225 		quit(1);
   226 	}
   226 	}
   227 
   227 
   228 	/* Allocate memory for the sprite info */
   228 	/* Allocate memory for the sprite info */
   229 	mem = (Uint8 *)malloc(4*sizeof(SDL_Rect)*numsprites);
   229 	mem = (Uint8 *)malloc(4*sizeof(SDL_Rect)*numsprites);