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.
This commit is contained in:
Eugene Sandulenko 2011-08-08 15:38:27 +01:00
parent 4144fef5a7
commit a4029a8e94
5 changed files with 81 additions and 20 deletions

View file

@ -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);