sync D3D_RenderReadPixels with D3D11_RenderReadPixels

- use the result of SDL_ConvertPixels to propagate error
- get rid of the verbose error message of D3D11_RenderReadPixels in case SDL_ConvertPixels failed
This commit is contained in:
pionere 2022-01-22 17:10:37 +01:00 committed by Ryan C. Gordon
parent 3bef4a5da6
commit 2cfc83eab7
No known key found for this signature in database
GPG key ID: FA148B892AB48044
2 changed files with 5 additions and 14 deletions

View file

@ -1271,6 +1271,7 @@ D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
RECT d3drect;
D3DLOCKED_RECT locked;
HRESULT result;
int status;
if (data->currentRenderTarget) {
backBuffer = data->currentRenderTarget;
@ -1305,7 +1306,7 @@ D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
return D3D_SetError("LockRect()", result);
}
SDL_ConvertPixels(rect->w, rect->h,
status = SDL_ConvertPixels(rect->w, rect->h,
D3DFMTToPixelFormat(desc.Format), locked.pBits, locked.Pitch,
format, pixels, pitch);
@ -1313,7 +1314,7 @@ D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
IDirect3DSurface9_Release(surface);
return 0;
return status;
}
static void