mirror of https://github.com/PCSX2/pcsx2.git
GSdx: implemented saving a snapshot to a dialog provided file path
This commit is contained in:
parent
6252c7bd6a
commit
413ba4b430
|
@ -740,10 +740,18 @@ EXPORT_C_(uint32) GSmakeSnapshot(char* path)
|
|||
{
|
||||
std::string s{path};
|
||||
|
||||
if(!s.empty() && s[s.length() - 1] != DIRECTORY_SEPARATOR)
|
||||
if (!s.empty())
|
||||
{
|
||||
// Facilitates Save As.. Feature
|
||||
if (s.substr(s.size() - 4, 4) == ".bmp")
|
||||
{
|
||||
return s_gs->MakeSnapshot(s);
|
||||
}
|
||||
else if (s[s.length() - 1] != DIRECTORY_SEPARATOR)
|
||||
{
|
||||
s = s + DIRECTORY_SEPARATOR;
|
||||
}
|
||||
}
|
||||
|
||||
return s_gs->MakeSnapshot(s + "gsdx");
|
||||
}
|
||||
|
|
|
@ -500,6 +500,13 @@ void GSRenderer::VSync(int field)
|
|||
bool GSRenderer::MakeSnapshot(const std::string& path)
|
||||
{
|
||||
if(m_snapshot.empty())
|
||||
{
|
||||
// Facilitates Save As.. Feature
|
||||
if (path.substr(path.size() - 4, 4) == ".bmp")
|
||||
{
|
||||
m_snapshot = path.substr(0, path.size() - 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
time_t cur_time = time(nullptr);
|
||||
static time_t prev_snap;
|
||||
|
@ -524,6 +531,7 @@ bool GSRenderer::MakeSnapshot(const std::string& path)
|
|||
prev_snap = cur_time;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue