r1161 - in trunk: . code code/botlib code/cgame code/client code/game code/jpeg-6 code/libs/win32 code/null code/q3_ui code/qcommon code/renderer code/server code/ui

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Sep 5 14:17:47 EDT 2007


Author: tma
Date: 2007-09-05 14:17:46 -0400 (Wed, 05 Sep 2007)
New Revision: 1161

Added:
   trunk/code/asm/
   trunk/code/libs/win32/libSDL.dll.a
   trunk/code/libs/win32/libSDL.la
   trunk/code/libs/win32/libSDLmain.a
   trunk/code/sdl/
   trunk/code/sys/
   trunk/misc/
Removed:
   trunk/code/renderer/qgl_linked.h
   trunk/code/unix/
   trunk/code/win32/
Modified:
   trunk/Makefile
   trunk/README
   trunk/TODO
   trunk/code/botlib/be_ai_chat.c
   trunk/code/botlib/be_ai_goal.c
   trunk/code/botlib/be_ai_move.c
   trunk/code/botlib/be_ai_move.h
   trunk/code/botlib/be_ai_weap.c
   trunk/code/botlib/be_interface.c
   trunk/code/botlib/l_memory.c
   trunk/code/botlib/l_precomp.c
   trunk/code/botlib/l_script.c
   trunk/code/cgame/cg_draw.c
   trunk/code/cgame/cg_drawtools.c
   trunk/code/cgame/cg_event.c
   trunk/code/cgame/cg_local.h
   trunk/code/cgame/cg_main.c
   trunk/code/cgame/cg_newdraw.c
   trunk/code/cgame/cg_players.c
   trunk/code/cgame/cg_servercmds.c
   trunk/code/client/cl_cgame.c
   trunk/code/client/cl_cin.c
   trunk/code/client/cl_console.c
   trunk/code/client/cl_curl.c
   trunk/code/client/cl_keys.c
   trunk/code/client/cl_main.c
   trunk/code/client/cl_scrn.c
   trunk/code/client/cl_ui.c
   trunk/code/client/client.h
   trunk/code/client/qal.c
   trunk/code/client/snd_dma.c
   trunk/code/client/snd_main.c
   trunk/code/client/snd_mix.c
   trunk/code/game/ai_chat.c
   trunk/code/game/ai_dmq3.c
   trunk/code/game/ai_main.c
   trunk/code/game/bg_lib.c
   trunk/code/game/bg_misc.c
   trunk/code/game/g_arenas.c
   trunk/code/game/g_bot.c
   trunk/code/game/g_client.c
   trunk/code/game/g_main.c
   trunk/code/game/g_mem.c
   trunk/code/game/g_session.c
   trunk/code/jpeg-6/jcdctmgr.c
   trunk/code/jpeg-6/jcmainct.c
   trunk/code/jpeg-6/jdmainct.c
   trunk/code/null/null_client.c
   trunk/code/null/null_snddma.c
   trunk/code/q3_ui/ui_atoms.c
   trunk/code/q3_ui/ui_connect.c
   trunk/code/q3_ui/ui_controls2.c
   trunk/code/q3_ui/ui_gameinfo.c
   trunk/code/q3_ui/ui_local.h
   trunk/code/q3_ui/ui_main.c
   trunk/code/q3_ui/ui_mods.c
   trunk/code/q3_ui/ui_qmenu.c
   trunk/code/q3_ui/ui_team.c
   trunk/code/q3_ui/ui_video.c
   trunk/code/qcommon/cm_trace.c
   trunk/code/qcommon/common.c
   trunk/code/qcommon/cvar.c
   trunk/code/qcommon/files.c
   trunk/code/qcommon/net_ip.c
   trunk/code/qcommon/q_math.c
   trunk/code/qcommon/q_platform.h
   trunk/code/qcommon/q_shared.c
   trunk/code/qcommon/q_shared.h
   trunk/code/qcommon/qcommon.h
   trunk/code/qcommon/vm.c
   trunk/code/qcommon/vm_interpreted.c
   trunk/code/qcommon/vm_local.h
   trunk/code/qcommon/vm_x86.c
   trunk/code/qcommon/vm_x86_64.c
   trunk/code/renderer/qgl.h
   trunk/code/renderer/tr_cmds.c
   trunk/code/renderer/tr_image.c
   trunk/code/renderer/tr_init.c
   trunk/code/renderer/tr_light.c
   trunk/code/renderer/tr_shader.c
   trunk/code/renderer/tr_types.h
   trunk/code/server/sv_bot.c
   trunk/code/server/sv_ccmds.c
   trunk/code/server/sv_client.c
   trunk/code/server/sv_game.c
   trunk/code/server/sv_init.c
   trunk/code/server/sv_main.c
   trunk/code/ui/ui_atoms.c
   trunk/code/ui/ui_gameinfo.c
   trunk/code/ui/ui_main.c
   trunk/code/ui/ui_shared.c
   trunk/make-macosx-ub.sh
Log:
* Merge unified-sdl to trunk
* Bump Q3_VERSION to 1.35


Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/Makefile	2007-09-05 18:17:46 UTC (rev 1161)
@@ -32,12 +32,8 @@
 BUILD_GAME_SO    =
 BUILD_GAME_QVM   =
 
-ifeq ($(V),1)
-echo_cmd=@:
-Q=
-else
-echo_cmd=@echo
-Q=@
+ifneq ($(PLATFORM),darwin)
+  BUILD_CLIENT_SMP = 0
 endif
 
 #############################################################################
@@ -96,10 +92,6 @@
 endif
 export USE_CCACHE
 
-ifndef USE_SDL
-USE_SDL=1
-endif
-
 ifndef USE_OPENAL
 USE_OPENAL=1
 endif
@@ -136,8 +128,9 @@
 SDIR=$(MOUNT_DIR)/server
 RDIR=$(MOUNT_DIR)/renderer
 CMDIR=$(MOUNT_DIR)/qcommon
-UDIR=$(MOUNT_DIR)/unix
-W32DIR=$(MOUNT_DIR)/win32
+SDLDIR=$(MOUNT_DIR)/sdl
+ASMDIR=$(MOUNT_DIR)/asm
+SYSDIR=$(MOUNT_DIR)/sys
 GDIR=$(MOUNT_DIR)/game
 CGDIR=$(MOUNT_DIR)/cgame
 BLIBDIR=$(MOUNT_DIR)/botlib
@@ -146,7 +139,7 @@
 Q3UIDIR=$(MOUNT_DIR)/q3_ui
 JPDIR=$(MOUNT_DIR)/jpeg-6
 TOOLSDIR=$(MOUNT_DIR)/tools
-LOKISETUPDIR=$(UDIR)/setup
+LOKISETUPDIR=misc/setup
 SDLHDIR=$(MOUNT_DIR)/SDL12
 LIBSDIR=$(MOUNT_DIR)/libs
 
@@ -158,7 +151,7 @@
 ifeq ($(wildcard .svn),.svn)
   SVN_REV=$(shell LANG=C svnversion .)
   ifneq ($(SVN_REV),)
-    SVN_VERSION=$(VERSION)_SVN$(SVN_REV)
+    SVN_VERSION=$(SVN_REV)
     USE_SVN=1
   endif
 endif
@@ -195,7 +188,8 @@
   endif
   endif
 
-  BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes -pipe
+  BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
+    -pipe -DUSE_ICON $(shell sdl-config --cflags)
 
   ifeq ($(USE_OPENAL),1)
     BASE_CFLAGS += -DUSE_OPENAL=1
@@ -215,12 +209,6 @@
     BASE_CFLAGS += -DUSE_CODEC_VORBIS=1
   endif
 
-  ifeq ($(USE_SDL),1)
-    BASE_CFLAGS += -DUSE_SDL_VIDEO=1 -DUSE_SDL_SOUND=1 $(shell sdl-config --cflags)
-  else
-    BASE_CFLAGS += -I/usr/X11R6/include
-  endif
-
   OPTIMIZE = -O3 -ffast-math -funroll-loops -fomit-frame-pointer
 
   ifeq ($(ARCH),x86_64)
@@ -247,10 +235,6 @@
     BASE_CFLAGS += -DNO_VM_COMPILED
   endif
 
-  DEBUG_CFLAGS = $(BASE_CFLAGS) -g -O0
-
-  RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
-
   SHLIBEXT=so
   SHLIBCFLAGS=-fPIC
   SHLIBLDFLAGS=-shared $(LDFLAGS)
@@ -258,18 +242,14 @@
   THREAD_LDFLAGS=-lpthread
   LDFLAGS=-ldl -lm
 
-  ifeq ($(USE_SDL),1)
-    CLIENT_LDFLAGS=$(shell sdl-config --libs)
-  else
-    CLIENT_LDFLAGS=-L/usr/X11R6/$(LIB) -lX11 -lXext -lXxf86dga -lXxf86vm
-  endif
+  CLIENT_LDFLAGS=$(shell sdl-config --libs) -lGL
 
   ifeq ($(USE_OPENAL),1)
     ifneq ($(USE_OPENAL_DLOPEN),1)
       CLIENT_LDFLAGS += -lopenal
     endif
   endif
- 
+
   ifeq ($(USE_CURL),1)
     ifneq ($(USE_CURL_DLOPEN),1)
       CLIENT_LDFLAGS += -lcurl
@@ -286,6 +266,9 @@
     LDFLAGS+=-m32
   endif
 
+  DEBUG_CFLAGS = $(BASE_CFLAGS) -g -O0
+  RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
+
 else # ifeq Linux
 
 #############################################################################
@@ -384,19 +367,13 @@
     CLIENT_LDFLAGS += -lvorbisfile -lvorbis -logg
   endif
 
-  ifeq ($(USE_SDL),1)
-    BASE_CFLAGS += -DUSE_SDL_VIDEO=1 -DUSE_SDL_SOUND=1 -D_THREAD_SAFE=1 \
-      -I$(SDLHDIR)/include
-    # We copy sdlmain before ranlib'ing it so that subversion doesn't think
-    #  the file has been modified by each build.
-    LIBSDLMAIN=$(B)/libSDLmain.a
-    LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDLmain.a
-    CLIENT_LDFLAGS += -framework Cocoa -framework IOKit -framework OpenGL \
-      $(LIBSDIR)/macosx/libSDL-1.2.0.dylib
-  else
-    # !!! FIXME: frameworks: OpenGL, Carbon, etc...
-    #CLIENT_LDFLAGS += -L/usr/X11R6/$(LIB) -lX11 -lXext -lXxf86dga -lXxf86vm
-  endif
+  BASE_CFLAGS += -D_THREAD_SAFE=1 -I$(SDLHDIR)/include
+  # We copy sdlmain before ranlib'ing it so that subversion doesn't think
+  #  the file has been modified by each build.
+  LIBSDLMAIN=$(B)/libSDLmain.a
+  LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDLmain.a
+  CLIENT_LDFLAGS += -framework Cocoa -framework IOKit -framework OpenGL \
+    $(LIBSDIR)/macosx/libSDL-1.2.0.dylib
 
   OPTIMIZE += -ffast-math -falign-loops=16
 
@@ -429,7 +406,8 @@
 
   ARCH=x86
 
-  BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes
+  BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
+    -DUSE_ICON -I$(SDLHDIR)/include
 
   ifeq ($(USE_OPENAL),1)
     BASE_CFLAGS += -DUSE_OPENAL=1 -DUSE_OPENAL_DLOPEN=1
@@ -446,22 +424,19 @@
     BASE_CFLAGS += -DUSE_CODEC_VORBIS=1
   endif
 
-  OPTIMIZE = -O3 -march=i586 -fomit-frame-pointer -ffast-math -falign-loops=2 \
-    -funroll-loops -falign-jumps=2 -falign-functions=2 -fstrength-reduce
+  OPTIMIZE = -O3 -march=i586 -fno-omit-frame-pointer -ffast-math \
+    -falign-loops=2 -funroll-loops -falign-jumps=2 -falign-functions=2 \
+    -fstrength-reduce
 
   HAVE_VM_COMPILED = true
 
-  DEBUG_CFLAGS=$(BASE_CFLAGS) -g -O0
-
-  RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
-
   SHLIBEXT=dll
   SHLIBCFLAGS=
   SHLIBLDFLAGS=-shared $(LDFLAGS)
 
   BINEXT=.exe
 
-  LDFLAGS= -mwindows -lwsock32 -lgdi32 -lwinmm -lole32
+  LDFLAGS= -mwindows -lwsock32 -lgdi32 -lwinmm -lole32 -lopengl32
   CLIENT_LDFLAGS=
 
   ifeq ($(USE_CURL),1)
@@ -480,6 +455,14 @@
     LDFLAGS+=-m32
   endif
 
+  DEBUG_CFLAGS=$(BASE_CFLAGS) -g -O0
+  RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
+
+  # libmingw32 must be linked before libSDLmain
+  CLIENT_LDFLAGS += -lmingw32 \
+                    $(LIBSDIR)/win32/libSDLmain.a \
+                    $(LIBSDIR)/win32/libSDL.dll.a
+
   BUILD_SERVER = 0
   BUILD_CLIENT_SMP = 0
 
@@ -499,10 +482,8 @@
 
 
   BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
-                -I/usr/X11R6/include
+    -DUSE_ICON $(shell sdl-config --cflags)
 
-  DEBUG_CFLAGS=$(BASE_CFLAGS) -g
-
   ifeq ($(USE_OPENAL),1)
     BASE_CFLAGS += -DUSE_OPENAL=1
     ifeq ($(USE_OPENAL_DLOPEN),1)
@@ -514,10 +495,6 @@
     BASE_CFLAGS += -DUSE_CODEC_VORBIS=1
   endif
 
-  ifeq ($(USE_SDL),1)
-    BASE_CFLAGS += $(shell sdl-config --cflags) -DUSE_SDL_VIDEO=1 -DUSE_SDL_SOUND=1
-  endif
-
   ifeq ($(ARCH),axp)
     BASE_CFLAGS += -DNO_VM_COMPILED
     RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -ffast-math -funroll-loops \
@@ -534,6 +511,8 @@
   endif
   endif
 
+  DEBUG_CFLAGS=$(BASE_CFLAGS) -g
+
   SHLIBEXT=so
   SHLIBCFLAGS=-fPIC
   SHLIBLDFLAGS=-shared $(LDFLAGS)
@@ -544,11 +523,7 @@
 
   CLIENT_LDFLAGS =
 
-  ifeq ($(USE_SDL),1)
-    CLIENT_LDFLAGS += $(shell sdl-config --libs)
-  else
-    CLIENT_LDFLAGS += -L/usr/X11R6/$(LIB) -lGL -lX11 -lXext -lXxf86dga -lXxf86vm
-  endif
+  CLIENT_LDFLAGS += $(shell sdl-config --libs) -lGL
 
   ifeq ($(USE_OPENAL),1)
     ifneq ($(USE_OPENAL_DLOPEN),1)
@@ -580,12 +555,13 @@
   THREAD_LDFLAGS=-lpthread
 
   BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes
-  DEBUG_CFLAGS=$(BASE_CFLAGS) -g
 
   ifneq ($(ARCH),i386)
     BASE_CFLAGS += -DNO_VM_COMPILED
   endif
 
+  DEBUG_CFLAGS=$(BASE_CFLAGS) -g
+
   BUILD_CLIENT = 0
   BUILD_GAME_QVM = 0
 
@@ -637,14 +613,9 @@
   endif
 
 
-  BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes -pipe
+  BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
+    -pipe -DUSE_ICON $(shell sdl-config --cflags)
 
-  ifeq ($(USE_SDL),1)
-    BASE_CFLAGS += -DUSE_SDL_SOUND=1 $(shell sdl-config --cflags)
-  else
-    BASE_CFLAGS += -I/usr/openwin/include
-  endif
-
   OPTIMIZE = -O3 -ffast-math -funroll-loops
 
   ifeq ($(ARCH),sparc)
@@ -681,11 +652,7 @@
 
   BOTCFLAGS=-O0
 
-  ifeq ($(USE_SDL),1)
-    CLIENT_LDFLAGS=$(shell sdl-config --libs) -L/usr/X11/lib -lGLU -lX11 -lXext
-  else
-    CLIENT_LDFLAGS=-L/usr/openwin/$(LIB) -L/usr/X11/lib -lGLU -lX11 -lXext
-  endif
+  CLIENT_LDFLAGS=$(shell sdl-config --libs) -lGL
 
 else # ifeq sunos
 
@@ -763,6 +730,14 @@
   BASE_CFLAGS += -DSVN_VERSION=\\\"$(SVN_VERSION)\\\"
 endif
 
+ifeq ($(V),1)
+echo_cmd=@:
+Q=
+else
+echo_cmd=@echo
+Q=@
+endif
+
 define DO_CC       
 $(echo_cmd) "CC $<"
 $(Q)$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -o $@ -c $<
@@ -1049,6 +1024,12 @@
   $(B)/client/tr_sky.o \
   $(B)/client/tr_surface.o \
   $(B)/client/tr_world.o \
+  \
+  $(B)/client/sdl_gamma.o \
+  $(B)/client/sdl_input.o \
+  $(B)/client/sdl_snd.o \
+  \
+  $(B)/client/sys_main.o
 
 ifeq ($(ARCH),i386)
   Q3OBJ += \
@@ -1082,44 +1063,19 @@
 
 ifeq ($(PLATFORM),mingw32)
   Q3OBJ += \
-    $(B)/client/win_gamma.o \
-    $(B)/client/win_glimp.o \
-    $(B)/client/win_input.o \
-    $(B)/client/win_main.o \
-    $(B)/client/win_qgl.o \
-    $(B)/client/win_shared.o \
-    $(B)/client/win_snd.o \
-    $(B)/client/win_syscon.o \
-    $(B)/client/win_wndproc.o \
-    $(B)/client/win_resource.o
+    $(B)/client/win_resource.o \
+    $(B)/client/sys_win32.o
 else
   Q3OBJ += \
-    $(B)/client/unix_main.o \
-    $(B)/client/unix_shared.o \
-    $(B)/client/linux_signals.o \
-    $(B)/client/linux_qgl.o \
-    $(B)/client/linux_snd.o \
-    $(B)/client/sdl_snd.o
+    $(B)/client/sys_unix.o
+endif
 
-  ifeq ($(PLATFORM),linux)
-    Q3OBJ += $(B)/client/linux_joystick.o
-  endif
+Q3POBJ += \
+  $(B)/client/sdl_glimp.o
 
-  ifeq ($(USE_SDL),1)
-    ifneq ($(PLATFORM),darwin)
-      BUILD_CLIENT_SMP = 0
-    endif
-  endif
+Q3POBJ_SMP += \
+  $(B)/clientsmp/sdl_glimp.o
 
-  Q3POBJ = \
-    $(B)/client/linux_glimp.o \
-    $(B)/client/sdl_glimp.o
-
-  Q3POBJ_SMP = \
-    $(B)/clientsmp/linux_glimp.o \
-    $(B)/clientsmp/sdl_glimp.o
-endif
-
 $(B)/ioquake3.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ) $(LIBSDLMAIN)
 	$(echo_cmd) "LD $@"
 	$(Q)$(CC) -o $@ $(Q3OBJ) $(Q3POBJ) $(CLIENT_LDFLAGS) \
@@ -1206,13 +1162,14 @@
   $(B)/ded/l_script.o \
   $(B)/ded/l_struct.o \
   \
-  $(B)/ded/linux_signals.o \
-  $(B)/ded/unix_main.o \
-  $(B)/ded/unix_shared.o \
-  \
   $(B)/ded/null_client.o \
   $(B)/ded/null_input.o \
-  $(B)/ded/null_snddma.o
+  $(B)/ded/null_snddma.o \
+  \
+  $(B)/ded/tty_console.o \
+  $(B)/ded/sys_unix.o \
+  \
+  $(B)/ded/sys_main.o
 
 ifeq ($(ARCH),i386)
   Q3DOBJ += \
@@ -1529,7 +1486,7 @@
 ## CLIENT/SERVER RULES
 #############################################################################
 
-$(B)/client/%.o: $(UDIR)/%.s
+$(B)/client/%.o: $(ASMDIR)/%.s
 	$(DO_AS)
 
 $(B)/client/%.o: $(CDIR)/%.c
@@ -1550,20 +1507,20 @@
 $(B)/client/%.o: $(RDIR)/%.c
 	$(DO_CC)
 
-$(B)/client/%.o: $(UDIR)/%.c
+$(B)/client/%.o: $(SDLDIR)/%.c
 	$(DO_CC)
 
-$(B)/clientsmp/%.o: $(UDIR)/%.c
+$(B)/clientsmp/%.o: $(SDLDIR)/%.c
 	$(DO_SMP_CC)
 
-$(B)/client/%.o: $(W32DIR)/%.c
+$(B)/client/%.o: $(SYSDIR)/%.c
 	$(DO_CC)
 
-$(B)/client/%.o: $(W32DIR)/%.rc
+$(B)/client/%.o: $(SYSDIR)/%.rc
 	$(DO_WINDRES)
 
 
-$(B)/ded/%.o: $(UDIR)/%.s
+$(B)/ded/%.o: $(ASMDIR)/%.s
 	$(DO_AS)
 
 $(B)/ded/%.o: $(SDIR)/%.c
@@ -1575,7 +1532,7 @@
 $(B)/ded/%.o: $(BLIBDIR)/%.c
 	$(DO_BOT_CC)
 
-$(B)/ded/%.o: $(UDIR)/%.c
+$(B)/ded/%.o: $(SYSDIR)/%.c
 	$(DO_DED_CC)
 
 $(B)/ded/%.o: $(NDIR)/%.c

Modified: trunk/README
===================================================================
--- trunk/README	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/README	2007-09-05 18:17:46 UTC (rev 1161)
@@ -10,7 +10,7 @@
 The intent of this project is to provide a baseline Quake 3 which may be used
 for further development. Some of the major features currently implemented are:
 
-  * SDL backend for unix-like operating systems
+  * SDL backend
   * OpenAL sound API support (multiple speaker support and better sound
     quality)
   * Full x86_64 support on Linux
@@ -46,18 +46,8 @@
 
 For Windows, using MinGW
   1. Download and install MinGW and MSys from http://www.mingw.org/.
-  2. Download http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz
-     and untar it into your MinGW directory (usually C:\MinGW).
-  3. Open an MSys terminal, and follow the instructions for compiling on *nix.
+  2. Open an MSys terminal, and follow the instructions for compiling on *nix.
 
-For Windows, using MSVC
-  1. Run Visual Studio and open the quake3.sln file in the code/win32/msvc
-     directory.
-  2. Build.
-  3. Copy the resultant Quake3.exe to your quake 3 directory, make a backup if
-     you want to keep your original. If you wish to use native libraries, copy
-     the resultant dlls to your baseq3 directory.
-
 For Mac OS X, building a Universal Binary
   1. Install the MacOSX10.2.8.sdk and MacOSX10.4u.sdk which are included in
      XCode 2.2 and newer.
@@ -68,7 +58,7 @@
 
 Installation, for *nix
   1. Set the COPYDIR variable in the shell to be where you installed Quake 3
-     to.  By default it will be /usr/local/games/quake3 if you haven't set it.
+     to. By default it will be /usr/local/games/quake3 if you haven't set it.
      This is the path as used by the original Linux Q3 installer and subsequent
      point releases.
   2. Run 'make copyfiles'.
@@ -83,11 +73,10 @@
 though you may find you need to change the value of the variables in this
 script to match your environment.
 
-If the make based build system is being used (i.e. *nix or MinGW), the
-following variables may be set, either on the command line or in
+The following variables may be set, either on the command line or in
 Makefile.local:
 
-  OPTIMIZE          - use this for custom CFLAGS
+  CFLAGS            - use this for custom CFLAGS
   V                 - set to show cc command line when building
   DEFAULT_BASEDIR   - extra path to search for baseq3 and such
   BUILD_SERVER      - build the 'ioq3ded' server binary
@@ -95,7 +84,6 @@
   BUILD_CLIENT_SMP  - build the 'ioquake3-smp' client binary
   BUILD_GAME_SO     - build the game shared libraries
   BUILD_GAME_QVM    - build the game qvms
-  USE_SDL           - use the SDL backend where available
   USE_OPENAL        - use OpenAL where available
   USE_OPENAL_DLOPEN - link with OpenAL at runtime
   USE_CURL          - use libcurl for http/ftp download support
@@ -140,15 +128,12 @@
   s_sdlDevSamps                     - SDL DMA buffer size override
   s_sdlMixSamps                     - SDL mix buffer size override
 
-  ttycon_ansicolor                  - enable use of ANSI escape codes in the tty
-  r_GLlibCoolDownMsec               - wait for some milliseconds to close GL
-                                      library
+  com_ansiColor                     - enable use of ANSI escape codes in the tty
   com_altivec                       - enable use of altivec on PowerPC systems
   s_backend                         - read only, indicates the current sound
                                       backend
-  in_shiftedKeys                    - non-SDL Linux only; enables binding to
-                                      shifted keys
-  in_joystickNo                     - SDL only; select which joystick to use
+  s_muteWhenMinimized               - mute sound when minimized
+  in_joystickNo                     - select which joystick to use
   cl_consoleHistory                 - read only, stores the console history
   cl_platformSensitivity            - read only, indicates the mouse input
                                       scaling
@@ -292,8 +277,8 @@
   Note that this cvar MUST be set as a command line parameter.
 
 SDL Keyboard Differences
-  ioquake3 clients built againt SDL (e.g. Linux and Mac OS X) have different
-  keyboard behaviour than the original Quake3 clients.
+  ioquake3 clients have different keyboard behaviour compared to the original
+  Quake3 clients.
 
     * "Caps Lock" and "Num Lock" can not be used as normal binds since they
       do not send a KEYUP event until the key is pressed again.
@@ -345,7 +330,7 @@
 
 The focus for ioquake3 to develop a stable base suitable for further
 development, and provide players with the same Quake 3 experience they've had
-for years.  As such ioq3 does not have any significant graphical enhancements
+for years. As such ioq3 does not have any significant graphical enhancements
 and none are planned at this time. However, improved graphics and sound
 patches will be accepted as long as they are entirely optional, do not
 require new media and are off by default.
@@ -372,8 +357,7 @@
     providing pak0.pk3 and the patch pk3s are not refered to or included in the
     installer.
 
-  * Please include at least an SDL so/dylib on every platform but Windows
-    (which doesn't use it yet).
+  * Please include at least an SDL so/dylib on every platform.
 
   * Please include an OpenAL so/dylib/dll, since every platform should be using
     it by now.

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/TODO	2007-09-05 18:17:46 UTC (rev 1161)
@@ -19,7 +19,6 @@
 
 For 1.35+:
 * IPv6 support
-* Replace windows DirectX backend with SDL
 * Graphical "ioquake3" watermark in videos, optional, on by default
 * Gamma stuff while recording videos.
 * Application for OS X at least to launch mods with appropriate hunkmegs, etc.

Copied: trunk/code/asm (from rev 1160, branches/unified-sdl/code/asm)

Modified: trunk/code/botlib/be_ai_chat.c
===================================================================
--- trunk/code/botlib/be_ai_chat.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/botlib/be_ai_chat.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -1439,7 +1439,7 @@
 		//if the last piece was a variable string
 		if (lastvariable >= 0)
 		{
-        		assert( match->variables[lastvariable].offset >= 0 ); // bk001204
+        		assert( match->variables[lastvariable].offset >= 0 );
 			match->variables[lastvariable].length =
 				strlen(&match->string[ (int) match->variables[lastvariable].offset]);
 		} //end if
@@ -1500,7 +1500,7 @@
 	{
 		if (match->variables[variable].length < size)
 			size = match->variables[variable].length+1;
-		assert( match->variables[variable].offset >= 0 ); // bk001204
+		assert( match->variables[variable].offset >= 0 );
 		strncpy(buf, &match->string[ (int) match->variables[variable].offset], size-1);
 		buf[size-1] = '\0';
 	} //end if
@@ -2316,7 +2316,7 @@
 					} //end if
 					if (match->variables[num].offset >= 0)
 					{
-					        assert( match->variables[num].offset >= 0 ); // bk001204
+					        assert( match->variables[num].offset >= 0 );
 						ptr = &match->string[ (int) match->variables[num].offset];
 						for (i = 0; i < match->variables[num].length; i++)
 						{

Modified: trunk/code/botlib/be_ai_goal.c
===================================================================
--- trunk/code/botlib/be_ai_goal.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/botlib/be_ai_goal.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -176,22 +176,22 @@
 	float avoidgoaltimes[MAX_AVOIDGOALS];		//times to avoid the goals
 } bot_goalstate_t;
 
-bot_goalstate_t *botgoalstates[MAX_CLIENTS + 1]; // bk001206 - FIXME: init?
+bot_goalstate_t *botgoalstates[MAX_CLIENTS + 1]; // FIXME: init?
 //item configuration
-itemconfig_t *itemconfig = NULL; // bk001206 - init
+itemconfig_t *itemconfig = NULL;
 //level items
-levelitem_t *levelitemheap = NULL; // bk001206 - init
-levelitem_t *freelevelitems = NULL; // bk001206 - init
-levelitem_t *levelitems = NULL; // bk001206 - init
+levelitem_t *levelitemheap = NULL;
+levelitem_t *freelevelitems = NULL;
+levelitem_t *levelitems = NULL;
 int numlevelitems = 0;
 //map locations
-maplocation_t *maplocations = NULL; // bk001206 - init
+maplocation_t *maplocations = NULL;
 //camp spots
-campspot_t *campspots = NULL; // bk001206 - init
+campspot_t *campspots = NULL;
 //the game type
-int g_gametype = 0; // bk001206 - init
+int g_gametype = 0;
 //additional dropped item weight
-libvar_t *droppedweight = NULL; // bk001206 - init
+libvar_t *droppedweight = NULL;
 
 //========================================================================
 //

Modified: trunk/code/botlib/be_ai_move.c
===================================================================
--- trunk/code/botlib/be_ai_move.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/botlib/be_ai_move.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -51,8 +51,6 @@
 //#define DEBUG_ELEVATOR
 //#define DEBUG_GRAPPLE
 
-// bk001204 - redundant bot_avoidspot_t, see be_ai_move.h
-
 //movement state
 //NOTE: the moveflags MFL_ONGROUND, MFL_TELEPORTED, MFL_WATERJUMP and
 //		MFL_GRAPPLEPULL must be set outside the movement code

Modified: trunk/code/botlib/be_ai_move.h
===================================================================
--- trunk/code/botlib/be_ai_move.h	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/botlib/be_ai_move.h	2007-09-05 18:17:46 UTC (rev 1161)
@@ -102,8 +102,6 @@
 
 #define bot_moveresult_t_cleared(x) bot_moveresult_t (x) = {0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, {0, 0, 0}}
 
-// bk001204: from code/botlib/be_ai_move.c
-// TTimo 04/12/2001 was moved here to avoid dup defines
 typedef struct bot_avoidspot_s
 {
 	vec3_t origin;

Modified: trunk/code/botlib/be_ai_weap.c
===================================================================
--- trunk/code/botlib/be_ai_weap.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/botlib/be_ai_weap.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -51,7 +51,7 @@
 #define WEAPON_OFS(x) (size_t)&(((weaponinfo_t *)0)->x)
 #define PROJECTILE_OFS(x) (size_t)&(((projectileinfo_t *)0)->x)
 
-//weapon definition // bk001212 - static
+//weapon definition
 static fielddef_t weaponinfo_fields[] =
 {
 {"number", WEAPON_OFS(number), FT_INT},						//weapon number

Modified: trunk/code/botlib/be_interface.c
===================================================================
--- trunk/code/botlib/be_interface.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/botlib/be_interface.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -21,7 +21,7 @@
 */
 
 /*****************************************************************************
- * name:		be_interface.c // bk010221 - FIXME - DEAD code elimination
+ * name:		be_interface.c
  *
  * desc:		bot library interface
  *
@@ -140,7 +140,7 @@
 	char		*homedir, *gamedir;
 	
 	bot_developer = LibVarGetValue("bot_developer");
-  memset( &botlibglobals, 0, sizeof(botlibglobals) ); // bk001207 - init
+ 	memset( &botlibglobals, 0, sizeof(botlibglobals) );
 	//initialize byte swapping (litte endian etc.)
 //	Swap_Init();
 	homedir = LibVarGetString("homedir");
@@ -860,9 +860,9 @@
 ============
 */
 botlib_export_t *GetBotLibAPI(int apiVersion, botlib_import_t *import) {
-	assert(import);   // bk001129 - this wasn't set for baseq3/
-  botimport = *import;
-  assert(botimport.Print);   // bk001129 - pars pro toto
+	assert(import);
+	botimport = *import;
+	assert(botimport.Print);
 
 	Com_Memset( &be_botlib_export, 0, sizeof( be_botlib_export ) );
 

Modified: trunk/code/botlib/l_memory.c
===================================================================
--- trunk/code/botlib/l_memory.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/botlib/l_memory.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -100,7 +100,7 @@
 {
 	void *ptr;
 	memoryblock_t *block;
-  assert(botimport.GetMemory); // bk001129 - was NULL'ed
+	assert(botimport.GetMemory);
 	ptr = botimport.GetMemory(size + sizeof(memoryblock_t));
 	block = (memoryblock_t *) ptr;
 	block->id = MEM_ID;

Modified: trunk/code/botlib/l_precomp.c
===================================================================
--- trunk/code/botlib/l_precomp.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/botlib/l_precomp.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -669,7 +669,7 @@
 	{
 		char *string;
 		int builtin;
-	} builtin[] = { // bk001204 - brackets
+	} builtin[] = {
 		{ "__LINE__",	BUILTIN_LINE },
 		{ "__FILE__",	BUILTIN_FILE },
 		{ "__DATE__",	BUILTIN_DATE },

Modified: trunk/code/botlib/l_script.c
===================================================================
--- trunk/code/botlib/l_script.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/botlib/l_script.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -706,14 +706,14 @@
 	{
 		c = *script->script_p;
 		//check for a LONG number
-		if ( (c == 'l' || c == 'L') // bk001204 - brackets 
+		if ( (c == 'l' || c == 'L')
 		     && !(token->subtype & TT_LONG))
 		{
 			script->script_p++;
 			token->subtype |= TT_LONG;
 		} //end if
 		//check for an UNSIGNED number
-		else if ( (c == 'u' || c == 'U') // bk001204 - brackets 
+		else if ( (c == 'u' || c == 'U')
 			  && !(token->subtype & (TT_UNSIGNED | TT_FLOAT)))
 		{
 			script->script_p++;

Modified: trunk/code/cgame/cg_draw.c
===================================================================
--- trunk/code/cgame/cg_draw.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/cgame/cg_draw.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -1596,18 +1596,18 @@
 	int			cmdNum;
 	usercmd_t	cmd;
 	const char		*s;
-	int			w;  // bk010215 - FIXME char message[1024];
+	int			w;
 
 	// draw the phone jack if we are completely past our buffers
 	cmdNum = trap_GetCurrentCmdNumber() - CMD_BACKUP + 1;
 	trap_GetUserCmd( cmdNum, &cmd );
 	if ( cmd.serverTime <= cg.snap->ps.commandTime
-		|| cmd.serverTime > cg.time ) {	// special check for map_restart // bk 0102165 - FIXME
+		|| cmd.serverTime > cg.time ) {	// special check for map_restart
 		return;
 	}
 
 	// also add text in center of screen
-	s = "Connection Interrupted"; // bk 010215 - FIXME
+	s = "Connection Interrupted";
 	w = CG_DrawStrlen( s ) * BIGCHAR_WIDTH;
 	CG_DrawBigString( 320 - w/2, 100, s, 1.0F);
 
@@ -1786,8 +1786,8 @@
 	char	*start;
 	int		l;
 	int		x, y, w;
-#ifdef MISSIONPACK // bk010221 - unused else
-  int h;
+#ifdef MISSIONPACK
+	int h;
 #endif
 	float	*color;
 

Modified: trunk/code/cgame/cg_drawtools.c
===================================================================
--- trunk/code/cgame/cg_drawtools.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/cgame/cg_drawtools.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -431,10 +431,6 @@
 }
 
 
-
-
-// bk001205 - code below duplicated in q3_ui/ui-atoms.c
-// bk001205 - FIXME: does this belong in ui_shared.c?
 /*
 =================
 UI_DrawProportionalString2
@@ -594,7 +590,7 @@
 static void UI_DrawBannerString2( int x, int y, const char* str, vec4_t color )
 {
 	const char* s;
-	unsigned char	ch; // bk001204 : array subscript
+	unsigned char	ch;
 	float	ax;
 	float	ay;
 	float	aw;
@@ -704,7 +700,7 @@
 static void UI_DrawProportionalString2( int x, int y, const char* str, vec4_t color, float sizeScale, qhandle_t charset )
 {
 	const char* s;
-	unsigned char	ch; // bk001204 - unsigned
+	unsigned char	ch;
 	float	ax;
 	float	ay;
 	float	aw;

Modified: trunk/code/cgame/cg_event.c
===================================================================
--- trunk/code/cgame/cg_event.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/cgame/cg_event.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -25,7 +25,7 @@
 #include "cg_local.h"
 
 // for the voice chats
-#ifdef MISSIONPACK // bk001205
+#ifdef MISSIONPACK
 #include "../../ui/menudef.h"
 #endif
 //==========================================================================

Modified: trunk/code/cgame/cg_local.h
===================================================================
--- trunk/code/cgame/cg_local.h	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/cgame/cg_local.h	2007-09-05 18:17:46 UTC (rev 1161)
@@ -1635,7 +1635,7 @@
   SYSTEM_PRINT,
   CHAT_PRINT,
   TEAMCHAT_PRINT
-} q3print_t; // bk001201 - warning: useless keyword or type name in empty declaration
+} q3print_t;
 
 
 int trap_CIN_PlayCinematic( const char *arg0, int xpos, int ypos, int width, int height, int bits);

Modified: trunk/code/cgame/cg_main.c
===================================================================
--- trunk/code/cgame/cg_main.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/cgame/cg_main.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -204,7 +204,7 @@
 	int			cvarFlags;
 } cvarTable_t;
 
-static cvarTable_t cvarTable[] = { // bk001129
+static cvarTable_t cvarTable[] = {
 	{ &cg_ignore, "cg_ignore", "0", 0 },	// used for debugging
 	{ &cg_autoswitch, "cg_autoswitch", "1", CVAR_ARCHIVE },
 	{ &cg_drawGun, "cg_drawGun", "1", CVAR_ARCHIVE },
@@ -1357,7 +1357,7 @@
 			continue;
 		}
 	}
-	return qfalse; // bk001204 - why not?
+	return qfalse;
 }
 
 void CG_ParseMenu(const char *menuFile) {
@@ -1690,7 +1690,7 @@
 }
 #endif
 
-#ifdef MISSIONPACK // bk001204 - only needed there
+#ifdef MISSIONPACK
 static float CG_Cvar_Get(const char *cvar) {
 	char buff[128];
 	memset(buff, 0, sizeof(buff));

Modified: trunk/code/cgame/cg_newdraw.c
===================================================================
--- trunk/code/cgame/cg_newdraw.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/cgame/cg_newdraw.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -20,7 +20,7 @@
 ===========================================================================
 */
 
-#ifndef MISSIONPACK // bk001204
+#ifndef MISSIONPACK
 #error This file not be used for classic Q3A.
 #endif
 
@@ -172,7 +172,7 @@
 	cent = &cg_entities[cg.snap->ps.clientNum];
 	ps = &cg.snap->ps;
 
-	if ( draw2D || ( !cg_draw3dIcons.integer && cg_drawIcons.integer) ) { // bk001206 - parentheses
+	if ( draw2D || ( !cg_draw3dIcons.integer && cg_drawIcons.integer) ) {
 		CG_DrawPic( rect->x, rect->y + rect->h/2 + 1, rect->w, rect->h, cgs.media.armorIcon );
   } else if (cg_draw3dIcons.integer) {
 	  VectorClear( angles );
@@ -209,10 +209,9 @@
 	}
 }
 
-#ifndef MISSIONPACK // bk001206 
+#ifndef MISSIONPACK
 static float healthColors[4][4] = { 
 //		{ 0.2, 1.0, 0.2, 1.0 } , { 1.0, 0.2, 0.2, 1.0 }, {0.5, 0.5, 0.5, 1} };
-  // bk0101016 - float const
   { 1.0f, 0.69f, 0.0f, 1.0f } ,		// normal
   { 1.0f, 0.2f, 0.2f, 1.0f },		// low health
   { 0.5f, 0.5f, 0.5f, 1.0f},		// weapon firing
@@ -228,7 +227,7 @@
 	cent = &cg_entities[cg.snap->ps.clientNum];
 	ps = &cg.snap->ps;
 
-	if ( draw2D || (!cg_draw3dIcons.integer && cg_drawIcons.integer) ) { // bk001206 - parentheses
+	if ( draw2D || (!cg_draw3dIcons.integer && cg_drawIcons.integer) ) {
 	  qhandle_t	icon;
     icon = cg_weapons[ cg.predictedPlayerState.weapon ].ammoIcon;
 		if ( icon ) {
@@ -1214,8 +1213,6 @@
 	vec4_t newColor;
 	glyphInfo_t *glyph;
   if (text) {
-// TTimo: FIXME
-//    const unsigned char *s = text; // bk001206 - unsigned
     const char *s = text;
 		float max = *maxX;
 		float useScale;

Modified: trunk/code/cgame/cg_players.c
===================================================================
--- trunk/code/cgame/cg_players.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/cgame/cg_players.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -1752,7 +1752,7 @@
 }
 
 
-#ifdef MISSIONPACK // bk001204
+#ifdef MISSIONPACK
 /*
 ===============
 CG_PlayerTokens
@@ -2025,7 +2025,7 @@
 	// fade the shadow out with height
 	alpha = 1.0 - trace.fraction;
 
-	// bk0101022 - hack / FPE - bogus planes?
+	// hack / FPE - bogus planes?
 	//assert( DotProduct( trace.plane.normal, trace.plane.normal ) != 0.0f ) 
 
 	// add the mark as a temporary, so it goes directly to the renderer

Modified: trunk/code/cgame/cg_servercmds.c
===================================================================
--- trunk/code/cgame/cg_servercmds.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/cgame/cg_servercmds.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -25,7 +25,7 @@
 // be a valid snapshot this frame
 
 #include "cg_local.h"
-#include "../../ui/menudef.h" // bk001205 - for Q3_ui as well
+#include "../../ui/menudef.h"
 
 typedef struct {
 	const char *order;
@@ -46,7 +46,7 @@
 
 static const int numValidOrders = sizeof(validOrders) / sizeof(orderTask_t);
 
-#ifdef MISSIONPACK // bk001204
+#ifdef MISSIONPACK
 static int CG_ValidOrder(const char *p) {
 	int i;
 	for (i = 0; i < numValidOrders; i++) {

Modified: trunk/code/client/cl_cgame.c
===================================================================
--- trunk/code/client/cl_cgame.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/client/cl_cgame.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -697,7 +697,7 @@
 		return re.inPVS( VMA(1), VMA(2) );
 
 	default:
-	        assert(0); // bk010102
+	        assert(0);
 		Com_Error( ERR_DROP, "Bad cgame system trap: %ld", (long int) args[0] );
 	}
 	return 0;
@@ -906,8 +906,6 @@
 		Cbuf_AddText( cl_activeAction->string );
 		Cvar_Set( "activeAction", "" );
 	}
-	
-	Sys_BeginProfiling();
 }
 
 /*
@@ -1010,9 +1008,35 @@
 	// while a normal demo may have different time samples
 	// each time it is played back
 	if ( cl_timedemo->integer ) {
+		int now = Sys_Milliseconds( );
+		int frameDuration;
+
 		if (!clc.timeDemoStart) {
-			clc.timeDemoStart = Sys_Milliseconds();
+			clc.timeDemoStart = clc.timeDemoLastFrame = now;
+			clc.timeDemoMinDuration = INT_MAX;
+			clc.timeDemoMaxDuration = 0;
 		}
+
+		frameDuration = now - clc.timeDemoLastFrame;
+		clc.timeDemoLastFrame = now;
+
+		// Ignore the first measurement as it'll always be 0
+		if( clc.timeDemoFrames > 0 )
+		{
+			if( frameDuration > clc.timeDemoMaxDuration )
+				clc.timeDemoMaxDuration = frameDuration;
+
+			if( frameDuration < clc.timeDemoMinDuration )
+				clc.timeDemoMinDuration = frameDuration;
+
+			// 255 ms = about 4fps
+			if( frameDuration > UCHAR_MAX )
+				frameDuration = UCHAR_MAX;
+
+			clc.timeDemoDurations[ ( clc.timeDemoFrames - 1 ) %
+				MAX_TIMEDEMO_DURATIONS ] = frameDuration;
+		}
+
 		clc.timeDemoFrames++;
 		cl.serverTime = clc.timeDemoBaseTime + clc.timeDemoFrames * 50;
 	}

Modified: trunk/code/client/cl_cin.c
===================================================================
--- trunk/code/client/cl_cin.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/client/cl_cin.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -1072,12 +1072,10 @@
 	
 	if (currentHandle < 0) return;
 
-	Sys_EndStreamedFile(cinTable[currentHandle].iFile);
 	FS_FCloseFile( cinTable[currentHandle].iFile );
 	FS_FOpenFileRead (cinTable[currentHandle].fileName, &cinTable[currentHandle].iFile, qtrue);
 	// let the background thread start reading ahead
-	Sys_BeginStreamedFile( cinTable[currentHandle].iFile, 0x10000 );
-	Sys_StreamedRead (cin.file, 16, 1, cinTable[currentHandle].iFile);
+	FS_Read (cin.file, 16, cinTable[currentHandle].iFile);
 	RoQ_init();
 	cinTable[currentHandle].status = FMV_LOOPED;
 }
@@ -1098,7 +1096,7 @@
         
 	if (currentHandle < 0) return;
 
-	Sys_StreamedRead( cin.file, cinTable[currentHandle].RoQFrameSize+8, 1, cinTable[currentHandle].iFile );
+	FS_Read( cin.file, cinTable[currentHandle].RoQFrameSize+8, cinTable[currentHandle].iFile );
 	if ( cinTable[currentHandle].RoQPlayed >= cinTable[currentHandle].ROQSize ) { 
 		if (cinTable[currentHandle].holdAtEnd==qfalse) {
 			if (cinTable[currentHandle].looping) {
@@ -1214,7 +1212,7 @@
 // one more frame hits the dust
 //
 //	assert(cinTable[currentHandle].RoQFrameSize <= 65536);
-//	r = Sys_StreamedRead( cin.file, cinTable[currentHandle].RoQFrameSize+8, 1, cinTable[currentHandle].iFile );
+//	r = FS_Read( cin.file, cinTable[currentHandle].RoQFrameSize+8, cinTable[currentHandle].iFile );
 	cinTable[currentHandle].RoQPlayed	+= cinTable[currentHandle].RoQFrameSize+8;
 }
 
@@ -1272,7 +1270,6 @@
 	cinTable[currentHandle].status = FMV_IDLE;
 
 	if (cinTable[currentHandle].iFile) {
-		Sys_EndStreamedFile( cinTable[currentHandle].iFile );
 		FS_FCloseFile( cinTable[currentHandle].iFile );
 		cinTable[currentHandle].iFile = 0;
 	}
@@ -1332,7 +1329,6 @@
 
 e_status CIN_RunCinematic (int handle)
 {
-        // bk001204 - init
 	int	start = 0;
 	int     thisTime = 0;
 
@@ -1472,8 +1468,6 @@
 	{
 		RoQ_init();
 //		FS_Read (cin.file, cinTable[currentHandle].RoQFrameSize+8, cinTable[currentHandle].iFile);
-		// let the background thread start reading ahead
-		Sys_BeginStreamedFile( cinTable[currentHandle].iFile, 0x10000 );
 
 		cinTable[currentHandle].status = FMV_PLAY;
 		Com_DPrintf("trFMV::play(), playing %s\n", arg);

Modified: trunk/code/client/cl_console.c
===================================================================
--- trunk/code/client/cl_console.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/client/cl_console.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -71,9 +71,8 @@
 ================
 */
 void Con_ToggleConsole_f (void) {
-	// closing a full screen console restarts the demo loop
+	// Can't toggle the console when it's the only thing available
 	if ( cls.state == CA_DISCONNECTED && cls.keyCatchers == KEYCATCH_CONSOLE ) {
-		CL_StartDemoLoop();
 		return;
 	}
 
@@ -619,13 +618,13 @@
 
 	re.SetColor( g_color_table[ColorIndex(COLOR_RED)] );
 
-	i = strlen( SVN_VERSION );
+	i = strlen( Q3_VERSION );
 
 	for (x=0 ; x<i ; x++) {
 
 		SCR_DrawSmallChar( cls.glconfig.vidWidth - ( i - x ) * SMALLCHAR_WIDTH, 
 
-			(lines-(SMALLCHAR_HEIGHT+SMALLCHAR_HEIGHT/2)), SVN_VERSION[x] );
+			(lines-(SMALLCHAR_HEIGHT+SMALLCHAR_HEIGHT/2)), Q3_VERSION[x] );
 
 	}
 

Modified: trunk/code/client/cl_curl.c
===================================================================
--- trunk/code/client/cl_curl.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/client/cl_curl.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -25,38 +25,8 @@
 cvar_t *cl_cURLLib;
 
 #if USE_CURL_DLOPEN
+#include "../sys/sys_loadlib.h"
 
-#if USE_SDL_VIDEO
-#include "SDL.h"
-#include "SDL_loadso.h"
-#define OBJTYPE void *
-#define OBJLOAD(x) SDL_LoadObject(x)
-#define SYMLOAD(x,y) SDL_LoadFunction(x,y)
-#define OBJFREE(x) SDL_UnloadObject(x)
-
-#elif defined _WIN32
-#include <windows.h>
-#define OBJTYPE HMODULE
-#define OBJLOAD(x) LoadLibrary(x)
-#define SYMLOAD(x,y) GetProcAddress(x,y)
-#define OBJFREE(x) FreeLibrary(x)
-
-#elif defined __linux__ || defined __FreeBSD__ || defined MACOS_X || defined __sun
-#include <dlfcn.h>
-#define OBJTYPE void *
-#define OBJLOAD(x) dlopen(x, RTLD_LAZY | RTLD_GLOBAL)
-#define SYMLOAD(x,y) dlsym(x,y)
-#define OBJFREE(x) dlclose(x)
-#else
-
-#error "Your platform has no lib loading code or it is disabled"
-#endif
-
-#if defined __linux__ || defined __FreeBSD__ || defined MACOS_X
-#include <unistd.h>
-#include <sys/types.h>
-#endif
-
 char* (*qcurl_version)(void);
 
 CURL* (*qcurl_easy_init)(void);
@@ -85,7 +55,7 @@
                                                 int *msgs_in_queue);
 const char *(*qcurl_multi_strerror)(CURLMcode);
 
-static OBJTYPE cURLLib = NULL;
+static void *cURLLib = NULL;
 
 /*
 =================
@@ -96,7 +66,7 @@
 {
 	void *rv;
 
-	rv = SYMLOAD(cURLLib, str);
+	rv = Sys_LoadFunction(cURLLib, str);
 	if(!rv)
 	{
 		Com_Printf("Can't load symbol %s\n", str);
@@ -124,17 +94,17 @@
 
 
 	Com_Printf("Loading \"%s\"...", cl_cURLLib->string);
-	if( (cURLLib = OBJLOAD(cl_cURLLib->string)) == 0 )
+	if( (cURLLib = Sys_LoadLibrary(cl_cURLLib->string)) == 0 )
 	{
 #ifdef _WIN32
 		return qfalse;
 #else
 		char fn[1024];
-		getcwd(fn, sizeof(fn));
+		Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) );
 		strncat(fn, "/", sizeof(fn)-strlen(fn)-1);
 		strncat(fn, cl_cURLLib->string, sizeof(fn)-strlen(fn)-1);
 
-		if( (cURLLib = OBJLOAD(fn)) == 0 )
+		if( (cURLLib = Sys_LoadLibrary(fn)) == 0 )
 		{
 			return qfalse;
 		}
@@ -189,7 +159,7 @@
 #if USE_CURL_DLOPEN
 	if(cURLLib)
 	{
-		OBJFREE(cURLLib);
+		Sys_UnloadLibrary(cURLLib);
 		cURLLib = NULL;
 	}
 	qcurl_easy_init = NULL;

Modified: trunk/code/client/cl_keys.c
===================================================================
--- trunk/code/client/cl_keys.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/client/cl_keys.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -1147,7 +1147,6 @@
 		}
 	}
 
-#ifndef _WIN32
 	if (key == K_ENTER)
 	{
 		if (down)
@@ -1157,14 +1156,10 @@
 				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
 	if (key == '`' || key == '~' ||
@@ -1207,7 +1202,7 @@
 			if ( cls.state == CA_ACTIVE && !clc.demoplaying ) {
 				VM_Call( uivm, UI_SET_ACTIVE_MENU, UIMENU_INGAME );
 			}
-			else {
+			else if ( cls.state != CA_DISCONNECTED ) {
 				CL_Disconnect_f();
 				S_StopAllSounds();
 				VM_Call( uivm, UI_SET_ACTIVE_MENU, UIMENU_MAIN );
@@ -1222,19 +1217,21 @@
 	//
 	// key up events only perform actions if the game key binding is
 	// a button command (leading + sign).  These will be processed even in
-	// console mode and menu mode, to keep the character from continuing 
+	// console mode and menu mode, to keep the character from continuing
 	// an action started before a mode switch.
 	//
-	if (!down) {
-		kb = keys[key].binding;
+	if (!down ) {
+		if ( cls.state != CA_DISCONNECTED ) {
+			kb = keys[key].binding;
 
-		CL_AddKeyUpCommands( key, kb, time );
+			CL_AddKeyUpCommands( key, kb, time );
 
-		if ( cls.keyCatchers & KEYCATCH_UI && uivm ) {
-			VM_Call( uivm, UI_KEY_EVENT, key, down );
-		} else if ( cls.keyCatchers & KEYCATCH_CGAME && cgvm ) {
-			VM_Call( cgvm, CG_KEY_EVENT, key, down );
-		} 
+			if ( cls.keyCatchers & KEYCATCH_UI && uivm ) {
+				VM_Call( uivm, UI_KEY_EVENT, key, down );
+			} else if ( cls.keyCatchers & KEYCATCH_CGAME && cgvm ) {
+				VM_Call( cgvm, CG_KEY_EVENT, key, down );
+			}
+		}
 
 		return;
 	}
@@ -1263,7 +1260,7 @@
 				Com_Printf ("%s is unbound, use controls menu to set.\n"
 					, Key_KeynumToString( key ) );
 			}
-		} else if (kb[0] == '+') {	
+		} else if (kb[0] == '+') {
 			int i;
 			char button[1024], *buttonPtr;
 			buttonPtr = button;

Modified: trunk/code/client/cl_main.c
===================================================================
--- trunk/code/client/cl_main.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/client/cl_main.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -43,6 +43,7 @@
 cvar_t	*cl_shownet;
 cvar_t	*cl_showSend;
 cvar_t	*cl_timedemo;
+cvar_t	*cl_timedemoLog;
 cvar_t	*cl_autoRecordDemo;
 cvar_t	*cl_aviFrameRate;
 cvar_t	*cl_aviMotionJpeg;
@@ -393,17 +394,94 @@
 
 /*
 =================
+CL_DemoFrameDurationSDev
+=================
+*/
+static float CL_DemoFrameDurationSDev( void )
+{
+	int i;
+	int numFrames;
+	float mean = 0.0f;
+	float variance = 0.0f;
+
+	if( ( clc.timeDemoFrames - 1 ) > MAX_TIMEDEMO_DURATIONS )
+		numFrames = MAX_TIMEDEMO_DURATIONS;
+	else
+		numFrames = clc.timeDemoFrames - 1;
+
+	for( i = 0; i < numFrames; i++ )
+		mean += clc.timeDemoDurations[ i ];
+	mean /= numFrames;
+
+	for( i = 0; i < numFrames; i++ )
+	{
+		float x = clc.timeDemoDurations[ i ];
+
+		variance += ( ( x - mean ) * ( x - mean ) );
+	}
+	variance /= numFrames;
+
+	return sqrt( variance );
+}
+
+/*
+=================
 CL_DemoCompleted
 =================
 */
-void CL_DemoCompleted( void ) {
-	if (cl_timedemo && cl_timedemo->integer) {
+void CL_DemoCompleted( void )
+{
+	char buffer[ MAX_STRING_CHARS ];
+
+	if( cl_timedemo && cl_timedemo->integer )
+	{
 		int	time;
 		
 		time = Sys_Milliseconds() - clc.timeDemoStart;
-		if ( time > 0 ) {
-			Com_Printf ("%i frames, %3.1f seconds: %3.1f fps\n", clc.timeDemoFrames,
-			time/1000.0, clc.timeDemoFrames*1000.0 / time);
+		if( time > 0 )
+		{
+			// Millisecond times are frame durations:
+			// minimum/average/maximum/std deviation
+			Com_sprintf( buffer, sizeof( buffer ),
+					"%i frames %3.1f seconds %3.1f fps %d.0/%.1f/%d.0/%.1f ms\n",
+					clc.timeDemoFrames,
+					time/1000.0,
+					clc.timeDemoFrames*1000.0 / time,
+					clc.timeDemoMinDuration,
+					time / (float)clc.timeDemoFrames,
+					clc.timeDemoMaxDuration,
+					CL_DemoFrameDurationSDev( ) );
+			Com_Printf( buffer );
+
+			// Write a log of all the frame durations
+			if( cl_timedemoLog && strlen( cl_timedemoLog->string ) > 0 )
+			{
+				int i;
+				int numFrames;
+				fileHandle_t f;
+
+				if( ( clc.timeDemoFrames - 1 ) > MAX_TIMEDEMO_DURATIONS )
+					numFrames = MAX_TIMEDEMO_DURATIONS;
+				else
+					numFrames = clc.timeDemoFrames - 1;
+
+				f = FS_FOpenFileWrite( cl_timedemoLog->string );
+				if( f )
+				{
+					FS_Printf( f, "# %s", buffer );
+
+					for( i = 0; i < numFrames; i++ )
+						FS_Printf( f, "%d\n", clc.timeDemoDurations[ i ] );
+
+					FS_FCloseFile( f );
+					Com_Printf( "%s written\n", cl_timedemoLog->string );
+				}
+				else
+				{
+					Com_Printf( "Couldn't open %s for writing\n",
+							cl_timedemoLog->string );
+				}
+			}
 		}
 	}
 
@@ -658,7 +736,7 @@
 		Hunk_ClearToMark();
 	}
 
-	CL_StartHunkUsers();
+	CL_StartHunkUsers( qfalse );
 }
 
 /*
@@ -671,6 +749,12 @@
 =====================
 */
 void CL_MapLoading( void ) {
+	if ( com_dedicated->integer ) {
+		cls.state = CA_DISCONNECTED;
+		cls.keyCatchers = KEYCATCH_CONSOLE;
+		return;
+	}
+
 	if ( !com_cl_running->integer ) {
 		return;
 	}
@@ -830,7 +914,7 @@
 	}
 
 	if ( clc.demoplaying || cls.state < CA_CONNECTED || cmd[0] == '+' ) {
-		Com_Printf ("Unknown command \"%s\"\n", cmd);
+		Com_Printf ("Unknown command \"%s" S_COLOR_WHITE "\"\n", cmd);
 		return;
 	}
 
@@ -939,26 +1023,22 @@
 		return;
 	}
 
-	if ( Cvar_VariableValue( "fs_restrict" ) ) {
-		Q_strncpyz( nums, "demota", sizeof( nums ) );
-	} else {
-		// only grab the alphanumeric values from the cdkey, to avoid any dashes or spaces
-		j = 0;
-		l = strlen( cl_cdkey );
-		if ( l > 32 ) {
-			l = 32;
-		}
-		for ( i = 0 ; i < l ; i++ ) {
-			if ( ( cl_cdkey[i] >= '0' && cl_cdkey[i] <= '9' )
+	// only grab the alphanumeric values from the cdkey, to avoid any dashes or spaces
+	j = 0;
+	l = strlen( cl_cdkey );
+	if ( l > 32 ) {
+		l = 32;
+	}
+	for ( i = 0 ; i < l ; i++ ) {
+		if ( ( cl_cdkey[i] >= '0' && cl_cdkey[i] <= '9' )
 				|| ( cl_cdkey[i] >= 'a' && cl_cdkey[i] <= 'z' )
 				|| ( cl_cdkey[i] >= 'A' && cl_cdkey[i] <= 'Z' )
-				) {
-				nums[j] = cl_cdkey[i];
-				j++;
-			}
+			 ) {
+			nums[j] = cl_cdkey[i];
+			j++;
 		}
-		nums[j] = 0;
 	}
+	nums[j] = 0;
 
 	fs = Cvar_Get ("cl_anonymous", "0", CVAR_INIT|CVAR_SYSTEMINFO );
 
@@ -1276,7 +1356,7 @@
 	CL_InitRef();
 
 	// startup all the client stuff
-	CL_StartHunkUsers();
+	CL_StartHunkUsers( qfalse );
 
 	// start the cgame if connected
 	if ( cls.state > CA_CONNECTED && cls.state != CA_CINEMATIC ) {
@@ -2316,7 +2396,7 @@
 This is the only place that any of these functions are called from
 ============================
 */
-void CL_StartHunkUsers( void ) {
+void CL_StartHunkUsers( qboolean rendererOnly ) {
 	if (!com_cl_running) {
 		return;
 	}
@@ -2330,6 +2410,10 @@
 		CL_InitRenderer();
 	}
 
+	if ( rendererOnly ) {
+		return;
+	}
+
 	if ( !cls.soundStarted ) {
 		cls.soundStarted = qtrue;
 		S_Init();
@@ -2590,6 +2674,7 @@
 	cl_activeAction = Cvar_Get( "activeAction", "", CVAR_TEMP );
 
 	cl_timedemo = Cvar_Get ("timedemo", "0", 0);
+	cl_timedemoLog = Cvar_Get ("cl_timedemoLog", "", CVAR_ARCHIVE);
 	cl_autoRecordDemo = Cvar_Get ("cl_autoRecordDemo", "0", CVAR_ARCHIVE);
 	cl_aviFrameRate = Cvar_Get ("cl_aviFrameRate", "25", CVAR_ARCHIVE);
 	cl_aviMotionJpeg = Cvar_Get ("cl_aviMotionJpeg", "1", CVAR_ARCHIVE);
@@ -3203,11 +3288,6 @@
 	for (i=3; i<count; i++)
 		buffptr += sprintf( buffptr, " %s", Cmd_Argv(i) );
 
-	// if we are a demo, automatically add a "demo" keyword
-	if ( Cvar_VariableValue( "fs_restrict" ) ) {
-		buffptr += sprintf( buffptr, " demo" );
-	}
-
 	NET_OutOfBandPrint( NS_SERVER, to, command );
 }
 

Modified: trunk/code/client/cl_scrn.c
===================================================================
--- trunk/code/client/cl_scrn.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/client/cl_scrn.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -448,14 +448,9 @@
 		}
 	}
 
-	if ( !uivm ) {
-		Com_DPrintf("draw screen without UI loaded\n");
-		return;
-	}
-
 	// if the menu is going to cover the entire screen, we
 	// don't need to render anything under it
-	if ( !VM_Call( uivm, UI_IS_FULLSCREEN )) {
+	if ( uivm && !VM_Call( uivm, UI_IS_FULLSCREEN )) {
 		switch( cls.state ) {
 		default:
 			Com_Error( ERR_FATAL, "SCR_DrawScreenField: bad cls.state" );

Modified: trunk/code/client/cl_ui.c
===================================================================
--- trunk/code/client/cl_ui.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/client/cl_ui.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -677,6 +677,8 @@
 ====================
 */
 void Key_SetCatcher( int catcher ) {
+	// prevent console from being closed
+	catcher |= cls.keyCatchers & KEYCATCH_CONSOLE;
 	cls.keyCatchers = catcher;
 }
 

Modified: trunk/code/client/client.h
===================================================================
--- trunk/code/client/client.h	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/client/client.h	2007-09-05 18:17:46 UTC (rev 1161)
@@ -153,6 +153,7 @@
 =============================================================================
 */
 
+#define MAX_TIMEDEMO_DURATIONS	4096
 
 typedef struct {
 
@@ -219,6 +220,10 @@
 	int			timeDemoFrames;		// counter of rendered frames
 	int			timeDemoStart;		// cls.realtime before first frame
 	int			timeDemoBaseTime;	// each frame will be at this time + frameNum * 50
+	int			timeDemoLastFrame;// time the last frame was rendered
+	int			timeDemoMinDuration;	// minimum frame duration
+	int			timeDemoMaxDuration;	// maximum frame duration
+	unsigned char	timeDemoDurations[ MAX_TIMEDEMO_DURATIONS ];	// log of frame durations
 
 	// big stuff at end of structure so most offsets are 15 bits or less
 	netchan_t	netchan;
@@ -384,7 +389,7 @@
 void CL_ShutdownAll(void);
 void CL_AddReliableCommand( const char *cmd );
 
-void CL_StartHunkUsers( void );
+void CL_StartHunkUsers( qboolean rendererOnly );
 
 void CL_Disconnect_f (void);
 void CL_GetChallengePacket (void);

Modified: trunk/code/client/qal.c
===================================================================
--- trunk/code/client/qal.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/client/qal.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -29,37 +29,8 @@
 
 #if USE_OPENAL_DLOPEN
 
-#if USE_SDL_VIDEO
-#include "SDL.h"
-#include "SDL_loadso.h"
-#define OBJTYPE void *
-#define OBJLOAD(x) SDL_LoadObject(x)
-#define SYMLOAD(x,y) SDL_LoadFunction(x,y)
-#define OBJFREE(x) SDL_UnloadObject(x)
+#include "../sys/sys_loadlib.h"
 
-#elif defined _WIN32
-#include <windows.h>
-#define OBJTYPE HMODULE
-#define OBJLOAD(x) LoadLibrary(x)
-#define SYMLOAD(x,y) GetProcAddress(x,y)
-#define OBJFREE(x) FreeLibrary(x)
-
-#elif defined __linux__ || defined __FreeBSD__ || defined MACOS_X || defined __sun
-#include <dlfcn.h>
-#define OBJTYPE void *
-#define OBJLOAD(x) dlopen(x, RTLD_LAZY | RTLD_GLOBAL)
-#define SYMLOAD(x,y) dlsym(x,y)
-#define OBJFREE(x) dlclose(x)
-#else
-
-#error "Your platform has no lib loading code or it is disabled"
-#endif
-
-#if defined __linux__ || defined __FreeBSD__ || defined MACOS_X
-#include <unistd.h>
-#include <sys/types.h>
-#endif
-
 LPALENABLE qalEnable;
 LPALDISABLE qalDisable;
 LPALISENABLED qalIsEnabled;
@@ -131,7 +102,7 @@
 LPALCGETSTRING qalcGetString;
 LPALCGETINTEGERV qalcGetIntegerv;
 
-static OBJTYPE OpenALLib = NULL;
+static void *OpenALLib = NULL;
 
 static qboolean alinit_fail = qfalse;
 
@@ -144,7 +115,7 @@
 {
 	void *rv;
 
-	rv = SYMLOAD(OpenALLib, str);
+	rv = Sys_LoadFunction(OpenALLib, str);
 	if(!rv)
 	{
 		Com_Printf( " Can't load symbol %s\n", str);
@@ -169,17 +140,17 @@
 		return qtrue;
 
 	Com_Printf( "Loading \"%s\"...\n", libname);
-	if( (OpenALLib = OBJLOAD(libname)) == 0 )
+	if( (OpenALLib = Sys_LoadLibrary(libname)) == 0 )
 	{
 #ifdef _WIN32
 		return qfalse;
 #else
 		char fn[1024];
-		getcwd(fn, sizeof(fn));
+		Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) );
 		strncat(fn, "/", sizeof(fn) - strlen(fn) - 1);
 		strncat(fn, libname, sizeof(fn) - strlen(fn) - 1);
 
-		if( (OpenALLib = OBJLOAD(fn)) == 0 )
+		if( (OpenALLib = Sys_LoadLibrary(fn)) == 0 )
 		{
 			return qfalse;
 		}
@@ -278,7 +249,7 @@
 {
 	if(OpenALLib)
 	{
-		OBJFREE(OpenALLib);
+		Sys_UnloadLibrary(OpenALLib);
 		OpenALLib = NULL;
 	}
 

Modified: trunk/code/client/snd_dma.c
===================================================================
--- trunk/code/client/snd_dma.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/client/snd_dma.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -616,11 +616,7 @@
 
 	SNDDMA_BeginPainting ();
 	if (dma.buffer)
-    // TTimo: due to a particular bug workaround in linux sound code,
-    //   have to optionally use a custom C implementation of Com_Memset
-    //   not affecting win32, we have #define Snd_Memset Com_Memset
-    // https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=371
-		Snd_Memset(dma.buffer, clear, dma.samples * dma.samplebits/8);
+		Com_Memset(dma.buffer, clear, dma.samples * dma.samplebits/8);
 	SNDDMA_Submit ();
 }
 

Modified: trunk/code/client/snd_main.c
===================================================================
--- trunk/code/client/snd_main.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/client/snd_main.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -30,6 +30,7 @@
 cvar_t *s_musicVolume;
 cvar_t *s_doppler;
 cvar_t *s_backend;
+cvar_t *s_muteWhenMinimized;
 
 static soundInterface_t si;
 
@@ -219,6 +220,11 @@
 */
 void S_Update( void )
 {
+	if( s_muteWhenMinimized->integer && com_minimized->integer ) {
+		S_StopAllSounds( );
+		return;
+	}
+
 	if( si.Update ) {
 		si.Update( );
 	}
@@ -372,6 +378,7 @@
 	s_musicVolume = Cvar_Get( "s_musicvolume", "0.25", CVAR_ARCHIVE );
 	s_doppler = Cvar_Get( "s_doppler", "1", CVAR_ARCHIVE );
 	s_backend = Cvar_Get( "s_backend", "", CVAR_ROM );
+	s_muteWhenMinimized = Cvar_Get( "s_muteWhenMinimized", "0", CVAR_ARCHIVE );
 
 	cv = Cvar_Get( "s_initsound", "1", 0 );
 	if( !cv->integer ) {

Modified: trunk/code/client/snd_mix.c
===================================================================
--- trunk/code/client/snd_mix.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/client/snd_mix.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -30,7 +30,6 @@
 static portable_samplepair_t paintbuffer[PAINTBUFFER_SIZE];
 static int snd_vol;
 
-// bk001119 - these not static, required by unix/snd_mixa.s
 int*     snd_p;  
 int      snd_linear_count;
 short*   snd_out;

Modified: trunk/code/game/ai_chat.c
===================================================================
--- trunk/code/game/ai_chat.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/game/ai_chat.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -53,7 +53,7 @@
 #include "match.h"				//string matching types and vars
 
 // for the voice chats
-#ifdef MISSIONPACK // bk001205
+#ifdef MISSIONPACK
 #include "../../ui/menudef.h"
 #endif
 

Modified: trunk/code/game/ai_dmq3.c
===================================================================
--- trunk/code/game/ai_dmq3.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/game/ai_dmq3.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -3751,7 +3751,6 @@
 BotSetMovedir
 ==================
 */
-// bk001205 - made these static
 static vec3_t VEC_UP		= {0, -1,  0};
 static vec3_t MOVEDIR_UP	= {0,  0,  1};
 static vec3_t VEC_DOWN		= {0, -2,  0};

Modified: trunk/code/game/ai_main.c
===================================================================
--- trunk/code/game/ai_main.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/game/ai_main.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -1626,9 +1626,6 @@
 	//game directory
 	trap_Cvar_VariableStringBuffer("fs_game", buf, sizeof(buf));
 	if (strlen(buf)) trap_BotLibVarSet("gamedir", buf);
-	//cd directory
-	trap_Cvar_VariableStringBuffer("fs_cdpath", buf, sizeof(buf));
-	if (strlen(buf)) trap_BotLibVarSet("cddir", buf);
 	//home directory
 	trap_Cvar_VariableStringBuffer("fs_homepath", buf, sizeof(buf));
 	if (strlen(buf)) trap_BotLibVarSet("homedir", buf);

Modified: trunk/code/game/bg_lib.c
===================================================================
--- trunk/code/game/bg_lib.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/game/bg_lib.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -43,7 +43,6 @@
 static const char rcsid[] =
 #endif /* LIBC_SCCS and not lint */
 
-// bk001127 - needed for DLL's
 #if !defined( Q3_VM )
 typedef int		 cmp_t(const void *, const void *);
 #endif
@@ -189,8 +188,6 @@
 
 
 // this file is excluded from release builds because of intrinsics
-
-// bk001211 - gcc errors on compiling strcpy:  parse error before `__extension__'
 #if defined ( Q3_VM )
 
 size_t strlen( const char *string ) {
@@ -265,7 +262,7 @@
 	}
 	return (char *)0;
 }
-#endif // bk001211
+#endif
 
 #if defined ( Q3_VM )
 int tolower( int c ) {
@@ -754,8 +751,6 @@
 #endif
 
 #ifdef Q3_VM
-// bk001127 - guarded this tan replacement 
-// ld: undefined versioned symbol name tan@@GLIBC_2.0
 double tan( double x ) {
 	return sin(x) / cos(x);
 }
@@ -844,7 +839,7 @@
 	const char	*string;
 	float sign;
 	float value;
-	int		c = '0'; // bk001211 - uninitialized use possible
+	int		c = '0';
 
 	string = *stringPtr;
 

Modified: trunk/code/game/bg_misc.c
===================================================================
--- trunk/code/game/bg_misc.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/game/bg_misc.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -1177,7 +1177,7 @@
             Com_Error( ERR_DROP, "BG_CanItemBeGrabbed: IT_BAD" );
         default:
 #ifndef Q3_VM
-#ifndef NDEBUG // bk0001204
+#ifndef NDEBUG
           Com_Printf("BG_CanItemBeGrabbed: unknown enum %d\n", item->giType );
 #endif
 #endif

Modified: trunk/code/game/g_arenas.c
===================================================================
--- trunk/code/game/g_arenas.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/game/g_arenas.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -43,7 +43,7 @@
 	int			playerClientNum;
 	int			n, accuracy, perfect,	msglen;
 	int			buflen;
-#ifdef MISSIONPACK // bk001205
+#ifdef MISSIONPACK
   int score1, score2;
 	qboolean won;
 #endif

Modified: trunk/code/game/g_bot.c
===================================================================
--- trunk/code/game/g_bot.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/game/g_bot.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -43,7 +43,6 @@
 	int		spawnTime;
 } botSpawnQueue_t;
 
-//static int			botBeginDelay = 0;  // bk001206 - unused, init
 static botSpawnQueue_t	botSpawnQueue[BOT_SPAWN_QUEUE_DEPTH];
 
 vmCvar_t bot_minplayers;

Modified: trunk/code/game/g_client.c
===================================================================
--- trunk/code/game/g_client.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/game/g_client.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -1129,7 +1129,7 @@
 	}
 	eventSequence = client->ps.eventSequence;
 
-	memset (client, 0, sizeof(*client)); // bk FIXME: Com_Memset?
+	Com_Memset (client, 0, sizeof(*client));
 
 	client->pers = saved;
 	client->sess = savedSess;

Modified: trunk/code/game/g_main.c
===================================================================
--- trunk/code/game/g_main.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/game/g_main.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -95,7 +95,6 @@
 vmCvar_t	g_proxMineTimeout;
 #endif
 
-// bk001129 - made static to avoid aliasing
 static cvarTable_t		gameCvarTable[] = {
 	// don't override the cheat state set by the system
 	{ &g_cheats, "sv_cheats", "", 0, 0, qfalse },
@@ -182,7 +181,6 @@
 
 };
 
-// bk001129 - made static to avoid aliasing
 static int gameCvarTableSize = sizeof( gameCvarTable ) / sizeof( gameCvarTable[0] );
 
 
@@ -1118,7 +1116,7 @@
 void LogExit( const char *string ) {
 	int				i, numSorted;
 	gclient_t		*cl;
-#ifdef MISSIONPACK // bk001205
+#ifdef MISSIONPACK
 	qboolean won = qtrue;
 #endif
 	G_LogPrintf( "Exit: %s\n", string );

Modified: trunk/code/game/g_mem.c
===================================================================
--- trunk/code/game/g_mem.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/game/g_mem.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -41,7 +41,7 @@
 	}
 
 	if ( allocPoint + size > POOLSIZE ) {
-	  G_Error( "G_Alloc: failed on allocation of %i bytes\n", size ); // bk010103 - was %u, but is signed
+	  G_Error( "G_Alloc: failed on allocation of %i bytes\n", size );
 		return NULL;
 	}
 

Modified: trunk/code/game/g_session.c
===================================================================
--- trunk/code/game/g_session.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/game/g_session.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -69,8 +69,6 @@
 void G_ReadSessionData( gclient_t *client ) {
 	char	s[MAX_STRING_CHARS];
 	const char	*var;
-
-	// bk001205 - format
 	int teamLeader;
 	int spectatorState;
 	int sessionTeam;
@@ -79,16 +77,15 @@
 	trap_Cvar_VariableStringBuffer( var, s, sizeof(s) );
 
 	sscanf( s, "%i %i %i %i %i %i %i",
-		&sessionTeam,                 // bk010221 - format
+		&sessionTeam,
 		&client->sess.spectatorTime,
-		&spectatorState,              // bk010221 - format
+		&spectatorState,
 		&client->sess.spectatorClient,
 		&client->sess.wins,
 		&client->sess.losses,
-		&teamLeader                   // bk010221 - format
+		&teamLeader
 		);
 
-	// bk001205 - format issues
 	client->sess.sessionTeam = (team_t)sessionTeam;
 	client->sess.spectatorState = (spectatorState_t)spectatorState;
 	client->sess.teamLeader = (qboolean)teamLeader;

Modified: trunk/code/jpeg-6/jcdctmgr.c
===================================================================
--- trunk/code/jpeg-6/jcdctmgr.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/jpeg-6/jcdctmgr.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -179,95 +179,6 @@
  * blocks. The quantized coefficients are returned in coef_blocks[].
  */
 
-#if 0 // bk001204
-METHODDEF void
-forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
-	     JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
-	     JDIMENSION start_row, JDIMENSION start_col,
-	     JDIMENSION num_blocks)
-/* This version is used for integer DCT implementations. */
-{
-  /* This routine is heavily used, so it's worth coding it tightly. */
-  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
-  forward_DCT_method_ptr do_dct = fdct->do_dct;
-  DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no];
-  DCTELEM workspace[DCTSIZE2];	/* work area for FDCT subroutine */
-  JDIMENSION bi;
-
-  sample_data += start_row;	/* fold in the vertical offset once */
-
-  for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
-    /* Load data into workspace, applying unsigned->signed conversion */
-    { register DCTELEM *workspaceptr;
-      register JSAMPROW elemptr;
-      register int elemr;
-
-      workspaceptr = workspace;
-      for (elemr = 0; elemr < DCTSIZE; elemr++) {
-	elemptr = sample_data[elemr] + start_col;
-#if DCTSIZE == 8		/* unroll the inner loop */
-	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
-	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
-	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
-	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
-	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
-	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
-	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
-	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
-#else
-	{ register int elemc;
-	  for (elemc = DCTSIZE; elemc > 0; elemc--) {
-	    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
-	  }
-	}
-#endif
-      }
-    }
-
-    /* Perform the DCT */
-    (*do_dct) (workspace);
-
-    /* Quantize/descale the coefficients, and store into coef_blocks[] */
-    { register DCTELEM temp, qval;
-      register int i;
-      register JCOEFPTR output_ptr = coef_blocks[bi];
-
-      for (i = 0; i < DCTSIZE2; i++) {
-	qval = divisors[i];
-	temp = workspace[i];
-	/* Divide the coefficient value by qval, ensuring proper rounding.
-	 * Since C does not specify the direction of rounding for negative
-	 * quotients, we have to force the dividend positive for portability.
-	 *
-	 * In most files, at least half of the output values will be zero
-	 * (at default quantization settings, more like three-quarters...)
-	 * so we should ensure that this case is fast.  On many machines,
-	 * a comparison is enough cheaper than a divide to make a special test
-	 * a win.  Since both inputs will be nonnegative, we need only test
-	 * for a < b to discover whether a/b is 0.
-	 * If your machine's division is fast enough, define FAST_DIVIDE.
-	 */
-#ifdef FAST_DIVIDE
-#define DIVIDE_BY(a,b)	a /= b
-#else
-#define DIVIDE_BY(a,b)	if (a >= b) a /= b; else a = 0
-#endif
-	if (temp < 0) {
-	  temp = -temp;
-	  temp += qval>>1;	/* for rounding */
-	  DIVIDE_BY(temp, qval);
-	  temp = -temp;
-	} else {
-	  temp += qval>>1;	/* for rounding */
-	  DIVIDE_BY(temp, qval);
-	}
-	output_ptr[i] = (JCOEF) temp;
-      }
-    }
-  }
-}
-#endif // 0
-
 #ifdef DCT_FLOAT_SUPPORTED
 
 METHODDEF void

Modified: trunk/code/jpeg-6/jcmainct.c
===================================================================
--- trunk/code/jpeg-6/jcmainct.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/jpeg-6/jcmainct.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -68,7 +68,6 @@
 METHODDEF void
 start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
 {
-  // bk001204 - don't use main...
   my_main_ptr jmain = (my_main_ptr) cinfo->main;
 
   /* Do nothing in raw-data mode. */
@@ -115,7 +114,6 @@
 			  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
 			  JDIMENSION in_rows_avail)
 {
-  // bk001204 - don't use main
   my_main_ptr jmain = (my_main_ptr) cinfo->main;
 
   while (jmain->cur_iMCU_row < cinfo->total_iMCU_rows) {
@@ -246,7 +244,6 @@
 GLOBAL void
 jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
 {
-  // bk001204 - don't use main
   my_main_ptr jmain;
   int ci;
   jpeg_component_info *compptr;

Modified: trunk/code/jpeg-6/jdmainct.c
===================================================================
--- trunk/code/jpeg-6/jdmainct.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/jpeg-6/jdmainct.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -159,7 +159,6 @@
  * This is done only once, not once per pass.
  */
 {
-  // bk001204 - no use main
   my_main_ptr jmain = (my_main_ptr) cinfo->main;
   int ci, rgroup;
   int M = cinfo->min_DCT_scaled_size;
@@ -201,7 +200,6 @@
  * This will be repeated at the beginning of each pass.
  */
 {
- // bk001204 - no use main
   my_main_ptr jmain = (my_main_ptr) cinfo->main;
   int ci, i, rgroup;
   int M = cinfo->min_DCT_scaled_size;
@@ -242,7 +240,6 @@
  * This changes the pointer list state from top-of-image to the normal state.
  */
 {
- // bk001204 - no use main
   my_main_ptr jmain = (my_main_ptr) cinfo->main;
   int ci, i, rgroup;
   int M = cinfo->min_DCT_scaled_size;
@@ -272,7 +269,6 @@
  * Also sets rowgroups_avail to indicate number of nondummy row groups in row.
  */
 {
- // bk001204 - no use main
   my_main_ptr jmain = (my_main_ptr) cinfo->main;
   int ci, i, rgroup, iMCUheight, rows_left;
   jpeg_component_info *compptr;
@@ -310,7 +306,6 @@
 METHODDEF void
 start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
 {
-  // bk001204 - no use main
   my_main_ptr jmain = (my_main_ptr) cinfo->main;
 
   switch (pass_mode) {
@@ -351,7 +346,6 @@
 			  JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
 			  JDIMENSION out_rows_avail)
 {
-  // bk001204 - no use main
   my_main_ptr jmain = (my_main_ptr) cinfo->main;
   JDIMENSION rowgroups_avail;
 
@@ -392,7 +386,6 @@
 			   JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
 			   JDIMENSION out_rows_avail)
 {
-  // bk001204 - no use main
   my_main_ptr jmain = (my_main_ptr) cinfo->main;
 
   /* Read input data if we haven't filled the main buffer yet */
@@ -482,7 +475,6 @@
 GLOBAL void
 jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
 {
-  // bk001204 - no use main
   my_main_ptr jmain;
   int ci, rgroup, ngroups;
   jpeg_component_info *compptr;

Copied: trunk/code/libs/win32/libSDL.dll.a (from rev 1160, branches/unified-sdl/code/libs/win32/libSDL.dll.a)
===================================================================
(Binary files differ)

Copied: trunk/code/libs/win32/libSDL.la (from rev 1160, branches/unified-sdl/code/libs/win32/libSDL.la)
===================================================================
--- trunk/code/libs/win32/libSDL.la	                        (rev 0)
+++ trunk/code/libs/win32/libSDL.la	2007-09-05 18:17:46 UTC (rev 1161)
@@ -0,0 +1,35 @@
+# libSDL.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='../bin/SDL.dll'
+
+# Names of this library.
+library_names='libSDL.dll.a'
+
+# The name of the static archive.
+old_library='libSDL.a'
+
+# Libraries that this one depends upon.
+dependency_libs=' -luser32 -lgdi32 -lwinmm -ldxguid'
+
+# Version information for libSDL.
+current=11
+age=11
+revision=1
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/Users/hercules/tmp/SDL-1.2.12/lib'

Copied: trunk/code/libs/win32/libSDLmain.a (from rev 1160, branches/unified-sdl/code/libs/win32/libSDLmain.a)
===================================================================
(Binary files differ)

Modified: trunk/code/null/null_client.c
===================================================================
--- trunk/code/null/null_client.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/null/null_client.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -53,7 +53,7 @@
 }
 
 qboolean CL_GameCommand( void ) {
-  return qfalse; // bk001204 - non-void
+  return qfalse;
 }
 
 void CL_KeyEvent (int key, qboolean down, unsigned time) {
@@ -81,11 +81,9 @@
 void CL_FlushMemory( void ) {
 }
 
-void CL_StartHunkUsers( void ) {
+void CL_StartHunkUsers( qboolean rendererOnly ) {
 }
 
-// bk001119 - added new dummy for sv_init.c
 void CL_ShutdownAll(void) {}
 
-// bk001208 - added new dummy (RC4)
 qboolean CL_CDKeyValidate( const char *key, const char *checksum ) { return qtrue; }

Modified: trunk/code/null/null_snddma.c
===================================================================
--- trunk/code/null/null_snddma.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/null/null_snddma.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -47,7 +47,6 @@
 {
 }
 
-// bk001119 - added boolean flag, match client/snd_public.h
 sfxHandle_t S_RegisterSound( const char *name, qboolean compressed ) 
 {
 	return 0;

Modified: trunk/code/q3_ui/ui_atoms.c
===================================================================
--- trunk/code/q3_ui/ui_atoms.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/q3_ui/ui_atoms.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -330,8 +330,6 @@
 #define PROPB_SPACE_WIDTH	12
 #define PROPB_HEIGHT		36
 
-// bk001205 - code below duplicated in cgame/cg_drawtools.c
-// bk001205 - FIXME: does this belong in ui_shared.c?
 /*
 =================
 UI_DrawBannerString
@@ -340,7 +338,7 @@
 static void UI_DrawBannerString2( int x, int y, const char* str, vec4_t color )
 {
 	const char* s;
-	unsigned char	ch; // bk001204 - unsigned
+	unsigned char	ch;
 	float	ax;
 	float	ay;
 	float	aw;
@@ -450,10 +448,10 @@
 static void UI_DrawProportionalString2( int x, int y, const char* str, vec4_t color, float sizeScale, qhandle_t charset )
 {
 	const char* s;
-	unsigned char	ch; // bk001204 - unsigned
+	unsigned char	ch;
 	float	ax;
 	float	ay;
-	float	aw = 0; // bk001204 - init
+	float	aw = 0;
 	float	ah;
 	float	frow;
 	float	fcol;
@@ -831,7 +829,6 @@
 		UI_InGameMenu();
 		return;
 		
-	// bk001204
 	case UIMENU_TEAM:
 	case UIMENU_POSTGAME:
 	default:

Modified: trunk/code/q3_ui/ui_connect.c
===================================================================
--- trunk/code/q3_ui/ui_connect.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/q3_ui/ui_connect.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -82,15 +82,6 @@
 	downloadCount = trap_Cvar_VariableValue( "cl_downloadCount" );
 	downloadTime = trap_Cvar_VariableValue( "cl_downloadTime" );
 
-#if 0 // bk010104
-	fprintf( stderr, "\n\n-----------------------------------------------\n");
-	fprintf( stderr, "DB: downloadSize:  %16d\n", downloadSize );
-	fprintf( stderr, "DB: downloadCount: %16d\n", downloadCount );
-	fprintf( stderr, "DB: downloadTime:  %16d\n", downloadTime );  
-  	fprintf( stderr, "DB: UI realtime:   %16d\n", uis.realtime );	// bk
-	fprintf( stderr, "DB: UI frametime:  %16d\n", uis.frametime );	// bk
-#endif
-
 	leftWidth = width = UI_ProportionalStringWidth( dlText ) * UI_ProportionalSizeScale( style );
 	width = UI_ProportionalStringWidth( etaText ) * UI_ProportionalSizeScale( style );
 	if (width > leftWidth) leftWidth = width;
@@ -118,10 +109,6 @@
 		UI_DrawProportionalString( leftWidth, 192, 
 			va("(%s of %s copied)", dlSizeBuf, totalSizeBuf), style, color_white );
 	} else {
-	  // bk010108
-	  //float elapsedTime = (float)(uis.realtime - downloadTime); // current - start (msecs)
-	  //elapsedTime = elapsedTime * 0.001f; // in seconds
-	  //if ( elapsedTime <= 0.0f ) elapsedTime == 0.0f;
 	  if ( (uis.realtime - downloadTime) / 1000) {
 			xferRate = downloadCount / ((uis.realtime - downloadTime) / 1000);
 		  //xferRate = (int)( ((float)downloadCount) / elapsedTime);
@@ -129,9 +116,6 @@
 			xferRate = 0;
 		}
 
-	  //fprintf( stderr, "DB: elapsedTime:  %16.8f\n", elapsedTime );	// bk
-	  //fprintf( stderr, "DB: xferRate:   %16d\n", xferRate );	// bk
-
 		UI_ReadableSize( xferRateBuf, sizeof xferRateBuf, xferRate );
 
 		// Extrapolate estimated completion time
@@ -141,7 +125,7 @@
 			// We do it in K (/1024) because we'd overflow around 4MB
 			n = (n - (((downloadCount/1024) * n) / (downloadSize/1024))) * 1000;
 			
-			UI_PrintTime ( dlTimeBuf, sizeof dlTimeBuf, n ); // bk010104
+			UI_PrintTime ( dlTimeBuf, sizeof dlTimeBuf, n );
 				//(n - (((downloadCount/1024) * n) / (downloadSize/1024))) * 1000);
 
 			UI_DrawProportionalString( leftWidth, 160, 

Modified: trunk/code/q3_ui/ui_controls2.c
===================================================================
--- trunk/code/q3_ui/ui_controls2.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/q3_ui/ui_controls2.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -223,7 +223,7 @@
 
 static controls_t s_controls;
 
-static vec4_t controls_binding_color  = {1.00f, 0.43f, 0.00f, 1.00f}; // bk: Win32 C4305
+static vec4_t controls_binding_color  = {1.00f, 0.43f, 0.00f, 1.00f};
 
 static bind_t g_bindings[] = 
 {
@@ -561,7 +561,6 @@
 	// disable all controls in all groups
 	for( i = 0; i < C_MAX; i++ ) {
 		controls = g_controls[i];
-		// bk001204 - parentheses
 		for( j = 0;  (control = controls[j]) ; j++ ) {
 			control->flags |= (QMF_HIDDEN|QMF_INACTIVE);
 		}
@@ -570,14 +569,12 @@
 	controls = g_controls[s_controls.section];
 
 	// enable controls in active group (and count number of items for vertical centering)
-	// bk001204 - parentheses
 	for( j = 0;  (control = controls[j]) ; j++ ) {
 		control->flags &= ~(QMF_GRAYED|QMF_HIDDEN|QMF_INACTIVE);
 	}
 
 	// position controls
 	y = ( SCREEN_HEIGHT - j * SMALLCHAR_HEIGHT ) / 2;
-	// bk001204 - parentheses
 	for( j = 0;	(control = controls[j]) ; j++, y += SMALLCHAR_HEIGHT ) {
 		control->x      = 320;
 		control->y      = y;

Modified: trunk/code/q3_ui/ui_gameinfo.c
===================================================================
--- trunk/code/q3_ui/ui_gameinfo.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/q3_ui/ui_gameinfo.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -811,10 +811,5 @@
 	UI_LoadArenas();
 	UI_LoadBots();
 
-	if( (trap_Cvar_VariableValue( "fs_restrict" )) || (ui_numSpecialSinglePlayerArenas == 0 && ui_numSinglePlayerArenas == 4) ) {
-		uis.demoversion = qtrue;
-	}
-	else {
-		uis.demoversion = qfalse;
-	}
+	uis.demoversion = qfalse;
 }

Modified: trunk/code/q3_ui/ui_local.h
===================================================================
--- trunk/code/q3_ui/ui_local.h	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/q3_ui/ui_local.h	2007-09-05 18:17:46 UTC (rev 1161)
@@ -26,7 +26,7 @@
 #include "../qcommon/q_shared.h"
 #include "../renderer/tr_types.h"
 //NOTE: include the ui_public.h from the new UI
-#include "../ui/ui_public.h" // bk001205 - yes, do have to use this
+#include "../ui/ui_public.h"
 //redefine to old API version
 #undef UI_API_VERSION
 #define UI_API_VERSION	4
@@ -678,7 +678,7 @@
 void			trap_GetCDKey( char *buf, int buflen );
 void			trap_SetCDKey( char *buf );
 
-qboolean               trap_VerifyCDKey( const char *key, const char *chksum); // bk001208 - RC4
+qboolean               trap_VerifyCDKey( const char *key, const char *chksum);
 
 void			trap_SetPbClStatus( int status );
 

Modified: trunk/code/q3_ui/ui_main.c
===================================================================
--- trunk/code/q3_ui/ui_main.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/q3_ui/ui_main.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -79,7 +79,7 @@
 		UI_DrawConnectScreen( arg0 );
 		return 0;
 	case UI_HASUNIQUECDKEY:				// mod authors need to observe this
-		return qtrue;  // bk010117 - change this to qfalse for mods!
+		return qtrue;  // change this to qfalse for mods!
 	}
 
 	return -1;
@@ -156,7 +156,6 @@
 
 vmCvar_t	ui_cdkeychecked;
 
-// bk001129 - made static to avoid aliasing.
 static cvarTable_t		cvarTable[] = {
 	{ &ui_ffa_fraglimit, "ui_ffa_fraglimit", "20", CVAR_ARCHIVE },
 	{ &ui_ffa_timelimit, "ui_ffa_timelimit", "0", CVAR_ARCHIVE },
@@ -216,7 +215,6 @@
 	{ &ui_cdkeychecked, "ui_cdkeychecked", "0", CVAR_ROM }
 };
 
-// bk001129 - made static to avoid aliasing
 static int cvarTableSize = sizeof(cvarTable) / sizeof(cvarTable[0]);
 
 

Modified: trunk/code/q3_ui/ui_mods.c
===================================================================
--- trunk/code/q3_ui/ui_mods.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/q3_ui/ui_mods.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -106,44 +106,8 @@
 }
 
 
-#if 0 // bk001204 - unused
 /*
 ===============
-UI_Mods_LoadModsFromFile
-===============
-*/
-static void UI_Mods_LoadModsFromFile( char *filename ) {
-	int				len;
-	fileHandle_t	f;
-	char			buf[1024];
-
-	len = trap_FS_FOpenFile( filename, &f, FS_READ );
-	if ( !f ) {
-		trap_Print( va( S_COLOR_RED "file not found: %s\n", filename ) );
-		return;
-	}
-	if ( len >= sizeof(buf) ) {
-		trap_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i", filename, len, sizeof(buf) ) );
-		trap_FS_FCloseFile( f );
-		return;
-	}
-
-	trap_FS_Read( buf, len, f );
-	buf[len] = 0;
-	trap_FS_FCloseFile( f );
-
-	len = strlen( filename );
-	if( !Q_stricmp(filename +  len - 4,".mod") ) {
-		filename[len-4] = '\0';
-	}
-
-	UI_Mods_ParseInfos( filename, buf );
-}
-#endif
-
-
-/*
-===============
 UI_Mods_LoadMods
 ===============
 */

Modified: trunk/code/q3_ui/ui_qmenu.c
===================================================================
--- trunk/code/q3_ui/ui_qmenu.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/q3_ui/ui_qmenu.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -327,7 +327,6 @@
 		if (b->shader)
 			UI_DrawHandlePic( x, y, w, h, b->shader );
 
-		// bk001204 - parentheses
 		if (  ( (b->generic.flags & QMF_PULSE) 
 			|| (b->generic.flags & QMF_PULSEIFFOCUS) )
 		      && (Menu_ItemAtCursor( b->generic.parent ) == b))

Modified: trunk/code/q3_ui/ui_team.c
===================================================================
--- trunk/code/q3_ui/ui_team.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/q3_ui/ui_team.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -47,16 +47,6 @@
 
 static teammain_t	s_teammain;
 
-// bk001204 - unused
-//static menuframework_s	s_teammain_menu;
-//static menuaction_s		s_teammain_orders;
-//static menuaction_s		s_teammain_voice;
-//static menuaction_s		s_teammain_joinred;
-//static menuaction_s		s_teammain_joinblue;
-//static menuaction_s		s_teammain_joingame;
-//static menuaction_s		s_teammain_spectate;
-
-
 /*
 ===============
 TeamMain_MenuEvent

Modified: trunk/code/q3_ui/ui_video.c
===================================================================
--- trunk/code/q3_ui/ui_video.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/q3_ui/ui_video.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -238,13 +238,6 @@
 #define GRAPHICSOPTIONS_ACCEPT0	"menu/art/accept_0"
 #define GRAPHICSOPTIONS_ACCEPT1	"menu/art/accept_1"
 
-static const char *s_drivers[] =
-{
-	OPENGL_DRIVER_NAME,
-	_3DFX_DRIVER_NAME,
-	NULL
-};
-
 #define ID_BACK2		101
 #define ID_FULLSCREEN	102
 #define ID_LIST			103
@@ -489,24 +482,9 @@
 	trap_Cvar_SetValue( "r_allowExtensions", s_graphicsoptions.allow_extensions.curvalue );
 	trap_Cvar_SetValue( "r_mode", s_graphicsoptions.mode.curvalue );
 	trap_Cvar_SetValue( "r_fullscreen", s_graphicsoptions.fs.curvalue );
-	trap_Cvar_Set( "r_glDriver", ( char * ) s_drivers[s_graphicsoptions.driver.curvalue] );
-	switch ( s_graphicsoptions.colordepth.curvalue )
-	{
-	case 0:
-		trap_Cvar_SetValue( "r_colorbits", 0 );
-		trap_Cvar_SetValue( "r_depthbits", 0 );
-		trap_Cvar_SetValue( "r_stencilbits", 0 );
-		break;
-	case 1:
-		trap_Cvar_SetValue( "r_colorbits", 16 );
-		trap_Cvar_SetValue( "r_depthbits", 16 );
-		trap_Cvar_SetValue( "r_stencilbits", 0 );
-		break;
-	case 2:
-		trap_Cvar_SetValue( "r_colorbits", 32 );
-		trap_Cvar_SetValue( "r_depthbits", 24 );
-		break;
-	}
+	trap_Cvar_SetValue( "r_colorbits", 0 );
+	trap_Cvar_SetValue( "r_depthbits", 0 );
+	trap_Cvar_SetValue( "r_stencilbits", 0 );
 	trap_Cvar_SetValue( "r_vertexLight", s_graphicsoptions.lighting.curvalue );
 
 	if ( s_graphicsoptions.geometry.curvalue == 2 )

Modified: trunk/code/qcommon/cm_trace.c
===================================================================
--- trunk/code/qcommon/cm_trace.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/cm_trace.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -41,7 +41,7 @@
 RotatePoint
 ================
 */
-void RotatePoint(vec3_t point, /*const*/ vec3_t matrix[3]) { // bk: FIXME 
+void RotatePoint(vec3_t point, /*const*/ vec3_t matrix[3]) { // FIXME 
 	vec3_t tvec;
 
 	VectorCopy(point, tvec);
@@ -55,7 +55,7 @@
 TransposeMatrix
 ================
 */
-void TransposeMatrix(/*const*/ vec3_t matrix[3], vec3_t transpose[3]) { // bk: FIXME
+void TransposeMatrix(/*const*/ vec3_t matrix[3], vec3_t transpose[3]) { // FIXME
 	int i, j;
 	for (i = 0; i < 3; i++) {
 		for (j = 0; j < 3; j++) {
@@ -1067,17 +1067,6 @@
 		if ( tw->isPoint ) {
 			offset = 0;
 		} else {
-#if 0 // bk010201 - DEAD
-			// an axial brush right behind a slanted bsp plane
-			// will poke through when expanded, so adjust
-			// by sqrt(3)
-			offset = fabs(tw->extents[0]*plane->normal[0]) +
-				fabs(tw->extents[1]*plane->normal[1]) +
-				fabs(tw->extents[2]*plane->normal[2]);
-
-			offset *= 2;
-			offset = tw->maxOffset;
-#endif
 			// this is silly
 			offset = 2048;
 		}
@@ -1276,7 +1265,7 @@
 	//
 	if (start[0] == end[0] && start[1] == end[1] && start[2] == end[2]) {
 		if ( model ) {
-#ifdef ALWAYS_BBOX_VS_BBOX // bk010201 - FIXME - compile time flag?
+#ifdef ALWAYS_BBOX_VS_BBOX // FIXME - compile time flag?
 			if ( model == BOX_MODEL_HANDLE || model == CAPSULE_MODEL_HANDLE) {
 				tw.sphere.use = qfalse;
 				CM_TestInLeaf( &tw, &cmod->leaf );

Modified: trunk/code/qcommon/common.c
===================================================================
--- trunk/code/qcommon/common.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/common.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -56,7 +56,6 @@
 fileHandle_t	com_journalFile;			// events are written here
 fileHandle_t	com_journalDataFile;		// config files are written here
 
-cvar_t	*com_viewlog;
 cvar_t	*com_speeds;
 cvar_t	*com_developer;
 cvar_t	*com_dedicated;
@@ -80,9 +79,9 @@
 cvar_t  *cl_packetdelay;
 cvar_t  *sv_packetdelay;
 cvar_t	*com_cameraMode;
-#if defined(_WIN32) && defined(_DEBUG)
-cvar_t	*com_noErrorInterrupt;
-#endif
+cvar_t	*com_ansiColor;
+cvar_t	*com_unfocused;
+cvar_t	*com_minimized;
 
 // com_speeds times
 int		time_game;
@@ -161,10 +160,9 @@
 		return;
 	}
 
-	// echo to console if we're not a dedicated server
-	if ( com_dedicated && !com_dedicated->integer ) {
-		CL_ConsolePrint( msg );
-	}
+#ifndef DEDICATED
+	CL_ConsolePrint( msg );
+#endif
 
 	// echo to dedicated console and early console
 	Sys_Print( msg );
@@ -246,16 +244,6 @@
 	static int	errorCount;
 	int			currentTime;
 
-#if defined(_WIN32) && defined(_DEBUG)
-	if ( code != ERR_DISCONNECT && code != ERR_NEED_CD ) {
-		if (!com_noErrorInterrupt->integer) {
-			__asm {
-				int 0x03
-			}
-		}
-	}
-#endif
-
 	// when we are running automated scripts, make sure we
 	// know if anything failed
 	if ( com_buildScript && com_buildScript->integer ) {
@@ -1126,7 +1114,6 @@
 	byte mem[2];
 } memstatic_t;
 
-// bk001204 - initializer brackets
 memstatic_t emptystring =
 	{ {(sizeof(memblock_t)+2 + 3) & ~3, TAG_STATIC, NULL, NULL, ZONEID}, {'\0', '\0'} };
 memstatic_t numberstring[] = {
@@ -1385,7 +1372,6 @@
 */
 void Com_InitSmallZoneMemory( void ) {
 	s_smallZoneTotal = 512 * 1024;
-	// bk001205 - was malloc
 	smallzone = calloc( s_smallZoneTotal, 1 );
 	if ( !smallzone ) {
 		Com_Error( ERR_FATAL, "Small zone data failed to allocate %1.1f megs", (float)s_smallZoneTotal / (1024*1024) );
@@ -1411,7 +1397,6 @@
 		s_zoneTotal = cv->integer * 1024 * 1024;
 	}
 
-	// bk001205 - was malloc
 	mainzone = calloc( s_zoneTotal, 1 );
 	if ( !mainzone ) {
 		Com_Error( ERR_FATAL, "Zone data failed to allocate %i megs", s_zoneTotal / (1024*1024) );
@@ -1536,8 +1521,6 @@
 		s_hunkTotal = cv->integer * 1024 * 1024;
 	}
 
-
-	// bk001205 - was malloc
 	s_hunkData = calloc( s_hunkTotal + 31, 1 );
 	if ( !s_hunkData ) {
 		Com_Error( ERR_FATAL, "Hunk data failed to allocate %i megs", s_hunkTotal / (1024*1024) );
@@ -1901,14 +1884,9 @@
 ===================================================================
 */
 
-// bk001129 - here we go again: upped from 64
-// FIXME TTimo blunt upping from 256 to 1024
-// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=5
 #define	MAX_PUSHED_EVENTS	            1024
-// bk001129 - init, also static
 static int com_pushedEventsHead = 0;
 static int com_pushedEventsTail = 0;
-// bk001129 - static
 static sysEvent_t	com_pushedEvents[MAX_PUSHED_EVENTS];
 
 /*
@@ -1942,6 +1920,125 @@
 }
 
 /*
+========================================================================
+
+EVENT LOOP
+
+========================================================================
+*/
+
+#define MAX_QUEUED_EVENTS  256
+#define MASK_QUEUED_EVENTS ( MAX_QUEUED_EVENTS - 1 )
+
+static sysEvent_t  eventQueue[ MAX_QUEUED_EVENTS ];
+static int         eventHead = 0;
+static int         eventTail = 0;
+static byte        sys_packetReceived[ MAX_MSGLEN ];
+
+/*
+================
+Com_QueueEvent
+
+A time of 0 will get the current time
+Ptr should either be null, or point to a block of data that can
+be freed by the game later.
+================
+*/
+void Com_QueueEvent( int time, sysEventType_t type, int value, int value2, int ptrLength, void *ptr )
+{
+	sysEvent_t  *ev;
+
+	ev = &eventQueue[ eventHead & MASK_QUEUED_EVENTS ];
+
+	if ( eventHead - eventTail >= MAX_QUEUED_EVENTS )
+	{
+		Com_Printf("Com_QueueEvent: overflow\n");
+		// we are discarding an event, but don't leak memory
+		if ( ev->evPtr )
+		{
+			Z_Free( ev->evPtr );
+		}
+		eventTail++;
+	}
+
+	eventHead++;
+
+	if ( time == 0 )
+	{
+		time = Sys_Milliseconds();
+	}
+
+	ev->evTime = time;
+	ev->evType = type;
+	ev->evValue = value;
+	ev->evValue2 = value2;
+	ev->evPtrLength = ptrLength;
+	ev->evPtr = ptr;
+}
+
+/*
+================
+Com_GetSystemEvent
+
+================
+*/
+sysEvent_t Com_GetSystemEvent( void )
+{
+	sysEvent_t  ev;
+	char        *s;
+	msg_t       netmsg;
+	netadr_t    adr;
+
+	// return if we have data
+	if ( eventHead > eventTail )
+	{
+		eventTail++;
+		return eventQueue[ ( eventTail - 1 ) & MASK_QUEUED_EVENTS ];
+	}
+
+	// check for console commands
+	s = Sys_ConsoleInput();
+	if ( s )
+	{
+		char  *b;
+		int   len;
+
+		len = strlen( s ) + 1;
+		b = Z_Malloc( len );
+		strcpy( b, s );
+		Com_QueueEvent( 0, SE_CONSOLE, 0, 0, len, b );
+	}
+
+	// check for network packets
+	MSG_Init( &netmsg, sys_packetReceived, sizeof( sys_packetReceived ) );
+	if ( Sys_GetPacket ( &adr, &netmsg ) )
+	{
+		netadr_t  *buf;
+		int       len;
+
+		// copy out to a seperate buffer for qeueing
+		len = sizeof( netadr_t ) + netmsg.cursize;
+		buf = Z_Malloc( len );
+		*buf = adr;
+		memcpy( buf+1, netmsg.data, netmsg.cursize );
+		Com_QueueEvent( 0, SE_PACKET, 0, 0, len, buf );
+	}
+
+	// return if we have data
+	if ( eventHead > eventTail )
+	{
+		eventTail++;
+		return eventQueue[ ( eventTail - 1 ) & MASK_QUEUED_EVENTS ];
+	}
+
+	// create an empty event to return
+	memset( &ev, 0, sizeof( ev ) );
+	ev.evTime = Sys_Milliseconds();
+
+	return ev;
+}
+
+/*
 =================
 Com_GetRealEvent
 =================
@@ -1964,7 +2061,7 @@
 			}
 		}
 	} else {
-		ev = Sys_GetEvent();
+		ev = Com_GetSystemEvent();
 
 		// write the journal value out if needed
 		if ( com_journal->integer == 1 ) {
@@ -1990,7 +2087,6 @@
 Com_InitPushEvent
 =================
 */
-// bk001129 - added
 void Com_InitPushEvent( void ) {
   // clear the static buffer array
   // this requires SE_NONE to be accepted as a valid but NOP event
@@ -2009,7 +2105,7 @@
 */
 void Com_PushEvent( sysEvent_t *event ) {
 	sysEvent_t		*ev;
-	static int printedWarning = 0; // bk001129 - init, bk001204 - explicit int
+	static int printedWarning = 0;
 
 	ev = &com_pushedEvents[ com_pushedEventsHead & (MAX_PUSHED_EVENTS-1) ];
 
@@ -2110,7 +2206,6 @@
 
 		switch ( ev.evType ) {
 		default:
-		  // bk001129 - was ev.evTime
 			Com_Error( ERR_FATAL, "Com_EventLoop: bad event type %i", ev.evType );
 			break;
         case SE_NONE:
@@ -2322,7 +2417,7 @@
 	}
 }
 
-#ifndef DEDICATED // bk001204
+#ifndef DEDICATED
 /*
 =================
 Com_WriteCDKey
@@ -2378,7 +2473,7 @@
 		static qboolean altivec = qfalse;
 		static qboolean detected = qfalse;
 		if (!detected) {
-			altivec = Sys_DetectAltivec();
+			altivec = ( Sys_GetProcessorFeatures( ) & CF_ALTIVEC );
 			detected = qtrue;
 		}
 
@@ -2397,13 +2492,17 @@
 void Com_Init( char *commandLine ) {
 	char	*s;
 
-	Com_Printf( "%s %s %s\n", SVN_VERSION, PLATFORM_STRING, __DATE__ );
+	Com_Printf( "%s %s %s\n", Q3_VERSION, PLATFORM_STRING, __DATE__ );
 
 	if ( setjmp (abortframe) ) {
 		Sys_Error ("Error during initialization");
 	}
 
-  // bk001129 - do this before anything else decides to push events
+	// Clear queues
+	Com_Memset( &eventQueue[ 0 ], 0, MAX_QUEUED_EVENTS * sizeof( sysEvent_t ) );
+	Com_Memset( &sys_packetReceived[ 0 ], 0, MAX_MSGLEN * sizeof( byte ) );
+
+  // do this before anything else decides to push events
   Com_InitPushEvent();
 
 	Com_InitSmallZoneMemory();
@@ -2473,7 +2572,6 @@
 	com_fixedtime = Cvar_Get ("fixedtime", "0", CVAR_CHEAT);
 	com_showtrace = Cvar_Get ("com_showtrace", "0", CVAR_CHEAT);
 	com_dropsim = Cvar_Get ("com_dropsim", "0", CVAR_CHEAT);
-	com_viewlog = Cvar_Get( "viewlog", "0", CVAR_CHEAT );
 	com_speeds = Cvar_Get ("com_speeds", "0", 0);
 	com_timedemo = Cvar_Get ("timedemo", "0", CVAR_CHEAT);
 	com_cameraMode = Cvar_Get ("com_cameraMode", "0", CVAR_CHEAT);
@@ -2485,19 +2583,13 @@
 	com_sv_running = Cvar_Get ("sv_running", "0", CVAR_ROM);
 	com_cl_running = Cvar_Get ("cl_running", "0", CVAR_ROM);
 	com_buildScript = Cvar_Get( "com_buildScript", "0", 0 );
+	com_ansiColor = Cvar_Get( "com_ansiColor", "0", CVAR_ARCHIVE );
 
+	com_unfocused = Cvar_Get( "com_unfocused", "0", CVAR_ROM );
+	com_minimized = Cvar_Get( "com_minimized", "0", CVAR_ROM );
+
 	com_introPlayed = Cvar_Get( "com_introplayed", "0", CVAR_ARCHIVE);
 
-#if defined(_WIN32) && defined(_DEBUG)
-	com_noErrorInterrupt = Cvar_Get( "com_noErrorInterrupt", "0", 0 );
-#endif
-
-	if ( com_dedicated->integer ) {
-		if ( !com_viewlog->integer ) {
-			Cvar_Set( "viewlog", "1" );
-		}
-	}
-
 	if ( com_developer && com_developer->integer ) {
 		Cmd_AddCommand ("error", Com_Error_f);
 		Cmd_AddCommand ("crash", Com_Crash_f );
@@ -2516,10 +2608,9 @@
 	SV_Init();
 
 	com_dedicated->modified = qfalse;
-	if ( !com_dedicated->integer ) {
-		CL_Init();
-		Sys_ShowConsole( com_viewlog->integer, qfalse );
-	}
+#ifndef DEDICATED
+	CL_Init();
+#endif
 
 	// set com_frameTime so that if a map is started on the
 	// command line it will still be able to count on com_frameTime
@@ -2541,7 +2632,7 @@
 	// start in full screen ui mode
 	Cvar_Set("r_uiFullScreen", "1");
 
-	CL_StartHunkUsers();
+	CL_StartHunkUsers( qfalse );
 
 	// make sure single player is off by default
 	Cvar_Set("ui_singlePlayerActive", "0");
@@ -2550,9 +2641,9 @@
 
 	// always set the cvar, but only print the info if it makes sense.
 	Com_DetectAltivec();
-	#if idppc
+#if idppc
 	Com_Printf ("Altivec support is %s\n", com_altivec->integer ? "enabled" : "disabled");
-	#endif
+#endif
 
 	Com_Printf ("--- Common Initialization Complete ---\n");
 }
@@ -2583,7 +2674,7 @@
 ===============
 */
 void Com_WriteConfiguration( void ) {
-#ifndef DEDICATED // bk001204
+#ifndef DEDICATED
 	cvar_t	*fs;
 #endif
 	// if we are quiting without fully initializing, make sure
@@ -2599,7 +2690,7 @@
 
 	Com_WriteConfigToFile( "q3config.cfg" );
 
-	// bk001119 - tentative "not needed for dedicated"
+	// not needed for dedicated
 #ifndef DEDICATED
 	fs = Cvar_Get ("fs_game", "", CVAR_INIT|CVAR_SYSTEMINFO );
 	if (UI_usesUniqueCDKey() && fs && fs->string[0] != 0) {
@@ -2708,8 +2799,6 @@
 		return;			// an ERR_DROP was thrown
 	}
 
-	// bk001204 - init to zero.
-	//  also:  might be clobbered by `longjmp' or `vfork'
 	timeBeforeFirstEvents =0;
 	timeBeforeServer =0;
 	timeBeforeEvents =0;
@@ -2723,14 +2812,6 @@
 	// write config file if anything changed
 	Com_WriteConfiguration(); 
 
-	// if "viewlog" has been modified, show or hide the log console
-	if ( com_viewlog->modified ) {
-		if ( !com_dedicated->value ) {
-			Sys_ShowConsole( com_viewlog->integer, qfalse );
-		}
-		com_viewlog->modified = qfalse;
-	}
-
 	//
 	// main event loop
 	//
@@ -2783,42 +2864,39 @@
 		Cvar_Get( "dedicated", "0", 0 );
 		com_dedicated->modified = qfalse;
 		if ( !com_dedicated->integer ) {
-			CL_Init();
-			Sys_ShowConsole( com_viewlog->integer, qfalse );
-		} else {
-			CL_Shutdown();
-			Sys_ShowConsole( 1, qtrue );
+			SV_Shutdown( "dedicated set to 0" );
+			CL_FlushMemory();
 		}
 	}
 
+#ifndef DEDICATED
 	//
 	// client system
 	//
-	if ( !com_dedicated->integer ) {
-		//
-		// run event loop a second time to get server to client packets
-		// without a frame of latency
-		//
-		if ( com_speeds->integer ) {
-			timeBeforeEvents = Sys_Milliseconds ();
-		}
-		Com_EventLoop();
-		Cbuf_Execute ();
+	//
+	// run event loop a second time to get server to client packets
+	// without a frame of latency
+	//
+	if ( com_speeds->integer ) {
+		timeBeforeEvents = Sys_Milliseconds ();
+	}
+	Com_EventLoop();
+	Cbuf_Execute ();
 
 
-		//
-		// client side
-		//
-		if ( com_speeds->integer ) {
-			timeBeforeClient = Sys_Milliseconds ();
-		}
+	//
+	// client side
+	//
+	if ( com_speeds->integer ) {
+		timeBeforeClient = Sys_Milliseconds ();
+	}
 
-		CL_Frame( msec );
+	CL_Frame( msec );
 
-		if ( com_speeds->integer ) {
-			timeAfter = Sys_Milliseconds ();
-		}
+	if ( com_speeds->integer ) {
+		timeAfter = Sys_Milliseconds ();
 	}
+#endif
 
 	//
 	// report timing information

Modified: trunk/code/qcommon/cvar.c
===================================================================
--- trunk/code/qcommon/cvar.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/cvar.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -511,8 +511,20 @@
 	if ( Cmd_Argc() == 1 ) {
 		Com_TruncateLongString( string, v->string );
 		Com_TruncateLongString( resetString, v->resetString );
-		Com_Printf ("\"%s\" is:\"%s" S_COLOR_WHITE "\" default:\"%s" S_COLOR_WHITE "\"\n",
-				v->name, string, resetString );
+		Com_Printf ("\"%s\" is:\"%s" S_COLOR_WHITE "\"",
+				v->name, string );
+
+		if ( !( v->flags & CVAR_ROM ) ) {
+			if ( !Q_stricmp( string, resetString ) ) {
+				Com_Printf (", the default" );
+			} else {
+				Com_Printf (" default:\"%s" S_COLOR_WHITE "\"",
+						resetString );
+			}
+		}
+
+		Com_Printf ("\n");
+
 		if ( v->latchedString ) {
 			Com_TruncateLongString( latchedString, v->latchedString );
 			Com_Printf( "latched: \"%s\"\n", latchedString );
@@ -895,8 +907,8 @@
 =====================
 */
 void	Cvar_Update( vmCvar_t *vmCvar ) {
-	cvar_t	*cv = NULL; // bk001129
-	assert(vmCvar); // bk
+	cvar_t	*cv = NULL;
+	assert(vmCvar);
 
 	if ( (unsigned)vmCvar->handle >= cvar_numIndexes ) {
 		Com_Error( ERR_DROP, "Cvar_Update: handle out of range" );
@@ -911,16 +923,10 @@
 		return;		// variable might have been cleared by a cvar_restart
 	}
 	vmCvar->modificationCount = cv->modificationCount;
-	// bk001129 - mismatches.
 	if ( strlen(cv->string)+1 > MAX_CVAR_VALUE_STRING ) 
 	  Com_Error( ERR_DROP, "Cvar_Update: src %s length %zd exceeds MAX_CVAR_VALUE_STRING",
 		     cv->string, 
 		     strlen(cv->string));
-	// bk001212 - Q_strncpyz guarantees zero padding and dest[MAX_CVAR_VALUE_STRING-1]==0 
-	// bk001129 - paranoia. Never trust the destination string.
-	// bk001129 - beware, sizeof(char*) is always 4 (for cv->string). 
-	//            sizeof(vmCvar->string) always MAX_CVAR_VALUE_STRING
-	//Q_strncpyz( vmCvar->string, cv->string, sizeof( vmCvar->string ) ); // id
 	Q_strncpyz( vmCvar->string, cv->string,  MAX_CVAR_VALUE_STRING ); 
 
 	vmCvar->value = cv->value;

Modified: trunk/code/qcommon/files.c
===================================================================
--- trunk/code/qcommon/files.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/files.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -51,15 +51,6 @@
 be modified at all after startup.  Any files that are created (demos, screenshots,
 etc) will be created reletive to the base path, so base path should usually be writable.
 
-The "cd path" is the path to an alternate hierarchy that will be searched if a file
-is not located in the base path.  A user can do a partial install that copies some
-data to a base path created on their hard drive and leave the rest on the cd.  Files
-are never writen to the cd path.  It defaults to a value set by the installer, like
-"e:\quake3", but it can be overridden with "+set fs_cdpath g:\quake3".
-
-If a user runs the game directly from a CD, the base path would be on the CD.  This
-should still function correctly, but all file writes will fail (harmlessly).
-
 The "home path" is the path used for all write access. On win32 systems we have "base path"
 == "home path", but on *nix systems the base installation is usually readonly, and
 "home path" points to ~/.q3a or similar
@@ -93,21 +84,6 @@
 should be exactly the same executables as release versions, but with different data that
 automatically restricts where game media can come from to prevent add-ons from working.
 
-After the paths are initialized, quake will look for the product.txt file.  If not
-found and verified, the game will run in restricted mode.  In restricted mode, only 
-files contained in demoq3/pak0.pk3 will be available for loading, and only if the zip header is
-verified to not have been modified.  A single exception is made for q3config.cfg.  Files
-can still be written out in restricted mode, so screenshots and demos are allowed.
-Restricted mode can be tested by setting "+set fs_restrict 1" on the command line, even
-if there is a valid product.txt under the basepath or cdpath.
-
-If not running in restricted mode, and a file is not found in any local filesystem,
-an attempt will be made to download it and save it under the base path.
-
-If the "fs_copyfiles" cvar is set to 1, then every time a file is sourced from the cd
-path, it will be copied over to the base path.  This is a development aid to help build
-test releases and to copy working sets over slow network links.
-
 File search order: when FS_FOpenFileRead gets called it will go through the fs_searchpaths
 structure and stop on the first successful hit. fs_searchpaths is built with successive
 calls to FS_AddGameDirectory
@@ -260,10 +236,7 @@
 static	cvar_t		*fs_homepath;
 static	cvar_t		*fs_basepath;
 static	cvar_t		*fs_basegame;
-static	cvar_t		*fs_cdpath;
-static	cvar_t		*fs_copyfiles;
 static	cvar_t		*fs_gamedirvar;
-static	cvar_t		*fs_restrict;
 static	searchpath_t	*fs_searchpaths;
 static	int			fs_readCount;			// total bytes read
 static	int			fs_loadCount;			// total files read
@@ -362,7 +335,7 @@
 {
 	return fs_loadStack;
 }
-                      
+
 /*
 ================
 return a hash value for the filename
@@ -676,8 +649,9 @@
 /*
 ===========
 FS_SV_FOpenFileRead
-search for a file somewhere below the home path, base path or cd path
-we search in that order, matching FS_SV_FOpenFileRead order
+
+Search for a file somewhere below the home path then base path
+in that order
 ===========
 */
 int FS_SV_FOpenFileRead( const char *filename, fileHandle_t *fp ) {
@@ -696,7 +670,7 @@
 	// don't let sound stutter
 	S_ClearSoundBuffer();
 
-  // search homepath
+	// search homepath
 	ospath = FS_BuildOSPath( fs_homepath->string, filename, "" );
 	// remove trailing slash
 	ospath[strlen(ospath)-1] = '\0';
@@ -707,48 +681,30 @@
 
 	fsh[f].handleFiles.file.o = fopen( ospath, "rb" );
 	fsh[f].handleSync = qfalse;
-  if (!fsh[f].handleFiles.file.o)
-  {
-    // NOTE TTimo on non *nix systems, fs_homepath == fs_basepath, might want to avoid
-    if (Q_stricmp(fs_homepath->string,fs_basepath->string))
-    {
-      // search basepath
-      ospath = FS_BuildOSPath( fs_basepath->string, filename, "" );
-      ospath[strlen(ospath)-1] = '\0';
+	if (!fsh[f].handleFiles.file.o)
+	{
+		// If fs_homepath == fs_basepath, don't bother
+		if (Q_stricmp(fs_homepath->string,fs_basepath->string))
+		{
+			// search basepath
+			ospath = FS_BuildOSPath( fs_basepath->string, filename, "" );
+			ospath[strlen(ospath)-1] = '\0';
 
-      if ( fs_debug->integer )
-      {
-        Com_Printf( "FS_SV_FOpenFileRead (fs_basepath): %s\n", ospath );
-      }
+			if ( fs_debug->integer )
+			{
+				Com_Printf( "FS_SV_FOpenFileRead (fs_basepath): %s\n", ospath );
+			}
 
-      fsh[f].handleFiles.file.o = fopen( ospath, "rb" );
-      fsh[f].handleSync = qfalse;
+			fsh[f].handleFiles.file.o = fopen( ospath, "rb" );
+			fsh[f].handleSync = qfalse;
+		}
 
-      if ( !fsh[f].handleFiles.file.o )
-      {
-        f = 0;
-      }
-    }
-  }
+		if ( !fsh[f].handleFiles.file.o )
+		{
+			f = 0;
+		}
+	}
 
-	if (!fsh[f].handleFiles.file.o) {
-    // search cd path
-    ospath = FS_BuildOSPath( fs_cdpath->string, filename, "" );
-    ospath[strlen(ospath)-1] = '\0';
-
-    if (fs_debug->integer)
-    {
-      Com_Printf( "FS_SV_FOpenFileRead (fs_cdpath) : %s\n", ospath );
-    }
-
-	  fsh[f].handleFiles.file.o = fopen( ospath, "rb" );
-	  fsh[f].handleSync = qfalse;
-
-	  if( !fsh[f].handleFiles.file.o ) {
-	    f = 0;
-	  }
-  }
-  
 	*fp = f;
 	if (f) {
 		return FS_filelength(f);
@@ -836,9 +792,6 @@
 		Com_Error( ERR_FATAL, "Filesystem call made without initialization\n" );
 	}
 
-	if (fsh[f].streamed) {
-		Sys_EndStreamedFile(f);
-	}
 	if (fsh[f].zipFile == qtrue) {
 		unzCloseCurrentFile( fsh[f].handleFiles.file.z );
 		if ( fsh[f].handleFiles.unique ) {
@@ -1155,12 +1108,12 @@
 			// if we are running restricted, the only files we
 			// will allow to come from the directory are .cfg files
 			l = strlen( filename );
-      // FIXME TTimo I'm not sure about the fs_numServerPaks test
-      // if you are using FS_ReadFile to find out if a file exists,
-      //   this test can make the search fail although the file is in the directory
-      // I had the problem on https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=8
-      // turned out I used FS_FileExists instead
-			if ( fs_restrict->integer || fs_numServerPaks ) {
+			// FIXME TTimo I'm not sure about the fs_numServerPaks test
+			// if you are using FS_ReadFile to find out if a file exists,
+			//   this test can make the search fail although the file is in the directory
+			// I had the problem on https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=8
+			// turned out I used FS_FileExists instead
+			if ( fs_numServerPaks ) {
 
 				if ( Q_stricmp( filename + l - 4, ".cfg" )		// for config files
 					&& Q_stricmp( filename + l - 5, ".menu" )	// menu files
@@ -1186,7 +1139,7 @@
 				&& Q_stricmp( filename + l - 4, ".dat" ) ) {	// for journal files
 				fs_fakeChkSum = random();
 			}
-      
+
 			Q_strncpyz( fsh[*file].name, filename, sizeof( fsh[*file].name ) );
 			fsh[*file].zipFile = qfalse;
 			if ( fs_debug->integer ) {
@@ -1194,15 +1147,6 @@
 					dir->path, dir->gamedir );
 			}
 
-			// if we are getting it from the cdpath, optionally copy it
-			//  to the basepath
-			if ( fs_copyfiles->integer && !Q_stricmp( dir->path, fs_cdpath->string ) ) {
-				char	*copypath;
-
-				copypath = FS_BuildOSPath( fs_basepath->string, dir->gamedir, filename );
-				FS_CopyFile( netpath, copypath );
-			}
-
 			return FS_filelength (*file);
 		}		
 	}
@@ -1235,7 +1179,7 @@
 	if (fsh[f].streamed) {
 		int r;
 		fsh[f].streamed = qfalse;
-		r = Sys_StreamedRead( buffer, len, 1, f);
+		r = FS_Read( buffer, len, f );
 		fsh[f].streamed = qtrue;
 		return r;
 	} else {
@@ -1371,7 +1315,7 @@
 
 	if (fsh[f].streamed) {
 		fsh[f].streamed = qfalse;
-		Sys_StreamSeek( f, offset, origin );
+	 	FS_Seek( f, offset, origin );
 		fsh[f].streamed = qtrue;
 	}
 
@@ -1946,7 +1890,7 @@
 			char	*name;
 
 			// don't scan directories for files if we are pure or restricted
-			if ( fs_restrict->integer || fs_numServerPaks ) {
+			if ( fs_numServerPaks ) {
 		        continue;
 		    } else {
 				netpath = FS_BuildOSPath( search->dir->path, search->dir->gamedir, path );
@@ -2060,58 +2004,51 @@
  */
 static unsigned int Sys_CountFileList(char **list)
 {
-  int i = 0;
+	int i = 0;
 
-  if (list)
-  {
-    while (*list)
-    {
-      list++;
-      i++;
-    }
-  }
-  return i;
+	if (list)
+	{
+		while (*list)
+		{
+			list++;
+			i++;
+		}
+	}
+	return i;
 }
 
-static char** Sys_ConcatenateFileLists( char **list0, char **list1, char **list2 )
+static char** Sys_ConcatenateFileLists( char **list0, char **list1 )
 {
-  int totalLength = 0;
-  char** cat = NULL, **dst, **src;
+	int totalLength = 0;
+	char** cat = NULL, **dst, **src;
 
-  totalLength += Sys_CountFileList(list0);
-  totalLength += Sys_CountFileList(list1);
-  totalLength += Sys_CountFileList(list2);
+	totalLength += Sys_CountFileList(list0);
+	totalLength += Sys_CountFileList(list1);
 
-  /* Create new list. */
-  dst = cat = Z_Malloc( ( totalLength + 1 ) * sizeof( char* ) );
+	/* Create new list. */
+	dst = cat = Z_Malloc( ( totalLength + 1 ) * sizeof( char* ) );
 
-  /* Copy over lists. */
-  if (list0)
-  {
-    for (src = list0; *src; src++, dst++)
-      *dst = *src;
-  }
-  if (list1)
-  {
-    for (src = list1; *src; src++, dst++)
-      *dst = *src;
-  }
-  if (list2)
-  {
-    for (src = list2; *src; src++, dst++)
-      *dst = *src;
-  }
+	/* Copy over lists. */
+	if (list0)
+	{
+		for (src = list0; *src; src++, dst++)
+			*dst = *src;
+	}
+	if (list1)
+	{
+		for (src = list1; *src; src++, dst++)
+			*dst = *src;
+	}
 
-  // Terminate the list
-  *dst = NULL;
+	// Terminate the list
+	*dst = NULL;
 
-  // Free our old lists.
-  // NOTE: not freeing their content, it's been merged in dst and still being used
-  if (list0) Z_Free( list0 );
-  if (list1) Z_Free( list1 );
-  if (list2) Z_Free( list2 );
+	// Free our old lists.
+	// NOTE: not freeing their content, it's been merged in dst and still being used
+	if (list0) Z_Free( list0 );
+	if (list1) Z_Free( list1 );
 
-  return cat;
+	return cat;
 }
 
 /*
@@ -2124,116 +2061,106 @@
 ================
 */
 int	FS_GetModList( char *listbuf, int bufsize ) {
-  int		nMods, i, j, nTotal, nLen, nPaks, nPotential, nDescLen;
-  char **pFiles = NULL;
-  char **pPaks = NULL;
-  char *name, *path;
-  char descPath[MAX_OSPATH];
-  fileHandle_t descHandle;
+	int		nMods, i, j, nTotal, nLen, nPaks, nPotential, nDescLen;
+	char **pFiles = NULL;
+	char **pPaks = NULL;
+	char *name, *path;
+	char descPath[MAX_OSPATH];
+	fileHandle_t descHandle;
 
-  int dummy;
-  char **pFiles0 = NULL;
-  char **pFiles1 = NULL;
-  char **pFiles2 = NULL;
-  qboolean bDrop = qfalse;
+	int dummy;
+	char **pFiles0 = NULL;
+	char **pFiles1 = NULL;
+	qboolean bDrop = qfalse;
 
-  *listbuf = 0;
-  nMods = nPotential = nTotal = 0;
+	*listbuf = 0;
+	nMods = nPotential = nTotal = 0;
 
-  pFiles0 = Sys_ListFiles( fs_homepath->string, NULL, NULL, &dummy, qtrue );
-  pFiles1 = Sys_ListFiles( fs_basepath->string, NULL, NULL, &dummy, qtrue );
-  pFiles2 = Sys_ListFiles( fs_cdpath->string, NULL, NULL, &dummy, qtrue );
-  // we searched for mods in the three paths
-  // it is likely that we have duplicate names now, which we will cleanup below
-  pFiles = Sys_ConcatenateFileLists( pFiles0, pFiles1, pFiles2 );
-  nPotential = Sys_CountFileList(pFiles);
+	pFiles0 = Sys_ListFiles( fs_homepath->string, NULL, NULL, &dummy, qtrue );
+	pFiles1 = Sys_ListFiles( fs_basepath->string, NULL, NULL, &dummy, qtrue );
+	// we searched for mods in the three paths
+	// it is likely that we have duplicate names now, which we will cleanup below
+	pFiles = Sys_ConcatenateFileLists( pFiles0, pFiles1 );
+	nPotential = Sys_CountFileList(pFiles);
 
-  for ( i = 0 ; i < nPotential ; i++ ) {
-    name = pFiles[i];
-    // NOTE: cleaner would involve more changes
-    // ignore duplicate mod directories
-    if (i!=0) {
-      bDrop = qfalse;
-      for(j=0; j<i; j++)
-      {
-        if (Q_stricmp(pFiles[j],name)==0) {
-          // this one can be dropped
-          bDrop = qtrue;
-          break;
-        }
-      }
-    }
-    if (bDrop) {
-      continue;
-    }
-    // we drop "baseq3" "." and ".."
-    if (Q_stricmp(name, BASEGAME) && Q_stricmpn(name, ".", 1)) {
-      // now we need to find some .pk3 files to validate the mod
-      // NOTE TTimo: (actually I'm not sure why .. what if it's a mod under developement with no .pk3?)
-      // we didn't keep the information when we merged the directory names, as to what OS Path it was found under
-      //   so it could be in base path, cd path or home path
-      //   we will try each three of them here (yes, it's a bit messy)
-      path = FS_BuildOSPath( fs_basepath->string, name, "" );
-      nPaks = 0;
-      pPaks = Sys_ListFiles(path, ".pk3", NULL, &nPaks, qfalse); 
-      Sys_FreeFileList( pPaks ); // we only use Sys_ListFiles to check wether .pk3 files are present
+	for ( i = 0 ; i < nPotential ; i++ ) {
+		name = pFiles[i];
+		// NOTE: cleaner would involve more changes
+		// ignore duplicate mod directories
+		if (i!=0) {
+			bDrop = qfalse;
+			for(j=0; j<i; j++)
+			{
+				if (Q_stricmp(pFiles[j],name)==0) {
+					// this one can be dropped
+					bDrop = qtrue;
+					break;
+				}
+			}
+		}
+		if (bDrop) {
+			continue;
+		}
+		// we drop "baseq3" "." and ".."
+		if (Q_stricmp(name, BASEGAME) && Q_stricmpn(name, ".", 1)) {
+			// now we need to find some .pk3 files to validate the mod
+			// NOTE TTimo: (actually I'm not sure why .. what if it's a mod under developement with no .pk3?)
+			// we didn't keep the information when we merged the directory names, as to what OS Path it was found under
+			//   so it could be in base path, cd path or home path
+			//   we will try each three of them here (yes, it's a bit messy)
+			path = FS_BuildOSPath( fs_basepath->string, name, "" );
+			nPaks = 0;
+			pPaks = Sys_ListFiles(path, ".pk3", NULL, &nPaks, qfalse); 
+			Sys_FreeFileList( pPaks ); // we only use Sys_ListFiles to check wether .pk3 files are present
 
-      /* Try on cd path */
-      if( nPaks <= 0 ) {
-        path = FS_BuildOSPath( fs_cdpath->string, name, "" );
-        nPaks = 0;
-        pPaks = Sys_ListFiles( path, ".pk3", NULL, &nPaks, qfalse );
-        Sys_FreeFileList( pPaks );
-      }
+			/* try on home path */
+			if ( nPaks <= 0 )
+			{
+				path = FS_BuildOSPath( fs_homepath->string, name, "" );
+				nPaks = 0;
+				pPaks = Sys_ListFiles( path, ".pk3", NULL, &nPaks, qfalse );
+				Sys_FreeFileList( pPaks );
+			}
 
-      /* try on home path */
-      if ( nPaks <= 0 )
-      {
-        path = FS_BuildOSPath( fs_homepath->string, name, "" );
-        nPaks = 0;
-        pPaks = Sys_ListFiles( path, ".pk3", NULL, &nPaks, qfalse );
-        Sys_FreeFileList( pPaks );
-      }
+			if (nPaks > 0) {
+				nLen = strlen(name) + 1;
+				// nLen is the length of the mod path
+				// we need to see if there is a description available
+				descPath[0] = '\0';
+				strcpy(descPath, name);
+				strcat(descPath, "/description.txt");
+				nDescLen = FS_SV_FOpenFileRead( descPath, &descHandle );
+				if ( nDescLen > 0 && descHandle) {
+					FILE *file;
+					file = FS_FileForHandle(descHandle);
+					Com_Memset( descPath, 0, sizeof( descPath ) );
+					nDescLen = fread(descPath, 1, 48, file);
+					if (nDescLen >= 0) {
+						descPath[nDescLen] = '\0';
+					}
+					FS_FCloseFile(descHandle);
+				} else {
+					strcpy(descPath, name);
+				}
+				nDescLen = strlen(descPath) + 1;
 
-      if (nPaks > 0) {
-        nLen = strlen(name) + 1;
-        // nLen is the length of the mod path
-        // we need to see if there is a description available
-        descPath[0] = '\0';
-        strcpy(descPath, name);
-        strcat(descPath, "/description.txt");
-        nDescLen = FS_SV_FOpenFileRead( descPath, &descHandle );
-        if ( nDescLen > 0 && descHandle) {
-          FILE *file;
-          file = FS_FileForHandle(descHandle);
-          Com_Memset( descPath, 0, sizeof( descPath ) );
-          nDescLen = fread(descPath, 1, 48, file);
-          if (nDescLen >= 0) {
-            descPath[nDescLen] = '\0';
-          }
-          FS_FCloseFile(descHandle);
-        } else {
-          strcpy(descPath, name);
-        }
-        nDescLen = strlen(descPath) + 1;
+				if (nTotal + nLen + 1 + nDescLen + 1 < bufsize) {
+					strcpy(listbuf, name);
+					listbuf += nLen;
+					strcpy(listbuf, descPath);
+					listbuf += nDescLen;
+					nTotal += nLen + nDescLen;
+					nMods++;
+				}
+				else {
+					break;
+				}
+			}
+		}
+	}
+	Sys_FreeFileList( pFiles );
 
-        if (nTotal + nLen + 1 + nDescLen + 1 < bufsize) {
-          strcpy(listbuf, name);
-          listbuf += nLen;
-          strcpy(listbuf, descPath);
-          listbuf += nDescLen;
-          nTotal += nLen + nDescLen;
-          nMods++;
-        }
-        else {
-          break;
-        }
-      }
-    }
-  }
-  Sys_FreeFileList( pFiles );
-
-  return nMods;
+	return nMods;
 }
 
 
@@ -2300,7 +2227,7 @@
 */
 int FS_PathCmp( const char *s1, const char *s2 ) {
 	int		c1, c2;
-	
+
 	do {
 		c1 = *s1++;
 		c2 = *s2++;
@@ -2429,9 +2356,6 @@
 /*
 ============
 FS_TouchFile_f
-
-The only purpose of this function is to allow game script files to copy
-arbitrary files furing an "fs_copyfiles 1" run.
 ============
 */
 void FS_TouchFile_f( void ) {
@@ -2477,8 +2401,7 @@
 	int				numfiles;
 	char			**pakfiles;
 
-	// this fixes the case where fs_basepath is the same as fs_cdpath
-	// which happens on full installs
+	// Unique
 	for ( sp = fs_searchpaths ; sp ; sp = sp->next ) {
 		if ( sp->dir && !Q_stricmp(sp->dir->path, path) && !Q_stricmp(sp->dir->gamedir, dir)) {
 			return;			// we've already got this one
@@ -2609,10 +2532,10 @@
 
 		// Make sure the server cannot make us write to non-quake3 directories.
 		if(FS_CheckDirTraversal(fs_serverReferencedPakNames[i]))
-                {
+		{
 			Com_Printf("WARNING: Invalid download name %s\n", fs_serverReferencedPakNames[i]);
-                        continue;
-                }
+			continue;
+		}
 
 		for ( sp = fs_searchpaths ; sp ; sp = sp->next ) {
 			if ( sp->pack && sp->pack->checksum == fs_serverReferencedPaks[i] ) {
@@ -2624,54 +2547,55 @@
 		if ( !havepak && fs_serverReferencedPakNames[i] && *fs_serverReferencedPakNames[i] ) { 
 			// Don't got it
 
-      if (dlstring)
-      {
-	// We need this to make sure we won't hit the end of the buffer or the server could
-	// overwrite non-pk3 files on clients by writing so much crap into neededpaks that
-	// Q_strcat cuts off the .pk3 extension.
-	
-	origpos += strlen(origpos);
-	
-        // Remote name
-        Q_strcat( neededpaks, len, "@");
-        Q_strcat( neededpaks, len, fs_serverReferencedPakNames[i] );
-        Q_strcat( neededpaks, len, ".pk3" );
+			if (dlstring)
+			{
+				// We need this to make sure we won't hit the end of the buffer or the server could
+				// overwrite non-pk3 files on clients by writing so much crap into neededpaks that
+				// Q_strcat cuts off the .pk3 extension.
 
-        // Local name
-        Q_strcat( neededpaks, len, "@");
-        // Do we have one with the same name?
-        if ( FS_SV_FileExists( va( "%s.pk3", fs_serverReferencedPakNames[i] ) ) )
-        {
-          char st[MAX_ZPATH];
-          // We already have one called this, we need to download it to another name
-          // Make something up with the checksum in it
-          Com_sprintf( st, sizeof( st ), "%s.%08x.pk3", fs_serverReferencedPakNames[i], fs_serverReferencedPaks[i] );
-          Q_strcat( neededpaks, len, st );
-        } else
-        {
-          Q_strcat( neededpaks, len, fs_serverReferencedPakNames[i] );
-          Q_strcat( neededpaks, len, ".pk3" );
-        }
-        
-        // Find out whether it might have overflowed the buffer and don't add this file to the
-        // list if that is the case.
-        if(strlen(origpos) + (origpos - neededpaks) >= len - 1)
-	{
-		*origpos = '\0';
-		break;
-	}
-      }
-      else
-      {
-        Q_strcat( neededpaks, len, fs_serverReferencedPakNames[i] );
-			  Q_strcat( neededpaks, len, ".pk3" );
-        // Do we have one with the same name?
-        if ( FS_SV_FileExists( va( "%s.pk3", fs_serverReferencedPakNames[i] ) ) )
-        {
-          Q_strcat( neededpaks, len, " (local file exists with wrong checksum)");
-        }
-        Q_strcat( neededpaks, len, "\n");
-      }
+				origpos += strlen(origpos);
+
+				// Remote name
+				Q_strcat( neededpaks, len, "@");
+				Q_strcat( neededpaks, len, fs_serverReferencedPakNames[i] );
+				Q_strcat( neededpaks, len, ".pk3" );
+
+				// Local name
+				Q_strcat( neededpaks, len, "@");
+				// Do we have one with the same name?
+				if ( FS_SV_FileExists( va( "%s.pk3", fs_serverReferencedPakNames[i] ) ) )
+				{
+					char st[MAX_ZPATH];
+					// We already have one called this, we need to download it to another name
+					// Make something up with the checksum in it
+					Com_sprintf( st, sizeof( st ), "%s.%08x.pk3", fs_serverReferencedPakNames[i], fs_serverReferencedPaks[i] );
+					Q_strcat( neededpaks, len, st );
+				}
+				else
+				{
+					Q_strcat( neededpaks, len, fs_serverReferencedPakNames[i] );
+					Q_strcat( neededpaks, len, ".pk3" );
+				}
+
+				// Find out whether it might have overflowed the buffer and don't add this file to the
+				// list if that is the case.
+				if(strlen(origpos) + (origpos - neededpaks) >= len - 1)
+				{
+					*origpos = '\0';
+					break;
+				}
+			}
+			else
+			{
+				Q_strcat( neededpaks, len, fs_serverReferencedPakNames[i] );
+				Q_strcat( neededpaks, len, ".pk3" );
+				// Do we have one with the same name?
+				if ( FS_SV_FileExists( va( "%s.pk3", fs_serverReferencedPakNames[i] ) ) )
+				{
+					Q_strcat( neededpaks, len, " (local file exists with wrong checksum)");
+				}
+				Q_strcat( neededpaks, len, "\n");
+			}
 		}
 	}
 
@@ -2731,7 +2655,7 @@
 
 void Com_AppendCDKey( const char *filename );
 void Com_ReadCDKey( const char *filename );
- 
+
 /*
 ================
 FS_ReorderPurePaks
@@ -2745,14 +2669,14 @@
 	int i;
 	searchpath_t **p_insert_index, // for linked list reordering
 		**p_previous; // when doing the scan
-	
+
 	// only relevant when connected to pure server
 	if ( !fs_numServerPaks )
 		return;
-	
+
 	fs_reordered = qfalse;
-	
-	p_insert_index = &fs_searchpaths; // we insert in order at the beginning of the list 
+
+	p_insert_index = &fs_searchpaths; // we insert in order at the beginning of the list
 	for ( i = 0 ; i < fs_numServerPaks ; i++ ) {
 		p_previous = p_insert_index; // track the pointer-to-current-item
 		for (s = *p_insert_index; s; s = s->next) {
@@ -2767,7 +2691,7 @@
 				p_insert_index = &s->next;
 				break; // iterate to next server pack
 			}
-			p_previous = &s->next; 
+			p_previous = &s->next;
 		}
 	}
 }
@@ -2777,43 +2701,35 @@
 FS_Startup
 ================
 */
-static void FS_Startup( const char *gameName ) {
-        const char *homePath;
+static void FS_Startup( const char *gameName )
+{
+	const char *homePath;
 	cvar_t	*fs;
 
 	Com_Printf( "----- FS_Startup -----\n" );
 
 	fs_debug = Cvar_Get( "fs_debug", "0", 0 );
-	fs_copyfiles = Cvar_Get( "fs_copyfiles", "0", CVAR_INIT );
-	fs_cdpath = Cvar_Get ("fs_cdpath", Sys_DefaultCDPath(), CVAR_INIT );
 	fs_basepath = Cvar_Get ("fs_basepath", Sys_DefaultInstallPath(), CVAR_INIT );
 	fs_basegame = Cvar_Get ("fs_basegame", "", CVAR_INIT );
-  homePath = Sys_DefaultHomePath();
-  if (!homePath || !homePath[0]) {
+	homePath = Sys_DefaultHomePath();
+	if (!homePath || !homePath[0]) {
 		homePath = fs_basepath->string;
 	}
 	fs_homepath = Cvar_Get ("fs_homepath", homePath, CVAR_INIT );
 	fs_gamedirvar = Cvar_Get ("fs_game", "", CVAR_INIT|CVAR_SYSTEMINFO );
-	fs_restrict = Cvar_Get ("fs_restrict", "", CVAR_INIT );
 
 	// add search path elements in reverse priority order
-	if (fs_cdpath->string[0]) {
-		FS_AddGameDirectory( fs_cdpath->string, gameName );
-	}
 	if (fs_basepath->string[0]) {
 		FS_AddGameDirectory( fs_basepath->string, gameName );
 	}
-  // fs_homepath is somewhat particular to *nix systems, only add if relevant
-  // NOTE: same filtering below for mods and basegame
-	if (fs_basepath->string[0] && Q_stricmp(fs_homepath->string,fs_basepath->string)) {
+	// fs_homepath is somewhat particular to *nix systems, only add if relevant
+	// NOTE: same filtering below for mods and basegame
+	if (fs_homepath->string[0] && Q_stricmp(fs_homepath->string,fs_basepath->string)) {
 		FS_AddGameDirectory ( fs_homepath->string, gameName );
 	}
-        
+
 	// check for additional base game so mods can be based upon other mods
 	if ( fs_basegame->string[0] && !Q_stricmp( gameName, BASEGAME ) && Q_stricmp( fs_basegame->string, gameName ) ) {
-		if (fs_cdpath->string[0]) {
-			FS_AddGameDirectory(fs_cdpath->string, fs_basegame->string);
-		}
 		if (fs_basepath->string[0]) {
 			FS_AddGameDirectory(fs_basepath->string, fs_basegame->string);
 		}
@@ -2824,9 +2740,6 @@
 
 	// check for additional game folder for mods
 	if ( fs_gamedirvar->string[0] && !Q_stricmp( gameName, BASEGAME ) && Q_stricmp( fs_gamedirvar->string, gameName ) ) {
-		if (fs_cdpath->string[0]) {
-			FS_AddGameDirectory(fs_cdpath->string, fs_gamedirvar->string);
-		}
 		if (fs_basepath->string[0]) {
 			FS_AddGameDirectory(fs_basepath->string, fs_gamedirvar->string);
 		}
@@ -2850,7 +2763,7 @@
 	// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=506
 	// reorder the pure pk3 files according to server order
 	FS_ReorderPurePaks();
-	
+
 	// print the current search paths
 	FS_Path_f();
 
@@ -3326,12 +3239,9 @@
 	// we have to specially handle this, because normal command
 	// line variable sets don't happen until after the filesystem
 	// has already been initialized
-	Com_StartupVariable( "fs_cdpath" );
 	Com_StartupVariable( "fs_basepath" );
 	Com_StartupVariable( "fs_homepath" );
 	Com_StartupVariable( "fs_game" );
-	Com_StartupVariable( "fs_copyfiles" );
-	Com_StartupVariable( "fs_restrict" );
 
 	// try to start up normally
 	FS_Startup( BASEGAME );
@@ -3343,13 +3253,10 @@
 	// graphics screen when the font fails to load
 	if ( FS_ReadFile( "default.cfg", NULL ) <= 0 ) {
 		Com_Error( ERR_FATAL, "Couldn't load default.cfg" );
-		// bk001208 - SafeMode see below, FIXME?
 	}
 
 	Q_strncpyz(lastValidBase, fs_basepath->string, sizeof(lastValidBase));
 	Q_strncpyz(lastValidGame, fs_gamedirvar->string, sizeof(lastValidGame));
-
-  // bk001208 - SafeMode see below, FIXME?
 }
 
 
@@ -3386,7 +3293,6 @@
 			Cvar_Set("fs_gamedirvar", lastValidGame);
 			lastValidBase[0] = '\0';
 			lastValidGame[0] = '\0';
-			Cvar_Set( "fs_restrict", "0" );
 			FS_Restart(checksumFeed);
 			Com_Error( ERR_DROP, "Invalid game folder\n" );
 			return;
@@ -3394,7 +3300,6 @@
 		Com_Error( ERR_FATAL, "Couldn't load default.cfg" );
 	}
 
-	// bk010116 - new check before safeMode
 	if ( Q_stricmp(fs_gamedirvar->string, lastValidGame) ) {
 		// skip the q3config.cfg if "safe" is on the command line
 		if ( !Com_SafeMode() ) {
@@ -3474,7 +3379,6 @@
 		fsh[*f].streamed = qfalse;
 
 		if (mode == FS_READ) {
-			Sys_BeginStreamedFile( *f, 0x4000 );
 			fsh[*f].streamed = qtrue;
 		}
 	}

Modified: trunk/code/qcommon/net_ip.c
===================================================================
--- trunk/code/qcommon/net_ip.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/net_ip.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -1026,28 +1026,22 @@
 ====================
 NET_Sleep
 
-Sleeps msec or until net socket is ready
+Sleeps msec or until something happens on the network or stdin
 ====================
 */
 void NET_Sleep( int msec ) {
 	struct timeval timeout;
 	fd_set	fdset;
-#ifndef _WIN32 //FIXME
-	extern qboolean stdin_active;
-#endif
 	int highestfd = 0;
 
 	if (!com_dedicated->integer)
 		return; // we're not a server, just run full speed
 
 	FD_ZERO(&fdset);
-#ifndef _WIN32 //FIXME
-	if (stdin_active)
-	{
-		FD_SET(0, &fdset); // stdin is processed too
-		highestfd = 1;
-	}
-#endif
+
+	FD_SET(fileno(stdin), &fdset);
+	highestfd = fileno(stdin) + 1;
+
 	if(ip_socket)
 	{
 		FD_SET(ip_socket, &fdset); // network socket

Modified: trunk/code/qcommon/q_math.c
===================================================================
--- trunk/code/qcommon/q_math.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/q_math.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -447,7 +447,7 @@
 
 	inv_denom =  DotProduct( normal, normal );
 #ifndef Q3_VM
-	assert( Q_fabs(inv_denom) != 0.0f ); // bk010122 - zero vectors get here
+	assert( Q_fabs(inv_denom) != 0.0f ); // zero vectors get here
 #endif
 	inv_denom = 1.0f / inv_denom;
 
@@ -515,7 +515,6 @@
 	y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
 //	y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed
 
-	//assert( !isnan(y) ); // bk010122 - FPE?
 	return y;
 }
 
@@ -1110,17 +1109,11 @@
 
 	if (length)
 	{
-#ifndef Q3_VM // bk0101022 - FPE related
-//	  assert( ((Q_fabs(v[0])!=0.0f) || (Q_fabs(v[1])!=0.0f) || (Q_fabs(v[2])!=0.0f)) );
-#endif
 		ilength = 1/length;
 		out[0] = v[0]*ilength;
 		out[1] = v[1]*ilength;
 		out[2] = v[2]*ilength;
 	} else {
-#ifndef Q3_VM // bk0101022 - FPE related
-//	  assert( ((Q_fabs(v[0])==0.0f) && (Q_fabs(v[1])==0.0f) && (Q_fabs(v[2])==0.0f)) );
-#endif
 		VectorClear( out );
 	}
 		

Modified: trunk/code/qcommon/q_platform.h
===================================================================
--- trunk/code/qcommon/q_platform.h	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/q_platform.h	2007-09-05 18:17:46 UTC (rev 1161)
@@ -168,7 +168,7 @@
 
 //=============================================================== FreeBSD ===
 
-#ifdef __FreeBSD__ // rb010123
+#ifdef __FreeBSD__
 
 #include <machine/endian.h>
 

Modified: trunk/code/qcommon/q_shared.c
===================================================================
--- trunk/code/qcommon/q_shared.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/q_shared.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -734,7 +734,6 @@
 =============
 */
 void Q_strncpyz( char *dest, const char *src, int destsize ) {
-  // bk001129 - also NULL dest
   if ( !dest ) {
     Com_Error( ERR_FATAL, "Q_strncpyz: NULL dest" );
   }
@@ -752,7 +751,6 @@
 int Q_stricmpn (const char *s1, const char *s2, int n) {
 	int		c1, c2;
 
-	// bk001129 - moved in 1.17 fix not in id codebase
         if ( s1 == NULL ) {
            if ( s2 == NULL )
              return 0;
@@ -846,7 +844,39 @@
 	Q_strncpyz( dest + l1, src, size - l1 );
 }
 
+/*
+* Find the first occurrence of find in s.
+*/
+const char *Q_stristr( const char *s, const char *find)
+{
+  char c, sc;
+  size_t len;
 
+  if ((c = *find++) != 0)
+  {
+    if (c >= 'a' && c <= 'z')
+    {
+      c -= ('a' - 'A');
+    }
+    len = strlen(find);
+    do
+    {
+      do
+      {
+        if ((sc = *s++) == 0)
+          return NULL;
+        if (sc >= 'a' && sc <= 'z')
+        {
+          sc -= ('a' - 'A');
+        }
+      } while (sc != c);
+    } while (Q_stricmpn(s, find, len) != 0);
+    s--;
+  }
+  return s;
+}
+
+
 int Q_PrintStrlen( const char *string ) {
 	int			len;
 	const char	*p;

Modified: trunk/code/qcommon/q_shared.h
===================================================================
--- trunk/code/qcommon/q_shared.h	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/q_shared.h	2007-09-05 18:17:46 UTC (rev 1161)
@@ -26,14 +26,15 @@
 // q_shared.h -- included first by ALL program modules.
 // A user mod should never modify this file
 
-#define Q3_VERSION            "ioQ3 1.33"
-#ifndef SVN_VERSION
-  #define SVN_VERSION Q3_VERSION
+#define Q3_VERSION_BASE         "ioq3 1.35"
+#ifdef SVN_VERSION
+# define Q3_VERSION Q3_VERSION_BASE "_SVN" SVN_VERSION
+#else
+# define Q3_VERSION Q3_VERSION_BASE
 #endif
-#define CLIENT_WINDOW_TITLE   "ioquake3"
-#define CLIENT_WINDOW_ICON    "ioq3"
-#define CONSOLE_WINDOW_TITLE  "ioquake3 console"
-#define CONSOLE_WINDOW_ICON   "ioq3 console"
+
+#define CLIENT_WINDOW_TITLE     "ioquake3"
+#define CLIENT_WINDOW_MIN_TITLE "ioq3"
 // 1.32 released 7-10-2002
 
 #define BASEGAME              "baseq3"
@@ -262,14 +263,6 @@
 void *Hunk_Alloc( int size, ha_pref preference );
 #endif
 
-#if defined(__GNUC__) && !defined(__MINGW32__) && !defined(MACOS_X)
-// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=371
-// custom Snd_Memset implementation for glibc memset bug workaround
-void Snd_Memset (void* dest, const int val, const size_t count);
-#else
-#define Snd_Memset Com_Memset
-#endif
-
 #define Com_Memset memset
 #define Com_Memcpy memcpy
 
@@ -678,6 +671,7 @@
 char	*Q_strlwr( char *s1 );
 char	*Q_strupr( char *s1 );
 char	*Q_strrchr( const char* string, int c );
+const char	*Q_stristr( const char *s, const char *find);
 
 // buffer size safe library replacements
 void	Q_strncpyz( char *dest, const char *src, int destsize );

Modified: trunk/code/qcommon/qcommon.h
===================================================================
--- trunk/code/qcommon/qcommon.h	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/qcommon.h	2007-09-05 18:17:46 UTC (rev 1161)
@@ -687,13 +687,11 @@
 ==============================================================
 */
 
-// TTimo
 // vsnprintf is ISO/IEC 9899:1999
 // abstracting this to make it portable
 #ifdef WIN32
 #define Q_vsnprintf _vsnprintf
 #else
-// TODO: do we need Mac define?
 #define Q_vsnprintf vsnprintf
 #endif
 
@@ -701,22 +699,46 @@
 // https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=470
 extern char cl_cdkey[34];
 
-// returnbed by Sys_GetProcessorId
-#define CPUID_GENERIC			0			// any unrecognized processor
+// returned by Sys_GetProcessorFeatures
+typedef enum
+{
+  CF_RDTSC      = 1 << 0,
+  CF_MMX        = 1 << 1,
+  CF_MMX_EXT    = 1 << 2,
+  CF_3DNOW      = 1 << 3,
+  CF_3DNOW_EXT  = 1 << 4,
+  CF_SSE        = 1 << 5,
+  CF_SSE2       = 1 << 6,
+  CF_ALTIVEC    = 1 << 7
+} cpuFeatures_t;
 
-#define CPUID_AXP				0x10
+// centralized and cleaned, that's the max string you can send to a Com_Printf / Com_DPrintf (above gets truncated)
+#define	MAXPRINTMSG	4096
 
-#define CPUID_INTEL_UNSUPPORTED	0x20			// Intel 386/486
-#define CPUID_INTEL_PENTIUM		0x21			// Intel Pentium or PPro
-#define CPUID_INTEL_MMX			0x22			// Intel Pentium/MMX or P2/MMX
-#define CPUID_INTEL_KATMAI		0x23			// Intel Katmai
 
-#define CPUID_AMD_3DNOW			0x30			// AMD K6 3DNOW!
+typedef enum {
+	// SE_NONE must be zero
+	SE_NONE = 0,	// evTime is still valid
+	SE_KEY,		// evValue is a key code, evValue2 is the down flag
+	SE_CHAR,	// evValue is an ascii char
+	SE_MOUSE,	// evValue and evValue2 are reletive signed x / y moves
+	SE_JOYSTICK_AXIS,	// evValue is an axis number and evValue2 is the current state (-127 to 127)
+	SE_CONSOLE,	// evPtr is a char*
+	SE_PACKET	// evPtr is a netadr_t followed by data bytes to evPtrLength
+} sysEventType_t;
 
-// TTimo
-// centralized and cleaned, that's the max string you can send to a Com_Printf / Com_DPrintf (above gets truncated)
-#define	MAXPRINTMSG	4096
+typedef struct {
+	int				evTime;
+	sysEventType_t	evType;
+	int				evValue, evValue2;
+	int				evPtrLength;	// bytes of data pointed to by evPtr, for journaling
+	void			*evPtr;			// this must be manually freed if not NULL
+} sysEvent_t;
 
+void		Com_QueueEvent( int time, sysEventType_t type, int value, int value2, int ptrLength, void *ptr );
+int			Com_EventLoop( void );
+sysEvent_t	Com_GetSystemEvent( void );
+
 char		*CopyString( const char *in );
 void		Info_Print( const char *s );
 
@@ -726,7 +748,7 @@
 void 		QDECL Com_DPrintf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2)));
 void 		QDECL Com_Error( int code, const char *fmt, ... ) __attribute__ ((format (printf, 2, 3)));
 void 		Com_Quit_f( void );
-int			Com_EventLoop( void );
+
 int			Com_Milliseconds( void );	// will be journaled properly
 unsigned	Com_BlockChecksum( const void *buffer, int length );
 char		*Com_MD5File(const char *filename, int length, const char *prefix, int prefix_len);
@@ -748,12 +770,14 @@
 extern	cvar_t	*com_timescale;
 extern	cvar_t	*com_sv_running;
 extern	cvar_t	*com_cl_running;
-extern	cvar_t	*com_viewlog;			// 0 = hidden, 1 = visible, 2 = minimized
 extern	cvar_t	*com_version;
 extern	cvar_t	*com_blood;
 extern	cvar_t	*com_buildScript;		// for building release pak files
 extern	cvar_t	*com_journal;
 extern	cvar_t	*com_cameraMode;
+extern	cvar_t	*com_ansiColor;
+extern	cvar_t	*com_unfocused;
+extern	cvar_t	*com_minimized;
 extern	cvar_t	*com_altivec;
 
 // both client and server must agree to pause
@@ -897,7 +921,7 @@
 void CL_FlushMemory( void );
 // dump all memory on an error
 
-void CL_StartHunkUsers( void );
+void CL_StartHunkUsers( qboolean rendererOnly );
 // start all the client stuff using the hunk
 
 void Key_WriteBindings( fileHandle_t f );
@@ -942,31 +966,9 @@
 	MAX_JOYSTICK_AXIS
 } joystickAxis_t;
 
-typedef enum {
-  // bk001129 - make sure SE_NONE is zero
-	SE_NONE = 0,	// evTime is still valid
-	SE_KEY,		// evValue is a key code, evValue2 is the down flag
-	SE_CHAR,	// evValue is an ascii char
-	SE_MOUSE,	// evValue and evValue2 are reletive signed x / y moves
-	SE_JOYSTICK_AXIS,	// evValue is an axis number and evValue2 is the current state (-127 to 127)
-	SE_CONSOLE,	// evPtr is a char*
-	SE_PACKET	// evPtr is a netadr_t followed by data bytes to evPtrLength
-} sysEventType_t;
-
-typedef struct {
-	int				evTime;
-	sysEventType_t	evType;
-	int				evValue, evValue2;
-	int				evPtrLength;	// bytes of data pointed to by evPtr, for journaling
-	void			*evPtr;			// this must be manually freed if not NULL
-} sysEvent_t;
-
-sysEvent_t	Sys_GetEvent( void );
-
 void	Sys_Init (void);
 
 // general development dll loading for virtual machine testing
-// fqpath param added 7/20/02 by T.Ray - Sys_LoadDll is only called in vm.c at this time
 void	* QDECL Sys_LoadDll( const char *name, char *fqpath , intptr_t (QDECL **entryPoint)(int, ...),
 				  intptr_t (QDECL *systemcalls)(intptr_t, ...) );
 void	Sys_UnloadDll( void *dllHandle );
@@ -1003,17 +1005,12 @@
 // the system console is shown when a dedicated server is running
 void	Sys_DisplaySystemConsole( qboolean show );
 
-int		Sys_GetProcessorId( void );
+cpuFeatures_t Sys_GetProcessorFeatures( void );
 
-void	Sys_BeginStreamedFile( fileHandle_t f, int readahead );
-void	Sys_EndStreamedFile( fileHandle_t f );
-int		Sys_StreamedRead( void *buffer, int size, int count, fileHandle_t f );
-void	Sys_StreamSeek( fileHandle_t f, int offset, int origin );
-
-void	Sys_ShowConsole( int level, qboolean quitOnClose );
 void	Sys_SetErrorText( const char *text );
 
 void	Sys_SendPacket( int length, const void *data, netadr_t to );
+qboolean Sys_GetPacket( netadr_t *net_from, msg_t *net_message );
 
 qboolean	Sys_StringToAdr( const char *s, netadr_t *a );
 //Does NOT parse port numbers, only base addresses.
@@ -1021,30 +1018,21 @@
 qboolean	Sys_IsLANAddress (netadr_t adr);
 void		Sys_ShowIP(void);
 
-qboolean	Sys_CheckCD( void );
-
 void	Sys_Mkdir( const char *path );
 char	*Sys_Cwd( void );
-void	Sys_SetDefaultCDPath(const char *path);
-char	*Sys_DefaultCDPath(void);
 void	Sys_SetDefaultInstallPath(const char *path);
 char	*Sys_DefaultInstallPath(void);
 void  Sys_SetDefaultHomePath(const char *path);
 char	*Sys_DefaultHomePath(void);
+const char *Sys_Dirname( char *path );
+const char *Sys_Basename( char *path );
+char *Sys_ConsoleInput(void);
 
 char **Sys_ListFiles( const char *directory, const char *extension, char *filter, int *numfiles, qboolean wantsubs );
 void	Sys_FreeFileList( char **list );
 
-void	Sys_BeginProfiling( void );
-void	Sys_EndProfiling( void );
-
 qboolean Sys_LowPhysicalMemory( void );
-unsigned int Sys_ProcessorCount( void );
 
-int Sys_MonkeyShouldBeSpanked( void );
-
-qboolean Sys_DetectAltivec( void );
-
 /* This is based on the Adaptive Huffman algorithm described in Sayood's Data
  * Compression book.  The ranks are not actually stored, but implicitly defined
  * by the location of a node within a doubly-linked list */

Modified: trunk/code/qcommon/vm.c
===================================================================
--- trunk/code/qcommon/vm.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/vm.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -36,8 +36,8 @@
 #include "vm_local.h"
 
 
-vm_t	*currentVM = NULL; // bk001212
-vm_t	*lastVM    = NULL; // bk001212
+vm_t	*currentVM = NULL;
+vm_t	*lastVM    = NULL;
 int		vm_debugLevel;
 
 #define	MAX_VM		3
@@ -543,14 +543,7 @@
 	Q_strncpyz( vm->name, module, sizeof( vm->name ) );
 	vm->systemCall = systemCalls;
 
-	// never allow dll loading with a demo
 	if ( interpret == VMI_NATIVE ) {
-		if ( Cvar_VariableValue( "fs_restrict" ) ) {
-			interpret = VMI_COMPILED;
-		}
-	}
-
-	if ( interpret == VMI_NATIVE ) {
 		// try to load as a system dll
 		Com_Printf( "Loading dll file %s.\n", vm->name );
 		vm->dllHandle = Sys_LoadDll( module, vm->fqpath , &vm->entryPoint, VM_DllSyscall );
@@ -655,7 +648,7 @@
 	if ( !intValue ) {
 		return NULL;
 	}
-	// bk001220 - currentVM is missing on reconnect
+	// currentVM is missing on reconnect
 	if ( currentVM==NULL )
 	  return NULL;
 
@@ -672,7 +665,7 @@
 		return NULL;
 	}
 
-	// bk010124 - currentVM is missing on reconnect here as well?
+	// currentVM is missing on reconnect here as well?
 	if ( currentVM==NULL )
 	  return NULL;
 
@@ -773,7 +766,7 @@
 #endif
 	}
 
-	if ( oldVM != NULL ) // bk001220 - assert(currentVM!=NULL) for oldVM==NULL
+	if ( oldVM != NULL )
 	  currentVM = oldVM;
 	return r;
 }

Modified: trunk/code/qcommon/vm_interpreted.c
===================================================================
--- trunk/code/qcommon/vm_interpreted.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/vm_interpreted.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -22,7 +22,7 @@
 #include "vm_local.h"
 
 //#define	DEBUG_VM
-#ifdef DEBUG_VM // bk001204
+#ifdef DEBUG_VM
 static char	*opnames[256] = {
 	"OP_UNDEF", 
 

Modified: trunk/code/qcommon/vm_local.h
===================================================================
--- trunk/code/qcommon/vm_local.h	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/vm_local.h	2007-09-05 18:17:46 UTC (rev 1161)
@@ -160,7 +160,6 @@
 	int			breakFunction;		// increment breakCount on function entry to this
 	int			breakCount;
 
-// fqpath member added 7/20/02 by T.Ray
 	char		fqpath[MAX_QPATH+1] ;
 
 	byte		*jumpTableTargets;

Modified: trunk/code/qcommon/vm_x86.c
===================================================================
--- trunk/code/qcommon/vm_x86.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/vm_x86.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -26,7 +26,7 @@
 #include <windows.h>
 #endif
 
-#ifdef __FreeBSD__ // rb0101023
+#ifdef __FreeBSD__
 #include <sys/types.h>
 #endif
 
@@ -77,13 +77,11 @@
 #else // _MSC_VER
 
 #if defined( FTOL_PTR )
-// bk001213 - BEWARE: does not work! UI menu etc. broken - stack!
-// bk001119 - added: int gftol( float x ) { return (int)x; }
 
-int qftol( void );     // bk001213 - label, see unix/ftol.nasm
-int qftol027F( void ); // bk001215 - fixed FPU control variants
+int qftol( void );
+int qftol027F( void );
 int qftol037F( void );
-int qftol0E7F( void ); // bk010102 - fixed bogus bits (duh)
+int qftol0E7F( void );
 int qftol0F7F( void );
 
 
@@ -95,7 +93,7 @@
 #endif
 
 
-static	int		callMask = 0; // bk001213 - init
+static	int		callMask = 0;
 
 static	int	instruction, pass;
 static	int	lastConst = 0;
@@ -1020,7 +1018,7 @@
 			EmitString( "D9 1F" );		// fstp dword ptr [edi]
 			break;
 		case OP_CVFI:
-#ifndef FTOL_PTR // WHENHELLISFROZENOVER  // bk001213 - was used in 1.17
+#ifndef FTOL_PTR // WHENHELLISFROZENOVER
 			// not IEEE complient, but simple and fast
 			EmitString( "D9 07" );		// fld dword ptr [edi]
 			EmitString( "DB 1F" );		// fistp dword ptr [edi]

Modified: trunk/code/qcommon/vm_x86_64.c
===================================================================
--- trunk/code/qcommon/vm_x86_64.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/qcommon/vm_x86_64.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -109,7 +109,7 @@
 	return ret;
 }
 
-#ifdef DEBUG_VM // bk001204
+#ifdef DEBUG_VM
 static char	*opnames[256] = {
 	"OP_UNDEF", 
 

Modified: trunk/code/renderer/qgl.h
===================================================================
--- trunk/code/renderer/qgl.h	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/renderer/qgl.h	2007-09-05 18:17:46 UTC (rev 1161)
@@ -26,12 +26,8 @@
 #ifndef __QGL_H__
 #define __QGL_H__
 
-#if defined( __LINT__ )
+#if defined( _WIN32 )
 
-#include <GL/gl.h>
-
-#elif defined( _WIN32 )
-
 #if _MSC_VER
 #pragma warning (disable: 4201)
 #pragma warning (disable: 4214)
@@ -43,6 +39,7 @@
 
 #include <windows.h>
 #include <GL/gl.h>
+#include <GL/glext.h>
 
 #elif defined(MACOS_X)
 
@@ -53,41 +50,16 @@
 #include <OpenGL/glext.h>
 #endif
 
-// This can be defined to use the CGLMacro.h support which avoids looking up
-// the current context.
-//#define USE_CGLMACROS
+#else
 
-#ifdef USE_CGLMACROS
-#include "macosx_local.h"
-#define cgl_ctx glw_state._cgl_ctx
-#include <OpenGL/CGLMacro.h>
-#endif
-
-#elif defined( __linux__ ) || defined(__FreeBSD__)
-
 #include <GL/gl.h>
-#include <GL/glx.h>
-// bk001129 - from cvs1.17 (mkv)
-#if defined(__FX__)
-#include <GL/fxmesa.h>
-#endif
+#include <GL/glext.h>
 
-#elif defined( __sun )
-#include <GL/gl.h>
-#include <GL/glx.h>
-
-#else
-
-#include <gl.h>
-
 #endif
 
 #ifndef APIENTRY
 #define APIENTRY
 #endif
-#ifndef WINAPI
-#define WINAPI
-#endif
 
 
 //===========================================================================
@@ -109,6 +81,7 @@
 
 #else
 
+// FIXME GL_MAX_TEXTURE_UNITS_ARB?
 #define GL_MAX_ACTIVE_TEXTURES_ARB          0x84E2
 
 #endif /* defined(__sun) */
@@ -122,9 +95,10 @@
    #define GL_CLAMP_TO_EDGE                  0x812F
 #endif
 
-//===========================================================================
+// S3TC compression constants
+#define GL_RGB_S3TC                          0x83A0
+#define GL_RGB4_S3TC                         0x83A1
 
-// NOTE: some Linux platforms would need those prototypes
 #if defined(MACOS_X) || ( defined(__sun) && defined(__sparc) )
 typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
 typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
@@ -162,445 +136,351 @@
 typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum target);
 #endif
 
-// TTimo - VC7 / XP ?
-#ifdef WIN32
-typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum target);
-typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum target);
-#endif
+//===========================================================================
 
-/*
-** extension constants
-*/
-
-
-// S3TC compression constants
-#define GL_RGB_S3TC							0x83A0
-#define GL_RGB4_S3TC						0x83A1
-
-
 // extensions will be function pointers on all platforms
+extern void ( APIENTRY * qglMultiTexCoord2fARB )( GLenum texture, GLfloat s, GLfloat t );
+extern void ( APIENTRY * qglActiveTextureARB )( GLenum texture );
+extern void ( APIENTRY * qglClientActiveTextureARB )( GLenum texture );
 
-extern	void ( APIENTRY * qglMultiTexCoord2fARB )( GLenum texture, GLfloat s, GLfloat t );
-extern	void ( APIENTRY * qglActiveTextureARB )( GLenum texture );
-extern	void ( APIENTRY * qglClientActiveTextureARB )( GLenum texture );
+extern void ( APIENTRY * qglLockArraysEXT)( GLint, GLint);
+extern void ( APIENTRY * qglUnlockArraysEXT) ( void );
 
-extern	void ( APIENTRY * qglLockArraysEXT) (GLint, GLint);
-extern	void ( APIENTRY * qglUnlockArraysEXT) (void);
-
 //===========================================================================
 
-// non-dlopening systems will just redefine qgl* to gl*
-#if !defined( _WIN32 ) && !defined(MACOS_X) && !defined( __linux__ ) && !defined( __FreeBSD__ ) && !defined(__sun) // rb010123
+#define qglAccum glAccum
+#define qglAlphaFunc glAlphaFunc
+#define qglAreTexturesResident glAreTexturesResident
+#define qglArrayElement glArrayElement
+#define qglBegin glBegin
+#define qglBindTexture glBindTexture
+#define qglBitmap glBitmap
+#define qglBlendFunc glBlendFunc
+#define qglCallList glCallList
+#define qglCallLists glCallLists
+#define qglClear glClear
+#define qglClearAccum glClearAccum
+#define qglClearColor glClearColor
+#define qglClearDepth glClearDepth
+#define qglClearIndex glClearIndex
+#define qglClearStencil glClearStencil
+#define qglClipPlane glClipPlane
+#define qglColor3b glColor3b
+#define qglColor3bv glColor3bv
+#define qglColor3d glColor3d
+#define qglColor3dv glColor3dv
+#define qglColor3f glColor3f
+#define qglColor3fv glColor3fv
+#define qglColor3i glColor3i
+#define qglColor3iv glColor3iv
+#define qglColor3s glColor3s
+#define qglColor3sv glColor3sv
+#define qglColor3ub glColor3ub
+#define qglColor3ubv glColor3ubv
+#define qglColor3ui glColor3ui
+#define qglColor3uiv glColor3uiv
+#define qglColor3us glColor3us
+#define qglColor3usv glColor3usv
+#define qglColor4b glColor4b
+#define qglColor4bv glColor4bv
+#define qglColor4d glColor4d
+#define qglColor4dv glColor4dv
+#define qglColor4f glColor4f
+#define qglColor4fv glColor4fv
+#define qglColor4i glColor4i
+#define qglColor4iv glColor4iv
+#define qglColor4s glColor4s
+#define qglColor4sv glColor4sv
+#define qglColor4ub glColor4ub
+#define qglColor4ubv glColor4ubv
+#define qglColor4ui glColor4ui
+#define qglColor4uiv glColor4uiv
+#define qglColor4us glColor4us
+#define qglColor4usv glColor4usv
+#define qglColorMask glColorMask
+#define qglColorMaterial glColorMaterial
+#define qglColorPointer glColorPointer
+#define qglCopyPixels glCopyPixels
+#define qglCopyTexImage1D glCopyTexImage1D
+#define qglCopyTexImage2D glCopyTexImage2D
+#define qglCopyTexSubImage1D glCopyTexSubImage1D
+#define qglCopyTexSubImage2D glCopyTexSubImage2D
+#define qglCullFace glCullFace
+#define qglDeleteLists glDeleteLists
+#define qglDeleteTextures glDeleteTextures
+#define qglDepthFunc glDepthFunc
+#define qglDepthMask glDepthMask
+#define qglDepthRange glDepthRange
+#define qglDisable glDisable
+#define qglDisableClientState glDisableClientState
+#define qglDrawArrays glDrawArrays
+#define qglDrawBuffer glDrawBuffer
+#define qglDrawElements glDrawElements
+#define qglDrawPixels glDrawPixels
+#define qglEdgeFlag glEdgeFlag
+#define qglEdgeFlagPointer glEdgeFlagPointer
+#define qglEdgeFlagv glEdgeFlagv
+#define qglEnable glEnable
+#define qglEnableClientState glEnableClientState
+#define qglEnd glEnd
+#define qglEndList glEndList
+#define qglEvalCoord1d glEvalCoord1d
+#define qglEvalCoord1dv glEvalCoord1dv
+#define qglEvalCoord1f glEvalCoord1f
+#define qglEvalCoord1fv glEvalCoord1fv
+#define qglEvalCoord2d glEvalCoord2d
+#define qglEvalCoord2dv glEvalCoord2dv
+#define qglEvalCoord2f glEvalCoord2f
+#define qglEvalCoord2fv glEvalCoord2fv
+#define qglEvalMesh1 glEvalMesh1
+#define qglEvalMesh2 glEvalMesh2
+#define qglEvalPoint1 glEvalPoint1
+#define qglEvalPoint2 glEvalPoint2
+#define qglFeedbackBuffer glFeedbackBuffer
+#define qglFinish glFinish
+#define qglFlush glFlush
+#define qglFogf glFogf
+#define qglFogfv glFogfv
+#define qglFogi glFogi
+#define qglFogiv glFogiv
+#define qglFrontFace glFrontFace
+#define qglFrustum glFrustum
+#define qglGenLists glGenLists
+#define qglGenTextures glGenTextures
+#define qglGetBooleanv glGetBooleanv
+#define qglGetClipPlane glGetClipPlane
+#define qglGetDoublev glGetDoublev
+#define qglGetError glGetError
+#define qglGetFloatv glGetFloatv
+#define qglGetIntegerv glGetIntegerv
+#define qglGetLightfv glGetLightfv
+#define qglGetLightiv glGetLightiv
+#define qglGetMapdv glGetMapdv
+#define qglGetMapfv glGetMapfv
+#define qglGetMapiv glGetMapiv
+#define qglGetMaterialfv glGetMaterialfv
+#define qglGetMaterialiv glGetMaterialiv
+#define qglGetPixelMapfv glGetPixelMapfv
+#define qglGetPixelMapuiv glGetPixelMapuiv
+#define qglGetPixelMapusv glGetPixelMapusv
+#define qglGetPointerv glGetPointerv
+#define qglGetPolygonStipple glGetPolygonStipple
+#define qglGetString glGetString
+#define qglGetTexGendv glGetTexGendv
+#define qglGetTexGenfv glGetTexGenfv
+#define qglGetTexGeniv glGetTexGeniv
+#define qglGetTexImage glGetTexImage
+#define qglGetTexLevelParameterfv glGetTexLevelParameterfv
+#define qglGetTexLevelParameteriv glGetTexLevelParameteriv
+#define qglGetTexParameterfv glGetTexParameterfv
+#define qglGetTexParameteriv glGetTexParameteriv
+#define qglHint glHint
+#define qglIndexMask glIndexMask
+#define qglIndexPointer glIndexPointer
+#define qglIndexd glIndexd
+#define qglIndexdv glIndexdv
+#define qglIndexf glIndexf
+#define qglIndexfv glIndexfv
+#define qglIndexi glIndexi
+#define qglIndexiv glIndexiv
+#define qglIndexs glIndexs
+#define qglIndexsv glIndexsv
+#define qglIndexub glIndexub
+#define qglIndexubv glIndexubv
+#define qglInitNames glInitNames
+#define qglInterleavedArrays glInterleavedArrays
+#define qglIsEnabled glIsEnabled
+#define qglIsList glIsList
+#define qglIsTexture glIsTexture
+#define qglLightModelf glLightModelf
+#define qglLightModelfv glLightModelfv
+#define qglLightModeli glLightModeli
+#define qglLightModeliv glLightModeliv
+#define qglLightf glLightf
+#define qglLightfv glLightfv
+#define qglLighti glLighti
+#define qglLightiv glLightiv
+#define qglLineStipple glLineStipple
+#define qglLineWidth glLineWidth
+#define qglListBase glListBase
+#define qglLoadIdentity glLoadIdentity
+#define qglLoadMatrixd glLoadMatrixd
+#define qglLoadMatrixf glLoadMatrixf
+#define qglLoadName glLoadName
+#define qglLogicOp glLogicOp
+#define qglMap1d glMap1d
+#define qglMap1f glMap1f
+#define qglMap2d glMap2d
+#define qglMap2f glMap2f
+#define qglMapGrid1d glMapGrid1d
+#define qglMapGrid1f glMapGrid1f
+#define qglMapGrid2d glMapGrid2d
+#define qglMapGrid2f glMapGrid2f
+#define qglMaterialf glMaterialf
+#define qglMaterialfv glMaterialfv
+#define qglMateriali glMateriali
+#define qglMaterialiv glMaterialiv
+#define qglMatrixMode glMatrixMode
+#define qglMultMatrixd glMultMatrixd
+#define qglMultMatrixf glMultMatrixf
+#define qglNewList glNewList
+#define qglNormal3b glNormal3b
+#define qglNormal3bv glNormal3bv
+#define qglNormal3d glNormal3d
+#define qglNormal3dv glNormal3dv
+#define qglNormal3f glNormal3f
+#define qglNormal3fv glNormal3fv
+#define qglNormal3i glNormal3i
+#define qglNormal3iv glNormal3iv
+#define qglNormal3s glNormal3s
+#define qglNormal3sv glNormal3sv
+#define qglNormalPointer glNormalPointer
+#define qglOrtho glOrtho
+#define qglPassThrough glPassThrough
+#define qglPixelMapfv glPixelMapfv
+#define qglPixelMapuiv glPixelMapuiv
+#define qglPixelMapusv glPixelMapusv
+#define qglPixelStoref glPixelStoref
+#define qglPixelStorei glPixelStorei
+#define qglPixelTransferf glPixelTransferf
+#define qglPixelTransferi glPixelTransferi
+#define qglPixelZoom glPixelZoom
+#define qglPointSize glPointSize
+#define qglPolygonMode glPolygonMode
+#define qglPolygonOffset glPolygonOffset
+#define qglPolygonStipple glPolygonStipple
+#define qglPopAttrib glPopAttrib
+#define qglPopClientAttrib glPopClientAttrib
+#define qglPopMatrix glPopMatrix
+#define qglPopName glPopName
+#define qglPrioritizeTextures glPrioritizeTextures
+#define qglPushAttrib glPushAttrib
+#define qglPushClientAttrib glPushClientAttrib
+#define qglPushMatrix glPushMatrix
+#define qglPushName glPushName
+#define qglRasterPos2d glRasterPos2d
+#define qglRasterPos2dv glRasterPos2dv
+#define qglRasterPos2f glRasterPos2f
+#define qglRasterPos2fv glRasterPos2fv
+#define qglRasterPos2i glRasterPos2i
+#define qglRasterPos2iv glRasterPos2iv
+#define qglRasterPos2s glRasterPos2s
+#define qglRasterPos2sv glRasterPos2sv
+#define qglRasterPos3d glRasterPos3d
+#define qglRasterPos3dv glRasterPos3dv
+#define qglRasterPos3f glRasterPos3f
+#define qglRasterPos3fv glRasterPos3fv
+#define qglRasterPos3i glRasterPos3i
+#define qglRasterPos3iv glRasterPos3iv
+#define qglRasterPos3s glRasterPos3s
+#define qglRasterPos3sv glRasterPos3sv
+#define qglRasterPos4d glRasterPos4d
+#define qglRasterPos4dv glRasterPos4dv
+#define qglRasterPos4f glRasterPos4f
+#define qglRasterPos4fv glRasterPos4fv
+#define qglRasterPos4i glRasterPos4i
+#define qglRasterPos4iv glRasterPos4iv
+#define qglRasterPos4s glRasterPos4s
+#define qglRasterPos4sv glRasterPos4sv
+#define qglReadBuffer glReadBuffer
+#define qglReadPixels glReadPixels
+#define qglRectd glRectd
+#define qglRectdv glRectdv
+#define qglRectf glRectf
+#define qglRectfv glRectfv
+#define qglRecti glRecti
+#define qglRectiv glRectiv
+#define qglRects glRects
+#define qglRectsv glRectsv
+#define qglRenderMode glRenderMode
+#define qglRotated glRotated
+#define qglRotatef glRotatef
+#define qglScaled glScaled
+#define qglScalef glScalef
+#define qglScissor glScissor
+#define qglSelectBuffer glSelectBuffer
+#define qglShadeModel glShadeModel
+#define qglStencilFunc glStencilFunc
+#define qglStencilMask glStencilMask
+#define qglStencilOp glStencilOp
+#define qglTexCoord1d glTexCoord1d
+#define qglTexCoord1dv glTexCoord1dv
+#define qglTexCoord1f glTexCoord1f
+#define qglTexCoord1fv glTexCoord1fv
+#define qglTexCoord1i glTexCoord1i
+#define qglTexCoord1iv glTexCoord1iv
+#define qglTexCoord1s glTexCoord1s
+#define qglTexCoord1sv glTexCoord1sv
+#define qglTexCoord2d glTexCoord2d
+#define qglTexCoord2dv glTexCoord2dv
+#define qglTexCoord2f glTexCoord2f
+#define qglTexCoord2fv glTexCoord2fv
+#define qglTexCoord2i glTexCoord2i
+#define qglTexCoord2iv glTexCoord2iv
+#define qglTexCoord2s glTexCoord2s
+#define qglTexCoord2sv glTexCoord2sv
+#define qglTexCoord3d glTexCoord3d
+#define qglTexCoord3dv glTexCoord3dv
+#define qglTexCoord3f glTexCoord3f
+#define qglTexCoord3fv glTexCoord3fv
+#define qglTexCoord3i glTexCoord3i
+#define qglTexCoord3iv glTexCoord3iv
+#define qglTexCoord3s glTexCoord3s
+#define qglTexCoord3sv glTexCoord3sv
+#define qglTexCoord4d glTexCoord4d
+#define qglTexCoord4dv glTexCoord4dv
+#define qglTexCoord4f glTexCoord4f
+#define qglTexCoord4fv glTexCoord4fv
+#define qglTexCoord4i glTexCoord4i
+#define qglTexCoord4iv glTexCoord4iv
+#define qglTexCoord4s glTexCoord4s
+#define qglTexCoord4sv glTexCoord4sv
+#define qglTexCoordPointer glTexCoordPointer
+#define qglTexEnvf glTexEnvf
+#define qglTexEnvfv glTexEnvfv
+#define qglTexEnvi glTexEnvi
+#define qglTexEnviv glTexEnviv
+#define qglTexGend glTexGend
+#define qglTexGendv glTexGendv
+#define qglTexGenf glTexGenf
+#define qglTexGenfv glTexGenfv
+#define qglTexGeni glTexGeni
+#define qglTexGeniv glTexGeniv
+#define qglTexImage1D glTexImage1D
+#define qglTexImage2D glTexImage2D
+#define qglTexParameterf glTexParameterf
+#define qglTexParameterfv glTexParameterfv
+#define qglTexParameteri glTexParameteri
+#define qglTexParameteriv glTexParameteriv
+#define qglTexSubImage1D glTexSubImage1D
+#define qglTexSubImage2D glTexSubImage2D
+#define qglTranslated glTranslated
+#define qglTranslatef glTranslatef
+#define qglVertex2d glVertex2d
+#define qglVertex2dv glVertex2dv
+#define qglVertex2f glVertex2f
+#define qglVertex2fv glVertex2fv
+#define qglVertex2i glVertex2i
+#define qglVertex2iv glVertex2iv
+#define qglVertex2s glVertex2s
+#define qglVertex2sv glVertex2sv
+#define qglVertex3d glVertex3d
+#define qglVertex3dv glVertex3dv
+#define qglVertex3f glVertex3f
+#define qglVertex3fv glVertex3fv
+#define qglVertex3i glVertex3i
+#define qglVertex3iv glVertex3iv
+#define qglVertex3s glVertex3s
+#define qglVertex3sv glVertex3sv
+#define qglVertex4d glVertex4d
+#define qglVertex4dv glVertex4dv
+#define qglVertex4f glVertex4f
+#define qglVertex4fv glVertex4fv
+#define qglVertex4i glVertex4i
+#define qglVertex4iv glVertex4iv
+#define qglVertex4s glVertex4s
+#define qglVertex4sv glVertex4sv
+#define qglVertexPointer glVertexPointer
+#define qglViewport glViewport
 
-#include "qgl_linked.h"
-
-#elif (defined(MACOS_X) && !defined(USE_SDL_VIDEO))
-// This includes #ifdefs for optional logging and GL error checking after every GL call as well as #defines to prevent incorrect usage of the non-'qgl' versions of the GL API.
-#include "macosx_qgl.h"
-
-#else
-
-// windows systems use a function pointer for each call so we can load minidrivers
-
-extern  void ( APIENTRY * qglAccum )(GLenum op, GLfloat value);
-extern  void ( APIENTRY * qglAlphaFunc )(GLenum func, GLclampf ref);
-extern  GLboolean ( APIENTRY * qglAreTexturesResident )(GLsizei n, const GLuint *textures, GLboolean *residences);
-extern  void ( APIENTRY * qglArrayElement )(GLint i);
-extern  void ( APIENTRY * qglBegin )(GLenum mode);
-extern  void ( APIENTRY * qglBindTexture )(GLenum target, GLuint texture);
-extern  void ( APIENTRY * qglBitmap )(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
-extern  void ( APIENTRY * qglBlendFunc )(GLenum sfactor, GLenum dfactor);
-extern  void ( APIENTRY * qglCallList )(GLuint list);
-extern  void ( APIENTRY * qglCallLists )(GLsizei n, GLenum type, const GLvoid *lists);
-extern  void ( APIENTRY * qglClear )(GLbitfield mask);
-extern  void ( APIENTRY * qglClearAccum )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-extern  void ( APIENTRY * qglClearColor )(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-extern  void ( APIENTRY * qglClearDepth )(GLclampd depth);
-extern  void ( APIENTRY * qglClearIndex )(GLfloat c);
-extern  void ( APIENTRY * qglClearStencil )(GLint s);
-extern  void ( APIENTRY * qglClipPlane )(GLenum plane, const GLdouble *equation);
-extern  void ( APIENTRY * qglColor3b )(GLbyte red, GLbyte green, GLbyte blue);
-extern  void ( APIENTRY * qglColor3bv )(const GLbyte *v);
-extern  void ( APIENTRY * qglColor3d )(GLdouble red, GLdouble green, GLdouble blue);
-extern  void ( APIENTRY * qglColor3dv )(const GLdouble *v);
-extern  void ( APIENTRY * qglColor3f )(GLfloat red, GLfloat green, GLfloat blue);
-extern  void ( APIENTRY * qglColor3fv )(const GLfloat *v);
-extern  void ( APIENTRY * qglColor3i )(GLint red, GLint green, GLint blue);
-extern  void ( APIENTRY * qglColor3iv )(const GLint *v);
-extern  void ( APIENTRY * qglColor3s )(GLshort red, GLshort green, GLshort blue);
-extern  void ( APIENTRY * qglColor3sv )(const GLshort *v);
-extern  void ( APIENTRY * qglColor3ub )(GLubyte red, GLubyte green, GLubyte blue);
-extern  void ( APIENTRY * qglColor3ubv )(const GLubyte *v);
-extern  void ( APIENTRY * qglColor3ui )(GLuint red, GLuint green, GLuint blue);
-extern  void ( APIENTRY * qglColor3uiv )(const GLuint *v);
-extern  void ( APIENTRY * qglColor3us )(GLushort red, GLushort green, GLushort blue);
-extern  void ( APIENTRY * qglColor3usv )(const GLushort *v);
-extern  void ( APIENTRY * qglColor4b )(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
-extern  void ( APIENTRY * qglColor4bv )(const GLbyte *v);
-extern  void ( APIENTRY * qglColor4d )(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
-extern  void ( APIENTRY * qglColor4dv )(const GLdouble *v);
-extern  void ( APIENTRY * qglColor4f )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-extern  void ( APIENTRY * qglColor4fv )(const GLfloat *v);
-extern  void ( APIENTRY * qglColor4i )(GLint red, GLint green, GLint blue, GLint alpha);
-extern  void ( APIENTRY * qglColor4iv )(const GLint *v);
-extern  void ( APIENTRY * qglColor4s )(GLshort red, GLshort green, GLshort blue, GLshort alpha);
-extern  void ( APIENTRY * qglColor4sv )(const GLshort *v);
-extern  void ( APIENTRY * qglColor4ub )(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
-extern  void ( APIENTRY * qglColor4ubv )(const GLubyte *v);
-extern  void ( APIENTRY * qglColor4ui )(GLuint red, GLuint green, GLuint blue, GLuint alpha);
-extern  void ( APIENTRY * qglColor4uiv )(const GLuint *v);
-extern  void ( APIENTRY * qglColor4us )(GLushort red, GLushort green, GLushort blue, GLushort alpha);
-extern  void ( APIENTRY * qglColor4usv )(const GLushort *v);
-extern  void ( APIENTRY * qglColorMask )(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-extern  void ( APIENTRY * qglColorMaterial )(GLenum face, GLenum mode);
-extern  void ( APIENTRY * qglColorPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-extern  void ( APIENTRY * qglCopyPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
-extern  void ( APIENTRY * qglCopyTexImage1D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
-extern  void ( APIENTRY * qglCopyTexImage2D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-extern  void ( APIENTRY * qglCopyTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-extern  void ( APIENTRY * qglCopyTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-extern  void ( APIENTRY * qglCullFace )(GLenum mode);
-extern  void ( APIENTRY * qglDeleteLists )(GLuint list, GLsizei range);
-extern  void ( APIENTRY * qglDeleteTextures )(GLsizei n, const GLuint *textures);
-extern  void ( APIENTRY * qglDepthFunc )(GLenum func);
-extern  void ( APIENTRY * qglDepthMask )(GLboolean flag);
-extern  void ( APIENTRY * qglDepthRange )(GLclampd zNear, GLclampd zFar);
-extern  void ( APIENTRY * qglDisable )(GLenum cap);
-extern  void ( APIENTRY * qglDisableClientState )(GLenum array);
-extern  void ( APIENTRY * qglDrawArrays )(GLenum mode, GLint first, GLsizei count);
-extern  void ( APIENTRY * qglDrawBuffer )(GLenum mode);
-extern  void ( APIENTRY * qglDrawElements )(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
-extern  void ( APIENTRY * qglDrawPixels )(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-extern  void ( APIENTRY * qglEdgeFlag )(GLboolean flag);
-extern  void ( APIENTRY * qglEdgeFlagPointer )(GLsizei stride, const GLvoid *pointer);
-extern  void ( APIENTRY * qglEdgeFlagv )(const GLboolean *flag);
-extern  void ( APIENTRY * qglEnable )(GLenum cap);
-extern  void ( APIENTRY * qglEnableClientState )(GLenum array);
-extern  void ( APIENTRY * qglEnd )(void);
-extern  void ( APIENTRY * qglEndList )(void);
-extern  void ( APIENTRY * qglEvalCoord1d )(GLdouble u);
-extern  void ( APIENTRY * qglEvalCoord1dv )(const GLdouble *u);
-extern  void ( APIENTRY * qglEvalCoord1f )(GLfloat u);
-extern  void ( APIENTRY * qglEvalCoord1fv )(const GLfloat *u);
-extern  void ( APIENTRY * qglEvalCoord2d )(GLdouble u, GLdouble v);
-extern  void ( APIENTRY * qglEvalCoord2dv )(const GLdouble *u);
-extern  void ( APIENTRY * qglEvalCoord2f )(GLfloat u, GLfloat v);
-extern  void ( APIENTRY * qglEvalCoord2fv )(const GLfloat *u);
-extern  void ( APIENTRY * qglEvalMesh1 )(GLenum mode, GLint i1, GLint i2);
-extern  void ( APIENTRY * qglEvalMesh2 )(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
-extern  void ( APIENTRY * qglEvalPoint1 )(GLint i);
-extern  void ( APIENTRY * qglEvalPoint2 )(GLint i, GLint j);
-extern  void ( APIENTRY * qglFeedbackBuffer )(GLsizei size, GLenum type, GLfloat *buffer);
-extern  void ( APIENTRY * qglFinish )(void);
-extern  void ( APIENTRY * qglFlush )(void);
-extern  void ( APIENTRY * qglFogf )(GLenum pname, GLfloat param);
-extern  void ( APIENTRY * qglFogfv )(GLenum pname, const GLfloat *params);
-extern  void ( APIENTRY * qglFogi )(GLenum pname, GLint param);
-extern  void ( APIENTRY * qglFogiv )(GLenum pname, const GLint *params);
-extern  void ( APIENTRY * qglFrontFace )(GLenum mode);
-extern  void ( APIENTRY * qglFrustum )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-extern  GLuint ( APIENTRY * qglGenLists )(GLsizei range);
-extern  void ( APIENTRY * qglGenTextures )(GLsizei n, GLuint *textures);
-extern  void ( APIENTRY * qglGetBooleanv )(GLenum pname, GLboolean *params);
-extern  void ( APIENTRY * qglGetClipPlane )(GLenum plane, GLdouble *equation);
-extern  void ( APIENTRY * qglGetDoublev )(GLenum pname, GLdouble *params);
-extern  GLenum ( APIENTRY * qglGetError )(void);
-extern  void ( APIENTRY * qglGetFloatv )(GLenum pname, GLfloat *params);
-extern  void ( APIENTRY * qglGetIntegerv )(GLenum pname, GLint *params);
-extern  void ( APIENTRY * qglGetLightfv )(GLenum light, GLenum pname, GLfloat *params);
-extern  void ( APIENTRY * qglGetLightiv )(GLenum light, GLenum pname, GLint *params);
-extern  void ( APIENTRY * qglGetMapdv )(GLenum target, GLenum query, GLdouble *v);
-extern  void ( APIENTRY * qglGetMapfv )(GLenum target, GLenum query, GLfloat *v);
-extern  void ( APIENTRY * qglGetMapiv )(GLenum target, GLenum query, GLint *v);
-extern  void ( APIENTRY * qglGetMaterialfv )(GLenum face, GLenum pname, GLfloat *params);
-extern  void ( APIENTRY * qglGetMaterialiv )(GLenum face, GLenum pname, GLint *params);
-extern  void ( APIENTRY * qglGetPixelMapfv )(GLenum map, GLfloat *values);
-extern  void ( APIENTRY * qglGetPixelMapuiv )(GLenum map, GLuint *values);
-extern  void ( APIENTRY * qglGetPixelMapusv )(GLenum map, GLushort *values);
-extern  void ( APIENTRY * qglGetPointerv )(GLenum pname, GLvoid* *params);
-extern  void ( APIENTRY * qglGetPolygonStipple )(GLubyte *mask);
-extern  const GLubyte * ( APIENTRY * qglGetString )(GLenum name);
-extern  void ( APIENTRY * qglGetTexEnvfv )(GLenum target, GLenum pname, GLfloat *params);
-extern  void ( APIENTRY * qglGetTexEnviv )(GLenum target, GLenum pname, GLint *params);
-extern  void ( APIENTRY * qglGetTexGendv )(GLenum coord, GLenum pname, GLdouble *params);
-extern  void ( APIENTRY * qglGetTexGenfv )(GLenum coord, GLenum pname, GLfloat *params);
-extern  void ( APIENTRY * qglGetTexGeniv )(GLenum coord, GLenum pname, GLint *params);
-extern  void ( APIENTRY * qglGetTexImage )(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-extern  void ( APIENTRY * qglGetTexLevelParameterfv )(GLenum target, GLint level, GLenum pname, GLfloat *params);
-extern  void ( APIENTRY * qglGetTexLevelParameteriv )(GLenum target, GLint level, GLenum pname, GLint *params);
-extern  void ( APIENTRY * qglGetTexParameterfv )(GLenum target, GLenum pname, GLfloat *params);
-extern  void ( APIENTRY * qglGetTexParameteriv )(GLenum target, GLenum pname, GLint *params);
-extern  void ( APIENTRY * qglHint )(GLenum target, GLenum mode);
-extern  void ( APIENTRY * qglIndexMask )(GLuint mask);
-extern  void ( APIENTRY * qglIndexPointer )(GLenum type, GLsizei stride, const GLvoid *pointer);
-extern  void ( APIENTRY * qglIndexd )(GLdouble c);
-extern  void ( APIENTRY * qglIndexdv )(const GLdouble *c);
-extern  void ( APIENTRY * qglIndexf )(GLfloat c);
-extern  void ( APIENTRY * qglIndexfv )(const GLfloat *c);
-extern  void ( APIENTRY * qglIndexi )(GLint c);
-extern  void ( APIENTRY * qglIndexiv )(const GLint *c);
-extern  void ( APIENTRY * qglIndexs )(GLshort c);
-extern  void ( APIENTRY * qglIndexsv )(const GLshort *c);
-extern  void ( APIENTRY * qglIndexub )(GLubyte c);
-extern  void ( APIENTRY * qglIndexubv )(const GLubyte *c);
-extern  void ( APIENTRY * qglInitNames )(void);
-extern  void ( APIENTRY * qglInterleavedArrays )(GLenum format, GLsizei stride, const GLvoid *pointer);
-extern  GLboolean ( APIENTRY * qglIsEnabled )(GLenum cap);
-extern  GLboolean ( APIENTRY * qglIsList )(GLuint list);
-extern  GLboolean ( APIENTRY * qglIsTexture )(GLuint texture);
-extern  void ( APIENTRY * qglLightModelf )(GLenum pname, GLfloat param);
-extern  void ( APIENTRY * qglLightModelfv )(GLenum pname, const GLfloat *params);
-extern  void ( APIENTRY * qglLightModeli )(GLenum pname, GLint param);
-extern  void ( APIENTRY * qglLightModeliv )(GLenum pname, const GLint *params);
-extern  void ( APIENTRY * qglLightf )(GLenum light, GLenum pname, GLfloat param);
-extern  void ( APIENTRY * qglLightfv )(GLenum light, GLenum pname, const GLfloat *params);
-extern  void ( APIENTRY * qglLighti )(GLenum light, GLenum pname, GLint param);
-extern  void ( APIENTRY * qglLightiv )(GLenum light, GLenum pname, const GLint *params);
-extern  void ( APIENTRY * qglLineStipple )(GLint factor, GLushort pattern);
-extern  void ( APIENTRY * qglLineWidth )(GLfloat width);
-extern  void ( APIENTRY * qglListBase )(GLuint base);
-extern  void ( APIENTRY * qglLoadIdentity )(void);
-extern  void ( APIENTRY * qglLoadMatrixd )(const GLdouble *m);
-extern  void ( APIENTRY * qglLoadMatrixf )(const GLfloat *m);
-extern  void ( APIENTRY * qglLoadName )(GLuint name);
-extern  void ( APIENTRY * qglLogicOp )(GLenum opcode);
-extern  void ( APIENTRY * qglMap1d )(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
-extern  void ( APIENTRY * qglMap1f )(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
-extern  void ( APIENTRY * qglMap2d )(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
-extern  void ( APIENTRY * qglMap2f )(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
-extern  void ( APIENTRY * qglMapGrid1d )(GLint un, GLdouble u1, GLdouble u2);
-extern  void ( APIENTRY * qglMapGrid1f )(GLint un, GLfloat u1, GLfloat u2);
-extern  void ( APIENTRY * qglMapGrid2d )(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
-extern  void ( APIENTRY * qglMapGrid2f )(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
-extern  void ( APIENTRY * qglMaterialf )(GLenum face, GLenum pname, GLfloat param);
-extern  void ( APIENTRY * qglMaterialfv )(GLenum face, GLenum pname, const GLfloat *params);
-extern  void ( APIENTRY * qglMateriali )(GLenum face, GLenum pname, GLint param);
-extern  void ( APIENTRY * qglMaterialiv )(GLenum face, GLenum pname, const GLint *params);
-extern  void ( APIENTRY * qglMatrixMode )(GLenum mode);
-extern  void ( APIENTRY * qglMultMatrixd )(const GLdouble *m);
-extern  void ( APIENTRY * qglMultMatrixf )(const GLfloat *m);
-extern  void ( APIENTRY * qglNewList )(GLuint list, GLenum mode);
-extern  void ( APIENTRY * qglNormal3b )(GLbyte nx, GLbyte ny, GLbyte nz);
-extern  void ( APIENTRY * qglNormal3bv )(const GLbyte *v);
-extern  void ( APIENTRY * qglNormal3d )(GLdouble nx, GLdouble ny, GLdouble nz);
-extern  void ( APIENTRY * qglNormal3dv )(const GLdouble *v);
-extern  void ( APIENTRY * qglNormal3f )(GLfloat nx, GLfloat ny, GLfloat nz);
-extern  void ( APIENTRY * qglNormal3fv )(const GLfloat *v);
-extern  void ( APIENTRY * qglNormal3i )(GLint nx, GLint ny, GLint nz);
-extern  void ( APIENTRY * qglNormal3iv )(const GLint *v);
-extern  void ( APIENTRY * qglNormal3s )(GLshort nx, GLshort ny, GLshort nz);
-extern  void ( APIENTRY * qglNormal3sv )(const GLshort *v);
-extern  void ( APIENTRY * qglNormalPointer )(GLenum type, GLsizei stride, const GLvoid *pointer);
-extern  void ( APIENTRY * qglOrtho )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-extern  void ( APIENTRY * qglPassThrough )(GLfloat token);
-extern  void ( APIENTRY * qglPixelMapfv )(GLenum map, GLsizei mapsize, const GLfloat *values);
-extern  void ( APIENTRY * qglPixelMapuiv )(GLenum map, GLsizei mapsize, const GLuint *values);
-extern  void ( APIENTRY * qglPixelMapusv )(GLenum map, GLsizei mapsize, const GLushort *values);
-extern  void ( APIENTRY * qglPixelStoref )(GLenum pname, GLfloat param);
-extern  void ( APIENTRY * qglPixelStorei )(GLenum pname, GLint param);
-extern  void ( APIENTRY * qglPixelTransferf )(GLenum pname, GLfloat param);
-extern  void ( APIENTRY * qglPixelTransferi )(GLenum pname, GLint param);
-extern  void ( APIENTRY * qglPixelZoom )(GLfloat xfactor, GLfloat yfactor);
-extern  void ( APIENTRY * qglPointSize )(GLfloat size);
-extern  void ( APIENTRY * qglPolygonMode )(GLenum face, GLenum mode);
-extern  void ( APIENTRY * qglPolygonOffset )(GLfloat factor, GLfloat units);
-extern  void ( APIENTRY * qglPolygonStipple )(const GLubyte *mask);
-extern  void ( APIENTRY * qglPopAttrib )(void);
-extern  void ( APIENTRY * qglPopClientAttrib )(void);
-extern  void ( APIENTRY * qglPopMatrix )(void);
-extern  void ( APIENTRY * qglPopName )(void);
-extern  void ( APIENTRY * qglPrioritizeTextures )(GLsizei n, const GLuint *textures, const GLclampf *priorities);
-extern  void ( APIENTRY * qglPushAttrib )(GLbitfield mask);
-extern  void ( APIENTRY * qglPushClientAttrib )(GLbitfield mask);
-extern  void ( APIENTRY * qglPushMatrix )(void);
-extern  void ( APIENTRY * qglPushName )(GLuint name);
-extern  void ( APIENTRY * qglRasterPos2d )(GLdouble x, GLdouble y);
-extern  void ( APIENTRY * qglRasterPos2dv )(const GLdouble *v);
-extern  void ( APIENTRY * qglRasterPos2f )(GLfloat x, GLfloat y);
-extern  void ( APIENTRY * qglRasterPos2fv )(const GLfloat *v);
-extern  void ( APIENTRY * qglRasterPos2i )(GLint x, GLint y);
-extern  void ( APIENTRY * qglRasterPos2iv )(const GLint *v);
-extern  void ( APIENTRY * qglRasterPos2s )(GLshort x, GLshort y);
-extern  void ( APIENTRY * qglRasterPos2sv )(const GLshort *v);
-extern  void ( APIENTRY * qglRasterPos3d )(GLdouble x, GLdouble y, GLdouble z);
-extern  void ( APIENTRY * qglRasterPos3dv )(const GLdouble *v);
-extern  void ( APIENTRY * qglRasterPos3f )(GLfloat x, GLfloat y, GLfloat z);
-extern  void ( APIENTRY * qglRasterPos3fv )(const GLfloat *v);
-extern  void ( APIENTRY * qglRasterPos3i )(GLint x, GLint y, GLint z);
-extern  void ( APIENTRY * qglRasterPos3iv )(const GLint *v);
-extern  void ( APIENTRY * qglRasterPos3s )(GLshort x, GLshort y, GLshort z);
-extern  void ( APIENTRY * qglRasterPos3sv )(const GLshort *v);
-extern  void ( APIENTRY * qglRasterPos4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-extern  void ( APIENTRY * qglRasterPos4dv )(const GLdouble *v);
-extern  void ( APIENTRY * qglRasterPos4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-extern  void ( APIENTRY * qglRasterPos4fv )(const GLfloat *v);
-extern  void ( APIENTRY * qglRasterPos4i )(GLint x, GLint y, GLint z, GLint w);
-extern  void ( APIENTRY * qglRasterPos4iv )(const GLint *v);
-extern  void ( APIENTRY * qglRasterPos4s )(GLshort x, GLshort y, GLshort z, GLshort w);
-extern  void ( APIENTRY * qglRasterPos4sv )(const GLshort *v);
-extern  void ( APIENTRY * qglReadBuffer )(GLenum mode);
-extern  void ( APIENTRY * qglReadPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
-extern  void ( APIENTRY * qglRectd )(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
-extern  void ( APIENTRY * qglRectdv )(const GLdouble *v1, const GLdouble *v2);
-extern  void ( APIENTRY * qglRectf )(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
-extern  void ( APIENTRY * qglRectfv )(const GLfloat *v1, const GLfloat *v2);
-extern  void ( APIENTRY * qglRecti )(GLint x1, GLint y1, GLint x2, GLint y2);
-extern  void ( APIENTRY * qglRectiv )(const GLint *v1, const GLint *v2);
-extern  void ( APIENTRY * qglRects )(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
-extern  void ( APIENTRY * qglRectsv )(const GLshort *v1, const GLshort *v2);
-extern  GLint ( APIENTRY * qglRenderMode )(GLenum mode);
-extern  void ( APIENTRY * qglRotated )(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-extern  void ( APIENTRY * qglRotatef )(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-extern  void ( APIENTRY * qglScaled )(GLdouble x, GLdouble y, GLdouble z);
-extern  void ( APIENTRY * qglScalef )(GLfloat x, GLfloat y, GLfloat z);
-extern  void ( APIENTRY * qglScissor )(GLint x, GLint y, GLsizei width, GLsizei height);
-extern  void ( APIENTRY * qglSelectBuffer )(GLsizei size, GLuint *buffer);
-extern  void ( APIENTRY * qglShadeModel )(GLenum mode);
-extern  void ( APIENTRY * qglStencilFunc )(GLenum func, GLint ref, GLuint mask);
-extern  void ( APIENTRY * qglStencilMask )(GLuint mask);
-extern  void ( APIENTRY * qglStencilOp )(GLenum fail, GLenum zfail, GLenum zpass);
-extern  void ( APIENTRY * qglTexCoord1d )(GLdouble s);
-extern  void ( APIENTRY * qglTexCoord1dv )(const GLdouble *v);
-extern  void ( APIENTRY * qglTexCoord1f )(GLfloat s);
-extern  void ( APIENTRY * qglTexCoord1fv )(const GLfloat *v);
-extern  void ( APIENTRY * qglTexCoord1i )(GLint s);
-extern  void ( APIENTRY * qglTexCoord1iv )(const GLint *v);
-extern  void ( APIENTRY * qglTexCoord1s )(GLshort s);
-extern  void ( APIENTRY * qglTexCoord1sv )(const GLshort *v);
-extern  void ( APIENTRY * qglTexCoord2d )(GLdouble s, GLdouble t);
-extern  void ( APIENTRY * qglTexCoord2dv )(const GLdouble *v);
-extern  void ( APIENTRY * qglTexCoord2f )(GLfloat s, GLfloat t);
-extern  void ( APIENTRY * qglTexCoord2fv )(const GLfloat *v);
-extern  void ( APIENTRY * qglTexCoord2i )(GLint s, GLint t);
-extern  void ( APIENTRY * qglTexCoord2iv )(const GLint *v);
-extern  void ( APIENTRY * qglTexCoord2s )(GLshort s, GLshort t);
-extern  void ( APIENTRY * qglTexCoord2sv )(const GLshort *v);
-extern  void ( APIENTRY * qglTexCoord3d )(GLdouble s, GLdouble t, GLdouble r);
-extern  void ( APIENTRY * qglTexCoord3dv )(const GLdouble *v);
-extern  void ( APIENTRY * qglTexCoord3f )(GLfloat s, GLfloat t, GLfloat r);
-extern  void ( APIENTRY * qglTexCoord3fv )(const GLfloat *v);
-extern  void ( APIENTRY * qglTexCoord3i )(GLint s, GLint t, GLint r);
-extern  void ( APIENTRY * qglTexCoord3iv )(const GLint *v);
-extern  void ( APIENTRY * qglTexCoord3s )(GLshort s, GLshort t, GLshort r);
-extern  void ( APIENTRY * qglTexCoord3sv )(const GLshort *v);
-extern  void ( APIENTRY * qglTexCoord4d )(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-extern  void ( APIENTRY * qglTexCoord4dv )(const GLdouble *v);
-extern  void ( APIENTRY * qglTexCoord4f )(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-extern  void ( APIENTRY * qglTexCoord4fv )(const GLfloat *v);
-extern  void ( APIENTRY * qglTexCoord4i )(GLint s, GLint t, GLint r, GLint q);
-extern  void ( APIENTRY * qglTexCoord4iv )(const GLint *v);
-extern  void ( APIENTRY * qglTexCoord4s )(GLshort s, GLshort t, GLshort r, GLshort q);
-extern  void ( APIENTRY * qglTexCoord4sv )(const GLshort *v);
-extern  void ( APIENTRY * qglTexCoordPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-extern  void ( APIENTRY * qglTexEnvf )(GLenum target, GLenum pname, GLfloat param);
-extern  void ( APIENTRY * qglTexEnvfv )(GLenum target, GLenum pname, const GLfloat *params);
-extern  void ( APIENTRY * qglTexEnvi )(GLenum target, GLenum pname, GLint param);
-extern  void ( APIENTRY * qglTexEnviv )(GLenum target, GLenum pname, const GLint *params);
-extern  void ( APIENTRY * qglTexGend )(GLenum coord, GLenum pname, GLdouble param);
-extern  void ( APIENTRY * qglTexGendv )(GLenum coord, GLenum pname, const GLdouble *params);
-extern  void ( APIENTRY * qglTexGenf )(GLenum coord, GLenum pname, GLfloat param);
-extern  void ( APIENTRY * qglTexGenfv )(GLenum coord, GLenum pname, const GLfloat *params);
-extern  void ( APIENTRY * qglTexGeni )(GLenum coord, GLenum pname, GLint param);
-extern  void ( APIENTRY * qglTexGeniv )(GLenum coord, GLenum pname, const GLint *params);
-extern  void ( APIENTRY * qglTexImage1D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-extern  void ( APIENTRY * qglTexImage2D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-extern  void ( APIENTRY * qglTexParameterf )(GLenum target, GLenum pname, GLfloat param);
-extern  void ( APIENTRY * qglTexParameterfv )(GLenum target, GLenum pname, const GLfloat *params);
-extern  void ( APIENTRY * qglTexParameteri )(GLenum target, GLenum pname, GLint param);
-extern  void ( APIENTRY * qglTexParameteriv )(GLenum target, GLenum pname, const GLint *params);
-extern  void ( APIENTRY * qglTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-extern  void ( APIENTRY * qglTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-extern  void ( APIENTRY * qglTranslated )(GLdouble x, GLdouble y, GLdouble z);
-extern  void ( APIENTRY * qglTranslatef )(GLfloat x, GLfloat y, GLfloat z);
-extern  void ( APIENTRY * qglVertex2d )(GLdouble x, GLdouble y);
-extern  void ( APIENTRY * qglVertex2dv )(const GLdouble *v);
-extern  void ( APIENTRY * qglVertex2f )(GLfloat x, GLfloat y);
-extern  void ( APIENTRY * qglVertex2fv )(const GLfloat *v);
-extern  void ( APIENTRY * qglVertex2i )(GLint x, GLint y);
-extern  void ( APIENTRY * qglVertex2iv )(const GLint *v);
-extern  void ( APIENTRY * qglVertex2s )(GLshort x, GLshort y);
-extern  void ( APIENTRY * qglVertex2sv )(const GLshort *v);
-extern  void ( APIENTRY * qglVertex3d )(GLdouble x, GLdouble y, GLdouble z);
-extern  void ( APIENTRY * qglVertex3dv )(const GLdouble *v);
-extern  void ( APIENTRY * qglVertex3f )(GLfloat x, GLfloat y, GLfloat z);
-extern  void ( APIENTRY * qglVertex3fv )(const GLfloat *v);
-extern  void ( APIENTRY * qglVertex3i )(GLint x, GLint y, GLint z);
-extern  void ( APIENTRY * qglVertex3iv )(const GLint *v);
-extern  void ( APIENTRY * qglVertex3s )(GLshort x, GLshort y, GLshort z);
-extern  void ( APIENTRY * qglVertex3sv )(const GLshort *v);
-extern  void ( APIENTRY * qglVertex4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-extern  void ( APIENTRY * qglVertex4dv )(const GLdouble *v);
-extern  void ( APIENTRY * qglVertex4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-extern  void ( APIENTRY * qglVertex4fv )(const GLfloat *v);
-extern  void ( APIENTRY * qglVertex4i )(GLint x, GLint y, GLint z, GLint w);
-extern  void ( APIENTRY * qglVertex4iv )(const GLint *v);
-extern  void ( APIENTRY * qglVertex4s )(GLshort x, GLshort y, GLshort z, GLshort w);
-extern  void ( APIENTRY * qglVertex4sv )(const GLshort *v);
-extern  void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-extern  void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height);
-
-#if defined( _WIN32 )
-
-extern  int   ( WINAPI * qwglChoosePixelFormat )(HDC, CONST PIXELFORMATDESCRIPTOR *);
-extern  int   ( WINAPI * qwglDescribePixelFormat) (HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
-extern  int   ( WINAPI * qwglGetPixelFormat)(HDC);
-extern  BOOL  ( WINAPI * qwglSetPixelFormat)(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
-extern  BOOL  ( WINAPI * qwglSwapBuffers)(HDC);
-
-extern	BOOL  ( WINAPI * qwglGetDeviceGammaRamp3DFX)( HDC, LPVOID );
-extern	BOOL  ( WINAPI * qwglSetDeviceGammaRamp3DFX)( HDC, LPVOID );
-
-extern BOOL  ( WINAPI * qwglCopyContext)(HGLRC, HGLRC, UINT);
-extern HGLRC ( WINAPI * qwglCreateContext)(HDC);
-extern HGLRC ( WINAPI * qwglCreateLayerContext)(HDC, int);
-extern BOOL  ( WINAPI * qwglDeleteContext)(HGLRC);
-extern HGLRC ( WINAPI * qwglGetCurrentContext)(VOID);
-extern HDC   ( WINAPI * qwglGetCurrentDC)(VOID);
-extern PROC  ( WINAPI * qwglGetProcAddress)(LPCSTR);
-extern BOOL  ( WINAPI * qwglMakeCurrent)(HDC, HGLRC);
-extern BOOL  ( WINAPI * qwglShareLists)(HGLRC, HGLRC);
-extern BOOL  ( WINAPI * qwglUseFontBitmaps)(HDC, DWORD, DWORD, DWORD);
-
-extern BOOL  ( WINAPI * qwglUseFontOutlines)(HDC, DWORD, DWORD, DWORD, FLOAT,
-                                           FLOAT, int, LPGLYPHMETRICSFLOAT);
-
-extern BOOL ( WINAPI * qwglDescribeLayerPlane)(HDC, int, int, UINT,
-                                            LPLAYERPLANEDESCRIPTOR);
-extern int  ( WINAPI * qwglSetLayerPaletteEntries)(HDC, int, int, int,
-                                                CONST COLORREF *);
-extern int  ( WINAPI * qwglGetLayerPaletteEntries)(HDC, int, int, int,
-                                                COLORREF *);
-extern BOOL ( WINAPI * qwglRealizeLayerPalette)(HDC, int, BOOL);
-extern BOOL ( WINAPI * qwglSwapLayerBuffers)(HDC, UINT);
-
-extern BOOL ( WINAPI * qwglSwapIntervalEXT)( int interval );
-
-#endif	// _WIN32
-
-#if ( (defined __linux__ )  || (defined __FreeBSD__ ) || (defined __sun) ) // rb010123
-
-//FX Mesa Functions
-// bk001129 - from cvs1.17 (mkv)
-#if defined (__FX__)
-extern fxMesaContext (*qfxMesaCreateContext)(GLuint win, GrScreenResolution_t, GrScreenRefresh_t, const GLint attribList[]);
-extern fxMesaContext (*qfxMesaCreateBestContext)(GLuint win, GLint width, GLint height, const GLint attribList[]);
-extern void (*qfxMesaDestroyContext)(fxMesaContext ctx);
-extern void (*qfxMesaMakeCurrent)(fxMesaContext ctx);
-extern fxMesaContext (*qfxMesaGetCurrentContext)(void);
-extern void (*qfxMesaSwapBuffers)(void);
 #endif
-
-//GLX Functions
-extern XVisualInfo * (*qglXChooseVisual)( Display *dpy, int screen, int *attribList );
-extern GLXContext (*qglXCreateContext)( Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct );
-extern void (*qglXDestroyContext)( Display *dpy, GLXContext ctx );
-extern Bool (*qglXMakeCurrent)( Display *dpy, GLXDrawable drawable, GLXContext ctx);
-extern void (*qglXCopyContext)( Display *dpy, GLXContext src, GLXContext dst, GLuint mask );
-extern void (*qglXSwapBuffers)( Display *dpy, GLXDrawable drawable );
-
-#endif // __linux__ || __FreeBSD__ || __sun // rb010123
-
-#endif	// _WIN32 && __linux__
-
-#endif

Deleted: trunk/code/renderer/qgl_linked.h
===================================================================
--- trunk/code/renderer/qgl_linked.h	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/renderer/qgl_linked.h	2007-09-05 18:17:46 UTC (rev 1161)
@@ -1,357 +0,0 @@
-/*
-===========================================================================
-Copyright (C) 1999-2005 Id Software, Inc.
-
-This file is part of Quake III Arena source code.
-
-Quake III Arena source code is free software; you can redistribute it
-and/or modify it under the terms of the GNU General Public License as
-published by the Free Software Foundation; either version 2 of the License,
-or (at your option) any later version.
-
-Quake III Arena source code is distributed in the hope that it will be
-useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Quake III Arena source code; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-===========================================================================
-*/
-
-#define qglAccum glAccum
-#define qglAlphaFunc glAlphaFunc
-#define qglAreTexturesResident glAreTexturesResident
-#define qglArrayElement glArrayElement
-#define qglBegin glBegin
-#define qglBindTexture glBindTexture
-#define qglBitmap glBitmap
-#define qglBlendFunc glBlendFunc
-#define qglCallList glCallList
-#define qglCallLists glCallLists
-#define qglClear glClear
-#define qglClearAccum glClearAccum
-#define qglClearColor glClearColor
-#define qglClearDepth glClearDepth
-#define qglClearIndex glClearIndex
-#define qglClearStencil glClearStencil
-#define qglClipPlane glClipPlane
-#define qglColor3b glColor3b
-#define qglColor3bv glColor3bv
-#define qglColor3d glColor3d
-#define qglColor3dv glColor3dv
-#define qglColor3f glColor3f
-#define qglColor3fv glColor3fv
-#define qglColor3i glColor3i
-#define qglColor3iv glColor3iv
-#define qglColor3s glColor3s
-#define qglColor3sv glColor3sv
-#define qglColor3ub glColor3ub
-#define qglColor3ubv glColor3ubv
-#define qglColor3ui glColor3ui
-#define qglColor3uiv glColor3uiv
-#define qglColor3us glColor3us
-#define qglColor3usv glColor3usv
-#define qglColor4b glColor4b
-#define qglColor4bv glColor4bv
-#define qglColor4d glColor4d
-#define qglColor4dv glColor4dv
-#define qglColor4f glColor4f
-#define qglColor4fv glColor4fv
-#define qglColor4i glColor4i
-#define qglColor4iv glColor4iv
-#define qglColor4s glColor4s
-#define qglColor4sv glColor4sv
-#define qglColor4ub glColor4ub
-#define qglColor4ubv glColor4ubv
-#define qglColor4ui glColor4ui
-#define qglColor4uiv glColor4uiv
-#define qglColor4us glColor4us
-#define qglColor4usv glColor4usv
-#define qglColorMask glColorMask
-#define qglColorMaterial glColorMaterial
-#define qglColorPointer glColorPointer
-#define qglCopyPixels glCopyPixels
-#define qglCopyTexImage1D glCopyTexImage1D
-#define qglCopyTexImage2D glCopyTexImage2D
-#define qglCopyTexSubImage1D glCopyTexSubImage1D
-#define qglCopyTexSubImage2D glCopyTexSubImage2D
-#define qglCullFace glCullFace
-#define qglDeleteLists glDeleteLists
-#define qglDeleteTextures glDeleteTextures
-#define qglDepthFunc glDepthFunc
-#define qglDepthMask glDepthMask
-#define qglDepthRange glDepthRange
-#define qglDisable glDisable
-#define qglDisableClientState glDisableClientState
-#define qglDrawArrays glDrawArrays
-#define qglDrawBuffer glDrawBuffer
-#define qglDrawElements glDrawElements
-#define qglDrawPixels glDrawPixels
-#define qglEdgeFlag glEdgeFlag
-#define qglEdgeFlagPointer glEdgeFlagPointer
-#define qglEdgeFlagv glEdgeFlagv
-#define qglEnable glEnable
-#define qglEnableClientState glEnableClientState
-#define qglEnd glEnd
-#define qglEndList glEndList
-#define qglEvalCoord1d glEvalCoord1d
-#define qglEvalCoord1dv glEvalCoord1dv
-#define qglEvalCoord1f glEvalCoord1f
-#define qglEvalCoord1fv glEvalCoord1fv
-#define qglEvalCoord2d glEvalCoord2d
-#define qglEvalCoord2dv glEvalCoord2dv
-#define qglEvalCoord2f glEvalCoord2f
-#define qglEvalCoord2fv glEvalCoord2fv
-#define qglEvalMesh1 glEvalMesh1
-#define qglEvalMesh2 glEvalMesh2
-#define qglEvalPoint1 glEvalPoint1
-#define qglEvalPoint2 glEvalPoint2
-#define qglFeedbackBuffer glFeedbackBuffer
-#define qglFinish glFinish
-#define qglFlush glFlush
-#define qglFogf glFogf
-#define qglFogfv glFogfv
-#define qglFogi glFogi
-#define qglFogiv glFogiv
-#define qglFrontFace glFrontFace
-#define qglFrustum glFrustum
-#define qglGenLists glGenLists
-#define qglGenTextures glGenTextures
-#define qglGetBooleanv glGetBooleanv
-#define qglGetClipPlane glGetClipPlane
-#define qglGetDoublev glGetDoublev
-#define qglGetError glGetError
-#define qglGetFloatv glGetFloatv
-#define qglGetIntegerv glGetIntegerv
-#define qglGetLightfv glGetLightfv
-#define qglGetLightiv glGetLightiv
-#define qglGetMapdv glGetMapdv
-#define qglGetMapfv glGetMapfv
-#define qglGetMapiv glGetMapiv
-#define qglGetMaterialfv glGetMaterialfv
-#define qglGetMaterialiv glGetMaterialiv
-#define qglGetPixelMapfv glGetPixelMapfv
-#define qglGetPixelMapuiv glGetPixelMapuiv
-#define qglGetPixelMapusv glGetPixelMapusv
-#define qglGetPointerv glGetPointerv
-#define qglGetPolygonStipple glGetPolygonStipple
-#define qglGetString glGetString
-#define qglGetTexGendv glGetTexGendv
-#define qglGetTexGenfv glGetTexGenfv
-#define qglGetTexGeniv glGetTexGeniv
-#define qglGetTexImage glGetTexImage
-#define qglGetTexLevelParameterfv glGetTexLevelParameterfv
-#define qglGetTexLevelParameteriv glGetTexLevelParameteriv
-#define qglGetTexParameterfv glGetTexParameterfv
-#define qglGetTexParameteriv glGetTexParameteriv
-#define qglHint glHint
-#define qglIndexMask glIndexMask
-#define qglIndexPointer glIndexPointer
-#define qglIndexd glIndexd
-#define qglIndexdv glIndexdv
-#define qglIndexf glIndexf
-#define qglIndexfv glIndexfv
-#define qglIndexi glIndexi
-#define qglIndexiv glIndexiv
-#define qglIndexs glIndexs
-#define qglIndexsv glIndexsv
-#define qglIndexub glIndexub
-#define qglIndexubv glIndexubv
-#define qglInitNames glInitNames
-#define qglInterleavedArrays glInterleavedArrays
-#define qglIsEnabled glIsEnabled
-#define qglIsList glIsList
-#define qglIsTexture glIsTexture
-#define qglLightModelf glLightModelf
-#define qglLightModelfv glLightModelfv
-#define qglLightModeli glLightModeli
-#define qglLightModeliv glLightModeliv
-#define qglLightf glLightf
-#define qglLightfv glLightfv
-#define qglLighti glLighti
-#define qglLightiv glLightiv
-#define qglLineStipple glLineStipple
-#define qglLineWidth glLineWidth
-#define qglListBase glListBase
-#define qglLoadIdentity glLoadIdentity
-#define qglLoadMatrixd glLoadMatrixd
-#define qglLoadMatrixf glLoadMatrixf
-#define qglLoadName glLoadName
-#define qglLogicOp glLogicOp
-#define qglMap1d glMap1d
-#define qglMap1f glMap1f
-#define qglMap2d glMap2d
-#define qglMap2f glMap2f
-#define qglMapGrid1d glMapGrid1d
-#define qglMapGrid1f glMapGrid1f
-#define qglMapGrid2d glMapGrid2d
-#define qglMapGrid2f glMapGrid2f
-#define qglMaterialf glMaterialf
-#define qglMaterialfv glMaterialfv
-#define qglMateriali glMateriali
-#define qglMaterialiv glMaterialiv
-#define qglMatrixMode glMatrixMode
-#define qglMultMatrixd glMultMatrixd
-#define qglMultMatrixf glMultMatrixf
-#define qglNewList glNewList
-#define qglNormal3b glNormal3b
-#define qglNormal3bv glNormal3bv
-#define qglNormal3d glNormal3d
-#define qglNormal3dv glNormal3dv
-#define qglNormal3f glNormal3f
-#define qglNormal3fv glNormal3fv
-#define qglNormal3i glNormal3i
-#define qglNormal3iv glNormal3iv
-#define qglNormal3s glNormal3s
-#define qglNormal3sv glNormal3sv
-#define qglNormalPointer glNormalPointer
-#define qglOrtho glOrtho
-#define qglPassThrough glPassThrough
-#define qglPixelMapfv glPixelMapfv
-#define qglPixelMapuiv glPixelMapuiv
-#define qglPixelMapusv glPixelMapusv
-#define qglPixelStoref glPixelStoref
-#define qglPixelStorei glPixelStorei
-#define qglPixelTransferf glPixelTransferf
-#define qglPixelTransferi glPixelTransferi
-#define qglPixelZoom glPixelZoom
-#define qglPointSize glPointSize
-#define qglPolygonMode glPolygonMode
-#define qglPolygonOffset glPolygonOffset
-#define qglPolygonStipple glPolygonStipple
-#define qglPopAttrib glPopAttrib
-#define qglPopClientAttrib glPopClientAttrib
-#define qglPopMatrix glPopMatrix
-#define qglPopName glPopName
-#define qglPrioritizeTextures glPrioritizeTextures
-#define qglPushAttrib glPushAttrib
-#define qglPushClientAttrib glPushClientAttrib
-#define qglPushMatrix glPushMatrix
-#define qglPushName glPushName
-#define qglRasterPos2d glRasterPos2d
-#define qglRasterPos2dv glRasterPos2dv
-#define qglRasterPos2f glRasterPos2f
-#define qglRasterPos2fv glRasterPos2fv
-#define qglRasterPos2i glRasterPos2i
-#define qglRasterPos2iv glRasterPos2iv
-#define qglRasterPos2s glRasterPos2s
-#define qglRasterPos2sv glRasterPos2sv
-#define qglRasterPos3d glRasterPos3d
-#define qglRasterPos3dv glRasterPos3dv
-#define qglRasterPos3f glRasterPos3f
-#define qglRasterPos3fv glRasterPos3fv
-#define qglRasterPos3i glRasterPos3i
-#define qglRasterPos3iv glRasterPos3iv
-#define qglRasterPos3s glRasterPos3s
-#define qglRasterPos3sv glRasterPos3sv
-#define qglRasterPos4d glRasterPos4d
-#define qglRasterPos4dv glRasterPos4dv
-#define qglRasterPos4f glRasterPos4f
-#define qglRasterPos4fv glRasterPos4fv
-#define qglRasterPos4i glRasterPos4i
-#define qglRasterPos4iv glRasterPos4iv
-#define qglRasterPos4s glRasterPos4s
-#define qglRasterPos4sv glRasterPos4sv
-#define qglReadBuffer glReadBuffer
-#define qglReadPixels glReadPixels
-#define qglRectd glRectd
-#define qglRectdv glRectdv
-#define qglRectf glRectf
-#define qglRectfv glRectfv
-#define qglRecti glRecti
-#define qglRectiv glRectiv
-#define qglRects glRects
-#define qglRectsv glRectsv
-#define qglRenderMode glRenderMode
-#define qglRotated glRotated
-#define qglRotatef glRotatef
-#define qglScaled glScaled
-#define qglScalef glScalef
-#define qglScissor glScissor
-#define qglSelectBuffer glSelectBuffer
-#define qglShadeModel glShadeModel
-#define qglStencilFunc glStencilFunc
-#define qglStencilMask glStencilMask
-#define qglStencilOp glStencilOp
-#define qglTexCoord1d glTexCoord1d
-#define qglTexCoord1dv glTexCoord1dv
-#define qglTexCoord1f glTexCoord1f
-#define qglTexCoord1fv glTexCoord1fv
-#define qglTexCoord1i glTexCoord1i
-#define qglTexCoord1iv glTexCoord1iv
-#define qglTexCoord1s glTexCoord1s
-#define qglTexCoord1sv glTexCoord1sv
-#define qglTexCoord2d glTexCoord2d
-#define qglTexCoord2dv glTexCoord2dv
-#define qglTexCoord2f glTexCoord2f
-#define qglTexCoord2fv glTexCoord2fv
-#define qglTexCoord2i glTexCoord2i
-#define qglTexCoord2iv glTexCoord2iv
-#define qglTexCoord2s glTexCoord2s
-#define qglTexCoord2sv glTexCoord2sv
-#define qglTexCoord3d glTexCoord3d
-#define qglTexCoord3dv glTexCoord3dv
-#define qglTexCoord3f glTexCoord3f
-#define qglTexCoord3fv glTexCoord3fv
-#define qglTexCoord3i glTexCoord3i
-#define qglTexCoord3iv glTexCoord3iv
-#define qglTexCoord3s glTexCoord3s
-#define qglTexCoord3sv glTexCoord3sv
-#define qglTexCoord4d glTexCoord4d
-#define qglTexCoord4dv glTexCoord4dv
-#define qglTexCoord4f glTexCoord4f
-#define qglTexCoord4fv glTexCoord4fv
-#define qglTexCoord4i glTexCoord4i
-#define qglTexCoord4iv glTexCoord4iv
-#define qglTexCoord4s glTexCoord4s
-#define qglTexCoord4sv glTexCoord4sv
-#define qglTexCoordPointer glTexCoordPointer
-#define	qglTexEnvf glTexEnvf
-#define	qglTexEnvfv glTexEnvfv
-#define	qglTexEnvi glTexEnvi
-#define	qglTexEnviv glTexEnviv
-#define qglTexGend glTexGend
-#define qglTexGendv glTexGendv
-#define qglTexGenf glTexGenf
-#define qglTexGenfv glTexGenfv
-#define qglTexGeni glTexGeni
-#define qglTexGeniv glTexGeniv
-#define qglTexImage1D glTexImage1D
-#define qglTexImage2D glTexImage2D
-#define qglTexParameterf glTexParameterf
-#define qglTexParameterfv glTexParameterfv
-#define qglTexParameteri glTexParameteri
-#define qglTexParameteriv glTexParameteriv
-#define qglTexSubImage1D glTexSubImage1D
-#define qglTexSubImage2D glTexSubImage2D
-#define qglTranslated glTranslated
-#define qglTranslatef glTranslatef
-#define qglVertex2d glVertex2d
-#define qglVertex2dv glVertex2dv
-#define qglVertex2f glVertex2f
-#define qglVertex2fv glVertex2fv
-#define qglVertex2i glVertex2i
-#define qglVertex2iv glVertex2iv
-#define qglVertex2s glVertex2s
-#define qglVertex2sv glVertex2sv
-#define qglVertex3d glVertex3d
-#define qglVertex3dv glVertex3dv
-#define qglVertex3f glVertex3f
-#define qglVertex3fv glVertex3fv
-#define qglVertex3i glVertex3i
-#define qglVertex3iv glVertex3iv
-#define qglVertex3s glVertex3s
-#define qglVertex3sv glVertex3sv
-#define qglVertex4d glVertex4d
-#define qglVertex4dv glVertex4dv
-#define qglVertex4f glVertex4f
-#define qglVertex4fv glVertex4fv
-#define qglVertex4i glVertex4i
-#define qglVertex4iv glVertex4iv
-#define qglVertex4s glVertex4s
-#define qglVertex4sv glVertex4sv
-#define qglVertexPointer glVertexPointer
-#define qglViewport glViewport
-

Modified: trunk/code/renderer/tr_cmds.c
===================================================================
--- trunk/code/renderer/tr_cmds.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/renderer/tr_cmds.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -118,7 +118,7 @@
 	renderCommandList_t	*cmdList;
 
 	cmdList = &backEndData[tr.smpFrame]->commands;
-	assert(cmdList); // bk001205
+	assert(cmdList);
 	// add an end-of-list command
 	*(int *)(cmdList->cmds + cmdList->used) = RC_END_OF_LIST;
 

Modified: trunk/code/renderer/tr_image.c
===================================================================
--- trunk/code/renderer/tr_image.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/renderer/tr_image.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -1358,7 +1358,6 @@
 
 #if 0 
   // TTimo: this is the chunk of code to ensure a behavior that meets TGA specs 
-  // bk0101024 - fix from Leonardo
   // bit 5 set => top-down
   if (targa_header.attributes & 0x20) {
     unsigned char *flip = (unsigned char*)malloc (columns*4);
@@ -4850,15 +4849,13 @@
 	tr.numImages = 0;
 
 	Com_Memset( glState.currenttextures, 0, sizeof( glState.currenttextures ) );
-	if ( qglBindTexture ) {
-		if ( qglActiveTextureARB ) {
-			GL_SelectTexture( 1 );
-			qglBindTexture( GL_TEXTURE_2D, 0 );
-			GL_SelectTexture( 0 );
-			qglBindTexture( GL_TEXTURE_2D, 0 );
-		} else {
-			qglBindTexture( GL_TEXTURE_2D, 0 );
-		}
+	if ( qglActiveTextureARB ) {
+		GL_SelectTexture( 1 );
+		qglBindTexture( GL_TEXTURE_2D, 0 );
+		GL_SelectTexture( 0 );
+		qglBindTexture( GL_TEXTURE_2D, 0 );
+	} else {
+		qglBindTexture( GL_TEXTURE_2D, 0 );
 	}
 }
 

Modified: trunk/code/renderer/tr_init.c
===================================================================
--- trunk/code/renderer/tr_init.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/renderer/tr_init.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -98,7 +98,6 @@
 cvar_t	*r_texturebits;
 
 cvar_t	*r_drawBuffer;
-cvar_t  *r_glDriver;
 cvar_t	*r_lightmap;
 cvar_t	*r_vertexLight;
 cvar_t	*r_uiFullScreen;
@@ -149,8 +148,6 @@
 cvar_t	*r_printShaders;
 cvar_t	*r_saveFontData;
 
-cvar_t	*r_GLlibCoolDownMsec;
-
 cvar_t	*r_maxpolys;
 int		max_polys;
 cvar_t	*r_maxpolyverts;
@@ -197,7 +194,6 @@
 	//
 	// GLimp_Init directly or indirectly references the following cvars:
 	//		- r_fullscreen
-	//		- r_glDriver
 	//		- r_mode
 	//		- r_(color|depth|stencil)bits
 	//		- r_ignorehwgamma
@@ -905,7 +901,6 @@
 	//
 	// latched and archived variables
 	//
-	r_glDriver = ri.Cvar_Get( "r_glDriver", OPENGL_DRIVER_NAME, CVAR_ARCHIVE | CVAR_LATCH );
 	r_allowExtensions = ri.Cvar_Get( "r_allowExtensions", "1", CVAR_ARCHIVE | CVAR_LATCH );
 	r_ext_compressed_textures = ri.Cvar_Get( "r_ext_compressed_textures", "0", CVAR_ARCHIVE | CVAR_LATCH );
 	r_ext_gamma_control = ri.Cvar_Get( "r_ext_gamma_control", "1", CVAR_ARCHIVE | CVAR_LATCH );
@@ -938,11 +933,7 @@
 	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_customPixelAspect = ri.Cvar_Get( "r_customPixelAspect", "1", CVAR_ARCHIVE | CVAR_LATCH );
@@ -979,12 +970,8 @@
 	r_dlightBacks = ri.Cvar_Get( "r_dlightBacks", "1", CVAR_ARCHIVE );
 	r_finish = ri.Cvar_Get ("r_finish", "0", CVAR_ARCHIVE);
 	r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE );
-#if USE_SDL_VIDEO
 	r_swapInterval = ri.Cvar_Get( "r_swapInterval", "0",
 					CVAR_ARCHIVE | CVAR_LATCH );
-#else
-	r_swapInterval = ri.Cvar_Get( "r_swapInterval", "0", CVAR_ARCHIVE );
-#endif
 	r_gamma = ri.Cvar_Get( "r_gamma", "1", CVAR_ARCHIVE );
 	r_facePlaneCull = ri.Cvar_Get ("r_facePlaneCull", "1", CVAR_ARCHIVE );
 
@@ -1046,8 +1033,6 @@
 	r_maxpolys = ri.Cvar_Get( "r_maxpolys", va("%d", MAX_POLYS), 0);
 	r_maxpolyverts = ri.Cvar_Get( "r_maxpolyverts", va("%d", MAX_POLYVERTS), 0);
 
-	r_GLlibCoolDownMsec = ri.Cvar_Get( "r_GLlibCoolDownMsec", "0", CVAR_ARCHIVE );
-  
 	// make sure all the commands added here are also
 	// removed in R_Shutdown
 	ri.Cmd_AddCommand( "imagelist", R_ImageList_f );

Modified: trunk/code/renderer/tr_light.c
===================================================================
--- trunk/code/renderer/tr_light.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/renderer/tr_light.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -160,7 +160,7 @@
 	VectorClear( ent->directedLight );
 	VectorClear( direction );
 
-	assert( tr.world->lightGridData ); // bk010103 - NULL with -nolight maps
+	assert( tr.world->lightGridData ); // NULL with -nolight maps
 
 	// trilerp the light value
 	gridStep[0] = 8;
@@ -380,7 +380,6 @@
 {
 	trRefEntity_t ent;
 	
-	// bk010103 - this segfaults with -nolight maps
 	if ( tr.world->lightGridData == NULL )
 	  return qfalse;
 

Modified: trunk/code/renderer/tr_shader.c
===================================================================
--- trunk/code/renderer/tr_shader.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/renderer/tr_shader.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -2360,7 +2360,7 @@
 	int			hash;
 	shader_t	*sh;
 
-	if ( (name==NULL) || (name[0] == 0) ) {  // bk001205
+	if ( (name==NULL) || (name[0] == 0) ) {
 		return tr.defaultShader;
 	}
 
@@ -2770,7 +2770,7 @@
 */
 shader_t *R_GetShaderByHandle( qhandle_t hShader ) {
 	if ( hShader < 0 ) {
-	  ri.Printf( PRINT_WARNING, "R_GetShaderByHandle: out of range hShader '%d'\n", hShader ); // bk: FIXME name
+	  ri.Printf( PRINT_WARNING, "R_GetShaderByHandle: out of range hShader '%d'\n", hShader );
 		return tr.defaultShader;
 	}
 	if ( hShader >= tr.numShaders ) {

Modified: trunk/code/renderer/tr_types.h
===================================================================
--- trunk/code/renderer/tr_types.h	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/renderer/tr_types.h	2007-09-05 18:17:46 UTC (rev 1161)
@@ -202,33 +202,4 @@
 	qboolean				smpActive;		// dual processor
 } glconfig_t;
 
-// FIXME: VM should be OS agnostic .. in theory
-
-/*
-#ifdef Q3_VM
-
-#define _3DFX_DRIVER_NAME	"Voodoo"
-#define OPENGL_DRIVER_NAME	"Default"
-
-#elif defined(_WIN32)
-*/
-
-#if defined(Q3_VM) || defined(_WIN32)
-
-#define _3DFX_DRIVER_NAME	"3dfxvgl"
-#define OPENGL_DRIVER_NAME	"opengl32"
-
-#elif defined(MACOS_X)
-
-#define _3DFX_DRIVER_NAME	"libMesaVoodooGL.dylib"
-#define OPENGL_DRIVER_NAME	"/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"
-
-#else
-
-#define _3DFX_DRIVER_NAME	"libMesaVoodooGL.so"
-// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=524
-#define OPENGL_DRIVER_NAME	"libGL.so.1"
-
-#endif	// !defined _WIN32
-
 #endif	// __TR_TYPES_H

Copied: trunk/code/sdl (from rev 1160, branches/unified-sdl/code/sdl)

Modified: trunk/code/server/sv_bot.c
===================================================================
--- trunk/code/server/sv_bot.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/server/sv_bot.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -518,10 +518,6 @@
 void SV_BotInitBotLib(void) {
 	botlib_import_t	botlib_import;
 
-	if ( !Cvar_VariableValue("fs_restrict") && !Sys_CheckCD() ) {
-		Com_Error( ERR_NEED_CD, "Game CD not in drive" );
-	}
-
 	if (debugpolygons) Z_Free(debugpolygons);
 	bot_maxdebugpolys = Cvar_VariableIntegerValue("bot_maxdebugpolys");
 	debugpolygons = Z_Malloc(sizeof(bot_debugpoly_t) * bot_maxdebugpolys);
@@ -558,7 +554,7 @@
 	botlib_import.DebugPolygonDelete = BotImport_DebugPolygonDelete;
 
 	botlib_export = (botlib_export_t *)GetBotLibAPI( BOTLIB_API_VERSION, &botlib_import );
-	assert(botlib_export); 	// bk001129 - somehow we end up with a zero import.
+	assert(botlib_export); 	// somehow we end up with a zero import.
 }
 
 

Modified: trunk/code/server/sv_ccmds.c
===================================================================
--- trunk/code/server/sv_ccmds.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/server/sv_ccmds.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -321,7 +321,7 @@
 			// this generally shouldn't happen, because the client
 			// was connected before the level change
 			SV_DropClient( client, denied );
-			Com_Printf( "SV_MapRestart_f(%d): dropped client %i - denied!\n", delay, i ); // bk010125
+			Com_Printf( "SV_MapRestart_f(%d): dropped client %i - denied!\n", delay, i );
 			continue;
 		}
 

Modified: trunk/code/server/sv_client.c
===================================================================
--- trunk/code/server/sv_client.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/server/sv_client.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -173,12 +173,6 @@
 	r = Cmd_Argv( 3 );			// reason
 
 	if ( !Q_stricmp( s, "demo" ) ) {
-		if ( Cvar_VariableValue( "fs_restrict" ) ) {
-			// a demo client connecting to a demo server
-			NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, 
-				"challengeResponse %i", svs.challenges[i].challenge );
-			return;
-		}
 		// they are a demo client trying to connect to a real server
 		NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, "print\nServer is not a demo server\n" );
 		// clear the challenge record so it won't timeout and let them through

Modified: trunk/code/server/sv_game.c
===================================================================
--- trunk/code/server/sv_game.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/server/sv_game.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -918,7 +918,7 @@
 
 	// do a restart instead of a free
 	gvm = VM_Restart( gvm );
-	if ( !gvm ) { // bk001212 - as done below
+	if ( !gvm ) {
 		Com_Error( ERR_FATAL, "VM_Restart on game failed" );
 	}
 

Modified: trunk/code/server/sv_init.c
===================================================================
--- trunk/code/server/sv_init.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/server/sv_init.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -416,6 +416,11 @@
 	// clear the whole hunk because we're (re)loading the server
 	Hunk_Clear();
 
+#ifndef DEDICATED
+	// Restart renderer
+	CL_StartHunkUsers( qtrue );
+#endif
+
 	// clear collision map data
 	CM_ClearMap();
 

Modified: trunk/code/server/sv_main.c
===================================================================
--- trunk/code/server/sv_main.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/server/sv_main.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -24,7 +24,7 @@
 
 serverStatic_t	svs;				// persistant server info
 server_t		sv;					// local server
-vm_t			*gvm = NULL;				// game virtual machine // bk001212 init
+vm_t			*gvm = NULL;				// game virtual machine
 
 cvar_t	*sv_fps;				// time rate for running non-clients
 cvar_t	*sv_timeout;			// seconds without any message
@@ -335,15 +335,6 @@
 	// to prevent timed spoofed reply packets that add ghost servers
 	Info_SetValueForKey( infostring, "challenge", Cmd_Argv(1) );
 
-	// add "demo" to the sv_keywords if restricted
-	if ( Cvar_VariableValue( "fs_restrict" ) ) {
-		char	keywords[MAX_INFO_STRING];
-
-		Com_sprintf( keywords, sizeof( keywords ), "demo %s",
-			Info_ValueForKey( infostring, "sv_keywords" ) );
-		Info_SetValueForKey( infostring, "sv_keywords", keywords );
-	}
-
 	status[0] = 0;
 	statusLength = 0;
 
@@ -780,13 +771,12 @@
 
 	if (!com_sv_running->integer)
 	{
-		if(com_dedicated->integer)
-		{
-			// Block indefinitely until something interesting happens
-			// on STDIN.
-			NET_Sleep(-1);
-		}
-		
+		// Running as a server, but no map loaded
+#ifdef DEDICATED
+		// Block until something interesting happens
+		NET_Sleep(-1);
+#endif
+
 		return;
 	}
 

Copied: trunk/code/sys (from rev 1160, branches/unified-sdl/code/sys)

Modified: trunk/code/ui/ui_atoms.c
===================================================================
--- trunk/code/ui/ui_atoms.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/ui/ui_atoms.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -76,7 +76,7 @@
 }
 
 
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static void NeedCDAction( qboolean result ) {
 	if ( !result ) {
 		trap_Cmd_ExecuteText( EXEC_APPEND, "quit\n" );
@@ -84,7 +84,7 @@
 }
 #endif // MISSIONPACK
 
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static void NeedCDKeyAction( qboolean result ) {
 	if ( !result ) {
 		trap_Cmd_ExecuteText( EXEC_APPEND, "quit\n" );

Modified: trunk/code/ui/ui_gameinfo.c
===================================================================
--- trunk/code/ui/ui_gameinfo.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/ui/ui_gameinfo.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -38,7 +38,7 @@
 static int		ui_numArenas;
 static char		*ui_arenaInfos[MAX_ARENAS];
 
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static int		ui_numSinglePlayerArenas;
 static int		ui_numSpecialSinglePlayerArenas;
 #endif

Modified: trunk/code/ui/ui_main.c
===================================================================
--- trunk/code/ui/ui_main.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/ui/ui_main.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -119,7 +119,7 @@
 	NULL
 };
 
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static char quake3worldMessage[] = "Visit www.quake3world.com - News, Community, Events, Files";
 #endif
 
@@ -203,7 +203,7 @@
 		  UI_DrawConnectScreen( arg0 );
 		  return 0;
 	  case UI_HASUNIQUECDKEY: // mod authors need to observe this
-	    return qtrue; // bk010117 - change this to qfalse for mods!
+	    return qtrue; // change this to qfalse for mods!
 
 	}
 
@@ -312,7 +312,7 @@
 	float max;
 	glyphInfo_t *glyph;
 	float useScale;
-	const char *s = text; // bk001206 - unsigned
+	const char *s = text;
 	fontInfo_t *font = &uiInfo.uiDC.Assets.textFont;
 	if (scale <= ui_smallFont.value) {
 		font = &uiInfo.uiDC.Assets.smallFont;
@@ -365,7 +365,7 @@
 	}
 	useScale = scale * font->glyphScale;
   if (text) {
-    const char *s = text; // bk001206 - unsigned
+    const char *s = text;
 		trap_R_SetColor( color );
 		memcpy(&newColor[0], &color[0], sizeof(vec4_t));
     len = strlen(text);
@@ -434,7 +434,7 @@
 	}
 	useScale = scale * font->glyphScale;
   if (text) {
-    const char *s = text; // bk001206 - unsigned
+    const char *s = text;
 		trap_R_SetColor( color );
 		memcpy(&newColor[0], &color[0], sizeof(vec4_t));
     len = strlen(text);
@@ -442,7 +442,7 @@
 			len = limit;
 		}
 		count = 0;
-		glyph2 = &font->glyphs[ (int) cursor]; // bk001206 - possible signed char
+		glyph2 = &font->glyphs[ (int) cursor];
 		while (s && *s && count < len) {
 			glyph = &font->glyphs[(int)*s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build
       //int yadj = Assets.textFont.glyphs[text[i]].bottom + Assets.textFont.glyphs[text[i]].top;
@@ -524,7 +524,7 @@
 	vec4_t newColor;
 	glyphInfo_t *glyph;
   if (text) {
-    const char *s = text; // bk001206 - unsigned
+    const char *s = text;
 		float max = *maxX;
 		float useScale;
 		fontInfo_t *font = &uiInfo.uiDC.Assets.textFont;
@@ -1007,7 +1007,7 @@
 }
 
 static const char *handicapValues[] = {"None","95","90","85","80","75","70","65","60","55","50","45","40","35","30","25","20","15","10","5",NULL};
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static int numHandicaps = sizeof(handicapValues) / sizeof(const char*);
 #endif
 
@@ -1412,7 +1412,7 @@
 }
 
 
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static const char *UI_OpponentLeaderName(void) {
   int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName"));
 	return uiInfo.teamList[i].teamMembers[0];
@@ -1429,7 +1429,7 @@
 	return "James";
 }
 
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static const int UI_AIIndex(const char *name) {
 	int j;
 	for (j = 0; j < uiInfo.characterCount; j++) {
@@ -1441,7 +1441,7 @@
 }
 #endif
 
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static const int UI_AIIndexFromName(const char *name) {
 	int j;
 	for (j = 0; j < uiInfo.aliasCount; j++) {
@@ -1454,14 +1454,14 @@
 #endif
 
 
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static const char *UI_OpponentLeaderHead(void) {
 	const char *leader = UI_OpponentLeaderName();
 	return UI_AIFromName(leader);
 }
 #endif
 
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static const char *UI_OpponentLeaderModel(void) {
 	int i;
 	const char *head = UI_OpponentLeaderHead();
@@ -4897,9 +4897,8 @@
 	}
 }
 
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static int UI_OwnerDraw_Width(int ownerDraw) {
-  // bk001205 - LCC missing return value
   return 0;
 }
 #endif
@@ -5131,7 +5130,7 @@
 #if 0
 	if (uiInfo.inGameLoad) {
 		UI_LoadMenus("ui/ingame.txt", qtrue);
-	} else { // bk010222: left this: UI_LoadMenus(menuSet, qtrue);
+	} else {
 	}
 #else 
 	UI_LoadMenus(menuSet, qtrue);
@@ -5697,8 +5696,6 @@
 vmCvar_t	ui_realWarmUp;
 vmCvar_t	ui_serverStatusTimeOut;
 
-
-// bk001129 - made static to avoid aliasing
 static cvarTable_t		cvarTable[] = {
 	{ &ui_ffa_fraglimit, "ui_ffa_fraglimit", "20", CVAR_ARCHIVE },
 	{ &ui_ffa_timelimit, "ui_ffa_timelimit", "0", CVAR_ARCHIVE },
@@ -5821,7 +5818,6 @@
 
 };
 
-// bk001129 - made static to avoid aliasing
 static int		cvarTableSize = sizeof(cvarTable) / sizeof(cvarTable[0]);
 
 
@@ -5885,7 +5881,7 @@
 ArenaServers_MaxPing
 =================
 */
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static int ArenaServers_MaxPing( void ) {
 	int		maxPing;
 

Modified: trunk/code/ui/ui_shared.c
===================================================================
--- trunk/code/ui/ui_shared.c	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/code/ui/ui_shared.c	2007-09-05 18:17:46 UTC (rev 1161)
@@ -534,7 +534,7 @@
 		}
 		Q_strcat(script, 1024, " ");
 	}
-	return qfalse; 	// bk001105 - LCC   missing return value
+	return qfalse;
 }
 
 // display, window, menu, item code
@@ -1342,13 +1342,13 @@
 	itemDef_t *oldFocus;
 	sfxHandle_t *sfx = &DC->Assets.itemFocusSound;
 	qboolean playSound = qfalse;
-	menuDef_t *parent; // bk001206: = (menuDef_t*)item->parent;
+	menuDef_t *parent;
 	// sanity check, non-null, not a decoration and does not already have the focus
 	if (item == NULL || item->window.flags & WINDOW_DECORATION || item->window.flags & WINDOW_HASFOCUS || !(item->window.flags & WINDOW_VISIBLE)) {
 		return qfalse;
 	}
 
-	// bk001206 - this can be NULL.
+	// this can be NULL
 	parent = (menuDef_t*)item->parent; 
       
 	// items can be enabled and disabled based on cvars
@@ -2374,7 +2374,6 @@
 		captureFunc = 0;
 		captureData = NULL;
 	} else {
-	  // bk001206 - parentheses
 		if ( down && ( key == K_MOUSE1 || key == K_MOUSE2 || key == K_MOUSE3 ) ) {
 			Item_StartCapture(item, key);
 		}
@@ -2629,7 +2628,6 @@
 		// see if the mouse is within the window bounds and if so is this a mouse click
 	if (down && !(menu->window.flags & WINDOW_POPUP) && !Rect_ContainsPoint(&menu->window.rect, DC->cursorx, DC->cursory)) {
 		static qboolean inHandleKey = qfalse;
-		// bk001206 - parentheses
 		if (!inHandleKey && ( key == K_MOUSE1 || key == K_MOUSE2 || key == K_MOUSE3 ) ) {
 			inHandleKey = qtrue;
 			Menus_HandleOOBClick(menu, key, down);
@@ -3188,7 +3186,6 @@
 	{"tauntGauntlet", K_F5,			-1,		-1, -1},
 	{"scoresUp", K_KP_PGUP,			-1,		-1, -1},
 	{"scoresDown", K_KP_PGDN,			-1,		-1, -1},
-	// bk001205 - this one below was:  '-1' 
 	{"messagemode",  -1,					-1,		-1, -1},
 	{"messagemode2", -1,						-1,		-1, -1},
 	{"messagemode3", -1,						-1,		-1, -1},
@@ -3198,7 +3195,7 @@
 
 static const int g_bindCount = sizeof(g_bindings) / sizeof(bind_t);
 
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static configcvar_t g_configcvars[] =
 {
 	{"cl_run",			0,					0},
@@ -3842,7 +3839,7 @@
 		}
 
 		if (item->cvarFlags & (CVAR_ENABLE | CVAR_DISABLE) && !Item_EnableShowViaCvar(item, CVAR_ENABLE)) {
-		  memcpy(color, parent->disableColor, sizeof(vec4_t)); // bk001207 - FIXME: Com_Memcpy
+		  Com_Memcpy(color, parent->disableColor, sizeof(vec4_t));
 		}
 	
 		if (item->text) {
@@ -4964,7 +4961,7 @@
 		}
 
 	}
-	return qfalse; 	// bk001205 - LCC missing return value
+	return qfalse;
 }
 
 qboolean ItemParse_cvarFloatList( itemDef_t *item, int handle ) {
@@ -5009,7 +5006,7 @@
 		}
 
 	}
-	return qfalse; 	// bk001205 - LCC missing return value
+	return qfalse;
 }
 
 
@@ -5188,7 +5185,7 @@
 			return qfalse;
 		}
 	}
-	return qfalse; 	// bk001205 - LCC missing return value
+	return qfalse;
 }
 
 
@@ -5242,7 +5239,7 @@
 
 qboolean MenuParse_fullscreen( itemDef_t *item, int handle ) {
 	menuDef_t *menu = (menuDef_t*)item;
-	if (!PC_Int_Parse(handle, (int*) &menu->fullScreen)) { // bk001206 - cast qboolean
+	if (!PC_Int_Parse(handle, (int*) &menu->fullScreen)) {
 		return qfalse;
 	}
 	return qtrue;
@@ -5591,7 +5588,7 @@
 			return qfalse;
 		}
 	}
-	return qfalse; 	// bk001205 - LCC missing return value
+	return qfalse;
 }
 
 /*
@@ -5639,7 +5636,7 @@
 	return DC;
 }
  
-#ifndef MISSIONPACK // bk001206
+#ifndef MISSIONPACK
 static float captureX;
 static float captureY;
 #endif

Modified: trunk/make-macosx-ub.sh
===================================================================
--- trunk/make-macosx-ub.sh	2007-09-05 16:54:02 UTC (rev 1160)
+++ trunk/make-macosx-ub.sh	2007-09-05 18:17:46 UTC (rev 1161)
@@ -2,7 +2,7 @@
 APPBUNDLE=ioquake3.app
 BINARY=ioquake3.ub
 PKGINFO=APPLIOQ3
-ICNS=code/unix/MacSupport/ioquake3.icns
+ICNS=misc/quake3.icns
 DESTDIR=build/release-darwin-ub
 BASEDIR=baseq3
 MPACKDIR=missionpack

Copied: trunk/misc (from rev 1160, branches/unified-sdl/misc)




More information about the quake3-commits mailing list