mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
EXPERIMENTAL:
rewrite frame dumping and screen shots to make them more stable and correct enable viewport resizing for all cards, the emulation is more correct in this way test this a lot please. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4971 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -392,32 +392,7 @@ void Video_AddMessage(const char* pstr, u32 milliseconds)
|
||||
|
||||
HRESULT ScreenShot(const char *File)
|
||||
{
|
||||
if (D3D::dev == NULL)
|
||||
return S_FALSE;
|
||||
|
||||
D3DDISPLAYMODE DisplayMode;
|
||||
if (FAILED(D3D::dev->GetDisplayMode(0, &DisplayMode)))
|
||||
return S_FALSE;
|
||||
|
||||
LPDIRECT3DSURFACE9 surf;
|
||||
if (FAILED(D3D::dev->CreateOffscreenPlainSurface(DisplayMode.Width, DisplayMode.Height, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &surf, NULL)))
|
||||
return S_FALSE;
|
||||
|
||||
if (FAILED(D3D::dev->GetFrontBufferData(0, surf)))
|
||||
{
|
||||
surf->Release();
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
RECT rect;
|
||||
::GetWindowRect(EmuWindow::GetWnd(), &rect);
|
||||
if (FAILED(D3DXSaveSurfaceToFileA(File, D3DXIFF_PNG, surf, NULL, &rect)))
|
||||
{
|
||||
surf->Release();
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
surf->Release();
|
||||
Renderer::SetScreenshot(File);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user