mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
added CDemoRecorder::TickCount() to get demo length by Batchyx
This commit is contained in:
parent
db9dd6b8c9
commit
974a40913d
|
@ -105,6 +105,7 @@ int CDemoRecorder::Start(class IStorage *pStorage, class IConsole *pConsole, con
|
|||
|
||||
m_LastKeyFrame = -1;
|
||||
m_LastTickMarker = -1;
|
||||
m_FirstTick = -1;
|
||||
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), "Recording to '%s'", pFilename);
|
||||
|
@ -164,6 +165,8 @@ void CDemoRecorder::WriteTickMarker(int Tick, int Keyframe)
|
|||
}
|
||||
|
||||
m_LastTickMarker = Tick;
|
||||
if(m_FirstTick < 0)
|
||||
m_FirstTick = Tick;
|
||||
}
|
||||
|
||||
void CDemoRecorder::Write(int Type, const void *pData, int Size)
|
||||
|
|
|
@ -22,6 +22,7 @@ class CDemoRecorder : public IDemoRecorder
|
|||
IOHANDLE m_File;
|
||||
int m_LastTickMarker;
|
||||
int m_LastKeyFrame;
|
||||
int m_FirstTick;
|
||||
unsigned char m_aLastSnapshotData[CSnapshot::MAX_SIZE];
|
||||
class CSnapshotDelta *m_pSnapshotDelta;
|
||||
|
||||
|
@ -37,6 +38,8 @@ public:
|
|||
void RecordMessage(const void *pData, int Size);
|
||||
|
||||
bool IsRecording() const { return m_File != 0; }
|
||||
|
||||
int TickCount() const { return m_LastTickMarker - m_FirstTick; }
|
||||
};
|
||||
|
||||
class CDemoPlayer : public IDemoPlayer
|
||||
|
|
Loading…
Reference in a new issue