mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Add an OSD message when taking screenshots in D3D9/D3D11
Fixes issue 6486.
This commit is contained in:
@ -58,6 +58,11 @@ void AddMessage(const char* pstr, u32 ms)
|
|||||||
s_listMsgs.push_back(MESSAGE(pstr, Common::Timer::GetTimeMs() + ms));
|
s_listMsgs.push_back(MESSAGE(pstr, Common::Timer::GetTimeMs() + ms));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AddMessage(const std::string& str, u32 ms)
|
||||||
|
{
|
||||||
|
AddMessage(str.c_str(), ms);
|
||||||
|
}
|
||||||
|
|
||||||
void DrawMessages()
|
void DrawMessages()
|
||||||
{
|
{
|
||||||
if(!SConfig::GetInstance().m_LocalCoreStartupParameter.bOnScreenDisplayMessages)
|
if(!SConfig::GetInstance().m_LocalCoreStartupParameter.bOnScreenDisplayMessages)
|
||||||
|
@ -5,11 +5,14 @@
|
|||||||
#ifndef _OSD_H_
|
#ifndef _OSD_H_
|
||||||
#define _OSD_H_
|
#define _OSD_H_
|
||||||
|
|
||||||
namespace OSD
|
#include <string>
|
||||||
|
|
||||||
|
namespace OSD
|
||||||
{
|
{
|
||||||
|
|
||||||
// On-screen message display
|
// On-screen message display
|
||||||
void AddMessage(const char* str, u32 ms = 2000);
|
void AddMessage(const char* str, u32 ms = 2000);
|
||||||
|
void AddMessage(const std::string& str, u32 ms = 2000);
|
||||||
void DrawMessages(); // draw the current messages on the screen. Only call once per frame.
|
void DrawMessages(); // draw the current messages on the screen. Only call once per frame.
|
||||||
void ClearMessages();
|
void ClearMessages();
|
||||||
|
|
||||||
|
@ -745,6 +745,15 @@ bool Renderer::SaveScreenshot(const std::string &filename, const TargetRectangle
|
|||||||
|
|
||||||
// ready to be saved
|
// ready to be saved
|
||||||
HRESULT hr = PD3DX11SaveTextureToFileA(D3D::context, s_screenshot_texture, D3DX11_IFF_PNG, filename.c_str());
|
HRESULT hr = PD3DX11SaveTextureToFileA(D3D::context, s_screenshot_texture, D3DX11_IFF_PNG, filename.c_str());
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
OSD::AddMessage(StringFromFormat("Saved %i x %i %s", D3D::GetBackBufferWidth(),
|
||||||
|
D3D::GetBackBufferHeight(), filename.c_str()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OSD::AddMessage(StringFromFormat("Error saving %s", filename.c_str()));
|
||||||
|
}
|
||||||
|
|
||||||
return SUCCEEDED(hr);
|
return SUCCEEDED(hr);
|
||||||
}
|
}
|
||||||
|
@ -742,6 +742,7 @@ bool Renderer::SaveScreenshot(const std::string &filename, const TargetRectangle
|
|||||||
PanicAlert("Error saving screen.");
|
PanicAlert("Error saving screen.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
OSD::AddMessage(StringFromFormat("Saved %i x %i %s", dst_rect.GetWidth(), dst_rect.GetHeight(), filename.c_str()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user