mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge pull request #8312 from ChillerDragon/pr_fix_misleading_demo_snap_var_names
Make demo snap variable names more obvious
This commit is contained in:
commit
bf2343d60b
|
@ -665,7 +665,7 @@ void CDemoPlayer::DoTick()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataSize = CVariableInt::Decompress(m_aDecompressedSnapshotData, DataSize, m_aCurrentSnapshotData, sizeof(m_aCurrentSnapshotData));
|
DataSize = CVariableInt::Decompress(m_aDecompressedSnapshotData, DataSize, m_aChunkData, sizeof(m_aChunkData));
|
||||||
if(DataSize < 0)
|
if(DataSize < 0)
|
||||||
{
|
{
|
||||||
Stop("Error during intpack decompression");
|
Stop("Error during intpack decompression");
|
||||||
|
@ -676,8 +676,8 @@ void CDemoPlayer::DoTick()
|
||||||
if(ChunkType == CHUNKTYPE_DELTA)
|
if(ChunkType == CHUNKTYPE_DELTA)
|
||||||
{
|
{
|
||||||
// process delta snapshot
|
// process delta snapshot
|
||||||
CSnapshot *pNewsnap = (CSnapshot *)m_aDeltaSnapshotData;
|
CSnapshot *pNewsnap = (CSnapshot *)m_aSnapshot;
|
||||||
DataSize = m_pSnapshotDelta->UnpackDelta((CSnapshot *)m_aLastSnapshotData, pNewsnap, m_aCurrentSnapshotData, DataSize);
|
DataSize = m_pSnapshotDelta->UnpackDelta((CSnapshot *)m_aLastSnapshotData, pNewsnap, m_aChunkData, DataSize);
|
||||||
|
|
||||||
if(DataSize < 0)
|
if(DataSize < 0)
|
||||||
{
|
{
|
||||||
|
@ -700,17 +700,17 @@ void CDemoPlayer::DoTick()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(m_pListener)
|
if(m_pListener)
|
||||||
m_pListener->OnDemoPlayerSnapshot(m_aDeltaSnapshotData, DataSize);
|
m_pListener->OnDemoPlayerSnapshot(m_aSnapshot, DataSize);
|
||||||
|
|
||||||
m_LastSnapshotDataSize = DataSize;
|
m_LastSnapshotDataSize = DataSize;
|
||||||
mem_copy(m_aLastSnapshotData, m_aDeltaSnapshotData, DataSize);
|
mem_copy(m_aLastSnapshotData, m_aSnapshot, DataSize);
|
||||||
GotSnapshot = true;
|
GotSnapshot = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(ChunkType == CHUNKTYPE_SNAPSHOT)
|
else if(ChunkType == CHUNKTYPE_SNAPSHOT)
|
||||||
{
|
{
|
||||||
// process full snapshot
|
// process full snapshot
|
||||||
CSnapshot *pSnap = (CSnapshot *)m_aCurrentSnapshotData;
|
CSnapshot *pSnap = (CSnapshot *)m_aChunkData;
|
||||||
if(!pSnap->IsValid(DataSize))
|
if(!pSnap->IsValid(DataSize))
|
||||||
{
|
{
|
||||||
if(m_pConsole)
|
if(m_pConsole)
|
||||||
|
@ -725,9 +725,9 @@ void CDemoPlayer::DoTick()
|
||||||
GotSnapshot = true;
|
GotSnapshot = true;
|
||||||
|
|
||||||
m_LastSnapshotDataSize = DataSize;
|
m_LastSnapshotDataSize = DataSize;
|
||||||
mem_copy(m_aLastSnapshotData, m_aCurrentSnapshotData, DataSize);
|
mem_copy(m_aLastSnapshotData, m_aChunkData, DataSize);
|
||||||
if(m_pListener)
|
if(m_pListener)
|
||||||
m_pListener->OnDemoPlayerSnapshot(m_aCurrentSnapshotData, DataSize);
|
m_pListener->OnDemoPlayerSnapshot(m_aChunkData, DataSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -748,7 +748,7 @@ void CDemoPlayer::DoTick()
|
||||||
else if(ChunkType == CHUNKTYPE_MESSAGE)
|
else if(ChunkType == CHUNKTYPE_MESSAGE)
|
||||||
{
|
{
|
||||||
if(m_pListener)
|
if(m_pListener)
|
||||||
m_pListener->OnDemoPlayerMessage(m_aCurrentSnapshotData, DataSize);
|
m_pListener->OnDemoPlayerMessage(m_aChunkData, DataSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,8 +118,13 @@ private:
|
||||||
CPlaybackInfo m_Info;
|
CPlaybackInfo m_Info;
|
||||||
unsigned char m_aCompressedSnapshotData[CSnapshot::MAX_SIZE];
|
unsigned char m_aCompressedSnapshotData[CSnapshot::MAX_SIZE];
|
||||||
unsigned char m_aDecompressedSnapshotData[CSnapshot::MAX_SIZE];
|
unsigned char m_aDecompressedSnapshotData[CSnapshot::MAX_SIZE];
|
||||||
unsigned char m_aCurrentSnapshotData[CSnapshot::MAX_SIZE];
|
|
||||||
unsigned char m_aDeltaSnapshotData[CSnapshot::MAX_SIZE];
|
// Depending on the chunk header
|
||||||
|
// this is either a full CSnapshot or a CSnapshotDelta.
|
||||||
|
unsigned char m_aChunkData[CSnapshot::MAX_SIZE];
|
||||||
|
// Storage for the full snapshot
|
||||||
|
// where the delta gets unpacked into.
|
||||||
|
unsigned char m_aSnapshot[CSnapshot::MAX_SIZE];
|
||||||
unsigned char m_aLastSnapshotData[CSnapshot::MAX_SIZE];
|
unsigned char m_aLastSnapshotData[CSnapshot::MAX_SIZE];
|
||||||
int m_LastSnapshotDataSize;
|
int m_LastSnapshotDataSize;
|
||||||
class CSnapshotDelta *m_pSnapshotDelta;
|
class CSnapshotDelta *m_pSnapshotDelta;
|
||||||
|
|
Loading…
Reference in a new issue