@@ -337,7 +337,29 @@ void W3DSmudgeManager::render(RenderInfoClass &rinfo)
337337#ifdef USE_COPY_RECTS
338338 DX8Wrapper::Set_Texture (0 ,m_backgroundTexture);
339339#else
340- DX8Wrapper::Set_DX8_Texture (0 ,backTexture);
340+
341+ IDirect3DTexture8* renderTextureCopy = NULL ;
342+ DX8Wrapper::_Get_D3D_Device8 ()->CreateTexture (
343+ D3DDesc.Width ,
344+ D3DDesc.Height ,
345+ 1 ,
346+ 0 ,
347+ D3DDesc.Format ,
348+ D3DPOOL_DEFAULT,
349+ &renderTextureCopy);
350+
351+ IDirect3DSurface8* srcRT = nullptr ;
352+ IDirect3DSurface8* dstRT = nullptr ;
353+
354+ backTexture->GetSurfaceLevel (0 , &srcRT);
355+ renderTextureCopy->GetSurfaceLevel (0 , &dstRT);
356+
357+ DX8Wrapper::_Get_D3D_Device8 ()->CopyRects (srcRT, nullptr , 0 , dstRT, nullptr );
358+
359+ srcRT->Release ();
360+ dstRT->Release ();
361+
362+ DX8Wrapper::Set_DX8_Texture (0 ,renderTextureCopy);
341363 // Need these states in case texture is non-power-of-2
342364 DX8Wrapper::Set_DX8_Texture_Stage_State ( 0 , D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
343365 DX8Wrapper::Set_DX8_Texture_Stage_State ( 0 , D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
@@ -441,12 +463,13 @@ void W3DSmudgeManager::render(RenderInfoClass &rinfo)
441463 // to force the GPU to flush all current pipeline state and commit the previous draw call.
442464 // This is required for some AMD models and drivers that refuse to flush a single draw call
443465 // for the smudges. This draw call is invisible and harmless.
444- if (smudgesBatchCount == 1 )
445- {
446- DX8Wrapper::_Get_D3D_Device8 ()->DrawPrimitive (D3DPT_POINTLIST, 0 , 1 );
447- }
466+ // if (smudgesBatchCount == 1)
467+ // {
468+ // DX8Wrapper::_Get_D3D_Device8()->DrawPrimitive(D3DPT_POINTLIST, 0, 1);
469+ // }
448470
449471 DX8Wrapper::Set_DX8_Texture_Stage_State (0 ,D3DTSS_COLOROP,D3DTOP_MODULATE);
450472 DX8Wrapper::Set_DX8_Texture_Stage_State (0 ,D3DTSS_ALPHAOP,D3DTOP_MODULATE);
451473
474+ renderTextureCopy->Release ();
452475}
0 commit comments