22 #ifndef COMMON_RECORDERFILE_H 23 #define COMMON_RECORDERFILE_H 25 #include "common/scummsys.h" 26 #include "common/events.h" 27 #include "common/mutex.h" 28 #include "common/memstream.h" 29 #include "common/config-manager.h" 30 #include "common/savefile.h" 33 #define kMaxBufferedRecords 10000 34 #define kRecordBuffSize sizeof(RecorderEvent) * kMaxBufferedRecords 42 enum RecorderEventType {
43 kRecorderEventTypeNormal = 0,
44 kRecorderEventTypeTimer = 1,
45 kRecorderEventTypeTimeDate = 2,
46 kRecorderEventTypeScreenUpdate = 3,
50 RecorderEventType recordedtype;
57 recordedtype = kRecorderEventTypeNormal;
69 recordedtype = kRecorderEventTypeNormal;
90 enum PlaybackFileState {
91 kFileStateCheckFormat,
92 kFileStateCheckVersion,
93 kFileStateProcessHash,
94 kFileStateProcessHeader,
95 kFileStateProcessRandom,
96 kFileStateSelectSection,
97 kFileStateProcessSettings,
98 kFileStateProcessSave,
103 kFormatIdTag =
MKTAG(
'P',
'B',
'C',
'K'),
104 kVersionTag =
MKTAG(
'V',
'E',
'R',
'S'),
105 kHeaderSectionTag =
MKTAG(
'H',
'E',
'A',
'D'),
106 kHashSectionTag =
MKTAG(
'H',
'A',
'S',
'H'),
107 kRandomSectionTag =
MKTAG(
'R',
'A',
'N',
'D'),
108 kEventTag =
MKTAG(
'E',
'V',
'N',
'T'),
109 kScreenShotTag =
MKTAG(
'T',
'H',
'M',
'B'),
110 kSettingsSectionTag =
MKTAG(
'S',
'E',
'T',
'T'),
111 kAuthorTag =
MKTAG(
'H',
'A',
'U',
'T'),
112 kCommentsTag =
MKTAG(
'H',
'C',
'M',
'T'),
113 kNameTag =
MKTAG(
'H',
'N',
'A',
'M'),
114 kHashRecordTag =
MKTAG(
'H',
'R',
'C',
'D'),
115 kRandomRecordTag =
MKTAG(
'R',
'R',
'C',
'D'),
116 kSettingsRecordTag =
MKTAG(
'S',
'R',
'E',
'C'),
117 kSettingsRecordKeyTag =
MKTAG(
'S',
'K',
'E',
'Y'),
118 kSettingsRecordValueTag =
MKTAG(
'S',
'V',
'A',
'L'),
119 kSaveTag =
MKTAG(
'S',
'A',
'V',
'E'),
120 kSaveRecordTag =
MKTAG(
'R',
'S',
'A',
'V'),
121 kSaveRecordNameTag =
MKTAG(
'S',
'N',
'A',
'M'),
122 kSaveRecordBufferTag =
MKTAG(
'S',
'B',
'U',
'F'),
123 kMD5Tag =
MKTAG(
'M',
'D',
'5',
' ')
143 RandomSeedsDictionary randomSourceRecords;
148 bool openWrite(
const String &fileName);
149 bool openRead(
const String &fileName);
152 bool hasNextEvent()
const;
159 int getScreensCount();
161 bool isEventsBufferEmpty()
const;
166 uint32 getVersion()
const {
return _version;}
181 PlaybackFileState _playbackParseState;
186 bool processChunk(ChunkHeader &nextChunk);
187 void returnToChunkHeader();
189 bool readSaveRecord();
190 void checkRecordedMD5();
191 bool readChunkHeader(ChunkHeader &nextChunk);
192 void processRndSeedRecord(ChunkHeader chunk);
193 bool processSettingsRecord();
195 bool checkPlaybackFileVersion();
197 void dumpHeaderToFile();
198 void writeSaveFilesSection();
199 void writeGameSettings();
200 void writeHeaderSection();
201 void writeGameHash();
202 void writeRandomRecords();
204 void dumpRecordsToFile();
206 String readString(
int len);
207 void readHashMap(ChunkHeader chunk);
209 bool skipToNextScreenshot();
211 void readEventsToBuffer(uint32 size);
Definition: recorderfile.h:49
Definition: managed_surface.h:51
Definition: recorderfile.h:83
Definition: recorderfile.h:130
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: memstream.h:43
#define MKTAG(a0, a1, a2, a3)
Definition: endian.h:188
Definition: memstream.h:155