aboutsummaryrefslogtreecommitdiff
path: root/base/main.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2011-08-08 15:38:27 +0100
committerEugene Sandulenko2011-08-08 20:01:07 +0100
commita4029a8e94a3dbbe03c0aa4571215e9a5b00058d (patch)
treea18d45985ba3d452cfe68fe3a1408b6aa910ff38 /base/main.cpp
parent4144fef5a7404bfab8dd127cc9d09694de89e997 (diff)
downloadscummvm-rg350-a4029a8e94a3dbbe03c0aa4571215e9a5b00058d.tar.gz
scummvm-rg350-a4029a8e94a3dbbe03c0aa4571215e9a5b00058d.tar.bz2
scummvm-rg350-a4029a8e94a3dbbe03c0aa4571215e9a5b00058d.zip
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.
Diffstat (limited to 'base/main.cpp')
-rw-r--r--base/main.cpp4
1 files changed, 4 insertions, 0 deletions
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);