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 38 enum RecorderEventType {
39 kRecorderEventTypeNormal = 0,
40 kRecorderEventTypeTimer = 1,
41 kRecorderEventTypeTimeDate = 2,
42 kRecorderEventTypeScreenUpdate = 3,
46 RecorderEventType recordedtype;
53 recordedtype = kRecorderEventTypeNormal;
65 recordedtype = kRecorderEventTypeNormal;
86 enum PlaybackFileState {
87 kFileStateCheckFormat,
88 kFileStateCheckVersion,
89 kFileStateProcessHash,
90 kFileStateProcessHeader,
91 kFileStateProcessRandom,
92 kFileStateSelectSection,
93 kFileStateProcessSettings,
94 kFileStateProcessSave,
99 kFormatIdTag =
MKTAG(
'P',
'B',
'C',
'K'),
100 kVersionTag =
MKTAG(
'V',
'E',
'R',
'S'),
101 kHeaderSectionTag =
MKTAG(
'H',
'E',
'A',
'D'),
102 kHashSectionTag =
MKTAG(
'H',
'A',
'S',
'H'),
103 kRandomSectionTag =
MKTAG(
'R',
'A',
'N',
'D'),
104 kEventTag =
MKTAG(
'E',
'V',
'N',
'T'),
105 kScreenShotTag =
MKTAG(
'T',
'H',
'M',
'B'),
106 kSettingsSectionTag =
MKTAG(
'S',
'E',
'T',
'T'),
107 kAuthorTag =
MKTAG(
'H',
'A',
'U',
'T'),
108 kCommentsTag =
MKTAG(
'H',
'C',
'M',
'T'),
109 kNameTag =
MKTAG(
'H',
'N',
'A',
'M'),
110 kHashRecordTag =
MKTAG(
'H',
'R',
'C',
'D'),
111 kRandomRecordTag =
MKTAG(
'R',
'R',
'C',
'D'),
112 kSettingsRecordTag =
MKTAG(
'S',
'R',
'E',
'C'),
113 kSettingsRecordKeyTag =
MKTAG(
'S',
'K',
'E',
'Y'),
114 kSettingsRecordValueTag =
MKTAG(
'S',
'V',
'A',
'L'),
115 kSaveTag =
MKTAG(
'S',
'A',
'V',
'E'),
116 kSaveRecordTag =
MKTAG(
'R',
'S',
'A',
'V'),
117 kSaveRecordNameTag =
MKTAG(
'S',
'N',
'A',
'M'),
118 kSaveRecordBufferTag =
MKTAG(
'S',
'B',
'U',
'F'),
119 kMD5Tag =
MKTAG(
'M',
'D',
'5',
' ')
139 RandomSeedsDictionary randomSourceRecords;
144 bool openWrite(
const String &fileName);
145 bool openRead(
const String &fileName);
148 bool hasNextEvent()
const;
154 int getScreensCount();
156 bool isEventsBufferEmpty()
const;
161 uint32 getVersion()
const {
return _version;}
176 PlaybackFileState _playbackParseState;
181 bool processChunk(ChunkHeader &nextChunk);
182 void returnToChunkHeader();
184 bool readSaveRecord();
185 void checkRecordedMD5();
186 bool readChunkHeader(ChunkHeader &nextChunk);
187 void processRndSeedRecord(ChunkHeader chunk);
188 bool processSettingsRecord();
190 bool checkPlaybackFileVersion();
192 void dumpHeaderToFile();
193 void writeSaveFilesSection();
194 void writeGameSettings();
195 void writeHeaderSection();
196 void writeGameHash();
197 void writeRandomRecords();
199 void dumpRecordsToFile();
201 String readString(
int len);
202 void readHashMap(ChunkHeader chunk);
204 bool skipToNextScreenshot();
206 void readEventsToBuffer(uint32 size);
Definition: recorderfile.h:45
int tm_hour
Definition: system.h:109
int tm_mday
Definition: system.h:110
int tm_min
Definition: system.h:108
Definition: recorderfile.h:79
Definition: recorderfile.h:126
int tm_wday
Definition: system.h:113
int tm_sec
Definition: system.h:107
Definition: algorithm.h:29
Definition: memstream.h:43
int tm_year
Definition: system.h:112
#define MKTAG(a0, a1, a2, a3)
Definition: endian.h:188
int tm_mon
Definition: system.h:111
Definition: memstream.h:155