mirror of https://github.com/PCSX2/pcsx2.git
GSdx-Capture: Abort capture if an invalid directory is given
This commit is contained in:
parent
7662e22665
commit
0ce4f7624f
|
@ -420,9 +420,6 @@ std::wstring* GSCapture::BeginCapture(float fps, GSVector2i recommendedResolutio
|
|||
if (IDOK != dlg.DoModal())
|
||||
return nullptr;
|
||||
|
||||
m_size.x = (dlg.m_width + 7) & ~7;
|
||||
m_size.y = (dlg.m_height + 7) & ~7;
|
||||
|
||||
{
|
||||
int start = dlg.m_filename.length() - 4;
|
||||
if (start > 0)
|
||||
|
@ -434,9 +431,21 @@ std::wstring* GSCapture::BeginCapture(float fps, GSVector2i recommendedResolutio
|
|||
}
|
||||
else
|
||||
dlg.m_filename += ".avi";
|
||||
|
||||
FILE* test = fopen(dlg.m_filename.c_str(), "w");
|
||||
if (test)
|
||||
fclose(test);
|
||||
else
|
||||
{
|
||||
dlg.InvalidFile();
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
std::wstring fn{dlg.m_filename.begin(), dlg.m_filename.end()};
|
||||
|
||||
m_size.x = (dlg.m_width + 7) & ~7;
|
||||
m_size.y = (dlg.m_height + 7) & ~7;
|
||||
//
|
||||
|
||||
HRESULT hr;
|
||||
|
|
|
@ -35,6 +35,13 @@
|
|||
|
||||
#define EndEnumSysDev }}}
|
||||
|
||||
void GSCaptureDlg::InvalidFile()
|
||||
{
|
||||
char tmp[512];
|
||||
sprintf_s(tmp, "GSdx couldn't open file for capturing: %s.\nCapture aborted.", m_filename.c_str());
|
||||
MessageBox(GetActiveWindow(), tmp, "GSdx System Message", MB_OK | MB_SETFOREGROUND);
|
||||
}
|
||||
|
||||
GSCaptureDlg::GSCaptureDlg()
|
||||
: GSDialog(IDD_CAPTURE)
|
||||
{
|
||||
|
|
|
@ -46,6 +46,7 @@ protected:
|
|||
|
||||
public:
|
||||
GSCaptureDlg();
|
||||
void InvalidFile();
|
||||
|
||||
int m_width;
|
||||
int m_height;
|
||||
|
|
Loading…
Reference in New Issue