#include <C4Record.h>
Public Member Functions | |
C4Playback () | |
~C4Playback () | |
bool | Open (C4Group &rGrp) |
bool | ReadBinary (const StdBuf &Buf) |
bool | ReadText (const StdStrBuf &Buf) |
void | NextChunk () |
bool | NextSequentialChunk () |
StdStrBuf | ReWriteText () |
StdBuf | ReWriteBinary () |
void | Strip () |
bool | ExecuteControl (C4Control *pCtrl, int iFrame) |
bool | IsFinished () |
void | Clear () |
void | Check (C4RecordChunkType eType, const uint8_t *pData, int iSize) |
void | DebugRecError (const char *szError) |
Static Public Member Functions | |
static bool | StreamToRecord (const char *szStream, StdStrBuf *pRecord) |
Definition at line 285 of file C4Record.h.
|
default |
C4Playback::~C4Playback | ( | ) |
Definition at line 377 of file C4Record.cpp.
References Clear().
void C4Playback::Check | ( | C4RecordChunkType | eType, |
const uint8_t * | pData, | ||
int | iSize | ||
) |
Definition at line 992 of file C4Record.cpp.
References StdStrBuf::Append(), Config, Control, DbgRecFile, DEBUGREC_START_FRAME, DebugRecError(), C4ConfigGeneral::DebugRecExternalFile, C4ConfigGeneral::DebugRecWrite, C4PacketList::Delete(), DoNoDebugRec, C4GameControl::ExecControlPacket(), C4PacketList::firstPkt(), StdStrBuf::Format(), FormatString(), C4Game::FrameCounter, Game, C4Config::General, StdStrBuf::getData(), C4PktBuf::getData(), GetDbgRecPktData(), StdBuf::getMData(), C4IDPacket::getPkt(), C4IDPacket::getPktType(), GetRecordChunkTypeName(), C4PktBuf::getSize(), C4PktDebugRec::getType(), iSize, Log(), NextChunk(), RCT_CtrlPkt, RCT_End, RCT_Undefined, CStdFile::Read(), StdBuf::SetSize(), C4ControlPacket::Sync(), and CStdFile::Write().
Referenced by C4GameControl::DbgRec().
void C4Playback::Clear | ( | ) |
Definition at line 909 of file C4Record.cpp.
References StdBuf::Clear(), CStdFile::Close(), Config, DbgRecFile, C4ConfigGeneral::DebugRec, C4ConfigGeneral::DebugRecExternalFile, C4PacketList::Delete(), C4PacketList::firstPkt(), and C4Config::General.
Referenced by Open(), and ~C4Playback().
void C4Playback::DebugRecError | ( | const char * | szError | ) |
Definition at line 1101 of file C4Record.cpp.
References BREAKPOINT_HERE, and LogF().
Referenced by Check(), and ExecuteControl().
bool C4Playback::ExecuteControl | ( | C4Control * | pCtrl, |
int | iFrame | ||
) |
Definition at line 840 of file C4Record.cpp.
References C4PacketList::Add(), C4Control::Add(), C4Control::Append(), CID_DebugRec, C4PacketList::Clear(), Config, C4ConfigGeneral::DebugRec, DebugRecError(), C4IDPacket::Default(), C4PacketList::firstPkt(), C4Config::General, C4IDPacket::getPkt(), C4IDPacket::getPktType(), NextChunk(), RCT_Ctrl, RCT_CtrlPkt, and RCT_End.
Referenced by C4GameControl::Execute().
|
inline |
Definition at line 311 of file C4Record.h.
void C4Playback::NextChunk | ( | ) |
Definition at line 609 of file C4Record.cpp.
References NextSequentialChunk().
Referenced by Check(), and ExecuteControl().
bool C4Playback::NextSequentialChunk | ( | ) |
Definition at line 622 of file C4Record.cpp.
References StdBuf::getMData(), StdBuf::New(), CStdFile::Read(), ReadBinary(), and StdBuf::SetSize().
Referenced by NextChunk(), and Open().
bool C4Playback::Open | ( | C4Group & | rGrp | ) |
Definition at line 382 of file C4Record.cpp.
References C4CFN_CtrlRec, C4CFN_CtrlRecText, Clear(), Config, CStdFile::Create(), DbgRecFile, C4ConfigGeneral::DebugRec, C4ConfigGeneral::DebugRecExternalFile, C4ConfigGeneral::DebugRecWrite, DirectorySeparator, C4Group::FindEntry(), FormatString(), Game, C4Config::General, StdStrBuf::getData(), GetExtension(), C4Group::GetFullName(), StdStrBuf::getLength(), C4Group::IsPacked(), C4Group::LoadEntry(), C4Group::LoadEntryString(), LogF(), LogFatal(), NextSequentialChunk(), CStdFile::Open(), ReadBinary(), ReadText(), C4Game::RecordDumpFile, ReWriteBinary(), ReWriteText(), StdBuf::SaveToFile(), StdStrBuf::SaveToFile(), SEqualNoCase(), and Strip().
Referenced by C4GameControl::InitReplay().
bool C4Playback::ReadBinary | ( | const StdBuf & | Buf | ) |
Definition at line 504 of file C4Record.cpp.
References StdBuf::Append(), StdCompilerBinRead::Begin(), StdBuf::Clear(), C4RecordChunk::Delete(), StdCompiler::End(), C4RecordChunk::Filename, C4RecordChunk::Frame, StdStrBuf::getData(), StdBuf::getPart(), StdCompilerBinRead::getPosition(), StdBuf::getRef(), StdBuf::getSize(), C4RecordChunkHead::iFrm, LogF(), mkPtrAdaptNoNull(), StdBuf::Move(), StdCompiler::Exception::Msg, RCT_Ctrl, RCT_CtrlPkt, RCT_End, RCT_File, StdCompilerBinRead::setInput(), StdBuf::Shrink(), C4RecordChunkHead::Type, C4RecordChunk::Type, and StdCompiler::Value().
Referenced by NextSequentialChunk(), Open(), and StreamToRecord().
bool C4Playback::ReadText | ( | const StdStrBuf & | Buf | ) |
Definition at line 604 of file C4Record.cpp.
References C4CFN_CtrlRecText, mkNamingAdapt(), and mkSTLContainerAdapt().
Referenced by Open().
StdBuf C4Playback::ReWriteBinary | ( | ) |
Definition at line 658 of file C4Record.cpp.
References StdStrBuf::getData(), StdBuf::getSize(), StdBuf::Grow(), C4RecordChunkHead::iFrm, LogF(), StdCompiler::Exception::Msg, RCT_Ctrl, RCT_CtrlPkt, RCT_End, StdBuf::SetSize(), C4RecordChunkHead::Type, and StdBuf::Write().
Referenced by Open(), and StreamToRecord().
StdStrBuf C4Playback::ReWriteText | ( | ) |
Definition at line 645 of file C4Record.cpp.
References StdStrBuf::Append(), mkDecompileAdapt(), and mkNamingAdapt().
Referenced by Open().
|
static |
Definition at line 1107 of file C4Record.cpp.
References _MAX_PATH, _MAX_PATH_LEN, C4Group::Add(), C4CFN_CtrlRec, C4Group_CopyItem(), C4Group_UnpackDirectory(), C4Group::Close(), StdStrBuf::Copy(), StdStrBuf::getData(), GetExtension(), StdBuf::getSize(), StdBuf::Grow(), C4Scenario::Head, C4Scenario::Load(), StdBuf::LoadFromFile(), Log(), LogF(), MakeTempFilename(), C4Group::Merge(), C4Group::Move(), StdBuf::New(), C4Group::Open(), C4SHead::Origin, RCT_File, ReadBinary(), ReWriteBinary(), SAppend(), StdBuf::SaveToFile(), SCopy(), StdBuf::SetSize(), and ZeroMem().
Referenced by C4Game::OpenScenario().
void C4Playback::Strip | ( | ) |
Definition at line 713 of file C4Record.cpp.
References CID_EditGraph, CID_EMDrawTool, CID_EMMoveObj, CID_JoinPlr, CID_Message, CID_ReInitScenario, CID_Script, CID_SyncCheck, C4Control::firstPkt(), FormatString(), C4RecordChunk::Frame, StdStrBuf::getData(), Log(), mkNamingAdapt(), C4Control::nextPkt(), RCT_Ctrl, RCT_CtrlPkt, RCT_End, C4ControlJoinPlayer::Strip(), and C4RecordChunk::Type.
Referenced by Open().