From 998611d1897011b85f5c5c3919d248808e9500b9 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 24 Aug 2004 01:36:43 +0000 Subject: [PATCH] move TestDrawPrimFailure to .cxx --- panda/src/dxgsg8/dxGraphicsStateGuardian8.I | 20 ------------------- panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.I b/panda/src/dxgsg8/dxGraphicsStateGuardian8.I index 29fe5ef1ff..233fa6755e 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.I +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.I @@ -16,26 +16,6 @@ // //////////////////////////////////////////////////////////////////// -#if defined(_DEBUG) || defined(COUNT_DRAWPRIMS) -typedef enum {DrawPrim,DrawIndexedPrim} DP_Type; -static const char *DP_Type_Strs[3] = {"DrawPrimitive","DrawIndexedPrimitive"}; - -void INLINE TestDrawPrimFailure(DP_Type dptype,HRESULT hr,IDirect3DDevice8 *pD3DDevice,DWORD nVerts,DWORD nTris) { - if(FAILED(hr)) { - // loss of exclusive mode is not a real DrawPrim problem, ignore it - HRESULT testcooplvl_hr = pD3DDevice->TestCooperativeLevel(); - if((testcooplvl_hr != D3DERR_DEVICELOST)||(testcooplvl_hr != D3DERR_DEVICENOTRESET)) { - dxgsg8_cat.fatal() << DP_Type_Strs[dptype] << "() failed: result = " << D3DERRORSTRING(hr); - exit(1); - } - } - - CountDPs(nVerts,nTris); -} -#else -#define TestDrawPrimFailure(a,b,c,nVerts,nTris) CountDPs(nVerts,nTris); -#endif - INLINE DWORD Colorf_to_D3DCOLOR(const Colorf &cColorf) { diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index 8f33a41f7e..449f347c80 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -136,6 +136,26 @@ set_color_clear_value(const Colorf& value) { _d3dcolor_clear_value = Colorf_to_D3DCOLOR(value); } +#if defined(_DEBUG) || defined(COUNT_DRAWPRIMS) +typedef enum {DrawPrim,DrawIndexedPrim} DP_Type; +static const char *DP_Type_Strs[3] = {"DrawPrimitive","DrawIndexedPrimitive"}; + +void INLINE TestDrawPrimFailure(DP_Type dptype,HRESULT hr,IDirect3DDevice8 *pD3DDevice,DWORD nVerts,DWORD nTris) { + if(FAILED(hr)) { + // loss of exclusive mode is not a real DrawPrim problem, ignore it + HRESULT testcooplvl_hr = pD3DDevice->TestCooperativeLevel(); + if((testcooplvl_hr != D3DERR_DEVICELOST)||(testcooplvl_hr != D3DERR_DEVICENOTRESET)) { + dxgsg8_cat.fatal() << DP_Type_Strs[dptype] << "() failed: result = " << D3DERRORSTRING(hr); + exit(1); + } + } + + CountDPs(nVerts,nTris); +} +#else +#define TestDrawPrimFailure(a,b,c,nVerts,nTris) CountDPs(nVerts,nTris); +#endif + DXShaderHandle DXGraphicsStateGuardian8:: read_pixel_shader(string &filename) { HRESULT hr;