Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows AVIDump: support "silent" frame dumping #2056

Merged
merged 1 commit into from
Feb 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions Source/Core/Core/ConfigManager.cpp
Expand Up @@ -362,6 +362,7 @@ void SConfig::SaveMovieSettings(IniFile& ini)
movie->Set("PauseMovie", m_PauseMovie);
movie->Set("Author", m_strMovieAuthor);
movie->Set("DumpFrames", m_DumpFrames);
movie->Set("DumpFramesSilent", m_DumpFramesSilent);
movie->Set("ShowInputDisplay", m_ShowInputDisplay);
}

Expand Down Expand Up @@ -603,6 +604,7 @@ void SConfig::LoadMovieSettings(IniFile& ini)
movie->Get("PauseMovie", &m_PauseMovie, false);
movie->Get("Author", &m_strMovieAuthor, "");
movie->Get("DumpFrames", &m_DumpFrames, false);
movie->Get("DumpFramesSilent", &m_DumpFramesSilent, false);
movie->Get("ShowInputDisplay", &m_ShowInputDisplay, false);
}

Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/ConfigManager.h
Expand Up @@ -100,6 +100,7 @@ struct SConfig : NonCopyable
std::string m_strMovieAuthor;
unsigned int m_FrameSkip;
bool m_DumpFrames;
bool m_DumpFramesSilent;
bool m_ShowInputDisplay;

// DSP settings
Expand Down
16 changes: 14 additions & 2 deletions Source/Core/VideoCommon/AVIDump.cpp
Expand Up @@ -88,8 +88,11 @@ bool AVIDump::CreateFile()
// Ask to delete file
if (File::Exists(movie_file_name))
{
if (AskYesNoT("Delete the existing file '%s'?", movie_file_name.c_str()))
if (SConfig::GetInstance().m_DumpFramesSilent ||
AskYesNoT("Delete the existing file '%s'?", movie_file_name.c_str()))
{
File::Delete(movie_file_name);
}
}

AVIFileInit();
Expand Down Expand Up @@ -291,7 +294,16 @@ bool AVIDump::SetCompressionOptions()
memset(&s_options, 0, sizeof(s_options));
s_array_options[0] = &s_options;

return (AVISaveOptions(s_emu_wnd, 0, 1, &s_stream, s_array_options) != 0);
if (SConfig::GetInstance().m_DumpFramesSilent)
{
s_options.fccType = streamtypeVIDEO;
s_options.fccHandler = mmioFOURCC('D', 'I', 'B', ' '); // Uncompressed
return true;
}
else
{
return (AVISaveOptions(s_emu_wnd, 0, 1, &s_stream, s_array_options) != 0);
}
}

bool AVIDump::SetVideoFormat()
Expand Down