Merge pull request #4267 from zhaowenlan1779/movie

movie: Add clock init time to CTM header
This commit is contained in:
Pengfei Zhu 2018-10-05 08:20:33 -05:00 committed by GitHub
commit 2a90426cb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 96 additions and 20 deletions

View file

@ -748,6 +748,10 @@ void GMainWindow::BootGame(const QString& filename) {
LOG_INFO(Frontend, "Citra starting...");
StoreRecentFile(filename); // Put the filename on top of the list
if (movie_record_on_start) {
Core::Movie::GetInstance().PrepareForRecording();
}
if (!LoadROM(filename))
return;
@ -1271,6 +1275,15 @@ void GMainWindow::OnCreateGraphicsSurfaceViewer() {
}
void GMainWindow::OnRecordMovie() {
if (emulation_running) {
QMessageBox::StandardButton answer = QMessageBox::warning(
this, tr("Record Movie"),
tr("To keep consistency with the RNG, it is recommended to record the movie from game "
"start.<br>Are you sure you still want to record movies now?"),
QMessageBox::Yes | QMessageBox::No);
if (answer == QMessageBox::No)
return;
}
const QString path =
QFileDialog::getSaveFileName(this, tr("Record Movie"), UISettings::values.movie_record_path,
tr("Citra TAS Movie (*.ctm)"));
@ -1332,6 +1345,16 @@ bool GMainWindow::ValidateMovie(const QString& path, u64 program_id) {
}
void GMainWindow::OnPlayMovie() {
if (emulation_running) {
QMessageBox::StandardButton answer = QMessageBox::warning(
this, tr("Play Movie"),
tr("To keep consistency with the RNG, it is recommended to play the movie from game "
"start.<br>Are you sure you still want to play movies now?"),
QMessageBox::Yes | QMessageBox::No);
if (answer == QMessageBox::No)
return;
}
const QString path =
QFileDialog::getOpenFileName(this, tr("Play Movie"), UISettings::values.movie_playback_path,
tr("Citra TAS Movie (*.ctm)"));
@ -1363,6 +1386,7 @@ void GMainWindow::OnPlayMovie() {
}
if (!ValidateMovie(path, program_id))
return;
Core::Movie::GetInstance().PrepareForPlayback(path.toStdString());
BootGame(game_path);
}
Core::Movie::GetInstance().StartPlayback(path.toStdString(), [this] {