diff --git a/DDrawCompat/D3dDdi/DeviceFuncs.cpp b/DDrawCompat/D3dDdi/DeviceFuncs.cpp index 805bdb9..0834ab2 100644 --- a/DDrawCompat/D3dDdi/DeviceFuncs.cpp +++ b/DDrawCompat/D3dDdi/DeviceFuncs.cpp @@ -417,6 +417,18 @@ namespace } return getOrigVtable(hDevice).pfnUnlock(hDevice, pData); } + + HRESULT APIENTRY updateWInfo(HANDLE hDevice, const D3DDDIARG_WINFO* pData) + { + if (pData && 1.0f == pData->WNear && 1.0f == pData->WFar) + { + D3DDDIARG_WINFO wInfo = {}; + wInfo.WNear = 0.0f; + wInfo.WFar = 1.0f; + return getOrigVtable(hDevice).pfnUpdateWInfo(hDevice, &wInfo); + } + return getOrigVtable(hDevice).pfnUpdateWInfo(hDevice, pData); + } } #define RENDER_FUNC(func) renderFunc @@ -449,5 +461,6 @@ namespace D3dDdi vtable.pfnPresent1 = &present1; vtable.pfnSetRenderTarget = &setRenderTarget; vtable.pfnUnlock = &unlock; + vtable.pfnUpdateWInfo = &updateWInfo; } } diff --git a/DDrawCompat/D3dDdi/Log/DeviceFuncsLog.cpp b/DDrawCompat/D3dDdi/Log/DeviceFuncsLog.cpp index 0faf965..c45a69c 100644 --- a/DDrawCompat/D3dDdi/Log/DeviceFuncsLog.cpp +++ b/DDrawCompat/D3dDdi/Log/DeviceFuncsLog.cpp @@ -132,6 +132,13 @@ std::ostream& operator<<(std::ostream& os, const D3DDDIARG_PRESENTSURFACE& val) << val.SubResourceIndex; } +std::ostream& operator<<(std::ostream& os, const D3DDDIARG_RENDERSTATE& val) +{ + return Compat::LogStruct(os) + << val.State + << val.Value; +} + std::ostream& operator<<(std::ostream& os, const D3DDDIARG_UNLOCK& val) { return Compat::LogStruct(os) @@ -140,6 +147,20 @@ std::ostream& operator<<(std::ostream& os, const D3DDDIARG_UNLOCK& val) << Compat::hex(val.Flags.Value); } +std::ostream& operator<<(std::ostream& os, const D3DDDIARG_WINFO& val) +{ + return Compat::LogStruct(os) + << val.WNear + << val.WFar; +} + +std::ostream& operator<<(std::ostream& os, const D3DDDIARG_ZRANGE& val) +{ + return Compat::LogStruct(os) + << val.MinZ + << val.MaxZ; +} + std::ostream& operator<<(std::ostream& os, const D3DDDIBOX& box) { return Compat::LogStruct(os) diff --git a/DDrawCompat/D3dDdi/Log/DeviceFuncsLog.h b/DDrawCompat/D3dDdi/Log/DeviceFuncsLog.h index 80695d9..02292e9 100644 --- a/DDrawCompat/D3dDdi/Log/DeviceFuncsLog.h +++ b/DDrawCompat/D3dDdi/Log/DeviceFuncsLog.h @@ -18,5 +18,8 @@ std::ostream& operator<<(std::ostream& os, const D3DDDIARG_OPENRESOURCE& val); std::ostream& operator<<(std::ostream& os, const D3DDDIARG_PRESENT& val); std::ostream& operator<<(std::ostream& os, const D3DDDIARG_PRESENT1& val); std::ostream& operator<<(std::ostream& os, const D3DDDIARG_PRESENTSURFACE& val); +std::ostream& operator<<(std::ostream& os, const D3DDDIARG_RENDERSTATE& val); std::ostream& operator<<(std::ostream& os, const D3DDDIARG_UNLOCK& val); +std::ostream& operator<<(std::ostream& os, const D3DDDIARG_WINFO& val); +std::ostream& operator<<(std::ostream& os, const D3DDDIARG_ZRANGE& val); std::ostream& operator<<(std::ostream& os, const D3DDDIBOX& val);