Den rest von Linux aufgeräumt

This commit is contained in:
Yamagi Burmeister 2009-03-04 16:15:53 +00:00
parent e5594a69ed
commit 7784426a43
3 changed files with 20 additions and 91 deletions

View file

@ -106,6 +106,7 @@ client:
build/posix \
build/posix/glob \
build/posix/sdl \
build/posix/vid \
build/server
$(MAKE) build/client/quake2
@ -184,12 +185,12 @@ POSIX_OBJS = \
build/posix/network.o \
build/posix/posix.o \
build/posix/system.o \
build/posix/vid_menu.o \
build/posix/vid_so.o \
build/posix/glob/glob.o \
build/posix/sdl/cd.o \
build/posix/sdl/sound.o
build/posix/sdl/sound.o \
build/posix/vid/menu.o \
build/posix/vid/refresher.o
# ----------
# Dedicated server object
@ -364,12 +365,6 @@ build/posix/posix.o : src/platforms/posix/posix.c
build/posix/system.o : src/platforms/posix/system.c
$(CC) $(CFLAGS_CLIENT) -o $@ -c $<
build/posix/vid_menu.o : src/platforms/posix/vid_menu.c
$(CC) $(CFLAGS_CLIENT) -o $@ -c $<
build/posix/vid_so.o : src/platforms/posix/vid_so.c
$(CC) $(CFLAGS_CLIENT) -o $@ -c $<
build/posix/glob/glob.o : src/platforms/posix/glob/glob.c
$(CC) $(CFLAGS_CLIENT) -o $@ -c $<
@ -378,6 +373,12 @@ build/posix/sdl/cd.o : src/platforms/posix/sdl/cd.c
build/posix/sdl/sound.o : src/platforms/posix/sdl/sound.c
$(CC) $(CFLAGS_CLIENT) -o $@ -c $< $(SDLCFLAGS)
build/posix/vid/menu.o : src/platforms/posix/vid/menu.c
$(CC) $(CFLAGS_CLIENT) -o $@ -c $<
build/posix/vid/refresher.o : src/platforms/posix/vid/refresher.c
$(CC) $(CFLAGS_CLIENT) -o $@ -c $<
# ----------

View file

@ -1,5 +1,5 @@
#include "../../client/header/client.h"
#include "../../client/menu/qmenu.h"
#include "../../../client/header/client.h"
#include "../../../client/menu/qmenu.h"
/*
====================================================================
@ -201,33 +201,6 @@ static void ApplyChanges( void *unused )
vid_ref->modified = true;
}
#if 0
/*
** update appropriate stuff if we're running OpenGL and gamma
** has been modified
*/
if ( strcasecmp( vid_ref->string, "gl" ) == 0 )
{
if ( vid_gamma->modified )
{
vid_ref->modified = true;
if ( strcasecmp( gl_driver->string, "3dfxgl" ) == 0 )
{
char envbuffer[1024];
float g;
vid_ref->modified = true;
g = 2.00 * ( 0.8 - ( vid_gamma->value - 0.5 ) ) + 1.0F;
Com_sprintf( envbuffer, sizeof(envbuffer), "SST_GAMMA=%f", g );
putenv( envbuffer );
vid_gamma->modified = false;
}
}
}
#endif
M_ForceMenuOff();
}
@ -275,7 +248,6 @@ void VID_MenuInit( void )
REF_SOFTSDL = NUMBER_OF_REFS;
REF_GLX = NUMBER_OF_REFS;
REF_SDLGL = NUMBER_OF_REFS;
//REF_FXGL = NUMBER_OF_REFS;
GL_REF_START = NUMBER_OF_REFS;
@ -351,31 +323,11 @@ void VID_MenuInit( void )
{
s_current_menu_index = OPENGL_MENU;
s_ref_list[s_current_menu_index].curvalue = REF_GLX;
#if 0
if ( strcmp( gl_driver->string, "3dfxgl" ) == 0 )
s_ref_list[s_current_menu_index].curvalue = REF_3DFX;
else if ( strcmp( gl_driver->string, "pvrgl" ) == 0 )
s_ref_list[s_current_menu_index].curvalue = REF_POWERVR;
else if ( strcmp( gl_driver->string, "opengl32" ) == 0 )
s_ref_list[s_current_menu_index].curvalue = REF_OPENGL;
else
s_ref_list[s_current_menu_index].curvalue = REF_VERITE;
#endif
}
else if ( strcmp( vid_ref->string, "sdlgl" ) == 0 )
{
s_current_menu_index = OPENGL_MENU;
s_ref_list[s_current_menu_index].curvalue = REF_SDLGL;
#if 0
if ( strcmp( gl_driver->string, "3dfxgl" ) == 0 )
s_ref_list[s_current_menu_index].curvalue = REF_3DFX;
else if ( strcmp( gl_driver->string, "pvrgl" ) == 0 )
s_ref_list[s_current_menu_index].curvalue = REF_POWERVR;
else if ( strcmp( gl_driver->string, "opengl32" ) == 0 )
s_ref_list[s_current_menu_index].curvalue = REF_OPENGL;
else
s_ref_list[s_current_menu_index].curvalue = REF_VERITE;
#endif
}
s_software_menu.x = viddef.width * 0.50;
@ -576,3 +528,4 @@ const char *VID_MenuKey( int key )
return sound;
}

View file

@ -27,9 +27,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <unistd.h>
#include <errno.h>
#include "../../client/header/client.h"
#include "../../../client/header/client.h"
#include "rw_linux.h"
#include "../posix.h"
// Structure containing functions exported from refresh DLL
refexport_t re;
@ -251,17 +251,7 @@ qboolean VID_LoadRefresh( char *name )
strstr(fn, "glx") == NULL &&
strstr(fn, "softsdl") == NULL &&
strstr(fn, "sdlgl") == NULL) { // softx doesn't require root
#if 0
if (st.st_uid != 0) {
Com_Printf( "LoadLibrary(\"%s\") failed: ref is not owned by root\n", name);
return false;
}
if ((st.st_mode & 0777) & ~0700) {
Com_Printf( "LoadLibrary(\"%s\") failed: invalid permissions, must be 700 for security considerations\n", name);
return false;
}
#endif
} else {
} else {
// softx requires we give up root now
setreuid(getuid(), getuid());
setegid(getgid());
@ -292,10 +282,6 @@ qboolean VID_LoadRefresh( char *name )
ri.Vid_MenuInit = VID_MenuInit;
ri.Vid_NewWindow = VID_NewWindow;
#ifdef QMAX
ri.SetParticlePics = SetParticleImages;
#endif
if ( ( GetRefAPI = (void *) dlsym( reflib_library, "GetRefAPI" ) ) == 0 )
Com_Error( ERR_FATAL, "dlsym failed on %s", name );
@ -335,22 +321,10 @@ qboolean VID_LoadRefresh( char *name )
}
/* Init KBD */
#if 1
if ((KBD_Init_fp = dlsym(reflib_library, "KBD_Init")) == NULL ||
(KBD_Update_fp = dlsym(reflib_library, "KBD_Update")) == NULL ||
(KBD_Close_fp = dlsym(reflib_library, "KBD_Close")) == NULL)
Sys_Error("No KBD functions in REF.\n");
#else
{
void KBD_Init(void);
void KBD_Update(void);
void KBD_Close(void);
KBD_Init_fp = KBD_Init;
KBD_Update_fp = KBD_Update;
KBD_Close_fp = KBD_Close;
}
#endif
KBD_Init_fp(Do_Key_Event);
Key_ClearStates();
@ -398,10 +372,10 @@ void VID_CheckChanges (void)
{
if ( strcmp (vid_ref->string, "soft") == 0 ||
strcmp (vid_ref->string, "softx") == 0 ) {
Com_Printf("Refresh failed\n");
Com_Printf("Refresh failed\n");
sw_mode = Cvar_Get( "sw_mode", "0", 0 );
if (sw_mode->value != 0) {
Com_Printf("Trying mode 0\n");
Com_Printf("Trying mode 0\n");
Cvar_SetValue("sw_mode", 0);
if ( !VID_LoadRefresh( name ) )
Com_Error (ERR_FATAL, "Couldn't fall back to software refresh!");
@ -568,3 +542,4 @@ char *Sys_GetClipboardData(void)
else
return NULL;
}