Esempio n. 1
0
void
mousemenu(void)
{
	if (mouse == YES) {
		if (changing == YES) {
			loadmenu(changemenu);
		}
		else {
			loadmenu(mainmenu);
		}
	}
}
Esempio n. 2
0
int menudraw1(void){
  int x;
loadmenu();
  menulist[0] = "Start game";
  
  menulist[1] = course[loadc].name;
  
  if(fullscreen == 1)
    menulist[2] = "Fullscreen";
  else
    menulist[2] = "Windowed";

  sprintf(res,"%ix%i",xres,yres);
  menulist[3] = res;
  
  menulist[4] = "Exit Game";
menulist[5]="First Person";
menulist[6]="Third person";
  
  orthosetup();
    glBindTexture(GL_TEXTURE_2D, texture[1]);
    glBegin(GL_QUADS);
      glTexCoord2f(0.0f,1.0f); glVertex2i(0,   0   );
      glTexCoord2f(0.0f,0.0f); glVertex2i(0,   yres);
      glTexCoord2f(1.0f,0.0f); glVertex2i(xres,yres);
      glTexCoord2f(1.0f,1.0f); glVertex2i(xres,0   );
    glEnd();
  orthoreset();

  glEnable(GL_BLEND);
    glColor3f(1.0f, 1.0f, 1.0f);
    fontprint(xres/2-(4.5*20), yres-80, "You lose",0,1,1);
    glColor3f(1.0f,0.0f,0.0f);
    fontprint(xres/2-(4.5*20)+2, yres-78, "You Lose",0,1,1);


    fontprint(xres/2-80, yres-130 - (25*menuitem), "o",0,0.5,0);
    glColor3f(1.0f, 1.0f, 0.0f);
    fontprint(xres/2-78, yres-128 - (25*menuitem), "o",0,0.5,0);

    glColor3f(0.0f, 0.0f, 1.0f);
    for(x=0; x<MENU_ITEMS; x++)
      fontprint(xres/2 - 60, yres-130 - (25*x), menulist[x],0,0.5,0);

    glColor3f(1.0f, 1.0f, 1.0f);
    for(x=0; x<MENU_ITEMS; x++)
      fontprint(xres/2 - 58, yres-128 - (25*x), menulist[x],0,0.5,0);

  glDisable(GL_BLEND);

  SDL_GL_SwapBuffers();
  SDL_Delay(10); /* Menu doesnt need high framerate */
  return 1;
}
Esempio n. 3
0
void MainMenu ()
{
  s8 ret;
  u8 quit = 0;
  menu = 0;
#ifdef HW_RVL
  u8 count = 6;
  char items[6][20] =
#else
  u8 count = 5;
  char items[5][20] =
#endif
  {
    {"Play Game"},
    {"Hard Reset"},
    {"Load New Game"},
    {"Emulator Options"},
#ifdef HW_RVL
    {"Return to Loader"},
#endif
    {"System Reboot"}
  };

  /* 50 hz TV mode */
  if (gc_pal)
  {
    VIDEO_Configure (vmode);
    VIDEO_ClearFrameBuffer(vmode, xfb[whichfb], COLOR_BLACK);
    VIDEO_Flush();
    VIDEO_WaitVSync();
    VIDEO_WaitVSync();
  }

  /* autosave (SRAM only) */
  int temp = config.freeze_auto;
  config.freeze_auto = -1;
  memfile_autosave();
  config.freeze_auto = temp;

  
  while (quit == 0)
  {
    strcpy (menutitle, "Version 1.04.2");  
    ret = DoMenu (&items[0], count);

    switch (ret)
    {
      case -1: /*** Button B ***/
      case 0:  /*** Play Game ***/
        quit = 1;
        break;

      case 1:
        emu_reset();
        quit = 1;
        break;
 
      case 2:  /*** Load ROM Menu ***/
        quit = loadmenu();
        break;

      case 3:  /*** Emulator Options */
        Emu_options();
        break;

      case 4:  /*** SD/PSO/TP Reload ***/
        memfile_autosave();
        VIDEO_ClearFrameBuffer(vmode, xfb[whichfb], COLOR_BLACK);
        VIDEO_Flush();
        VIDEO_WaitVSync();
#ifdef HW_RVL
        DI_Close();
        exit(0);
        break;

      case 5:  /*** Return to Wii System Menu ***/
        memfile_autosave();
        VIDEO_ClearFrameBuffer(vmode, xfb[whichfb], COLOR_BLACK);
        VIDEO_Flush();
        VIDEO_WaitVSync();
        DI_Close();
        SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
#else
        SYS_ResetSystem(SYS_HOTRESET,0,0);
#endif
        break;
    }
  }
  
  /*** Remove any still held buttons ***/
  while (PAD_ButtonsHeld(0)) PAD_ScanPads();
#ifdef HW_RVL
  while (WPAD_ButtonsHeld(0)) WPAD_ScanPads();
#endif

  /*** Restore fullscreen 50hz ***/
  if (gc_pal)
  {
    extern GXRModeObj TV50hz_576i;
    GXRModeObj *rmode = &TV50hz_576i;
    Mtx p;

    rmode->xfbHeight = 574;
    rmode->viYOrigin = 0;
    rmode->viHeight = 574;
    VIDEO_Configure (rmode);
    VIDEO_ClearFrameBuffer(rmode, xfb[whichfb], COLOR_BLACK);
    VIDEO_Flush();
    VIDEO_WaitVSync();
    VIDEO_WaitVSync();

    /* reset rendering mode */
    GX_SetViewport (0.0F, 0.0F, rmode->fbWidth, rmode->efbHeight, 0.0F, 1.0F);
    GX_SetScissor (0, 0, rmode->fbWidth, rmode->efbHeight);
    f32 yScale = GX_GetYScaleFactor(rmode->efbHeight, rmode->xfbHeight);
    u16 xfbHeight = GX_SetDispCopyYScale (yScale);
    GX_SetDispCopySrc (0, 0, rmode->fbWidth, rmode->efbHeight);
    GX_SetDispCopyDst (rmode->fbWidth, xfbHeight);
    GX_SetCopyFilter (rmode->aa, rmode->sample_pattern, GX_TRUE, rmode->vfilter);
    GX_SetFieldMode (rmode->field_rendering, ((rmode->viHeight == 2 * rmode->xfbHeight) ? GX_ENABLE : GX_DISABLE));
    GX_SetPixelFmt (GX_PF_RGB8_Z24, GX_ZC_LINEAR);
    guOrtho(p, rmode->efbHeight/2, -(rmode->efbHeight/2), -(rmode->fbWidth/2), rmode->fbWidth/2, 100, 1000);
    GX_LoadProjectionMtx (p, GX_ORTHOGRAPHIC);

  }

#ifndef HW_RVL
  /*** Stop the DVD from causing clicks while playing ***/
  uselessinquiry ();
#endif
}
Esempio n. 4
0
void
mouseinit(void)
{
	char	*term;

	/* see if this is emacsterm or viterm */
	term = mygetenv("TERM", "");
	if (strcmp(term, "emacsterm") == 0 || 
	    strcmp(term, "viterm") == 0) {
		emacsviterm = YES;
		mouse = YES;
	}
	/* the MOUSE enviroment variable is for 5620 terminal programs that have
	   mouse support but the TERM environment variable is the same as a
	   terminal without a mouse, such as myx */
	else if (strcmp(mygetenv("MOUSE", ""), "myx") == 0) {
		mouse = YES;
	}
#if UNIXPC
	else if (strcmp(term,"s4") == 0 || 
	         strcmp(term,"s120") == 0 ||
	         strcmp(term,"s90") == 0) {
		int retval;
		struct uwdata uwd;	/* Window data structure */
		struct umdata umd;	/* Mouse data structure */

		/* Ask for character size info */
			
		retval = ioctl(1,WIOCGETD,&uwd);
		if(retval || uwd.uw_hs <= 0 || uwd.uw_vs <= 0) {
			/**************************************************
			 * something wrong with the kernel, so fake it... 
			 **************************************************/
			if(!strcmp(term,"s4")) {
				uw_hs = 9;
				uw_vs = 12;
			}
			else {
				uw_hs = 6;
				uw_vs = 10;
			}
		}
		else {
			/* Kernel is working and knows about this font */
			uw_hs = uwd.uw_hs;
			uw_vs = uwd.uw_vs;
		}
		
		/**************************************************
		 * Now turn on mouse reporting so we can actually
		 * make use of all this stuff.
		 **************************************************/
		if((retval = ioctl(1,WIOCGETMOUSE,&umd)) != -1) {
			umd.um_flags= MSDOWN+MSUP;
			ioctl(1,WIOCSETMOUSE,&umd);
		}
		unixpcmouse = YES;
	}
#endif
	if (mouse == YES) {
		loadmenu(mainmenu);
	}
}