From: Holger Z. <hz...@us...> - 2005-01-12 08:36:31
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29108/src/jake2/client Modified Files: Menu.java VID.java Log Message: dynamic video menu Index: Menu.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Menu.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Menu.java 11 Jan 2005 14:24:59 -0000 1.14 --- Menu.java 12 Jan 2005 08:36:21 -0000 1.15 *************** *** 1431,1444 **** } ! static String cd_music_items[] = { "disabled", "enabled", null }; ! ! static String soundstate_items[] = { "on", "off", null }; static String compatibility_items[] = { "max compatibility", ! "max performance", null }; ! static String yesno_names[] = { "no", "yes", null }; ! static String crosshair_names[] = { "none", "cross", "dot", "angle", null }; static void Options_MenuInit() { --- 1431,1442 ---- } ! static String cd_music_items[] = { "disabled", "enabled" }; static String compatibility_items[] = { "max compatibility", ! "max performance" }; ! static String yesno_names[] = { "no", "yes" }; ! static String crosshair_names[] = { "none", "cross", "dot", "angle" }; static void Options_MenuInit() { *************** *** 2022,2026 **** static String difficulty_names[] = { "easy", "medium", ! "fuckin shitty hard", null }; static void Game_MenuInit() { --- 2020,2024 ---- static String difficulty_names[] = { "easy", "medium", ! "fuckin shitty hard" }; static void Game_MenuInit() { *************** *** 2697,2705 **** } ! static String dm_coop_names[] = { "deathmatch", "cooperative", null }; ! static String dm_coop_names_rogue[] = { "deathmatch", "cooperative", "tag", ! // "deathball", ! null }; static void StartServer_MenuInit() { --- 2695,2701 ---- } ! static String dm_coop_names[] = { "deathmatch", "cooperative" }; ! static String dm_coop_names_rogue[] = { "deathmatch", "cooperative", "tag" }; static void StartServer_MenuInit() { *************** *** 2744,2748 **** Com.Error(ERR_DROP, "no maps in maps.lst\n"); ! mapnames = new String[nummaps + 1]; for (i = 0; i < nummaps; i++) { --- 2740,2744 ---- Com.Error(ERR_DROP, "no maps in maps.lst\n"); ! mapnames = new String[nummaps]; for (i = 0; i < nummaps; i++) { *************** *** 2756,2760 **** mapnames[i] = scratch; } - mapnames[nummaps] = null; if (fp != null) { --- 2752,2755 ---- *************** *** 3095,3099 **** //static String yes_no_names[] = { "no", "yes", 0 }; ! static String teamplay_names[] = { "disabled", "by skin", "by model", null }; static void DMOptions_MenuInit() { --- 3090,3094 ---- //static String yes_no_names[] = { "no", "yes", 0 }; ! static String teamplay_names[] = { "disabled", "by skin", "by model" }; static void DMOptions_MenuInit() { *************** *** 3450,3454 **** } ! static String yes_no_names[] = { "no", "yes", null }; static void DownloadOptions_MenuInit() { --- 3445,3449 ---- } ! static String yes_no_names[] = { "no", "yes" }; static void DownloadOptions_MenuInit() { *************** *** 3720,3724 **** static String rate_names[] = { "28.8 Modem", "33.6 Modem", "Single ISDN", ! "Dual ISDN/Cable", "T1/LAN", "User defined", null }; static void DownloadOptionsFunc(Object self) { --- 3715,3719 ---- static String rate_names[] = { "28.8 Modem", "33.6 Modem", "Single ISDN", ! "Dual ISDN/Cable", "T1/LAN", "User defined" }; static void DownloadOptionsFunc(Object self) { *************** *** 3926,3930 **** } ! static String handedness[] = { "right", "left", "center", null }; static boolean PlayerConfig_MenuInit() { --- 3921,3925 ---- } ! static String handedness[] = { "right", "left", "center" }; static boolean PlayerConfig_MenuInit() { *************** *** 4900,4905 **** if (s.curvalue < 0) s.curvalue = 0; ! else if (s.curvalue >= s.itemnames.length) ! s.curvalue = s.itemnames.length - 1; if (s.callback != null) --- 4895,4900 ---- if (s.curvalue < 0) s.curvalue = 0; ! else if (s.curvalue >= s.itemnames.length || s.itemnames[s.curvalue] == null) ! s.curvalue--; if (s.callback != null) Index: VID.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/VID.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** VID.java 12 Jan 2005 00:40:14 -0000 1.13 --- VID.java 12 Jan 2005 08:36:21 -0000 1.14 *************** *** 436,495 **** Cvar.SetValue( "_windowed_mouse", s_windowed_mouse.curvalue); ! switch ( s_ref_list.curvalue ) ! { ! // case REF_SOFT: ! // Cvar_Set( "vid_ref", "soft" ); ! // break; ! // case REF_SOFTX11: ! // Cvar_Set( "vid_ref", "softx" ); ! // break; ! // ! // case REF_MESA3D : ! // Cvar_Set( "vid_ref", "gl" ); ! // Cvar_Set( "gl_driver", "libMesaGL.so.2" ); ! // if (gl_driver->modified) ! // vid_ref->modified = true; ! // break; ! // ! // case REF_OPENGLX : ! // Cvar_Set( "vid_ref", "glx" ); ! // Cvar_Set( "gl_driver", "libGL.so" ); ! // if (gl_driver->modified) ! // vid_ref->modified = true; ! // break; ! // ! // case REF_MESA3DGLX : ! // Cvar_Set( "vid_ref", "glx" ); ! // Cvar_Set( "gl_driver", "libMesaGL.so.2" ); ! // if (gl_driver->modified) ! // vid_ref->modified = true; ! // break; ! // ! // case REF_3DFXGL : ! // Cvar_Set( "vid_ref", "gl" ); ! // Cvar_Set( "gl_driver", "lib3dfxgl.so" ); ! // if (gl_driver->modified) ! // vid_ref->modified = true; ! // break; ! case REF_OPENGL_JOGL : ! Cvar.Set( "vid_ref", "jogl" ); ! Cvar.Set( "gl_driver", "jogl" ); ! if (gl_driver.modified) ! vid_ref.modified = true; ! break; ! case REF_OPENGL_FASTJOGL : ! Cvar.Set( "vid_ref", "fastjogl" ); ! Cvar.Set( "gl_driver", "fastjogl" ); ! if (gl_driver.modified) ! vid_ref.modified = true; ! break; ! case REF_OPENGL_LWJGL : ! Cvar.Set( "vid_ref", "lwjgl" ); ! Cvar.Set( "gl_driver", "lwjgl" ); ! if (gl_driver.modified) ! vid_ref.modified = true; ! break; ! } ! Menu.ForceMenuOff(); } --- 436,444 ---- Cvar.SetValue( "_windowed_mouse", s_windowed_mouse.curvalue); ! Cvar.Set( "vid_ref", drivers[s_ref_list.curvalue] ); ! Cvar.Set( "gl_driver", drivers[s_ref_list.curvalue] ); ! if (gl_driver.modified) ! vid_ref.modified = true; ! Menu.ForceMenuOff(); } *************** *** 513,528 **** static int mode_x; ! static final String[] refs = ! { ! // "[software ]", ! // "[software X11 ]", ! // "[Mesa 3-D 3DFX ]", ! // "[3DFXGL Miniport]", ! // "[OpenGL glX ]", ! // "[Mesa 3-D glX ]", ! "[OpenGL jogl ]", ! "[OpenGL fastjogl]", ! "[OpenGL lwjgl ]", ! }; static final String[] yesno_names = { --- 462,468 ---- static int mode_x; ! static String[] refs; ! static String[] drivers; ! static final String[] yesno_names = { *************** *** 556,559 **** --- 496,512 ---- } + private static void initRefs() { + drivers = Renderer.getDriverNames(); + refs = new String[drivers.length]; + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < drivers.length; i++) { + sb.setLength(0); + sb.append("[OpenGL ").append(drivers[i]); + while (sb.length() < 16) sb.append(" "); + sb.append("]"); + refs[i] = sb.toString(); + } + } + /* ** VID_MenuInit *************** *** 561,564 **** --- 514,519 ---- public static void MenuInit() { + initRefs(); + if ( gl_driver == null ) gl_driver = Cvar.Get( "gl_driver", Renderer.getPreferedName(), 0 ); *************** *** 598,640 **** s_screensize_slider.curvalue = (int)(SCR.scr_viewsize.value/10); ! // if ( strcmp( vid_ref->string, "soft" ) == 0) ! // { ! // s_current_menu_index = SOFTWARE_MENU; ! // s_ref_list[0].curvalue = s_ref_list[1].curvalue = REF_SOFT; ! // } ! if ( vid_ref.string.equalsIgnoreCase("jogl")) ! { ! s_ref_list.curvalue = REF_OPENGL_JOGL; ! } ! else if ( vid_ref.string.equalsIgnoreCase("fastjogl")) ! { ! s_ref_list.curvalue = REF_OPENGL_FASTJOGL; ! } ! else if ( vid_ref.string.equalsIgnoreCase("lwjgl")) ! { ! s_ref_list.curvalue = REF_OPENGL_LWJGL; } ! // else if (strcmp( vid_ref->string, "softx" ) == 0 ) ! // { ! // s_current_menu_index = SOFTWARE_MENU; ! // s_ref_list[0].curvalue = s_ref_list[1].curvalue = REF_SOFTX11; ! // } ! // else if ( strcmp( vid_ref->string, "gl" ) == 0 ) ! // { ! // s_current_menu_index = OPENGL_MENU; ! // if ( strcmp( gl_driver->string, "lib3dfxgl.so" ) == 0 ) ! // s_ref_list[s_current_menu_index].curvalue = REF_3DFXGL; ! // else ! // s_ref_list[s_current_menu_index].curvalue = REF_MESA3D; ! // } ! // else if ( strcmp( vid_ref->string, "glx" ) == 0 ) ! // { ! // s_current_menu_index = OPENGL_MENU; ! // if ( strcmp( gl_driver->string, "libMesaGL.so.2" ) == 0 ) ! // s_ref_list[s_current_menu_index].curvalue = REF_MESA3DGLX; ! // else ! // s_ref_list[s_current_menu_index].curvalue = REF_OPENGLX; ! // } ! // s_opengl_menu.x = (int)(viddef.width * 0.50f); s_opengl_menu.nitems = 0; --- 553,562 ---- s_screensize_slider.curvalue = (int)(SCR.scr_viewsize.value/10); ! for (int i = 0; i < drivers.length; i++) { ! if (vid_ref.string.equals(drivers[i])) { ! s_ref_list.curvalue = i; ! } } ! s_opengl_menu.x = (int)(viddef.width * 0.50f); s_opengl_menu.nitems = 0; |