Lines Matching refs:screen
23 static void FillBackground(SDL_Surface *screen) in FillBackground() argument
32 if ( SDL_LockSurface(screen) < 0 ) { in FillBackground()
37 buffer=(Uint8 *)screen->pixels; in FillBackground()
38 if (screen->format->BytesPerPixel!=2) { in FillBackground()
39 for ( i=0; i<screen->h; ++i ) { in FillBackground()
40 memset(buffer,(i*255)/screen->h, screen->w*screen->format->BytesPerPixel); in FillBackground()
41 buffer += screen->pitch; in FillBackground()
46 for ( i=0; i<screen->h; ++i ) { in FillBackground()
47 gradient=((i*255)/screen->h); in FillBackground()
48 color = (Uint16)SDL_MapRGB(screen->format, gradient, gradient, gradient); in FillBackground()
50 for (k=0; k<screen->w; k++) in FillBackground()
54 buffer += screen->pitch; in FillBackground()
58 SDL_UnlockSurface(screen); in FillBackground()
59 SDL_UpdateRect(screen, 0, 0, 0, 0); in FillBackground()
153 void FlashLight(SDL_Surface *screen, SDL_Surface *light, int x, int y) in FlashLight() argument
165 SDL_BlitSurface(light, NULL, screen, &position); in FlashLight()
167 SDL_UpdateRects(screen, 1, &position); in FlashLight()
181 int LoadSprite(SDL_Surface *screen, char *file) in LoadSprite() argument
230 position.x = (screen->w-sprite->w)/2; in LoadSprite()
231 position.y = (screen->h-sprite->h)/2; in LoadSprite()
247 void MoveSprite(SDL_Surface *screen, SDL_Surface *light) in MoveSprite() argument
255 SDL_BlitSurface(backing, NULL, screen, &updates[0]); in MoveSprite()
269 FlashLight(screen, light, x, y); in MoveSprite()
274 if ( (position.x < 0) || (position.x >= screen->w) ) { in MoveSprite()
279 if ( (position.y < 0) || (position.y >= screen->h) ) { in MoveSprite()
296 SDL_BlitSurface(screen, &updates[1], backing, NULL); in MoveSprite()
300 SDL_BlitSurface(sprite, NULL, screen, &updates[1]); in MoveSprite()
303 SDL_UpdateRects(screen, 2, updates); in MoveSprite()
306 void WarpSprite(SDL_Surface *screen, int x, int y) in WarpSprite() argument
312 SDL_BlitSurface(backing, NULL, screen, &updates[0]); in WarpSprite()
316 SDL_BlitSurface(screen, &updates[1], backing, NULL); in WarpSprite()
318 SDL_BlitSurface(sprite, NULL, screen, &updates[1]); in WarpSprite()
319 SDL_UpdateRects(screen, 2, updates); in WarpSprite()
325 SDL_Surface *screen; in main() local
396 if ( (screen=SDL_SetVideoMode(w,h,video_bpp,videoflags)) == NULL ) { in main()
401 FillBackground(screen); in main()
410 if ( LoadSprite(screen, "icon.bmp") < 0 ) { in main()
416 printf("Screen is at %d bits per pixel\n",screen->format->BitsPerPixel); in main()
417 if ( (screen->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { in main()
422 if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) { in main()
432 MoveSprite(screen, NULL); in main()
443 clip.w = screen->w-(2*32); in main()
444 clip.h = screen->h-(2*32); in main()
445 SDL_SetClipRect(screen, &clip); in main()
455 MoveSprite(screen, light); in main()
458 MoveSprite(screen, NULL); in main()
478 screen = SDL_SetVideoMode(event.resize.w, event.resize.h, video_bpp, videoflags); in main()
479 if ( screen ) { in main()
480 FillBackground(screen); in main()
503 SDL_FillRect(screen, &area, 0); in main()
504 SDL_UpdateRects(screen,1,&area); in main()
516 screen = SDL_SetVideoMode(w, h, video_bpp, videoflags); in main()
517 if ( screen == NULL ) { in main()
522 FillBackground(screen); in main()