From 112cb48660db754fd5cf67c9280ed42afb154532 Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Thu, 5 Mar 2009 15:03:56 +0000 Subject: [PATCH] =?UTF-8?q?Erster=20Versuch=20das=20Rendermen=C3=BC=20anzu?= =?UTF-8?q?passen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/posix/vid/menu.c | 77 +++----------------------------------------- 1 file changed, 5 insertions(+), 72 deletions(-) diff --git a/src/posix/vid/menu.c b/src/posix/vid/menu.c index 122a9c9a..808cada3 100644 --- a/src/posix/vid/menu.c +++ b/src/posix/vid/menu.c @@ -12,19 +12,13 @@ are present on this system */ /* this will have to be updated if ref's are added/removed from ref_t */ -#define NUMBER_OF_REFS 5 +#define NUMBER_OF_REFS 1 /* all the refs should be initially set to 0 */ static char *refs[NUMBER_OF_REFS+1] = { 0 }; /* make all these have illegal values, as they will be redefined */ -static int REF_SOFT = NUMBER_OF_REFS; -static int REF_SOFTX11 = NUMBER_OF_REFS; -static int REF_SOFTSDL = NUMBER_OF_REFS; -static int REF_GLX = NUMBER_OF_REFS; static int REF_SDLGL = NUMBER_OF_REFS; -//static int REF_FXGL = NUMBER_OF_REFS; - static int GL_REF_START = NUMBER_OF_REFS; typedef struct @@ -36,11 +30,7 @@ typedef struct static const ref_t possible_refs[NUMBER_OF_REFS] = { - { "[software ]", "soft", &REF_SOFT }, - { "[software X11 ]", "softx", &REF_SOFTX11 }, - { "[software SDL ]", "softsdl", &REF_SOFTSDL }, - { "[OpenGL GLX ]", "glx", &REF_GLX }, - { "[SDL OpenGL ]", "sdlgl", &REF_SDLGL } + { "[SDL OpenGL ]", "gl", &REF_SDLGL } }; /* @@ -118,22 +108,10 @@ static void ScreenSizeCallback( void *s ) static void BrightnessCallback( void *s ) { - menuslider_s *slider = ( menuslider_s * ) s; - if ( s_current_menu_index == 0) s_brightness_slider[1].curvalue = s_brightness_slider[0].curvalue; else s_brightness_slider[0].curvalue = s_brightness_slider[1].curvalue; - - if ( strcasecmp( vid_ref->string, "soft" ) == 0 || - strcasecmp( vid_ref->string, "softx" ) == 0 || - strcasecmp( vid_ref->string, "softsdl" ) == 0 || - strcasecmp( vid_ref->string, "glx" ) == 0 ) - { - float gamma = ( 0.8 - ( slider->curvalue/10.0 - 0.5 ) ) + 0.5; - - Cvar_SetValue( "vid_gamma", gamma ); - } } static void ResetDefaults( void *unused ) @@ -172,29 +150,9 @@ static void ApplyChanges( void *unused ) ** and not #DEFINE's (constants) */ ref = s_ref_list[s_current_menu_index].curvalue; - if ( ref == REF_SOFT ) + if ( ref == REF_SDLGL ) { - Cvar_Set( "vid_ref", "soft" ); - } - else if ( ref == REF_SOFTX11 ) - { - Cvar_Set( "vid_ref", "softx" ); - } - else if ( ref == REF_SOFTSDL ) - { - Cvar_Set( "vid_ref", "softsdl" ); - } - else if ( ref == REF_GLX ) - { - Cvar_Set( "vid_ref", "glx" ); - // below is wrong if we use different libs for different GL reflibs - Cvar_Get( "gl_driver", "libGL.so.1", CVAR_ARCHIVE ); // ??? create if it doesn't exit - if (gl_driver->modified) - vid_ref->modified = true; - } - else if ( ref == REF_SDLGL ) - { - Cvar_Set( "vid_ref", "sdlgl" ); + Cvar_Set( "vid_ref", "gl" ); // below is wrong if we use different libs for different GL reflibs Cvar_Get( "gl_driver", "libGL.so.1", CVAR_ARCHIVE ); // ??? create if it doesn't exist if (gl_driver->modified) @@ -243,12 +201,7 @@ void VID_MenuInit( void ) }; /* make sure these are invalided before showing the menu again */ - REF_SOFT = NUMBER_OF_REFS; - REF_SOFTX11 = NUMBER_OF_REFS; - REF_SOFTSDL = NUMBER_OF_REFS; - REF_GLX = NUMBER_OF_REFS; REF_SDLGL = NUMBER_OF_REFS; - GL_REF_START = NUMBER_OF_REFS; /* now test to see which ref's are present */ @@ -304,27 +257,7 @@ void VID_MenuInit( void ) s_screensize_slider[SOFTWARE_MENU].curvalue = scr_viewsize->value/10; s_screensize_slider[OPENGL_MENU].curvalue = 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; - } - 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, "softsdl" ) == 0 ) - { - s_current_menu_index = SOFTWARE_MENU; - s_ref_list[0].curvalue = s_ref_list[1].curvalue = REF_SOFTSDL; - } - else if ( strcmp( vid_ref->string, "glx" ) == 0 ) - { - s_current_menu_index = OPENGL_MENU; - s_ref_list[s_current_menu_index].curvalue = REF_GLX; - } - else if ( strcmp( vid_ref->string, "sdlgl" ) == 0 ) + if ( strcmp( vid_ref->string, "gl" ) == 0 ) { s_current_menu_index = OPENGL_MENU; s_ref_list[s_current_menu_index].curvalue = REF_SDLGL;