This commit is contained in:
nephacks
2025-06-04 03:22:50 +02:00
parent f234f23848
commit f12416cffd
14243 changed files with 6446499 additions and 26 deletions

72
public/tools/bonelist.cpp Normal file
View File

@@ -0,0 +1,72 @@
//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======
//
// Purpose:
//
//=============================================================================
#include "cbase.h"
#include "bonelist.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
CBoneList::CBoneList()
{
m_bShouldDelete = false;
m_nBones = 0;
Q_memset( m_vecPos, 0, sizeof( m_vecPos ) );
Q_memset( m_quatRot, 0, sizeof( m_quatRot ) );
}
void CBoneList::Release()
{
if (m_bShouldDelete )
{
delete this;
}
else
{
Warning( "Called Release() on CBoneList not allocated via Alloc() method\n" );
}
}
CBoneList *CBoneList::Alloc()
{
CBoneList *newList = new CBoneList;
Assert( newList );
if ( newList )
{
newList->m_bShouldDelete = true;
}
return newList;
}
CFlexList::CFlexList()
{
m_bShouldDelete = false;
m_nNumFlexes = 0;
Q_memset( m_flexWeights, 0, sizeof( m_flexWeights ) );
}
void CFlexList::Release()
{
if (m_bShouldDelete )
{
delete this;
}
else
{
Warning( "Called Release() on CFlexList not allocated via Alloc() method\n" );
}
}
CFlexList *CFlexList::Alloc()
{
CFlexList *newList = new CFlexList;
Assert( newList );
if ( newList )
{
newList->m_bShouldDelete = true;
}
return newList;
}

61
public/tools/bonelist.h Normal file
View File

@@ -0,0 +1,61 @@
//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======
//
// Purpose:
//
//=============================================================================
#ifndef BONELIST_H
#define BONELIST_H
#ifdef _WIN32
#pragma once
#endif
#include "studio.h"
class CBoneList
{
public:
CBoneList();
void Release();
static CBoneList *Alloc();
unsigned int GetWriteSize() const
{
return 2 + m_nBones * ( sizeof( Vector ) + sizeof( Quaternion ) );
}
// The order of these data members must be maintained in order for the server
// demo system. ServerDemoPacket_BaseAnimating::GetSize() depends on this.
private:
bool m_bShouldDelete : 1;
public:
uint16 m_nBones : 15;
Vector m_vecPos[ MAXSTUDIOBONES ];
Quaternion m_quatRot[ MAXSTUDIOBONES ];
};
class CFlexList
{
public:
CFlexList();
void Release();
static CFlexList *Alloc();
public:
int m_nNumFlexes;
float m_flexWeights[ MAXSTUDIOFLEXCTRL ];
private:
bool m_bShouldDelete;
};
#endif // BONELIST_H