test/testalpha.c
changeset 1465 8dfa9a6d69a5
parent 1293 23b1ef7d003b
child 1516 4d241ea8a1cd
     1.1 --- a/test/testalpha.c	Sat Mar 04 05:13:03 2006 +0000
     1.2 +++ b/test/testalpha.c	Sat Mar 04 08:24:35 2006 +0000
     1.3 @@ -45,7 +45,7 @@
     1.4          {
     1.5  		for ( i=0; i<screen->h; ++i ) {
     1.6  			gradient=((i*255)/screen->h);
     1.7 -                        color = SDL_MapRGB(screen->format, gradient, gradient, gradient);
     1.8 +                        color = (Uint16)SDL_MapRGB(screen->format, gradient, gradient, gradient);
     1.9                          buffer16=(Uint16*)buffer;
    1.10                          for (k=0; k<screen->w; k++)
    1.11                          {
    1.12 @@ -340,8 +340,14 @@
    1.13  	}
    1.14  
    1.15  	/* Alpha blending doesn't work well at 8-bit color */
    1.16 +#ifdef _WIN32_WCE
    1.17 +	/* Pocket PC */
    1.18 +	w = 240;
    1.19 +	h = 320;
    1.20 +#else
    1.21  	w = 640;
    1.22  	h = 480;
    1.23 +#endif
    1.24  	info = SDL_GetVideoInfo();
    1.25  	if ( info->vfmt->BitsPerPixel > 8 ) {
    1.26  		video_bpp = info->vfmt->BitsPerPixel;
    1.27 @@ -386,21 +392,12 @@
    1.28  		}
    1.29  	}
    1.30  
    1.31 -	/* Set 640x480 video mode */
    1.32 -#ifndef _WIN32_WCE
    1.33 +	/* Set video mode */
    1.34  	if ( (screen=SDL_SetVideoMode(w,h,video_bpp,videoflags)) == NULL ) {
    1.35 -		fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n",
    1.36 -						video_bpp, SDL_GetError());
    1.37 +		fprintf(stderr, "Couldn't set %dx%dx%d video mode: %s\n",
    1.38 +						w, h, video_bpp, SDL_GetError());
    1.39  		quit(2);
    1.40  	}
    1.41 -#else
    1.42 -	/* Pocket PC */
    1.43 -	if ( (screen=SDL_SetVideoMode(240,320,video_bpp,SDL_FULLSCREEN)) == NULL ) {
    1.44 -		fprintf(stderr, "Couldn't set 240x320x%d video mode: %s\n",
    1.45 -						video_bpp, SDL_GetError());
    1.46 -		quit(2);
    1.47 -	}
    1.48 -#endif
    1.49  	FillBackground(screen);
    1.50  
    1.51  	/* Create the light */