From c8d07f38833347c44be827eda65d59b61457c4a7 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 20 Dec 2006 02:20:59 +0000 Subject: [PATCH] - Fixed: D3DFB::Reset() also needs to restore the texture border color, otherwise it gets reset to black and unused. - Fixed: I_SetWndProc() needs to be called before any of the DirectX interfaces are initialized, because DirectX subclasses the window itself, and I_SetWndProc() undoes that subclassing. SVN r419 (trunk) --- docs/rh-log.txt | 7 +++++++ src/win32/fb_d3d9.cpp | 11 +++++++++-- src/win32/fb_ddraw.cpp | 2 -- src/win32/win32video.cpp | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index d05b79ab1c..2057d1a024 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,10 @@ +December 19, 2006 +- Fixed: D3DFB::Reset() also needs to restore the texture border color, + otherwise it gets reset to black and unused. +- Fixed: I_SetWndProc() needs to be called before any of the DirectX + interfaces are initialized, because DirectX subclasses the window itself, + and I_SetWndProc() undoes that subclassing. + December 19, 2006 (Changes by Graf Zahl) - Fixed: Inventory.Icon printed error message for all the missing icons in Strife's teaser. diff --git a/src/win32/fb_d3d9.cpp b/src/win32/fb_d3d9.cpp index 6f48aac7ca..fabcb916eb 100644 --- a/src/win32/fb_d3d9.cpp +++ b/src/win32/fb_d3d9.cpp @@ -277,7 +277,6 @@ void D3DFB::FillPresentParameters (D3DPRESENT_PARAMETERS *pp, bool fullscreen, b bool D3DFB::CreateResources () { - I_SetWndProc(); if (!Windowed) { // Remove the window border in fullscreen mode @@ -373,6 +372,14 @@ bool D3DFB::Reset () { return false; } + if (OffByOneAt < 256) + { + D3DDevice->SetSamplerState (1, D3DSAMP_ADDRESSU, D3DTADDRESS_BORDER); + D3DDevice->SetSamplerState (1, D3DSAMP_BORDERCOLOR, + D3DCOLOR_XRGB(GammaTable[SourcePalette[255].r], + GammaTable[SourcePalette[255].g], + GammaTable[SourcePalette[255].b])); + } return true; } @@ -383,7 +390,7 @@ bool D3DFB::Reset () // Since NVidia hardware has an off-by-one error in the pixel shader. // On a Geforce 7950GT and a 6200, I have witnessed it skip palette entry // 240. I have a report that an FX card skips in a totally different spot. -// So rather than try and detect it in the shader, we do it here and +// So rather than try and correct it in the shader, we detect it here and // compensate when uploading the palette and when drawing by setting the // sampler mode for the palette to border and making the border color the // final color in the palette. diff --git a/src/win32/fb_ddraw.cpp b/src/win32/fb_ddraw.cpp index ad3ff5d181..801ca130f0 100644 --- a/src/win32/fb_ddraw.cpp +++ b/src/win32/fb_ddraw.cpp @@ -230,8 +230,6 @@ bool DDrawFB::CreateResources () BufferCount = 1; - I_SetWndProc(); - if (!Windowed) { // Remove the window border in fullscreen mode diff --git a/src/win32/win32video.cpp b/src/win32/win32video.cpp index 5c3ebdbdec..5a0dd53ff0 100644 --- a/src/win32/win32video.cpp +++ b/src/win32/win32video.cpp @@ -110,6 +110,7 @@ Win32Video::Win32Video (int parm) : m_Modes (NULL), m_IsFullscreen (false) { + I_SetWndProc(); if (!InitD3D9()) { InitDDraw();