Home | History | Annotate | Download | only in test

Lines Matching defs:sprite

3 		    Then move an alpha valued sprite around the screen.
175 static SDL_Surface *sprite;
185 /* Load the sprite image */
186 sprite = SDL_LoadBMP(file);
187 if ( sprite == NULL ) {
193 if ( sprite->format->palette ) {
194 SDL_SetColorKey(sprite, SDL_SRCCOLORKEY,
195 *(Uint8 *)sprite->pixels);
198 /* Convert sprite to video format */
199 converted = SDL_DisplayFormat(sprite);
200 SDL_FreeSurface(sprite);
206 sprite = converted;
209 backing = SDL_CreateRGBSurface(SDL_SWSURFACE, sprite->w, sprite->h, 8,
214 SDL_FreeSurface(sprite);
224 SDL_FreeSurface(sprite);
229 /* Set the initial position of the sprite */
230 position.x = (screen->w-sprite->w)/2;
231 position.y = (screen->h-sprite->h)/2;
232 position.w = sprite->w;
233 position.h = sprite->h;
252 /* Erase the sprite if it was visible */
262 /* Since the sprite is off the screen, we can do other drawing
263 without being overwritten by the saved area behind the sprite.
272 /* Move the sprite, bounce at the wall */
285 alpha = sprite->format->alpha;
292 SDL_SetAlpha(sprite, SDL_SRCALPHA, (Uint8)(alpha+alpha_vel));
294 /* Save the area behind the sprite */
298 /* Blit the sprite onto the screen */
300 SDL_BlitSurface(sprite, NULL, screen, &updates[1]);
313 position.x = x-sprite->w/2; /* Center about X */
314 position.y = y-sprite->h/2; /* Center about Y */
318 SDL_BlitSurface(sprite, NULL, screen, &updates[1]);
409 /* Load the sprite */
425 if ( (sprite->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
426 printf("Sprite is in video memory\n");
428 printf("Sprite is in system memory\n");
433 if ( (sprite->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
434 printf("Sprite blit uses hardware alpha acceleration\n");
436 printf("Sprite blit dosn't uses hardware alpha acceleration\n");
453 /* Update the frame -- move the sprite */
483 /* Attract sprite while mouse is held down */
536 SDL_FreeSurface(sprite);