aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorEugene Sandulenko2011-08-14 12:19:14 +0100
committerEugene Sandulenko2011-08-14 12:20:19 +0100
commitdfcefb3c2231c46eba3c4ac5cd24ef09cb8b17d1 (patch)
tree1d2e6ffaedf32582a1073b7418db7b97e4d74afb /common
parent3de0b4e3f2c762128fdf9c9e6954af4b8abffbda (diff)
downloadscummvm-rg350-dfcefb3c2231c46eba3c4ac5cd24ef09cb8b17d1.tar.gz
scummvm-rg350-dfcefb3c2231c46eba3c4ac5cd24ef09cb8b17d1.tar.bz2
scummvm-rg350-dfcefb3c2231c46eba3c4ac5cd24ef09cb8b17d1.zip
RECORDER: Lower I/O in recorder
Diffstat (limited to 'common')
-rw-r--r--common/EventRecorder.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/common/EventRecorder.cpp b/common/EventRecorder.cpp
index 3be3161203..5e24f128c3 100644
--- a/common/EventRecorder.cpp
+++ b/common/EventRecorder.cpp
@@ -22,6 +22,7 @@
#include "common/EventRecorder.h"
+#include "common/bufferedstream.h"
#include "common/config-manager.h"
#include "common/random.h"
#include "common/savefile.h"
@@ -171,8 +172,8 @@ void EventRecorder::init() {
if (_recordMode == kRecorderRecord) {
_recordCount = 0;
_recordTimeCount = 0;
- _recordFile = g_system->getSavefileManager()->openForSaving(_recordTempFileName);
- _recordTimeFile = g_system->getSavefileManager()->openForSaving(_recordTimeFileName);
+ _recordFile = wrapBufferedWriteStream(g_system->getSavefileManager()->openForSaving(_recordTempFileName), 128 * 1024);
+ _recordTimeFile = wrapBufferedWriteStream(g_system->getSavefileManager()->openForSaving(_recordTimeFileName), 128 * 1024);
_recordSubtitles = ConfMan.getBool("subtitles");
}
@@ -181,8 +182,8 @@ void EventRecorder::init() {
if (_recordMode == kRecorderPlayback) {
_playbackCount = 0;
_playbackTimeCount = 0;
- _playbackFile = g_system->getSavefileManager()->openForLoading(_recordFileName);
- _playbackTimeFile = g_system->getSavefileManager()->openForLoading(_recordTimeFileName);
+ _playbackFile = wrapBufferedSeekableReadStream(g_system->getSavefileManager()->openForLoading(_recordFileName), 128 * 1024, DisposeAfterUse::YES);
+ _playbackTimeFile = wrapBufferedSeekableReadStream(g_system->getSavefileManager()->openForLoading(_recordTimeFileName), 128 * 1024, DisposeAfterUse::YES);
if (!_playbackFile) {
warning("Cannot open playback file %s. Playback was switched off", _recordFileName.c_str());