File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
GeneralsMD/Code/GameEngine/Source/Common
Generals/Code/GameEngine/Source/Common Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 4848#include " Common/version.h"
4949
5050CONSTEXPR const char s_genrep[] = " GENREP" ;
51+ CONSTEXPR const UnsignedInt replayBufferBytes = 8192 ;
5152
5253Int REPLAY_CRC_INTERVAL = 100 ;
5354
@@ -845,7 +846,9 @@ Bool RecorderClass::readReplayHeader(ReplayHeader& header)
845846 AsciiString filepath = getReplayDir ();
846847 filepath.concat (header.filename .str ());
847848
848- m_file = TheFileSystem->openFile (filepath.str (), File::READ | File::BINARY );
849+ // TheSuperHackers @performance More buffered data reduces disk overhead and will improve fast forward playback
850+ const UnsignedInt buffersize = header.forPlayback ? replayBufferBytes : File::BUFFERSIZE;
851+ m_file = TheFileSystem->openFile (filepath.str (), File::READ | File::BINARY, buffersize);
849852
850853 if (m_file == NULL )
851854 {
Original file line number Diff line number Diff line change 4848#include " Common/version.h"
4949
5050CONSTEXPR const char s_genrep[] = " GENREP" ;
51+ CONSTEXPR const UnsignedInt replayBufferBytes = 8192 ;
5152
5253Int REPLAY_CRC_INTERVAL = 100 ;
5354
@@ -847,7 +848,9 @@ Bool RecorderClass::readReplayHeader(ReplayHeader& header)
847848 AsciiString filepath = getReplayDir ();
848849 filepath.concat (header.filename .str ());
849850
850- m_file = TheFileSystem->openFile (filepath.str (), File::READ | File::BINARY );
851+ // TheSuperHackers @performance More buffered data reduces disk overhead and will improve fast forward playback
852+ const UnsignedInt buffersize = header.forPlayback ? replayBufferBytes : File::BUFFERSIZE;
853+ m_file = TheFileSystem->openFile (filepath.str (), File::READ | File::BINARY, buffersize);
851854
852855 if (m_file == NULL )
853856 {
You can’t perform that action at this time.
0 commit comments