From 7cbdd7b430b921886b3b4317877a2445fc881913 Mon Sep 17 00:00:00 2001 From: PatrickvL Date: Tue, 19 Sep 2017 09:33:02 +0200 Subject: [PATCH] Allow merging this code by NOT switching over to new pixel shader code yet (it requires more work before this can be enabled). --- src/CxbxKrnl/EmuD3D8.cpp | 20 +++++++------------- src/CxbxKrnl/EmuD3D8/PixelShader.cpp | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/CxbxKrnl/EmuD3D8.cpp b/src/CxbxKrnl/EmuD3D8.cpp index 8cd804b29..bdbc9715c 100644 --- a/src/CxbxKrnl/EmuD3D8.cpp +++ b/src/CxbxKrnl/EmuD3D8.cpp @@ -3716,22 +3716,17 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreatePixelShader) LOG_FUNC_END; HRESULT hRet = E_FAIL; - DWORD* pFunction = NULL; - LPD3DXBUFFER pRecompiledBuffer = NULL; - // DWORD Handle = 0; - -#if 1 // PatrickvL Dxbx pixel shader translation - pFunction = (DWORD*)pPSDef; +#if 0 // PatrickvL Dxbx pixel shader translation // Attempt to recompile PixelShader hRet = DxbxUpdateActivePixelShader(pPSDef, pHandle); - // redirect to windows d3d DEBUG_D3DRESULT(hRet, "g_pD3DDevice8->CreatePixelShader"); - #endif +#if 1 // Kingofc's pixel shader translation + DWORD* pFunction = NULL; + LPD3DXBUFFER pRecompiledBuffer = NULL; -#if 0 // Kingofc's pixel shader translation hRet = CreatePixelShaderFunction(pPSDef, &pRecompiledBuffer); DEBUG_D3DRESULT(hRet, "CreatePixelShaderFunction"); @@ -3762,14 +3757,15 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreatePixelShader) memcpy(&pPixelShader->PSDef, pPSDef, sizeof(X_D3DPIXELSHADERDEF)); + DWORD Handle = 0; // ?? pPixelShader->Handle = Handle; pPixelShader->dwStatus = hRet; *pHandle = (DWORD)pPixelShader; */ #endif - #if 0 // Older Cxbx pixel shader translation - // ================================================================ + DWORD* pFunction = NULL; + pFunction = (DWORD*) pPSDef; // Attempt to recompile PixelShader @@ -3782,8 +3778,6 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreatePixelShader) pHandle ); DEBUG_D3DRESULT(hRet, "g_pD3DDevice8->CreatePixelShader"); - - // ================================================================ #endif if(FAILED(hRet)) diff --git a/src/CxbxKrnl/EmuD3D8/PixelShader.cpp b/src/CxbxKrnl/EmuD3D8/PixelShader.cpp index fb91103bf..d668ed73d 100644 --- a/src/CxbxKrnl/EmuD3D8/PixelShader.cpp +++ b/src/CxbxKrnl/EmuD3D8/PixelShader.cpp @@ -2138,7 +2138,7 @@ std::string PSH_XBOX_SHADER::DecodedToString(XTL::X_D3DPIXELSHADERDEF *pPSDef) _AddStr(DxbxFormat(aStr, Args)); \ } { - int i; +// int i; std::string Result = ""; // Show the contents to the user