summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-01-27 19:50:12 +0000
committerTim Angus <tim@ngus.net>2006-01-27 19:50:12 +0000
commitdfff1857ce0517dec0c67c59eed9bab0a4d55e25 (patch)
tree10d227310c61eb1fc6e0cddbd8bb9ec847918cb6
parentc106cea01560ffc77938d6cb3d9239250828c8d5 (diff)
* Merged ioq3-r529
- Quick fullscreen changes - Fix to that server crashing memory leak - Some FreeBSD changes * Default for r_znear changed
-rw-r--r--Makefile34
-rw-r--r--src/cgame/cg_view.c4
-rw-r--r--src/client/cl_keys.c38
-rw-r--r--src/qcommon/cm_patch.c1
-rw-r--r--src/qcommon/cm_polylib.c2
-rw-r--r--src/renderer/tr_init.c6
-rw-r--r--src/unix/sdl_glimp.c28
7 files changed, 86 insertions, 27 deletions
diff --git a/Makefile b/Makefile
index d587243a..ca44dd6b 100644
--- a/Makefile
+++ b/Makefile
@@ -415,6 +415,21 @@ ifeq ($(PLATFORM),freebsd)
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
+ ifeq ($(USE_OPENAL),1)
+ BASE_CFLAGS += -DUSE_OPENAL=1
+ ifeq ($(USE_OPENAL_DLOPEN),1)
+ BASE_CFLAGS += -DUSE_OPENAL_DLOPEN=1
+ endif
+ endif
+
+ ifeq ($(USE_CODEC_VORBIS),1)
+ BASE_CFLAGS += -DUSE_CODEC_VORBIS=1
+ endif
+
+ ifeq ($(USE_SDL),1)
+ BASE_CFLAGS += $(shell sdl11-config --cflags) -DUSE_SDL_VIDEO=1 -DUSE_SDL_SOUND=1
+ endif
+
ifeq ($(ARCH),axp)
CC=gcc
BASE_CFLAGS += -DNO_VM_COMPILED
@@ -440,7 +455,24 @@ ifeq ($(PLATFORM),freebsd)
# don't need -ldl (FreeBSD)
LDFLAGS=-lm
- CLIENT_LDFLAGS=-L/usr/X11R6/$(LIB) -lGL -lX11 -lXext -lXxf86dga -lXxf86vm
+ CLIENT_LDFLAGS =
+
+ ifeq ($(USE_SDL),1)
+ CLIENT_LDFLAGS += $(shell sdl11-config --libs)
+ else
+ CLIENT_LDFLAGS += -L/usr/X11R6/$(LIB) -lGL -lX11 -lXext -lXxf86dga -lXxf86vm
+ endif
+
+ ifeq ($(USE_OPENAL),1)
+ ifneq ($(USE_OPENAL_DLOPEN),1)
+ CLIENT_LDFLAGS += $(THREAD_LDFLAGS) -lopenal
+ endif
+ endif
+
+ ifeq ($(USE_CODEC_VORBIS),1)
+ CLIENT_LDFLAGS += -lvorbisfile -lvorbis -logg
+ endif
+
else # ifeq freebsd
diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c
index edfc9896..9fc2a145 100644
--- a/src/cgame/cg_view.c
+++ b/src/cgame/cg_view.c
@@ -761,11 +761,11 @@ static int CG_CalcFov( void )
float temp, temp2;
temp = (float)( cg.time - cg.spawnTime ) / FOVWARPTIME;
- temp2 = ( 180 - fov_x ) * temp;
+ temp2 = ( 170 - fov_x ) * temp;
//Com_Printf( "%f %f\n", temp*100, temp2*100 );
- fov_x = 180 - temp2;
+ fov_x = 170 - temp2;
}
// account for zooms
diff --git a/src/client/cl_keys.c b/src/client/cl_keys.c
index 232f04a4..a0d4e065 100644
--- a/src/client/cl_keys.c
+++ b/src/client/cl_keys.c
@@ -1044,28 +1044,22 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
}
#ifndef _WIN32
- if (key == K_ENTER)
- {
- if (down)
- {
- if (keys[K_ALT].down)
- {
- Key_ClearStates();
- if (Cvar_VariableValue("r_fullscreen") == 0)
- {
- Com_Printf("Switching to fullscreen rendering\n");
- Cvar_Set("r_fullscreen", "1");
- }
- else
- {
- Com_Printf("Switching to windowed rendering\n");
- Cvar_Set("r_fullscreen", "0");
- }
- Cbuf_ExecuteText( EXEC_APPEND, "vid_restart\n");
- return;
- }
- }
- }
+ if (key == K_ENTER)
+ {
+ if (down)
+ {
+ if (keys[K_ALT].down)
+ {
+ Key_ClearStates();
+ Cvar_SetValue( "r_fullscreen",
+ !Cvar_VariableIntegerValue( "r_fullscreen" ) );
+#if !USE_SDL_VIDEO // This is handled in sdl_glimp.c/GLimp_EndFrame
+ Cbuf_ExecuteText( EXEC_APPEND, "vid_restart\n");
+#endif
+ return;
+ }
+ }
+ }
#endif
// console key is hardcoded, so the user can never unbind it
diff --git a/src/qcommon/cm_patch.c b/src/qcommon/cm_patch.c
index fa0ff55a..194b806c 100644
--- a/src/qcommon/cm_patch.c
+++ b/src/qcommon/cm_patch.c
@@ -768,6 +768,7 @@ static qboolean CM_ValidateFacet( facet_t *facet ) {
w = BaseWindingForPlane( plane, plane[3] );
for ( j = 0 ; j < facet->numBorders && w ; j++ ) {
if ( facet->borderPlanes[j] == -1 ) {
+ FreeWinding( w );
return qfalse;
}
Vector4Copy( planes[ facet->borderPlanes[j] ].plane, plane );
diff --git a/src/qcommon/cm_polylib.c b/src/qcommon/cm_polylib.c
index acd8f613..1a937544 100644
--- a/src/qcommon/cm_polylib.c
+++ b/src/qcommon/cm_polylib.c
@@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// counters are only bumped when running single threaded,
-// because they are an awefull coherence problem
+// because they are an awful coherence problem
int c_active_windings;
int c_peak_windings;
int c_winding_allocs;
diff --git a/src/renderer/tr_init.c b/src/renderer/tr_init.c
index 79c910d1..4d47f46c 100644
--- a/src/renderer/tr_init.c
+++ b/src/renderer/tr_init.c
@@ -927,7 +927,11 @@ void R_Register( void )
r_overBrightBits = ri.Cvar_Get ("r_overBrightBits", "1", CVAR_ARCHIVE | CVAR_LATCH );
r_ignorehwgamma = ri.Cvar_Get( "r_ignorehwgamma", "0", CVAR_ARCHIVE | CVAR_LATCH);
r_mode = ri.Cvar_Get( "r_mode", "3", CVAR_ARCHIVE | CVAR_LATCH );
+#if USE_SDL_VIDEO
+ r_fullscreen = ri.Cvar_Get( "r_fullscreen", "1", CVAR_ARCHIVE );
+#else
r_fullscreen = ri.Cvar_Get( "r_fullscreen", "1", CVAR_ARCHIVE | CVAR_LATCH );
+#endif
r_customwidth = ri.Cvar_Get( "r_customwidth", "1600", CVAR_ARCHIVE | CVAR_LATCH );
r_customheight = ri.Cvar_Get( "r_customheight", "1024", CVAR_ARCHIVE | CVAR_LATCH );
r_customaspect = ri.Cvar_Get( "r_customaspect", "1", CVAR_ARCHIVE | CVAR_LATCH );
@@ -954,7 +958,7 @@ void R_Register( void )
r_lodCurveError = ri.Cvar_Get( "r_lodCurveError", "250", CVAR_ARCHIVE|CVAR_CHEAT );
r_lodbias = ri.Cvar_Get( "r_lodbias", "0", CVAR_ARCHIVE );
r_flares = ri.Cvar_Get ("r_flares", "0", CVAR_ARCHIVE );
- r_znear = ri.Cvar_Get( "r_znear", "4", CVAR_CHEAT );
+ r_znear = ri.Cvar_Get( "r_znear", "1", CVAR_CHEAT );
AssertCvarRange( r_znear, 0.001f, 200, qtrue );
r_ignoreGLErrors = ri.Cvar_Get( "r_ignoreGLErrors", "1", CVAR_ARCHIVE );
r_fastsky = ri.Cvar_Get( "r_fastsky", "0", CVAR_ARCHIVE );
diff --git a/src/unix/sdl_glimp.c b/src/unix/sdl_glimp.c
index 1343cb61..e0ab58ce 100644
--- a/src/unix/sdl_glimp.c
+++ b/src/unix/sdl_glimp.c
@@ -1041,6 +1041,34 @@ void GLimp_EndFrame (void)
SDL_GL_SwapBuffers();
}
+ if( r_fullscreen->modified )
+ {
+ qboolean fullscreen;
+ qboolean sdlToggled = qfalse;
+ SDL_Surface *s = SDL_GetVideoSurface( );
+
+ if( s )
+ {
+ // Find out the current state
+ if( s->flags & SDL_FULLSCREEN )
+ fullscreen = qtrue;
+ else
+ fullscreen = qfalse;
+
+ // Is the state we want different from the current state?
+ if( !!r_fullscreen->integer != fullscreen )
+ sdlToggled = SDL_WM_ToggleFullScreen( s );
+ else
+ sdlToggled = qtrue;
+ }
+
+ // SDL_WM_ToggleFullScreen didn't work, so do it the slow way
+ if( !sdlToggled )
+ Cbuf_AddText( "vid_restart" );
+
+ r_fullscreen->modified = qfalse;
+ }
+
// check logging
QGL_EnableLogging( (qboolean)r_logFile->integer ); // bk001205 - was ->value
}