Schreibe das Hardwaregamma auf X11 um :)

This commit is contained in:
Yamagi Burmeister 2010-10-25 15:57:39 +00:00
parent 6e13a06b06
commit 6db456587c
5 changed files with 18 additions and 21 deletions

View file

@ -60,7 +60,7 @@ OGGCFLAGS = -I/usr/include -I/usr/local/include
SDLCFLAGS := $(shell sdl-config --cflags)
# Client
CFLAGS_CLIENT = $(CFLAGS_BASE)
CFLAGS_CLIENT = $(CFLAGS_BASE)
# Dedicated Server
CFLAGS_DEDICATED_SERVER = $(CFLAGS_BASE)
@ -82,11 +82,13 @@ CFLAGS_GAME += -fPIC
# Linux
ifeq ($(OSTYPE),Linux)
LDFLAGS=-lm -ldl
X11LDFLAGS=-L/usr/lib -lXxf86vm -lX11
endif
# FreeBSD
ifeq ($(OSTYPE),FreeBSD)
LDFLAGS=-lm
LDFLAGS=-L/usr/local/lib -lm -lXxf86vm -lX11
X11LDFLAGS=-L/usr/local/lib -lXxf86vm -lX11
endif
# OGG/Vorbis
@ -1082,7 +1084,7 @@ release/quake2 : $(CLIENT_OBJS) $(COMMON_OBJS) $(GAME_ABI_OBJS) \
$(SERVER_OBJS) $(POSIX_OBJS) $(SDL_OBJS)
$(CC) $(CFLAGS_CLIENT) -o $@ $(CLIENT_OBJS) $(COMMON_OBJS) $(GAME_ABI_OBJS) \
$(SERVER_OBJS) $(POSIX_OBJS) $(SDL_OBJS) $(LDFLAGS) \
$(SDLLDFLAGS) $(OGGLDFLAGS) $(ZLIBLDFLAGS)
$(SDLLDFLAGS) $(OGGLDFLAGS) $(ZLIBLDFLAGS) $(X11LDFLAGS)
# Dedicated Server
release/q2ded : $(DEDICATED_SERVER_OBJS) $(DEDICATED_SERVER_COMMON_OBJS) \

View file

@ -115,11 +115,8 @@ BrightnessCallback ( void *s )
s_brightness_slider [ 0 ].curvalue = s_brightness_slider [ 1 ].curvalue;
}
if ( ( strcasecmp( vid_ref->string, "glx" ) == 0 ) )
{
float gamma = ( 0.8 - ( slider->curvalue / 10.0 - 0.5 ) ) + 0.5;
Cvar_SetValue( "vid_gamma", gamma );
}
float gamma = slider->curvalue / 10.0;
Cvar_SetValue( "vid_gamma", gamma );
}
static void
@ -142,7 +139,6 @@ ApplyChanges ( void *unused )
/* invert sense so greater = brighter, and scale to a range of 0.5 to 1.3 */
gamma = ( 0.8 - ( s_brightness_slider [ s_current_menu_index ].curvalue / 10.0 - 0.5 ) ) + 0.5;
Cvar_SetValue( "vid_gamma", gamma );
Cvar_SetValue( "gl_picmip", 3 - s_tq_slider.curvalue );
Cvar_SetValue( "vid_fullscreen", s_fs_box [ s_current_menu_index ].curvalue );
Cvar_SetValue( "gl_ext_palettedtexture", s_paletted_texture_box.curvalue );
@ -329,9 +325,9 @@ VID_MenuInit ( void )
s_brightness_slider [ i ].generic.y = 30;
s_brightness_slider [ i ].generic.name = "brightness";
s_brightness_slider [ i ].generic.callback = BrightnessCallback;
s_brightness_slider [ i ].minvalue = 5;
s_brightness_slider [ i ].maxvalue = 13;
s_brightness_slider [ i ].curvalue = ( 1.3 - vid_gamma->value + 0.5 ) * 10;
s_brightness_slider [ i ].minvalue = 1;
s_brightness_slider [ i ].maxvalue = 20;
s_brightness_slider [ i ].curvalue = vid_gamma->value * 10;
s_fs_box [ i ].generic.type = MTYPE_SPINCONTROL;
s_fs_box [ i ].generic.x = 0;

View file

@ -1143,14 +1143,7 @@ R_InitImages ( void )
registration_sequence = 1;
/* init intensity conversions */
if ( gl_config.mtexcombine )
{
intensity = ri.Cvar_Get( "intensity", "3", CVAR_ARCHIVE );
}
else
{
intensity = ri.Cvar_Get( "intensity", "2", CVAR_ARCHIVE );
}
intensity = ri.Cvar_Get( "intensity", "2", CVAR_ARCHIVE );
if ( intensity->value <= 1 )
{

View file

@ -985,7 +985,7 @@ R_Register ( void )
gl_ext_swapinterval = ri.Cvar_Get( "gl_ext_swapinterval", "1", CVAR_ARCHIVE );
gl_ext_palettedtexture = ri.Cvar_Get( "gl_ext_palettedtexture", "1", CVAR_ARCHIVE );
gl_ext_multitexture = ri.Cvar_Get( "gl_ext_multitexture", "1", CVAR_ARCHIVE );
gl_ext_multitexture = ri.Cvar_Get( "gl_ext_multitexture", "0", CVAR_ARCHIVE );
gl_ext_pointparameters = ri.Cvar_Get( "gl_ext_pointparameters", "1", CVAR_ARCHIVE );
gl_ext_compiled_vertex_array = ri.Cvar_Get( "gl_ext_compiled_vertex_array", "1", CVAR_ARCHIVE );
gl_ext_mtexcombine = ri.Cvar_Get( "gl_ext_mtexcombine", "1", CVAR_ARCHIVE );

View file

@ -132,6 +132,9 @@ UpdateHardwareGamma(void)
x11_gamma.blue = gamma;
XF86VidModeSetGamma(dpy, screen, &x11_gamma);
/* This forces X11 to update the gamma tables */
XF86VidModeGetGamma(dpy, screen, &x11_gamma);
}
/*
@ -291,6 +294,9 @@ void GLimp_Shutdown( void )
if (gl_state.hwgamma == true)
{
XF86VidModeSetGamma(dpy, screen, &x11_oldgamma);
/* This forces X11 to update the gamma tables */
XF86VidModeGetGamma(dpy, screen, &x11_oldgamma);
}