Пример #1
0
int startupmenu(int i)
{
	while (1) {
		drawbox(5, STARTUP_Y-2, 22, STARTUP_N+4, NULL);
		printmenuhelp(19);
		i = startup_menu(i-1, 8, STARTUP_Y);
# ifndef TTY_SOCKET
		if (!i)
			break;
# else
		if (i==2 && !select_2p_tty(24, STARTUP_Y+1))
			continue;
		if (!i) {
			setcurs(5, STARTUP_Y-2);
			wclrtobot(window);
			if ((i = menu_checkinvit(1, 7)) == -1) {
				refresh();
				setwcurs(0, 5, 7);
				i = 1;
				continue;
			}
			if (!i)
				break;
		}
		move(term_height-1, 0);
		clrtoeol();
		refresh();
# endif
		setcurs(5, STARTUP_Y-2);
		wclrtobot(window);
		break;
	}
	return i;
}
Пример #2
0
int startupmenu(int i)
{
	while (1) {
		drawbox(5, STARTUP_Y-2, 22, STARTUP_N+4, NULL);
		printmenuhelp(19);
		i = startup_menu(i-1, 8, STARTUP_Y);
# ifndef TTY_SOCKET
		if (!i)
			break;
# else
		if (i==2 && !select_2p_tty(24, STARTUP_Y+1))
			continue;
		if (!i) {
			clearbox(0, 6, 0, 16);
			if ((i = menu_checkinvit(1, 7)) == -1) {
				i = 1;
				continue;
			}
			if (!i)
				break;
		}
		setcurs_end();
		cleartoeol();
		textgfx_entermenu();
# endif
		clearbox(0, 6, 0, 16);
		break;
	}
	return i;
}
Пример #3
0
int startupmenu(int i)
{
	while (1) {
		print_vitetris_ver(19, 4);
		newln(0);
		newln(19);
		printstr("Written by"); newln(19);
		printstr("Victor Nilsson"); newln(19);
		printstr("2007-2009");
		i = startup_menu(i-1, 1, 4);
# ifndef TTY_SOCKET
		if (!i)
			break;
# else
		if (i==2 && !select_2p_tty(17, 5))
			continue;
		if (!i && (i = menu_checkinvit(1, 4)) == -1) {
			i = 1;
			continue;
		}
		if (!i)
			break;
		setcurs_end();
		printf("\033[K");
# endif
		clearbox(0, 4, 0, menuheight-4);
		break;
	}
	return i;
}
Пример #4
0
int main(void)
{

/*
The following code is for use if your system is set up to prevent an application writing to its own directory.
Normally this will prevent highscores and key configurations being saved, but the following code puts the
initfile in a better place. This may be a default on some systems (eg Unixes and possibly Windows Vista)
and can be set on some other systems.

The only problem with this is that you'll have to manually type or copy the various other options (windowed,
vsync, joystick buttons etc) into the initfile in this new location (or just copy the initfile across, or
just rely on the default values and let the game make a new initfile).

Thanks to Thomas Harte for this code! I had no idea it was necessary (it isn't on my Windows XP computer, and
I haven't tested it).

*/




int allint =  allegro_init();
   if (allint == -1)
   {
      set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
      allegro_message("Failed to initialise Allegro! This isn't going to work, sorry.");
      exit(1);
   }

//#define UNIX_OSX_VISTA_ETC

#ifdef UNIX_OSX_VISTA_ETC

   {

//     char *HPath = getenv("HOME");

// use this if for some reason you're running Windows Vista:
        char *HPath = getenv("APPDATA");

	 char ConfigPath[2048];

	 sprintf(ConfigPath, "%s/.Hspider", HPath);
	 set_config_file(ConfigPath);

   }
#else
   set_config_file("init.txt");
#endif

   install_keyboard();
   install_timer();

   three_finger_flag = 0;
   key_led_flag = 0;

 init_at_startup();

// now we've initialised, let's play the game!
// game_loop();
 startup_menu();

 return 0;

}