From 6942e100d301c919214d5132aa7fc5162358e19c Mon Sep 17 00:00:00 2001
From: Lance <moodles@users.sourceforge.net>
Date: Fri, 28 Jan 2011 05:39:40 +0000
Subject: [PATCH] Version prints if d3d renderer is available, the video menu
 now sets "d3d" instead of invalid "d3d9" when selecting the D3D renderer,
 fixes to the Makefile so win32's m-rel will compile with gl+d3d,
 win32_SDL+win64+win64_SDL need alittle work still to compile, win32
 d3d-rel/dbg still needs alittle work to compile

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3723 fc73d0e0-1445-4013-8a0c-d673dee63da5
---
 engine/Makefile          | 17 ++++++-----------
 engine/client/renderer.c |  6 +++---
 engine/common/common.c   | 14 ++++++++------
 3 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/engine/Makefile b/engine/Makefile
index 71bbed75a..fcb3e137d 100644
--- a/engine/Makefile
+++ b/engine/Makefile
@@ -421,12 +421,7 @@ GLQUAKE_OBJS =		\
 D3DQUAKE_OBJS =		\
 	d3d_backend.o \
 	d3d_image.o	\
-	vid_d3d.o	\
-	d3d9_draw.o	\
-	d3d9_mesh.o	\
-	d3d9_rmain.o	\
-	d3d9_rsurf.o	\
-	vid_d3d9.o
+	vid_d3d.o
 
 MP3_OBJS =			\
 	fixed.o		\
@@ -589,7 +584,7 @@ ifeq ($(FTE_TARGET),win32_SDL)
 	MB_DIR=m_mgw_sdl$(BITS)
 	M_EXE_NAME=../fteqw_sdl.exe
 	MCL_OBJS=$(GLQUAKE_OBJS) $(SOFTWARE_OBJS) $(D3DQUAKE_OBJS) gl_vidsdl.o snd_sdl.o cd_sdl.o sys_sdl.o in_sdl.o snd_directx.o resources.o
-	M_CFLAGS=-D_MINGW_VFPRINTF -D_SDL -I./libs/ -I./libs/mingw-libs/  -I./libs/dxsdk7/include/ -I./libs/mingw-libs $(GLCFLAGS) `sdl-config --cflags` -D_MERGED_SDL
+	M_CFLAGS=$(D3DCFLAGS) -D_MINGW_VFPRINTF -D_SDL -I./libs/ -I./libs/mingw-libs/  -I./libs/dxsdk7/include/ -I./libs/mingw-libs $(GLCFLAGS) `sdl-config --cflags` -D_MERGED_SDL
 	M_LDFLAGS=$(GLLDFLAGS) $(IMAGELDFLAGS)
 	
 	ifdef windir
@@ -626,7 +621,7 @@ ifeq ($(FTE_TARGET),win64_SDL)
 	MB_DIR=m_mgw_sdl$(BITS)
 	M_EXE_NAME=../fteqw_sdl64.exe
 	MCL_OBJS=$(GLQUAKE_OBJS) $(SOFTWARE_OBJS) $(D3DQUAKE_OBJS) gl_vidsdl.o snd_sdl.o cd_sdl.o sys_sdl.o in_sdl.o snd_directx.o resources.o
-	M_CFLAGS=-D_MINGW_VFPRINTF -D_SDL -I./libs/ -I./libs/mingw64-libs/  -I./libs/dxsdk7/include/ -I./libs/mingw64-libs $(GLCFLAGS) `sdl-config --cflags` -D_MERGED_SDL
+	M_CFLAGS= $(D3DCFLAGS) -D_MINGW_VFPRINTF -D_SDL -I./libs/ -I./libs/mingw64-libs/  -I./libs/dxsdk7/include/ -I./libs/mingw64-libs $(GLCFLAGS) `sdl-config --cflags` -D_MERGED_SDL
 	M_LDFLAGS=$(GLLDFLAGS) $(IMAGELDFLAGS)
 	
 	ifdef windir
@@ -661,7 +656,7 @@ ifeq ($(FTE_TARGET),vc)
 	
 	M_EXE_NAME=../fteqw.exe
 	MCL_OBJS=$(GL_OBJS) $(GLQUAKE_OBJS) fs_win32.o gl_vidnt.o snd_win.o snd_directx.o cd_win.o in_win.o sys_win.o resources.o
-	M_CFLAGS=$(GLCFLAGS) $(W32_CFLAGS)
+	M_CFLAGS=$(GLCFLAGS) $(W32_CFLAGS) $(D3DCFLAGS)
 	MB_DIR=m_vc
 	M_LDFLAGS=$(GLLDFLAGS) libs/jpeg.lib libs/libpng.lib libs/zlib.lib uuid.lib gdi32.lib ole32.lib libs/dxsdk7/lib/dxguid.lib /subsystem:windows
 endif
@@ -716,7 +711,7 @@ endif
 	M_EXE_NAME=../fteqw.exe
 	MCL_EXE_NAME=../fteqwcl.exe
 	M_LDFLAGS=$(GLLDFLAGS) $(IMAGELDFLAGS) -ldxguid -lws2_32 -lwinmm -lgdi32 -lole32
-	M_CFLAGS=$(GLCFLAGS) $(W32_CFLAGS)
+	M_CFLAGS=$(GLCFLAGS) $(W32_CFLAGS) $(D3DCFLAGS)
 	MB_DIR=m_mgw
 	MCL_DIR=mcl_mgw
 
@@ -782,7 +777,7 @@ endif
 	M_EXE_NAME=../fteqw64.exe
 	MCL_EXE_NAME=../fteqwcl64.exe
 	M_LDFLAGS=$(GLLDFLAGS) $(IMAGELDFLAGS) -ldxguid -lws2_32 -lwinmm -lgdi32 -lole32
-	M_CFLAGS=$(GLCFLAGS) $(W32_CFLAGS)
+	M_CFLAGS=$(GLCFLAGS) $(W32_CFLAGS) $(D3DCFLAGS)
 	MB_DIR=m_mgw64
 	MCL_DIR=mcl_mgw64
 
diff --git a/engine/client/renderer.c b/engine/client/renderer.c
index a81e1e4a3..d7b41872e 100644
--- a/engine/client/renderer.c
+++ b/engine/client/renderer.c
@@ -60,7 +60,7 @@ cvar_t gl_nocolors							= CVAR  ("gl_nocolors", "0");
 cvar_t gl_part_flame						= CVAR  ("gl_part_flame", "1");
 
 //opengl library, blank means try default.
-static cvar_t gl_driver						= CVARF ("gl_driver", "", 
+static cvar_t gl_driver						= CVARF ("gl_driver", "",
 													 CVAR_ARCHIVE | CVAR_RENDERERLATCH);
 cvar_t gl_shadeq1_name						= CVAR  ("gl_shadeq1_name", "*");
 extern cvar_t r_vertexlight;
@@ -1057,7 +1057,7 @@ qboolean M_VideoApply (union menuoption_s *op,struct menu_s *menu,int key)
 #endif
 #ifdef D3DQUAKE
 	case 1:
-        Cbuf_AddText("setrenderer d3d9\n", RESTRICT_LOCAL);
+        Cbuf_AddText("setrenderer d3d\n", RESTRICT_LOCAL);
         break;
 #endif
 	}
@@ -1835,7 +1835,7 @@ TRACE(("dbg: R_RestartRenderer_f\n"));
 
 	if (!*_vid_wait_override.string || _vid_wait_override.value < 0)
 		newr.wait = -1;
-	else 
+	else
 		newr.wait = _vid_wait_override.value;
 
 	Q_strncpyz(newr.glrenderer, gl_driver.string, sizeof(newr.glrenderer));
diff --git a/engine/common/common.c b/engine/common/common.c
index 5397d56ba..02d43e404 100644
--- a/engine/common/common.c
+++ b/engine/common/common.c
@@ -3112,18 +3112,20 @@ void COM_Version_f (void)
 #ifdef GLQUAKE
 	Con_Printf("OpenGL available\n");
 #endif
+#ifdef D3DQUAKE
+	Con_Printf("Direct3D available\n");
+#endif
+#ifdef USE_D3D
+	Con_Printf("FakeGL available\n");
+#endif
 
 #ifdef _SDL
 	Con_Printf("SDL version: %d.%d.%d\n", SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
 #endif
 
 // Don't print both as a 64bit MinGW built client
-#if defined(__MINGW32__) && !defined(__MINGW64__)
-	Con_Printf("Compiled with MinGW32 version: %i.%i\n",__MINGW32_MAJOR_VERSION, __MINGW32_MINOR_VERSION);
-#endif
-
-#ifdef __MINGW64__
-	Con_Printf("Compiled with MinGW64 version: %i.%i\n",__MINGW32_MAJOR_VERSION, __MINGW32_MINOR_VERSION);
+#if defined(__MINGW32__)
+	Con_Printf("Compiled with MinGW32/64 version: %i.%i\n",__MINGW32_MAJOR_VERSION, __MINGW32_MINOR_VERSION);
 #endif
 
 #ifdef __CYGWIN__