Added a YUV overlay test program (thanks Jon!)
authorSam Lantinga <slouken@libsdl.org>
Thu, 14 Feb 2002 00:47:46 +0000
changeset 277255c7ee077cb
parent 276 8af85680ca0a
child 278 dcd9f7b50a1c
Added a YUV overlay test program (thanks Jon!)
docs.html
test/Makefile.am
test/testoverlay.c
     1.1 --- a/docs.html	Wed Feb 13 23:40:13 2002 +0000
     1.2 +++ b/docs.html	Thu Feb 14 00:47:46 2002 +0000
     1.3 @@ -16,6 +16,7 @@
     1.4  Major changes since SDL 1.0.0:
     1.5  </H2>
     1.6  <UL>
     1.7 +	<LI> 1.2.4: Added a YUV overlay test program (thanks Jon!)
     1.8  	<LI> 1.2.4: Added support for building SDL for EPOC/SymbianOS 6.0
     1.9  	<LI> 1.2.4: Added support for Xi Graphics XME fullscreen extension
    1.10  	<LI> 1.2.3: Added X11 Xinerama support - fullscreen starts on screen 0
     2.1 --- a/test/Makefile.am	Wed Feb 13 23:40:13 2002 +0000
     2.2 +++ b/test/Makefile.am	Thu Feb 14 00:47:46 2002 +0000
     2.3 @@ -4,7 +4,7 @@
     2.4  	testver testtypes testhread testlock testerror testsem testtimer \
     2.5  	loopwave testcdrom testkeys testvidinfo checkkeys testwin graywin \
     2.6  	testsprite testbitmap testalpha testgamma testpalette testwm \
     2.7 -	threadwin testgl testjoystick
     2.8 +	threadwin testoverlay testgl testjoystick
     2.9  
    2.10  testalpha_SOURCES = testalpha.c
    2.11  testalpha_LDADD = @MATHLIB@
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/test/testoverlay.c	Thu Feb 14 00:47:46 2002 +0000
     3.3 @@ -0,0 +1,512 @@
     3.4 +
     3.5 +/* Bring up a window and play with it */
     3.6 +
     3.7 +#include <stdlib.h>
     3.8 +#include <stdio.h>
     3.9 +#include <string.h>
    3.10 +
    3.11 +#define BENCHMARK_SDL
    3.12 +
    3.13 +#define NOTICE(X)	printf("%s", X);
    3.14 +
    3.15 +#include "SDL.h"
    3.16 +
    3.17 +SDL_Surface *screen, *pic;
    3.18 +SDL_Overlay *overlay;
    3.19 +int scale;
    3.20 +
    3.21 +/* NOTE: These RGB conversion functions are not intended for speed,
    3.22 +         only as examples.
    3.23 +*/
    3.24 +
    3.25 +void RGBtoYUV(Uint8 *rgb, int *yuv)
    3.26 +{
    3.27 +	int i;
    3.28 +#if 1 /* these are the two formulas that I found on the FourCC site... */
    3.29 +	yuv[0] = 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2];
    3.30 +	yuv[1] = (rgb[2]-yuv[0])*0.565 + 128;
    3.31 +	yuv[2] = (rgb[0]-yuv[0])*0.713 + 128;
    3.32 +#else
    3.33 +	yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
    3.34 +	yuv[1] = 128 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2]);
    3.35 +	yuv[2] = 128 + (0.439 * rgb[0]) - (0.368 * rgb[1]) - (0.071 * rgb[2]);
    3.36 +#endif
    3.37 +	/* clamp values...if you need to, we don't seem to have a need */
    3.38 +	/*
    3.39 +	for(i=0;i<3;i++)
    3.40 +	{
    3.41 +		if(yuv[i]<0)
    3.42 +			yuv[i]=0;
    3.43 +		if(yuv[i]>255)
    3.44 +			yuv[i]=255;
    3.45 +	}
    3.46 +	*/
    3.47 +}
    3.48 +
    3.49 +ConvertRGBtoYV12(SDL_Surface *s, SDL_Overlay *o)
    3.50 +{
    3.51 +	int x,y;
    3.52 +	int yuv[3];
    3.53 +	Uint8 *p,*op[3];
    3.54 +
    3.55 +	SDL_LockSurface(s);
    3.56 +	SDL_LockYUVOverlay(o);
    3.57 +
    3.58 +	/* Black initialization */
    3.59 +	/*
    3.60 +	memset(o->pixels[0],0,o->pitches[0]*o->h);
    3.61 +	memset(o->pixels[1],128,o->pitches[1]*((o->h+1)/2));
    3.62 +	memset(o->pixels[2],128,o->pitches[2]*((o->h+1)/2));
    3.63 +	*/
    3.64 +
    3.65 +	/* Convert */
    3.66 +	for(y=0; y<s->h && y<o->h; y++)
    3.67 +	{
    3.68 +		p=s->pixels+s->pitch*y;
    3.69 +		op[0]=o->pixels[0]+o->pitches[0]*y;
    3.70 +		op[1]=o->pixels[1]+o->pitches[1]*(y/2);
    3.71 +		op[2]=o->pixels[2]+o->pitches[2]*(y/2);
    3.72 +		for(x=0; x<s->w && x<o->w; x++)
    3.73 +		{
    3.74 +			RGBtoYUV(p,yuv);
    3.75 +			*(op[0]++)=yuv[0];
    3.76 +			if(x%2==0 && y%2==0)
    3.77 +			{
    3.78 +				*(op[1]++)=yuv[2];
    3.79 +				*(op[2]++)=yuv[1];
    3.80 +			}
    3.81 +			p+=s->format->BytesPerPixel;
    3.82 +		}
    3.83 +	}
    3.84 +
    3.85 +	SDL_UnlockYUVOverlay(o);
    3.86 +	SDL_UnlockSurface(s);
    3.87 +}
    3.88 +
    3.89 +ConvertRGBtoIYUV(SDL_Surface *s, SDL_Overlay *o)
    3.90 +{
    3.91 +	int x,y;
    3.92 +	int yuv[3];
    3.93 +	Uint8 *p,*op[3];
    3.94 +
    3.95 +	SDL_LockSurface(s);
    3.96 +	SDL_LockYUVOverlay(o);
    3.97 +
    3.98 +	/* Black initialization */
    3.99 +	/*
   3.100 +	memset(o->pixels[0],0,o->pitches[0]*o->h);
   3.101 +	memset(o->pixels[1],128,o->pitches[1]*((o->h+1)/2));
   3.102 +	memset(o->pixels[2],128,o->pitches[2]*((o->h+1)/2));
   3.103 +	*/
   3.104 +
   3.105 +	/* Convert */
   3.106 +	for(y=0; y<s->h && y<o->h; y++)
   3.107 +	{
   3.108 +		p=s->pixels+s->pitch*y;
   3.109 +		op[0]=o->pixels[0]+o->pitches[0]*y;
   3.110 +		op[1]=o->pixels[1]+o->pitches[1]*(y/2);
   3.111 +		op[2]=o->pixels[2]+o->pitches[2]*(y/2);
   3.112 +		for(x=0; x<s->w && x<o->w; x++)
   3.113 +		{
   3.114 +			RGBtoYUV(p,yuv);
   3.115 +			*(op[0]++)=yuv[0];
   3.116 +			if(x%2==0 && y%2==0)
   3.117 +			{
   3.118 +				*(op[1]++)=yuv[1];
   3.119 +				*(op[2]++)=yuv[2];
   3.120 +			}
   3.121 +			p+=s->format->BytesPerPixel;
   3.122 +		}
   3.123 +	}
   3.124 +
   3.125 +	SDL_UnlockYUVOverlay(o);
   3.126 +	SDL_UnlockSurface(s);
   3.127 +}
   3.128 +
   3.129 +ConvertRGBtoUYVY(SDL_Surface *s, SDL_Overlay *o)
   3.130 +{
   3.131 +	int x,y;
   3.132 +	int yuv[3];
   3.133 +	Uint8 *p,*op;
   3.134 +
   3.135 +	SDL_LockSurface(s);
   3.136 +	SDL_LockYUVOverlay(o);
   3.137 +
   3.138 +	for(y=0; y<s->h && y<o->h; y++)
   3.139 +	{
   3.140 +		p=s->pixels+s->pitch*y;
   3.141 +		op=o->pixels[0]+o->pitches[0]*y;
   3.142 +		for(x=0; x<s->w && x<o->w; x++)
   3.143 +		{
   3.144 +			RGBtoYUV(p,yuv);
   3.145 +			if(x%2==0)
   3.146 +			{
   3.147 +				*(op++)=yuv[1];
   3.148 +				*(op++)=yuv[0];
   3.149 +				*(op++)=yuv[2];
   3.150 +			}
   3.151 +			else
   3.152 +				*(op++)=yuv[0];
   3.153 +
   3.154 +			p+=s->format->BytesPerPixel;
   3.155 +		}
   3.156 +	}
   3.157 +
   3.158 +	SDL_UnlockYUVOverlay(o);
   3.159 +	SDL_UnlockSurface(s);
   3.160 +}
   3.161 +
   3.162 +ConvertRGBtoYVYU(SDL_Surface *s, SDL_Overlay *o)
   3.163 +{
   3.164 +	int x,y;
   3.165 +	int yuv[3];
   3.166 +	Uint8 *p,*op;
   3.167 +
   3.168 +	SDL_LockSurface(s);
   3.169 +	SDL_LockYUVOverlay(o);
   3.170 +
   3.171 +	for(y=0; y<s->h && y<o->h; y++)
   3.172 +	{
   3.173 +		p=s->pixels+s->pitch*y;
   3.174 +		op=o->pixels[0]+o->pitches[0]*y;
   3.175 +		for(x=0; x<s->w && x<o->w; x++)
   3.176 +		{
   3.177 +			RGBtoYUV(p,yuv);
   3.178 +			if(x%2==0)
   3.179 +			{
   3.180 +				*(op++)=yuv[0];
   3.181 +				*(op++)=yuv[2];
   3.182 +				op[1]=yuv[1];
   3.183 +			}
   3.184 +			else
   3.185 +			{
   3.186 +				*op=yuv[0];
   3.187 +				op+=2;
   3.188 +			}
   3.189 +
   3.190 +			p+=s->format->BytesPerPixel;
   3.191 +		}
   3.192 +	}
   3.193 +
   3.194 +	SDL_UnlockYUVOverlay(o);
   3.195 +	SDL_UnlockSurface(s);
   3.196 +}
   3.197 +
   3.198 +ConvertRGBtoYUY2(SDL_Surface *s, SDL_Overlay *o)
   3.199 +{
   3.200 +	int x,y;
   3.201 +	int yuv[3];
   3.202 +	Uint8 *p,*op;
   3.203 +
   3.204 +	SDL_LockSurface(s);
   3.205 +	SDL_LockYUVOverlay(o);
   3.206 +
   3.207 +	for(y=0; y<s->h && y<o->h; y++)
   3.208 +	{
   3.209 +		p=s->pixels+s->pitch*y;
   3.210 +		op=o->pixels[0]+o->pitches[0]*y;
   3.211 +		for(x=0; x<s->w && x<o->w; x++)
   3.212 +		{
   3.213 +			RGBtoYUV(p,yuv);
   3.214 +			if(x%2==0)
   3.215 +			{
   3.216 +				*(op++)=yuv[0];
   3.217 +				*(op++)=yuv[1];
   3.218 +				op[1]=yuv[2];
   3.219 +			}
   3.220 +			else
   3.221 +			{
   3.222 +				*op=yuv[0];
   3.223 +				op+=2;
   3.224 +			}
   3.225 +
   3.226 +			p+=s->format->BytesPerPixel;
   3.227 +		}
   3.228 +	}
   3.229 +
   3.230 +	SDL_UnlockYUVOverlay(o);
   3.231 +	SDL_UnlockSurface(s);
   3.232 +}
   3.233 +
   3.234 +void Draw()
   3.235 +{
   3.236 +	SDL_Rect rect;
   3.237 +	int i;
   3.238 +
   3.239 +	if(!scale)
   3.240 +	{
   3.241 +		rect.w=overlay->w;
   3.242 +		rect.h=overlay->h;
   3.243 +		for(i=0; i<200; i++)
   3.244 +		{
   3.245 +			rect.x=i;
   3.246 +			rect.y=i;
   3.247 +			SDL_DisplayYUVOverlay(overlay,&rect);
   3.248 +		}
   3.249 +	}
   3.250 +	else
   3.251 +	{
   3.252 +		rect.w=screen->w;
   3.253 +		rect.h=screen->h;
   3.254 +		for(i=0; i<200; i++)
   3.255 +		{
   3.256 +			rect.x=i-199;
   3.257 +			rect.y=i-199;
   3.258 +			SDL_DisplayYUVOverlay(overlay,&rect);
   3.259 +		}
   3.260 +	}
   3.261 +	printf("Displayed %d times.\n",i);
   3.262 +}
   3.263 +
   3.264 +int main(int argc, char **argv)
   3.265 +{
   3.266 +	int flip;
   3.267 +	int w, h;
   3.268 +	int delay;
   3.269 +	int desired_bpp;
   3.270 +	Uint32 video_flags, overlay_format;
   3.271 +	char *bmpfile;
   3.272 +#ifdef BENCHMARK_SDL
   3.273 +	Uint32 then, now;
   3.274 +#endif
   3.275 +	int i;
   3.276 +
   3.277 +	/* Set default options and check command-line */
   3.278 +	flip = 0;
   3.279 +	scale=0;
   3.280 +	delay = 1;
   3.281 +	w = 640;
   3.282 +	h = 480;
   3.283 +	desired_bpp = 0;
   3.284 +	video_flags = 0;
   3.285 +	overlay_format = SDL_YV12_OVERLAY;
   3.286 +
   3.287 +	while ( argc > 1 ) {
   3.288 +		if ( strcmp(argv[1], "-delay") == 0 ) {
   3.289 +			if ( argv[2] ) {
   3.290 +				delay = atoi(argv[2]);
   3.291 +				argv += 2;
   3.292 +				argc -= 2;
   3.293 +			} else {
   3.294 +				fprintf(stderr,
   3.295 +				"The -delay option requires an argument\n");
   3.296 +				exit(1);
   3.297 +			}
   3.298 +		} else
   3.299 +		if ( strcmp(argv[1], "-width") == 0 ) {
   3.300 +			if ( argv[2] && ((w = atoi(argv[2])) > 0) ) {
   3.301 +				argv += 2;
   3.302 +				argc -= 2;
   3.303 +			} else {
   3.304 +				fprintf(stderr,
   3.305 +				"The -width option requires an argument\n");
   3.306 +				exit(1);
   3.307 +			}
   3.308 +		} else
   3.309 +		if ( strcmp(argv[1], "-height") == 0 ) {
   3.310 +			if ( argv[2] && ((h = atoi(argv[2])) > 0) ) {
   3.311 +				argv += 2;
   3.312 +				argc -= 2;
   3.313 +			} else {
   3.314 +				fprintf(stderr,
   3.315 +				"The -height option requires an argument\n");
   3.316 +				exit(1);
   3.317 +			}
   3.318 +		} else
   3.319 +		if ( strcmp(argv[1], "-bpp") == 0 ) {
   3.320 +			if ( argv[2] ) {
   3.321 +				desired_bpp = atoi(argv[2]);
   3.322 +				argv += 2;
   3.323 +				argc -= 2;
   3.324 +			} else {
   3.325 +				fprintf(stderr,
   3.326 +				"The -bpp option requires an argument\n");
   3.327 +				exit(1);
   3.328 +			}
   3.329 +		} else
   3.330 +		if ( strcmp(argv[1], "-format") == 0 ) {
   3.331 +			if ( argv[2] ) {
   3.332 +				if(!strcmp(argv[2],"YV12"))
   3.333 +					overlay_format = SDL_YV12_OVERLAY;
   3.334 +				else if(!strcmp(argv[2],"IYUV"))
   3.335 +					overlay_format = SDL_IYUV_OVERLAY;
   3.336 +				else if(!strcmp(argv[2],"YUY2"))
   3.337 +					overlay_format = SDL_YUY2_OVERLAY;
   3.338 +				else if(!strcmp(argv[2],"UYVY"))
   3.339 +					overlay_format = SDL_UYVY_OVERLAY;
   3.340 +				else if(!strcmp(argv[2],"YVYU"))
   3.341 +					overlay_format = SDL_YVYU_OVERLAY;
   3.342 +				else
   3.343 +				{
   3.344 +					fprintf(stderr, "The -format option %s is not recognized\n",argv[2]);
   3.345 +					exit(1);
   3.346 +				}
   3.347 +				argv += 2;
   3.348 +				argc -= 2;
   3.349 +			} else {
   3.350 +				fprintf(stderr,
   3.351 +				"The -format option requires an argument\n");
   3.352 +				exit(1);
   3.353 +			}
   3.354 +		} else
   3.355 +		if ( strcmp(argv[1], "-hw") == 0 ) {
   3.356 +			video_flags |= SDL_HWSURFACE;
   3.357 +			argv += 1;
   3.358 +			argc -= 1;
   3.359 +		} else
   3.360 +		if ( strcmp(argv[1], "-flip") == 0 ) {
   3.361 +			video_flags |= SDL_DOUBLEBUF;
   3.362 +			argv += 1;
   3.363 +			argc -= 1;
   3.364 +		} else
   3.365 +		if ( strcmp(argv[1], "-scale") == 0 ) {
   3.366 +			scale = 1;
   3.367 +			argv += 1;
   3.368 +			argc -= 1;
   3.369 +		} else
   3.370 +		if ( strcmp(argv[1], "-fullscreen") == 0 ) {
   3.371 +			video_flags |= SDL_FULLSCREEN;
   3.372 +			argv += 1;
   3.373 +			argc -= 1;
   3.374 +		} else
   3.375 +			break;
   3.376 +	}
   3.377 +	if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
   3.378 +		fprintf(stderr,
   3.379 +			"Couldn't initialize SDL: %s\n", SDL_GetError());
   3.380 +		exit(1);
   3.381 +	}
   3.382 +	atexit(SDL_Quit);			/* Clean up on exit */
   3.383 +
   3.384 +	/* Initialize the display */
   3.385 +	screen = SDL_SetVideoMode(w, h, desired_bpp, video_flags);
   3.386 +	if ( screen == NULL ) {
   3.387 +		fprintf(stderr, "Couldn't set %dx%dx%d video mode: %s\n",
   3.388 +					w, h, desired_bpp, SDL_GetError());
   3.389 +		exit(1);
   3.390 +	}
   3.391 +	printf("Set%s %dx%dx%d mode\n",
   3.392 +			screen->flags & SDL_FULLSCREEN ? " fullscreen" : "",
   3.393 +			screen->w, screen->h, screen->format->BitsPerPixel);
   3.394 +	printf("(video surface located in %s memory)\n",
   3.395 +			(screen->flags&SDL_HWSURFACE) ? "video" : "system");
   3.396 +	if ( screen->flags & SDL_DOUBLEBUF ) {
   3.397 +		printf("Double-buffering enabled\n");
   3.398 +		flip = 1;
   3.399 +	}
   3.400 +
   3.401 +	/* Set the window manager title bar */
   3.402 +	SDL_WM_SetCaption("SDL test overlay", "testoverlay");
   3.403 +
   3.404 +	/* Load picture */
   3.405 +	bmpfile=(argv[1]?argv[1]:"sample.bmp");
   3.406 +	pic = SDL_LoadBMP(bmpfile);
   3.407 +	if ( pic == NULL ) {
   3.408 +		fprintf(stderr, "Couldn't load %s: %s\n", bmpfile,
   3.409 +							SDL_GetError());
   3.410 +		exit(1);
   3.411 +	}
   3.412 +
   3.413 +	/* Convert the picture to 32bits, for easy conversion */
   3.414 +	{
   3.415 +		SDL_Surface *newsurf;
   3.416 +		SDL_PixelFormat format;
   3.417 +
   3.418 +		format.palette=NULL;
   3.419 +		format.BitsPerPixel=32;
   3.420 +		format.BytesPerPixel=4;
   3.421 +#if SDL_BYTEORDER == SDL_LIL_ENDIAN
   3.422 +		format.Rshift=0;
   3.423 +		format.Gshift=8;
   3.424 +		format.Bshift=16;
   3.425 +#else
   3.426 +		format.Rshift=24;
   3.427 +		format.Gshift=16;
   3.428 +		format.Bshift=8;
   3.429 +#endif
   3.430 +		format.Ashift=0;
   3.431 +		format.Rmask=0xff<<format.Rshift;
   3.432 +		format.Gmask=0xff<<format.Gshift;
   3.433 +		format.Bmask=0xff<<format.Bshift;
   3.434 +		format.Amask=0;
   3.435 +		format.Rloss=0;
   3.436 +		format.Gloss=0;
   3.437 +		format.Bloss=0;
   3.438 +		format.Aloss=8;
   3.439 +		format.colorkey=0;
   3.440 +		format.alpha=0;
   3.441 +
   3.442 +		newsurf=SDL_ConvertSurface(pic, &format, SDL_SWSURFACE);
   3.443 +		if(!newsurf)
   3.444 +		{
   3.445 +			fprintf(stderr, "Couldn't convert picture to 32bits RGB: %s\n",
   3.446 +							SDL_GetError());
   3.447 +			exit(1);
   3.448 +		}
   3.449 +		SDL_FreeSurface(pic);
   3.450 +		pic=newsurf;
   3.451 +	}
   3.452 +	
   3.453 +	/* Create the overlay */
   3.454 +	overlay = SDL_CreateYUVOverlay(pic->w, pic->h, overlay_format, screen);
   3.455 +	if ( overlay == NULL ) {
   3.456 +		fprintf(stderr, "Couldn't create overlay: %s\n", SDL_GetError());
   3.457 +		exit(1);
   3.458 +	}
   3.459 +	printf("Created %dx%dx%d %s %s overlay\n",overlay->w,overlay->h,overlay->planes,
   3.460 +			overlay->hw_overlay?"hardware":"software",
   3.461 +			overlay->format==SDL_YV12_OVERLAY?"YV12":
   3.462 +			overlay->format==SDL_IYUV_OVERLAY?"IYUV":
   3.463 +			overlay->format==SDL_YUY2_OVERLAY?"YUY2":
   3.464 +			overlay->format==SDL_UYVY_OVERLAY?"UYVY":
   3.465 +			overlay->format==SDL_YVYU_OVERLAY?"YVYU":
   3.466 +			"Unknown");
   3.467 +	for(i=0; i<overlay->planes; i++)
   3.468 +	{
   3.469 +		printf("  plane %d: pitch=%d\n", i, overlay->pitches[i]);
   3.470 +	}
   3.471 +	
   3.472 +	/* Convert to YUV, and draw to the overlay */
   3.473 +#ifdef BENCHMARK_SDL
   3.474 +	then = SDL_GetTicks();
   3.475 +#endif
   3.476 +	switch(overlay->format)
   3.477 +	{
   3.478 +		case SDL_YV12_OVERLAY:
   3.479 +			ConvertRGBtoYV12(pic,overlay);
   3.480 +			break;
   3.481 +		case SDL_UYVY_OVERLAY:
   3.482 +			ConvertRGBtoUYVY(pic,overlay);
   3.483 +			break;
   3.484 +		case SDL_YVYU_OVERLAY:
   3.485 +			ConvertRGBtoYVYU(pic,overlay);
   3.486 +			break;
   3.487 +		case SDL_YUY2_OVERLAY:
   3.488 +			ConvertRGBtoYUY2(pic,overlay);
   3.489 +			break;
   3.490 +		case SDL_IYUV_OVERLAY:
   3.491 +			ConvertRGBtoIYUV(pic,overlay);
   3.492 +			break;
   3.493 +		default:
   3.494 +			printf("cannot convert RGB picture to obtained YUV format!\n");
   3.495 +			exit(1);
   3.496 +			break;
   3.497 +	}
   3.498 +#ifdef BENCHMARK_SDL
   3.499 +	now = SDL_GetTicks();
   3.500 +	printf("Conversion Time: %d milliseconds\n", now-then);
   3.501 +#endif
   3.502 +	
   3.503 +	/* Do all the drawing work */
   3.504 +#ifdef BENCHMARK_SDL
   3.505 +	then = SDL_GetTicks();
   3.506 +#endif
   3.507 +	Draw();
   3.508 +#ifdef BENCHMARK_SDL
   3.509 +	now = SDL_GetTicks();
   3.510 +	printf("Time: %d milliseconds\n", now-then);
   3.511 +#endif
   3.512 +	SDL_Delay(delay*1000);
   3.513 +	return(0);
   3.514 +}
   3.515 +