Beispiel #1
0
/*
 * Function
 *	TorcsMainMenuInit
 *
 * Description
 *	init the main menus
 *
 * Parameters
 *	none
 *
 * Return
 *	0 ok -1 nok
 *
 * Remarks
 *	
 */
int
TorcsMainMenuInit(void)
{
	if (getTextOnly())
		ReSinglePlayerInit(NULL);
	else
	{
	    menuHandle = GfuiScreenCreateEx((float*)NULL, 
					    NULL, TorcsMainMenuActivate, 
					    NULL, (tfuiCallback)NULL, 
					    1);

	    GfuiScreenAddBgImg(menuHandle, "data/img/splash-main.png");

	    GfuiTitleCreate(menuHandle, "TORCS", 0);

	    GfuiLabelCreate(menuHandle,
			    "The Open Racing Car Simulator",
			    GFUI_FONT_LARGE,
			    320,
			    420,
			    GFUI_ALIGN_HC_VB,
			    0);

	    GfuiMenuButtonCreate(menuHandle,
				 "Race", "Races Menu",
				 ReSinglePlayerInit(menuHandle), GfuiScreenActivate);

	    GfuiMenuButtonCreate(menuHandle,
				 "Configure Players", "Players configuration menu",
				 TorcsDriverMenuInit(menuHandle), GfuiScreenActivate);

	    GfuiMenuButtonCreate(menuHandle,
				 "Options", "Configure",
				 TorcsOptionOptionInit(menuHandle), GfuiScreenActivate);
	    
	    GfuiMenuDefaultKeysAdd(menuHandle);

	    GfuiMenuBackQuitButtonCreate(menuHandle,
					 "Quit", "Quit TORCS",
					 TorcsMainExitMenuInit(menuHandle), GfuiScreenActivate);
	}

    return 0;
}
Beispiel #2
0
/*
 * Function
 *	TorcsMainMenuInit
 *
 * Description
 *	init the main menus
 *
 * Parameters
 *	none
 *
 * Return
 *	0 ok -1 nok
 *
 * Remarks
 *	
 */
int
TorcsMainMenuInit(void)
{
    menuHandle = GfuiScreenCreateEx((float*)NULL, 
				    NULL, TorcsMainMenuActivate, 
				    NULL, (tfuiCallback)NULL, 
				    1);

    GfuiScreenAddBgImg(menuHandle, "data/img/splash-main.png");

    GfuiTitleCreate(menuHandle, "TORCS Adaptive", 0);

    GfuiLabelCreate(menuHandle,
		    "A TORCS Modification with procedural tracks",
		    GFUI_FONT_LARGE,
		    320,
		    420,
		    GFUI_ALIGN_HC_VB,
		    0);

    GfuiMenuButtonCreate(menuHandle,
			 "Race", "Races Menu",
			 ReSinglePlayerInit(menuHandle), GfuiScreenActivate);

    GfuiMenuButtonCreate(menuHandle,
			 "Configure Players", "Players configuration menu",
			 TorcsDriverMenuInit(menuHandle), GfuiScreenActivate);

    GfuiMenuButtonCreate(menuHandle,
			 "Options", "Configure",
			 TorcsOptionOptionInit(menuHandle), GfuiScreenActivate);
    
    GfuiMenuDefaultKeysAdd(menuHandle);

    GfuiMenuBackQuitButtonCreate(menuHandle,
				 "Quit", "Quit TORCS",
				 TorcsMainExitMenuInit(menuHandle), GfuiScreenActivate);
	
    return 0;
}