ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

#include <recorderfile.h>

Collaboration diagram for Common::PlaybackFile:

List of all members.

Classes

struct  ChunkHeader
struct  PlaybackFileHeader
struct  SaveFileBuffer

Public Member Functions

 PlaybackFile ()
 ~PlaybackFile ()
bool openWrite (const String &fileName)
bool openRead (const String &fileName)
void close ()
RecorderEvent getNextEvent ()
void writeEvent (const RecorderEvent &event)
void saveScreenShot (Graphics::Surface &screen, byte md5[16])
Graphics::SurfacegetScreenShot (int number)
int getScreensCount ()
bool isEventsBufferEmpty ()
PlaybackFileHeadergetHeader ()
void updateHeader ()
void addSaveFile (const String &fileName, InSaveFile *saveStream)

Private Types

enum  fileMode { kRead = 0, kWrite = 1, kClosed = 2 }
enum  PlaybackFileState {
  kFileStateCheckFormat, kFileStateCheckVersion, kFileStateProcessHash, kFileStateProcessHeader,
  kFileStateProcessRandom, kFileStateSelectSection, kFileStateProcessSettings, kFileStateProcessSave,
  kFileStateDone, kFileStateError
}
enum  FileTag {
  kFormatIdTag = MKTAG('P','B','C','K'), kVersionTag = MKTAG('V','E','R','S'), kHeaderSectionTag = MKTAG('H','E','A','D'), kHashSectionTag = MKTAG('H','A','S','H'),
  kRandomSectionTag = MKTAG('R','A','N','D'), kEventTag = MKTAG('E','V','N','T'), kScreenShotTag = MKTAG('B','M','H','T'), kSettingsSectionTag = MKTAG('S','E','T','T'),
  kAuthorTag = MKTAG('H','A','U','T'), kCommentsTag = MKTAG('H','C','M','T'), kNameTag = MKTAG('H','N','A','M'), kHashRecordTag = MKTAG('H','R','C','D'),
  kRandomRecordTag = MKTAG('R','R','C','D'), kSettingsRecordTag = MKTAG('S','R','E','C'), kSettingsRecordKeyTag = MKTAG('S','K','E','Y'), kSettingsRecordValueTag = MKTAG('S','V','A','L'),
  kSaveTag = MKTAG('S','A','V','E'), kSaveRecordTag = MKTAG('R','S','A','V'), kSaveRecordNameTag = MKTAG('S','N','A','M'), kSaveRecordBufferTag = MKTAG('S','B','U','F'),
  kMD5Tag = MKTAG('M','D','5',' ')
}
typedef HashMap< String,
uint32, IgnoreCase_Hash,
IgnoreCase_EqualTo
RandomSeedsDictionary

Private Member Functions

void skipHeader ()
bool parseHeader ()
bool processChunk (ChunkHeader &nextChunk)
void returnToChunkHeader ()
bool readSaveRecord ()
void checkRecordedMD5 ()
bool readChunkHeader (ChunkHeader &nextChunk)
void processRndSeedRecord (ChunkHeader chunk)
bool processSettingsRecord ()
bool checkPlaybackFileVersion ()
void dumpHeaderToFile ()
void writeSaveFilesSection ()
void writeGameSettings ()
void writeHeaderSection ()
void writeGameHash ()
void writeRandomRecords ()
void dumpRecordsToFile ()
String readString (int len)
void readHashMap (ChunkHeader chunk)
bool skipToNextScreenshot ()
void readEvent (RecorderEvent &event)
void readEventsToBuffer (uint32 size)
bool grabScreenAndComputeMD5 (Graphics::Surface &screen, uint8 md5[16])

Private Attributes

WriteStream_recordFile
WriteStream_writeStream
WriteStream_screenshotsFile
MemoryReadStream _tmpPlaybackFile
SeekableReadStream_readStream
SeekableMemoryWriteStream _tmpRecordFile
fileMode _mode
bool _headerDumped
int _recordCount
uint32 _eventsSize
byte _tmpBuffer [kRecordBuffSize]
PlaybackFileHeader _header
PlaybackFileState _playbackParseState

Detailed Description

Definition at line 51 of file recorderfile.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
kRead 
kWrite 
kClosed 

Definition at line 53 of file recorderfile.h.

Enumerator:
kFormatIdTag 
kVersionTag 
kHeaderSectionTag 
kHashSectionTag 
kRandomSectionTag 
kEventTag 
kScreenShotTag 
kSettingsSectionTag 
kAuthorTag 
kCommentsTag 
kNameTag 
kHashRecordTag 
kRandomRecordTag 
kSettingsRecordTag 
kSettingsRecordKeyTag 
kSettingsRecordValueTag 
kSaveTag 
kSaveRecordTag 
kSaveRecordNameTag 
kSaveRecordBufferTag 
kMD5Tag 

Definition at line 70 of file recorderfile.h.

Enumerator:
kFileStateCheckFormat 
kFileStateCheckVersion 
kFileStateProcessHash 
kFileStateProcessHeader 
kFileStateProcessRandom 
kFileStateSelectSection 
kFileStateProcessSettings 
kFileStateProcessSave 
kFileStateDone 
kFileStateError 

Definition at line 58 of file recorderfile.h.


Constructor & Destructor Documentation

Common::PlaybackFile::PlaybackFile (  ) 

Definition at line 37 of file recorderfile.cpp.

Common::PlaybackFile::~PlaybackFile (  ) 

Definition at line 52 of file recorderfile.cpp.


Member Function Documentation

void Common::PlaybackFile::addSaveFile ( const String fileName,
InSaveFile saveStream 
)

Definition at line 664 of file recorderfile.cpp.

bool Common::PlaybackFile::checkPlaybackFileVersion (  )  [private]

Definition at line 130 of file recorderfile.cpp.

void Common::PlaybackFile::checkRecordedMD5 (  )  [private]

Definition at line 696 of file recorderfile.cpp.

void Common::PlaybackFile::close (  ) 

Definition at line 89 of file recorderfile.cpp.

void Common::PlaybackFile::dumpHeaderToFile (  )  [private]

Definition at line 425 of file recorderfile.cpp.

void Common::PlaybackFile::dumpRecordsToFile (  )  [private]

Definition at line 410 of file recorderfile.cpp.

PlaybackFileHeader& Common::PlaybackFile::getHeader (  )  [inline]

Definition at line 128 of file recorderfile.h.

RecorderEvent Common::PlaybackFile::getNextEvent (  ) 

Definition at line 322 of file recorderfile.cpp.

int Common::PlaybackFile::getScreensCount (  ) 

Definition at line 570 of file recorderfile.cpp.

Graphics::Surface * Common::PlaybackFile::getScreenShot ( int  number  ) 

Definition at line 601 of file recorderfile.cpp.

bool Common::PlaybackFile::grabScreenAndComputeMD5 ( Graphics::Surface screen,
uint8  md5[16] 
) [private]
bool Common::PlaybackFile::isEventsBufferEmpty (  ) 

Definition at line 354 of file recorderfile.cpp.

bool Common::PlaybackFile::openRead ( const String fileName  ) 

Definition at line 69 of file recorderfile.cpp.

bool Common::PlaybackFile::openWrite ( const String fileName  ) 

Definition at line 56 of file recorderfile.cpp.

bool Common::PlaybackFile::parseHeader (  )  [private]

Definition at line 111 of file recorderfile.cpp.

bool Common::PlaybackFile::processChunk ( ChunkHeader nextChunk  )  [private]

Definition at line 163 of file recorderfile.cpp.

void Common::PlaybackFile::processRndSeedRecord ( ChunkHeader  chunk  )  [private]

Definition at line 275 of file recorderfile.cpp.

bool Common::PlaybackFile::processSettingsRecord (  )  [private]

Definition at line 281 of file recorderfile.cpp.

bool Common::PlaybackFile::readChunkHeader ( PlaybackFile::ChunkHeader nextChunk  )  [private]

Definition at line 157 of file recorderfile.cpp.

void Common::PlaybackFile::readEvent ( RecorderEvent event  )  [private]

Definition at line 358 of file recorderfile.cpp.

void Common::PlaybackFile::readEventsToBuffer ( uint32  size  )  [private]

Definition at line 396 of file recorderfile.cpp.

void Common::PlaybackFile::readHashMap ( ChunkHeader  chunk  )  [private]

Definition at line 269 of file recorderfile.cpp.

bool Common::PlaybackFile::readSaveRecord (  )  [private]

Definition at line 299 of file recorderfile.cpp.

String Common::PlaybackFile::readString ( int  len  )  [private]

Definition at line 141 of file recorderfile.cpp.

void Common::PlaybackFile::returnToChunkHeader (  )  [private]

Definition at line 265 of file recorderfile.cpp.

void Common::PlaybackFile::saveScreenShot ( Graphics::Surface screen,
byte  md5[16] 
)

Definition at line 402 of file recorderfile.cpp.

void Common::PlaybackFile::skipHeader (  )  [private]

Definition at line 647 of file recorderfile.cpp.

bool Common::PlaybackFile::skipToNextScreenshot (  )  [private]

Definition at line 584 of file recorderfile.cpp.

void Common::PlaybackFile::updateHeader (  ) 

Definition at line 622 of file recorderfile.cpp.

void Common::PlaybackFile::writeEvent ( const RecorderEvent event  ) 

Definition at line 509 of file recorderfile.cpp.

void Common::PlaybackFile::writeGameHash (  )  [private]

Definition at line 473 of file recorderfile.cpp.

void Common::PlaybackFile::writeGameSettings (  )  [private]

Definition at line 551 of file recorderfile.cpp.

void Common::PlaybackFile::writeHeaderSection (  )  [private]

Definition at line 440 of file recorderfile.cpp.

void Common::PlaybackFile::writeRandomRecords (  )  [private]

Definition at line 491 of file recorderfile.cpp.

void Common::PlaybackFile::writeSaveFilesSection (  )  [private]

Definition at line 673 of file recorderfile.cpp.


Member Data Documentation

Definition at line 142 of file recorderfile.h.

Definition at line 144 of file recorderfile.h.

Definition at line 140 of file recorderfile.h.

Definition at line 139 of file recorderfile.h.

Definition at line 141 of file recorderfile.h.

Definition at line 132 of file recorderfile.h.

Definition at line 134 of file recorderfile.h.

byte Common::PlaybackFile::_tmpBuffer[kRecordBuffSize] [private]

Definition at line 143 of file recorderfile.h.

Definition at line 133 of file recorderfile.h.


The documentation for this class was generated from the following files:


Generated on Sat May 18 2019 05:06:04 for ResidualVM by doxygen 1.7.1
curved edge   curved edge