Add a fallback to CopyRects for cases which StretchRect can't handle

Fixes menus in World Racing 2 because CopyRects tries to copy
a texture to texture.
This commit is contained in:
Silent 2020-10-20 19:40:46 +02:00
parent 8588230ee1
commit ea98d4bdea
No known key found for this signature in database
GPG Key ID: AE53149BB0C45AF1
1 changed files with 5 additions and 1 deletions

View File

@ -5118,7 +5118,11 @@ xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_CopyRects)
HRESULT hRet = g_pD3DDevice->StretchRect(pHostSourceSurface, &SourceRect, pHostDestSurface, &DestRect, D3DTEXF_LINEAR);
if (FAILED(hRet)) {
LOG_TEST_CASE("D3DDevice_CopyRects: Failed to copy surface");
// Fallback for cases which StretchRect cannot handle (such as copying from texture to texture)
hRet = D3DXLoadSurfaceFromSurface(pHostDestSurface, nullptr, &DestRect, pHostSourceSurface, nullptr, &SourceRect, D3DTEXF_LINEAR, 0);
if (FAILED(hRet)) {
LOG_TEST_CASE("D3DDevice_CopyRects: Failed to copy surface");
}
}
}
}