citra-emu
/
citra-canary
Archived
1
0
Fork 0

citra_qt: Simplify movie recording code

The behavior shouldn't be changed.
This commit is contained in:
zhupengfei 2020-07-23 14:10:16 +08:00
parent 1780f8b5b8
commit d6b64f6b09
No known key found for this signature in database
GPG Key ID: DD129E108BD09378
1 changed files with 13 additions and 16 deletions

View File

@ -1074,6 +1074,14 @@ void GMainWindow::BootGame(const QString& filename) {
ShowFullscreen(); ShowFullscreen();
} }
if (movie_record_on_start) {
Core::Movie::GetInstance().StartRecording(movie_record_path.toStdString(),
movie_record_author.toStdString());
movie_record_on_start = false;
movie_record_path.clear();
movie_record_author.clear();
}
if (video_dumping_on_start) { if (video_dumping_on_start) {
Layout::FramebufferLayout layout{ Layout::FramebufferLayout layout{
Layout::FrameLayoutFromResolutionScale(VideoCore::GetResolutionScaleFactor())}; Layout::FrameLayoutFromResolutionScale(VideoCore::GetResolutionScaleFactor())};
@ -1540,14 +1548,6 @@ void GMainWindow::OnMenuRecentFile() {
void GMainWindow::OnStartGame() { void GMainWindow::OnStartGame() {
Camera::QtMultimediaCameraHandler::ResumeCameras(); Camera::QtMultimediaCameraHandler::ResumeCameras();
if (movie_record_on_start) {
Core::Movie::GetInstance().StartRecording(movie_record_path.toStdString(),
movie_record_author.toStdString());
movie_record_on_start = false;
movie_record_path.clear();
movie_record_author.clear();
}
PreventOSSleep(); PreventOSSleep();
emu_thread->SetRunning(true); emu_thread->SetRunning(true);
@ -1853,15 +1853,12 @@ void GMainWindow::OnRecordMovie() {
return; return;
} }
if (emulation_running) {
// Restart game
BootGame(QString(game_path));
Core::Movie::GetInstance().StartRecording(dialog.GetPath().toStdString(),
dialog.GetAuthor().toStdString());
} else {
movie_record_on_start = true; movie_record_on_start = true;
movie_record_path = dialog.GetPath(); movie_record_path = dialog.GetPath();
movie_record_author = dialog.GetAuthor(); movie_record_author = dialog.GetAuthor();
if (emulation_running) { // Restart game
BootGame(QString(game_path));
} }
ui->action_Close_Movie->setEnabled(true); ui->action_Close_Movie->setEnabled(true);
} }