From f80cafc6fae806714ca0738a85498a771e767d6d Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 21 Mar 2017 17:35:27 +0000 Subject: [PATCH] small fixups for the d3d8 renderer, to give eukara the conflicts that he asked for. disabled by default, because I cba to deal with the dxsdk headers. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5075 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/Makefile | 4 ++++ engine/client/merged.h | 2 +- engine/client/snd_wasapi.c | 6 ++++++ engine/d3d/d3d8_backend.c | 4 ++-- engine/d3d/vid_d3d8.c | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/engine/Makefile b/engine/Makefile index 98debfa33..ed25105d2 100644 --- a/engine/Makefile +++ b/engine/Makefile @@ -572,6 +572,10 @@ GLQUAKE_OBJS = \ $(VKQUAKE_OBJS) D3DQUAKE_OBJS = \ + d3d8_backend.o \ + d3d8_image.o \ + d3d8_shader.o \ + vid_d3d8.o \ d3d_backend.o \ d3d_image.o \ d3d_shader.o \ diff --git a/engine/client/merged.h b/engine/client/merged.h index ea36050e1..ddd2c4a3b 100644 --- a/engine/client/merged.h +++ b/engine/client/merged.h @@ -344,7 +344,7 @@ typedef union vboarray_s void *addr; } gl; #endif -#if defined(D3D9QUAKE) || defined(D3D11QUAKE) +#if defined(D3D8QUAKE) || defined(D3D9QUAKE) || defined(D3D11QUAKE) struct { void *buff; diff --git a/engine/client/snd_wasapi.c b/engine/client/snd_wasapi.c index 739240d11..0b0cc4869 100644 --- a/engine/client/snd_wasapi.c +++ b/engine/client/snd_wasapi.c @@ -1,6 +1,12 @@ #include "quakedef.h" #if defined(AVAIL_WASAPI) && !defined(SERVERONLY) +//wasapi is nice in that you can use it to bypass the windows audio mixer. hurrah for exclusive audio. +//this should give slightly lower latency audio. +//its otherwise not that interesting. + +//side note: wasapi does provide proper notifications for when a sound device is enabled/disabled, which is useful even if you're using directsound instead. +//this means that we can finally restart the audio if someone plugs in a headset. #include "winquake.h" #include diff --git a/engine/d3d/d3d8_backend.c b/engine/d3d/d3d8_backend.c index b94ccd889..808a09e50 100644 --- a/engine/d3d/d3d8_backend.c +++ b/engine/d3d/d3d8_backend.c @@ -415,6 +415,7 @@ void D3D8BE_Reset(qboolean before) int i; if (before) { + IDirect3DDevice8_SetVertexShader(pD3DDev8, 0); IDirect3DDevice8_SetStreamSource(pD3DDev8, 0, NULL, 0); IDirect3DDevice8_SetIndices(pD3DDev8, NULL, 0); @@ -1482,8 +1483,8 @@ static qboolean BE_DrawMeshChain_SetupPass(shaderpass_t *pass, unsigned int vert /*all meshes in a chain must have the same features*/ vdec = D3DFVF_QVBO; - *vertfirst = shaderstate.dynvbo_offs/sizeof(*map); allocvertexbuffer(shaderstate.dynvbo_buff, shaderstate.dynvbo_size, &shaderstate.dynvbo_offs, &map, vertcount*sizeof(*map)); + *vertfirst = (shaderstate.dynvbo_offs - vertcount*sizeof(*map))/sizeof(*map); for (mno = 0; mno < shaderstate.nummeshes; mno++) @@ -1518,7 +1519,6 @@ static qboolean BE_DrawMeshChain_SetupPass(shaderpass_t *pass, unsigned int vert d3dcheck(IDirect3DDevice8_SetStreamSource(pD3DDev8, 0, shaderstate.dynvbo_buff, sizeof(vbovdata_t))); d3dcheck(IDirect3DDevice8_SetIndices(pD3DDev8, shaderstate.dynidx_buff, *vertfirst)); //base vertex is considered part of ebo state in d3d8, I guess -// *vertfirst = 0; /*we only use one colour, generated from the first pass*/ //vdec |= BE_GenerateColourMods(vertcount, pass); diff --git a/engine/d3d/vid_d3d8.c b/engine/d3d/vid_d3d8.c index 431aceea0..86dbafb54 100644 --- a/engine/d3d/vid_d3d8.c +++ b/engine/d3d/vid_d3d8.c @@ -796,7 +796,7 @@ static qboolean D3D8_VID_Init(rendererstate_t *info, unsigned char *palette) mouseactive = false; } - D3D8BE_Reset(false); +// D3D8BE_Reset(false); //FIXME: old hardware is not guarenteed to support hardware cursors. //this should not be a problem on dx9+ hardware, but might on earlier stuff.