mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 04:08:55 +00: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:
parent
a241a469b8
commit
e856d0b3ed
2 changed files with 94 additions and 93 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue