From a4029a8e94a3dbbe03c0aa4571215e9a5b00058d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 8 Aug 2011 15:38:27 +0100 Subject: RECORDER: Restore event recorder functionality. It was badly broken after refactoring into EventObserver. Fitst, deinit() method was never called which lead to bad record files. Then, the concept of counting pollEvent() calls was ignored. Introduced dispatchPoll() method of EventObserver which is implemented in EventRecorder. It counts calls so is able to inject events at more proper time. Additionally now event times are recorded. --- base/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index 717ccb3344..780015d307 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -419,6 +419,10 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { // Try to run the game Common::Error result = runGame(plugin, system, specialDebug); + // Flush Event recorder file. The recorder does not get reinitialized for next game + // which is intentional. Only single game per session is allowed. + g_eventRec.deinit(); + #if defined(UNCACHED_PLUGINS) && defined(DYNAMIC_MODULES) // do our best to prevent fragmentation by unloading as soon as we can PluginManager::instance().unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false); -- cgit v1.2.3