Ejemplo n.º 1
0
void menu_unraise(void)
{
	int i;
	for(i=0;i<=80;i+=16)
	{
#if !defined(NO_SOUND) && defined(MENU_MUSIC)
		Mix_VolumeMusic(MUSIC_VOLUME-(i<<1));
#endif
		text_draw_background();
		fade16(text_screen,i);
		text_flip();
		SDL_Delay(10);
	}
}
Ejemplo n.º 2
0
void menu_unraise(void)
{
	int i;
	for(i=0;i<=64;i+=4)
	{
		Mix_VolumeMusic(96-(i<<1));
#ifndef DREAMCAST
		SDL_Delay(10);
#endif
		text_draw_background();
		fade16(text_screen,i);
		text_flip();
	}
}
Ejemplo n.º 3
0
void init_text(int splash)
{
	SDL_Surface *tmp;

	if (prSDLScreen==NULL)
	{
		SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK);
		prSDLScreen=SDL_SetVideoMode(320,240,16,VIDEO_FLAGS);
    		SDL_ShowCursor(SDL_DISABLE);
 	   	//SDL_JoystickEventState(SDL_ENABLE);
    		//SDL_JoystickOpen(0);
	}
#ifdef DREAMCAST
        __sdl_dc_emulate_keyboard=1;
#endif
	if (!text_screen)
	{
		text_screen=SDL_CreateRGBSurface(prSDLScreen->flags,prSDLScreen->w,prSDLScreen->h,prSDLScreen->format->BitsPerPixel,prSDLScreen->format->Rmask,prSDLScreen->format->Gmask,prSDLScreen->format->Bmask,prSDLScreen->format->Amask);
		tmp=SDL_LoadBMP(MENU_FILE_TEXT);
		if (text_screen==NULL || tmp==NULL)
			exit(-1);
		text_image=SDL_DisplayFormat(tmp);
		SDL_FreeSurface(tmp);
		if (text_image==NULL)
			exit(-2);
		SDL_SetColorKey(text_image,(SDL_SRCCOLORKEY | SDL_RLEACCEL),SDL_MapRGB(text_image -> format, 0, 0, 0));
		tmp=SDL_LoadBMP(MENU_FILE_BACKGROUND);
		if (tmp==NULL)
			exit(-3);
		text_background=SDL_DisplayFormat(tmp);
		SDL_FreeSurface(tmp);
		if (text_background==NULL)
			exit(-3);
		tmp=SDL_LoadBMP(MENU_FILE_WINDOW);
		if (tmp==NULL)
			exit(-4);
		text_window_background=SDL_DisplayFormat(tmp);
		SDL_FreeSurface(tmp);
		if (text_window_background==NULL)
			exit(-5);
	}
	if (splash)
	{
		SDL_Surface *sur;
		SDL_Rect r;
		int i,j;

		obten_colores();
		uae4all_init_sound();
		if (skipintro) goto skipintro;
#if !defined(DEBUG_UAE4ALL) && !defined(PROFILER_UAE4ALL) && !defined(AUTO_RUN) && !defined(AUTO_FRAMERATE)
		tmp=SDL_LoadBMP(MENU_FILE_SPLASH);
		if (tmp==NULL)
			exit(-6);
		sur = SDL_DisplayFormat(tmp);
		SDL_FreeSurface(tmp);
		r.x=(text_screen->w - sur->w)/2;
		r.y=(text_screen->h - sur->h)/2;
		r.h=sur->w;
		r.w=sur->h;
		SDL_FillRect(text_screen,NULL,0xFFFFFFFF);
		for (i=128;i>-8;i-=8)
		{
#ifdef DREAMCAST
			vid_waitvbl();
#else
			SDL_Delay(50);
#endif
			SDL_FillRect(text_screen,NULL,0xFFFFFFFF);
			SDL_BlitSurface(sur,NULL,text_screen,&r);
			fade16(text_screen,i);
			text_flip();
		}
		SDL_Delay(3000);
		for(i=0;i<128;i+=16)
		{
#ifdef DREAMCAST
			vid_waitvbl();
#else
			SDL_Delay(50);
#endif
			SDL_FillRect(text_screen,NULL,0xFFFFFFFF);
			SDL_BlitSurface(sur,NULL,text_screen,&r);
			fade16(text_screen,i);
			text_flip();
		}
		for(i=128;i>-8;i-=8)
		{
#ifdef DREAMCAST
			vid_waitvbl();
#else
			SDL_Delay(50);
#endif
			text_draw_background();
			fade16(text_screen,i);
			text_flip();
		}
		SDL_FreeSurface(sur);
#else
#if !defined (DREAMCAST) && !defined (GP2X)
		chdir("example");
#else
#ifdef DREAMCAST
		fs_chdir("/cd");
#endif
#endif
#endif
skipintro:
		for(i=0;i<10;i++)
		{
			SDL_Event ev;
			if (!uae4all_init_rom(romfile))
				break;

			text_draw_background();
			text_draw_window(54,91,250,64,"--- ERROR ---");
			write_text(11,14,"KICK.ROM not found");
			write_text(8,16,"Press any button to retry");
			text_flip();
			SDL_Delay(333);
			while(SDL_PollEvent(&ev))
#ifndef DREAMCAST
				if (ev.type==SDL_QUIT)
					exit(1);
				else
#endif
				SDL_Delay(10);
			while(!SDL_PollEvent(&ev))
				SDL_Delay(10);
			while(SDL_PollEvent(&ev))
				if (ev.type==SDL_QUIT)
					exit(1);
			text_draw_background();
			text_flip();
			SDL_Delay(333);
		}
		if (i>=10)
			exit(1);
	}
	else
	{
		SDL_FillRect(text_screen,NULL,0xFFFFFFFF);
		text_flip();
		uae4all_resume_music();
	}
	menu_msg_time=SDL_GetTicks();
}
Ejemplo n.º 4
0
void init_text(int splash)
{
	char fname[256];
	
	SDL_Surface *tmp;

	if (!text_screen)
	{
		text_screen=SDL_CreateRGBSurface(prSDLScreen->flags,prSDLScreen->w,prSDLScreen->h,prSDLScreen->format->BitsPerPixel,prSDLScreen->format->Rmask,prSDLScreen->format->Gmask,prSDLScreen->format->Bmask,prSDLScreen->format->Amask);
		window_screen=SDL_CreateRGBSurface(prSDLScreen->flags,prSDLScreen->w,prSDLScreen->h,prSDLScreen->format->BitsPerPixel,prSDLScreen->format->Rmask,prSDLScreen->format->Gmask,prSDLScreen->format->Bmask,prSDLScreen->format->Amask);
		tmp=SDL_LoadBMP(MENU_FILE_TEXT);
		if (text_screen==NULL || tmp==NULL)
			exit(-1);
		text_image=SDL_DisplayFormat(tmp);
		SDL_FreeSurface(tmp);
		if (text_image==NULL)
			exit(-2);
		SDL_SetColorKey(text_image,(SDL_SRCCOLORKEY | SDL_RLEACCEL),SDL_MapRGB(text_image -> format, 0, 0, 0));
		tmp=SDL_LoadBMP(MENU_FILE_BACKGROUND);
		if (tmp==NULL)
			exit(-3);
		text_background=SDL_DisplayFormat(tmp);
		SDL_FreeSurface(tmp);
		if (text_background==NULL)
			exit(-3);
		tmp=SDL_LoadBMP(MENU_FILE_WINDOW);
		if (tmp==NULL)
			exit(-4);
		SDL_Rect dest;
		dest.w=32;
		dest.h=24;
		for (int y=0;y<10;y++)
		{
			//text_window_background
			dest.y=24*y;
			for(int x=0;x<10;x++)
			{
				dest.x=32*x;
				SDL_BlitSurface(tmp,NULL,window_screen,&dest);
			}
		}
		SDL_FreeSurface(tmp);
	}
	if (splash)
	{
		SDL_Surface *sur;
		SDL_Rect r;
		int i,j;

		obten_colores();
		if (skipintro) 
			goto skipintro;
		tmp=SDL_LoadBMP(MENU_FILE_SPLASH);
		if (tmp==NULL)
			exit(-6);
		sur = SDL_DisplayFormat(tmp);
		SDL_FreeSurface(tmp);
		r.x=(text_screen->w - sur->w)/2;
		r.y=(text_screen->h - sur->h)/2;
		r.h=sur->w;
		r.w=sur->h;
		SDL_FillRect(text_screen,NULL,0xFFFFFFFF);
		for (i=128;i>-8;i-=8)
		{
			SDL_Delay(50);
			SDL_FillRect(text_screen,NULL,0xFFFFFFFF);
			SDL_BlitSurface(sur,NULL,text_screen,&r);
			fade16(text_screen,i);
			text_flip();
		}
		SDL_Delay(3000);
		for(i=0;i<128;i+=16)
		{
			SDL_Delay(50);
			SDL_FillRect(text_screen,NULL,0xFFFFFFFF);
			SDL_BlitSurface(sur,NULL,text_screen,&r);
			fade16(text_screen,i);
			text_flip();
		}
		for(i=128;i>-8;i-=8)
		{
			SDL_Delay(50);
			text_draw_background();
			fade16(text_screen,i);
			text_flip();
		}
		SDL_FreeSurface(sur);
	}
	else
	{
		SDL_FillRect(text_screen,NULL,0xFFFFFFFF);
		text_flip();
		uae4all_resume_music();
	}
skipintro:		
	menu_msg_time=SDL_GetTicks();
}
Ejemplo n.º 5
0
void init_text(int splash)
{
	SDL_Event ev;
	int toexit=0;
	SDL_Surface *sur;
	SDL_Rect r;
	int i,j;


	if (!text_screen)
	{

//		text_screen=SDL_ConvertSurface(screen,screen->format,0);
		text_screen=SDL_CreateRGBSurface(screen->flags,screen->w,screen->h,screen->format->BitsPerPixel,screen->format->Rmask,screen->format->Gmask,screen->format->Bmask,screen->format->Amask);
//		text_screen=SDL_DisplayFormat(screen);
		if (!text_screen)
		{
#ifdef STDOUTPUT
			puts("Unable to make a SDL_Surface (text_screen)");
#endif
			exit(-1);

		}
	}

#ifdef DREAMCAST
        __sdl_dc_emulate_keyboard=1;
#endif
	if (!splash)
	{
		menu_raise();
		return;
	}

	text_image2=load_img_0(MENU_FILE_TEXT2);
	font_inv.Surface=text_image2;
	SFont_InitFontInfo(&font_inv);

	text_image=load_img_0(MENU_FILE_TEXT);
	SFont_InitFont(text_image);

	text_win_uleft=load_img_255(MENU_FILE_WIN_ULEFT);
	text_win_uright=load_img_255(MENU_FILE_WIN_URIGHT);
	text_win_upper=load_img_255(MENU_FILE_WIN_UPPER);
	text_win_left=load_img_255(MENU_FILE_WIN_LEFT);
	text_win_right=load_img_255(MENU_FILE_WIN_RIGHT);
	text_win_bright=load_img_255(MENU_FILE_WIN_BRIGHT);
	text_win_bleft=load_img_255(MENU_FILE_WIN_BLEFT);
	text_win_bottom=load_img_255(MENU_FILE_WIN_BOTTOM);
	text_cdrom=menu_IMG_Load(MENU_FILE_LOADING);

	init_background();

	obten_colores();
	sound_play_menu_music();
#ifndef AUTO_EVENTS
	sur=menu_IMG_Load(MENU_FILE_SPLASH);
	r.x=(text_screen->w - sur->w)/2;
	r.y=(text_screen->h - sur->h)/2;
	r.h=sur->w;
	r.w=sur->h;
	SDL_FillRect(text_screen,NULL,0); //0xFFFFFFFF);
	while(SDL_PollEvent(&ev)) SDL_Delay(50);
	for (i=128;(i>-8)&&(!toexit);i-=8)
	{
#ifdef DREAMCAST
		vid_waitvbl();
#else
		SDL_Delay(50);
#endif
		SDL_FillRect(text_screen,NULL,0); //0xFFFFFFFF);
		SDL_BlitSurface(sur,NULL,text_screen,&r);
		fade16(text_screen,i);
		text_flip();
		while(SDL_PollEvent(&ev)) toexit=1;
	}
	for(i=0;(i<23)&&(!toexit);i++)
	{
		while(SDL_PollEvent(&ev)) toexit=1;
		SDL_Delay(100);
	}
	for(i=0;(i<128)&&(!toexit);i+=16)
	{
#ifdef DREAMCAST
		vid_waitvbl();
#else
		SDL_Delay(50);
#endif
		SDL_FillRect(text_screen,NULL,0); //0xFFFFFFFF);
		SDL_BlitSurface(sur,NULL,text_screen,&r);
		fade16(text_screen,i);
		text_flip();
		while(SDL_PollEvent(&ev)) toexit=1;
	}
	for(i=128;(i>-8)&&(!toexit);i-=8)
	{
#ifdef DREAMCAST
		vid_waitvbl();
#else
		SDL_Delay(50);
#endif
		text_draw_background();
		fade16(text_screen,i);
		text_flip();
		while(SDL_PollEvent(&ev)) toexit=1;
	}
	SDL_FreeSurface(sur);
#else
#ifndef DREAMCAST
	chdir(ROM_PREFIX);
#else
//	fs_chdir(ROM_PREFIX);
	fs_chdir("/");//ROM_PREFIX);
#endif
#endif
//	menu_msg_time=SDL_GetTicks();
}