Exemplo n.º 1
0
static void ApplyChanges( void *unused )
{
    float gamma;

    /*
    ** invert sense so greater = brighter, and scale to a range of 0.5 to 1.3
    */
    gamma = ( 0.8f - ( s_brightness_slider.curvalue/10.0f - 0.5f ) ) + 0.5f;

    Cvar_SetValue( "vid_gamma", gamma );
    Cvar_SetValue( "sw_stipplealpha", s_stipple_box.curvalue );
    Cvar_SetValue( "gl_picmip", 3 - s_tq_slider.curvalue );
    Cvar_SetValue( "vid_fullscreen", s_fs_box.curvalue );
    Cvar_SetValue( "gl_finish", s_finish_box.curvalue );

#ifndef GL_QUAKE
    if(s_mode_list.curvalue == RMODES)
        Cvar_SetValue( "sw_mode", -1 );
    else
        Cvar_SetValue( "sw_mode", s_mode_list.curvalue );
#else
    if(s_mode_list.curvalue == RMODES)
        Cvar_SetValue( "gl_mode", -1 );
    else
        Cvar_SetValue( "gl_mode", s_mode_list.curvalue );

    switch ( s_ref_list.curvalue )
    {
#ifdef _WIN32
    case REF_OPENGL:
        Cvar_Set( "gl_driver", "opengl32" );
        break;
    case REF_3DFX:
        Cvar_Set( "gl_driver", "3dfxgl" );
        break;
    case REF_POWERVR:
        Cvar_Set( "gl_driver", "pvrgl" );
        break;
#else
    case REF_OPENGLX :
        Cvar_Set( "gl_driver", "libGL.so" );
        break;

    case REF_MESA3DGLX :
        Cvar_Set( "gl_driver", "libMesaGL.so.2" );
        break;
#endif
    }
    if ( gl_driver->modified )
        VID_Restart_f ();
#endif


    M_ForceMenuOff();
}
Exemplo n.º 2
0
void Q3E_OGLRestart()
{
VID_Restart_f();
}
Exemplo n.º 3
0
/*
================
VID_MenuKey
================
*/
static void VID_MenuKey (int key)
{
	switch (key)
	{
	case K_ESCAPE:
		vid_cursor = (num_fmodes) ? 0 : VID_RESOLUTION;
		M_Menu_Options_f ();
		return;

	case K_ENTER:
		switch (vid_cursor)
		{
		case VID_RESET:
			vid_menu_fs = (modestate != MS_WINDOWED);
			vid_menunum = vid_modenum;
			vid_cursor = (num_fmodes) ? 0 : VID_RESOLUTION;
			break;
		case VID_APPLY:
			if (need_apply)
			{
				Cvar_SetValue("vid_mode", vid_menunum);
				Cvar_SetValue("vid_config_fscr", vid_menu_fs);
				VID_Restart_f();
			}
			vid_cursor = (num_fmodes) ? 0 : VID_RESOLUTION;
			break;
		}
		return;

	case K_LEFTARROW:
		switch (vid_cursor)
		{
		case VID_FULLSCREEN:
			vid_menu_fs = !vid_menu_fs;
			if (fs_toggle_works)
				VID_ToggleFullscreen();
			break;
		case VID_RESOLUTION:
			S_LocalSound ("raven/menu1.wav");
			vid_menunum--;
			if (vid_menunum < 0)
				vid_menunum = 0;
			break;
		}
		return;

	case K_RIGHTARROW:
		switch (vid_cursor)
		{
		case VID_FULLSCREEN:
			vid_menu_fs = !vid_menu_fs;
			if (fs_toggle_works)
				VID_ToggleFullscreen();
			break;
		case VID_RESOLUTION:
			S_LocalSound ("raven/menu1.wav");
			vid_menunum++;
			if (vid_menunum >= *nummodes)
				vid_menunum = *nummodes - 1;
			break;
		}
		return;

	case K_UPARROW:
		S_LocalSound ("raven/menu1.wav");
		vid_cursor--;
		if (vid_cursor < 0)
		{
			vid_cursor = (need_apply) ? VID_ITEMS-1 : VID_BLANKLINE-1;
		}
		else if (vid_cursor == VID_BLANKLINE)
		{
			vid_cursor--;
		}
		break;

	case K_DOWNARROW:
		S_LocalSound ("raven/menu1.wav");
		vid_cursor++;
		if (vid_cursor >= VID_ITEMS)
		{
			vid_cursor = (num_fmodes) ? 0 : VID_RESOLUTION;
			break;
		}
		if (vid_cursor >= VID_BLANKLINE)
		{
			if (need_apply)
			{
				if (vid_cursor == VID_BLANKLINE)
					vid_cursor++;
			}
			else
			{
				vid_cursor = (num_fmodes) ? 0 : VID_RESOLUTION;
			}
		}
		break;

	default:
		return;
	}
}