Added zstd training set
This commit is contained in:
parent
1a3e348316
commit
4067d7cfe6
6 changed files with 51 additions and 58 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -20,7 +20,6 @@ Release_*/
|
||||||
*.idb
|
*.idb
|
||||||
*.pdb
|
*.pdb
|
||||||
*.rc
|
*.rc
|
||||||
*.bin
|
|
||||||
*.vcxproj*
|
*.vcxproj*
|
||||||
*.sln
|
*.sln
|
||||||
*.dll*
|
*.dll*
|
||||||
|
|
Binary file not shown.
|
@ -89,7 +89,7 @@ void WriteConfig_f( ConVar *var, const char *pOldString );
|
||||||
// If we get more than 250 messages in the incoming buffer queue, dump any above this #
|
// If we get more than 250 messages in the incoming buffer queue, dump any above this #
|
||||||
#define MAX_INCOMING_MESSAGES 250
|
#define MAX_INCOMING_MESSAGES 250
|
||||||
// Size of command send buffer
|
// Size of command send buffer
|
||||||
#define MAX_CMD_BUFFER 4000
|
#define MAX_CMD_BUFFER 0x10000
|
||||||
|
|
||||||
CGlobalVarsBase g_ClientGlobalVariables( true );
|
CGlobalVarsBase g_ClientGlobalVariables( true );
|
||||||
IVideoRecorder *g_pVideoRecorder = NULL;
|
IVideoRecorder *g_pVideoRecorder = NULL;
|
||||||
|
|
|
@ -1391,7 +1391,7 @@ bool COM_BufferToBufferCompress_ZSTD(void* dest,
|
||||||
Assert( destLen );
|
Assert( destLen );
|
||||||
Assert( source );
|
Assert( source );
|
||||||
|
|
||||||
//#define ZSTD_GENERATE_TRAINING_SET
|
#define ZSTD_GENERATE_TRAINING_SET
|
||||||
|
|
||||||
#ifdef ZSTD_GENERATE_TRAINING_SET
|
#ifdef ZSTD_GENERATE_TRAINING_SET
|
||||||
static int zstdTrainingSetCount = 0;
|
static int zstdTrainingSetCount = 0;
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
#include "bitbuf.h"
|
#include "bitbuf.h"
|
||||||
#include "checksum_md5.h"
|
#include "checksum_md5.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "platform.h"
|
#include "utlvector.h"
|
||||||
|
#include "shareddefs.h"
|
||||||
|
|
||||||
// memdbgon must be the last include file in a .cpp file!!!
|
// memdbgon must be the last include file in a .cpp file!!!
|
||||||
#ifdef CLIENT_DLL
|
#ifdef CLIENT_DLL
|
||||||
|
@ -178,53 +179,51 @@ void WriteUsercmd( bf_write *buf, const CUserCmd *to, const CUserCmd *from )
|
||||||
buf->WriteOneBit( 0 );
|
buf->WriteOneBit( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int entityCount = 0;
|
|
||||||
#ifdef CLIENT_DLL
|
#ifdef CLIENT_DLL
|
||||||
|
int highestEntityIndex = 0;
|
||||||
if (cl_entitylist)
|
if (cl_entitylist)
|
||||||
entityCount = cl_entitylist->GetHighestEntityIndex();
|
highestEntityIndex = cl_entitylist->GetHighestEntityIndex();
|
||||||
#else
|
#else
|
||||||
entityCount = MAX_EDICTS;
|
static constexpr auto highestEntityIndex = MAX_EDICTS-1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
buf->WriteSignedVarInt32(entityCount);
|
// Write entity count
|
||||||
|
buf->WriteUBitLong(highestEntityIndex, 11);
|
||||||
|
|
||||||
if (entityCount > 0)
|
// Write finally simulation data with entity index
|
||||||
|
for (unsigned int i = 0; i <= highestEntityIndex; i++)
|
||||||
{
|
{
|
||||||
for (int i = 0; i <= entityCount; i++)
|
if (from->simulationdata[i].m_flInterpolatedSimulationTime
|
||||||
{
|
!= to->simulationdata[i].m_flInterpolatedSimulationTime)
|
||||||
if (to->simulationdata[i].m_flInterpolatedSimulationTime
|
|
||||||
!= from->simulationdata[i].m_flInterpolatedSimulationTime)
|
|
||||||
{
|
{
|
||||||
buf->WriteOneBit(1);
|
buf->WriteOneBit(1);
|
||||||
buf->WriteFloat(
|
buf->WriteBitFloat(to->simulationdata[i].m_flInterpolatedSimulationTime);
|
||||||
to->simulationdata[i].m_flInterpolatedSimulationTime);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buf->WriteOneBit(0);
|
buf->WriteOneBit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (to->simulationdata[i].m_flSimulationTime
|
if (from->simulationdata[i].m_flSimulationTime != to->simulationdata[i].m_flSimulationTime)
|
||||||
!= from->simulationdata[i].m_flSimulationTime)
|
|
||||||
{
|
{
|
||||||
buf->WriteOneBit(1);
|
buf->WriteOneBit(1);
|
||||||
buf->WriteFloat(to->simulationdata[i].m_flSimulationTime);
|
buf->WriteBitFloat(to->simulationdata[i].m_flSimulationTime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buf->WriteOneBit(0);
|
buf->WriteOneBit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ( to->debug_hitboxes != from->debug_hitboxes )
|
if (to->debug_hitboxes != from->debug_hitboxes)
|
||||||
{
|
{
|
||||||
buf->WriteOneBit( 1 );
|
buf->WriteOneBit(1);
|
||||||
buf->WriteByte( to->debug_hitboxes );
|
buf->WriteUBitLong(to->debug_hitboxes, 2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buf->WriteOneBit( 0 );
|
buf->WriteOneBit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined( HL2_CLIENT_DLL )
|
#if defined( HL2_CLIENT_DLL )
|
||||||
|
@ -346,29 +345,24 @@ void ReadUsercmd( bf_read *buf, CUserCmd *move, CUserCmd *from )
|
||||||
move->mousedy = buf->ReadShort();
|
move->mousedy = buf->ReadShort();
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto entityCount = buf->ReadSignedVarInt32();
|
const auto highestEntityIndex = buf->ReadUBitLong(11);
|
||||||
|
|
||||||
if (entityCount > 0)
|
for (unsigned int i = 0; i <= highestEntityIndex;i++)
|
||||||
{
|
|
||||||
for (int i = 0; i <= entityCount; i++)
|
|
||||||
{
|
{
|
||||||
if (buf->ReadOneBit())
|
if (buf->ReadOneBit())
|
||||||
{
|
{
|
||||||
move->simulationdata[i].m_flInterpolatedSimulationTime = buf
|
move->simulationdata[i].m_flInterpolatedSimulationTime = buf->ReadBitFloat();
|
||||||
->ReadFloat();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buf->ReadOneBit())
|
if (buf->ReadOneBit())
|
||||||
{
|
{
|
||||||
move->simulationdata[i].m_flSimulationTime = buf
|
move->simulationdata[i].m_flSimulationTime = buf->ReadBitFloat();
|
||||||
->ReadFloat();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( buf->ReadOneBit() )
|
if ( buf->ReadOneBit() )
|
||||||
{
|
{
|
||||||
move->debug_hitboxes = (CUserCmd::debug_hitboxes_t)buf->ReadByte();
|
move->debug_hitboxes = (CUserCmd::debug_hitboxes_t)buf->ReadUBitLong(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined( HL2_DLL )
|
#if defined( HL2_DLL )
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue