From 27424c4894cb0738ade3adf4e273bb788f2309dd Mon Sep 17 00:00:00 2001 From: Martin Gerhardy Date: Sun, 4 Jan 2026 12:49:02 +0100 Subject: [PATCH] BASE: EVENTRECORDER: control fast mode via record-mode argument --- base/commandLine.cpp | 7 +------ base/main.cpp | 6 +++--- doc/docportal/advanced_topics/command_line.rst | 3 +-- gui/EventRecorder.cpp | 7 ++++--- gui/EventRecorder.h | 1 + 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 6cb24877d4d..cfbc7aa6f5e 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -204,7 +204,7 @@ static const char HELP_STRING4[] = " atari, macintosh, macintoshbw, vgaGray)\n" #ifdef ENABLE_EVENTRECORDER " --record-mode=MODE Specify record mode for event recorder (record, playback,\n" - " info, update, passthrough [default])\n" + " fast_playback, info, update, passthrough [default])\n" " --record-file-name=FILE Specify record file name\n" " --disable-display Disable any gfx output. Used for headless events\n" " playback by Event Recorder\n" @@ -212,7 +212,6 @@ static const char HELP_STRING4[] = " (default: 60000)\n" " --list-records Display a list of recordings for the target specified\n" " --list-records-json Display a list of recordings in JSON format for the target specified\n" - " --fast-mode Enable fast mode for event recorder playback\n" #endif "\n" #if defined(ENABLE_SKY) || defined(ENABLE_QUEEN) @@ -385,7 +384,6 @@ void registerDefaults() { #ifdef ENABLE_EVENTRECORDER ConfMan.registerDefault("disable_display", false); - ConfMan.registerDefault("fast_mode", false); #endif ConfMan.registerDefault("record_mode", "none"); ConfMan.registerDefault("record_file_name", "record.bin"); @@ -833,9 +831,6 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha DO_LONG_OPTION_INT("screenshot-period") END_OPTION - - DO_LONG_OPTION_BOOL("fast-mode") - END_OPTION #endif DO_LONG_OPTION("opl-driver") diff --git a/base/main.cpp b/base/main.cpp index 346c4e77b88..7b2c1e7f8e2 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -587,9 +587,6 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { if (settings.contains("disable-display")) { ConfMan.setInt("disable_display", 1, Common::ConfigManager::kTransientDomain); } - if (settings.contains("fast-mode")) { - ConfMan.setInt("fast_mode", 1, Common::ConfigManager::kTransientDomain); - } #endif setupGraphics(system); @@ -791,6 +788,9 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { g_eventRec.init(recordFileName, GUI::EventRecorder::kRecorderUpdate); } else if (recordMode == "playback") { g_eventRec.init(recordFileName, GUI::EventRecorder::kRecorderPlayback); + } else if (recordMode == "fast_playback") { + g_eventRec.init(recordFileName, GUI::EventRecorder::kRecorderPlayback); + g_eventRec.setFastPlayback(true); } else if ((recordMode == "info") && (!recordFileName.empty())) { Common::PlaybackFile record; record.openRead(recordFileName); diff --git a/doc/docportal/advanced_topics/command_line.rst b/doc/docportal/advanced_topics/command_line.rst index 2fd527d890c..6a23c2901da 100755 --- a/doc/docportal/advanced_topics/command_line.rst +++ b/doc/docportal/advanced_topics/command_line.rst @@ -167,7 +167,6 @@ Short options are listed where they are available. ``--engine=ID``,,"In combination with ``--list-games`` or ``--list-all-games`` only lists games for this engine", ``--engine-speed=NUM``,,"Sets frame-per-second limit for Grim Fandango or Escape from Monkey Island. 0 is no limit. Allowed values 0 - 100", 60 ``--extrapath=PATH``,,":ref:`Extra path to additional game data `", - ``--fast-mode``,, "Enable fast playback mode (`Event Recorder `_)", ``--filtering``,,":ref:`Forces filtered graphics mode `",false ``--fullscreen``,``-f``,":ref:`Forces full-screen mode `",false ``--game=ID``,,"In combination with ``--add`` or ``--detect`` only adds or attempts to detect the game with specified ID.", @@ -228,7 +227,7 @@ Short options are listed where they are available. - windows", ``--random-seed=SEED``,,":ref:`Sets the random seed used to initialize entropy `", ``--record-file-name=FILE``,,"Specifies recorded file name (`Event Recorder `_)",record.bin - ``--record-mode=MODE``,,"Specifies record mode for `Event Recorder `_. Allowed values: record, playback, info, update, passthrough.", none + ``--record-mode=MODE``,,"Specifies record mode for `Event Recorder `_. Allowed values: record, playback, fast_playback, info, update, passthrough.", none ``--recursive``,,"In combination with ``--add or ``--detect`` recurses down all subdirectories", ``--renderer=RENDERER``,,"Selects 3D renderer. Allowed values: software, opengl, opengl_shaders", ``--render-mode=MODE``,,":ref:`Enables additional render modes `. diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp index 37594a9e3d8..e359d162a00 100644 --- a/gui/EventRecorder.cpp +++ b/gui/EventRecorder.cpp @@ -379,6 +379,9 @@ Common::String EventRecorder::generateRecordFileName(const Common::String &targe return ""; } +void EventRecorder::setFastPlayback(bool fastPlayback) { + _fastPlayback = fastPlayback; +} void EventRecorder::init(const Common::String &recordFileName, RecordMode mode) { _fakeMixerManager = new NullMixerManager(); @@ -389,13 +392,11 @@ void EventRecorder::init(const Common::String &recordFileName, RecordMode mode) _lastScreenshotTime = 0; _recordMode = mode; _needcontinueGame = false; + _fastPlayback = false; if (ConfMan.hasKey("disable_display")) { DebugMan.enableDebugChannel("EventRec"); gDebugLevel = 1; } - if (ConfMan.hasKey("fast_mode")) { - _fastPlayback = ConfMan.getInt("fast_mode") != 0; - } if ((_recordMode == kRecorderPlayback) || (_recordMode == kRecorderUpdate)) { debugC(1, kDebugLevelEventRec, "playback:action=\"Load file\" filename=%s", recordFileName.c_str()); Common::EventDispatcher *eventDispatcher = g_system->getEventManager()->getEventDispatcher(); diff --git a/gui/EventRecorder.h b/gui/EventRecorder.h index 9beaea8e9d7..a68dd4bbdbe 100644 --- a/gui/EventRecorder.h +++ b/gui/EventRecorder.h @@ -80,6 +80,7 @@ public: void init(const Common::String &recordFileName, RecordMode mode); void deinit(); bool processDelayMillis(); + void setFastPlayback(bool fastPlayback); uint32 getRandomSeed(const Common::String &name); void processTimeAndDate(TimeDate &td, bool skipRecord); void processMillis(uint32 &millis, bool skipRecord);