Skip to content

Commit d2a434f

Browse files
committed
It has come to my attention that some of the code from the RDA merge may have been leaked/stolen.
It is a violation of the license we have with Valve to use leaked or stolen code, so five pieces of code have been removed, including the client-side sprite implementation. I have written a new client-side sprite implementation from scratch based on C_ASW_Snow_Volume, so we don't have to lose any features as a result of this.
1 parent 971f2a2 commit d2a434f

10 files changed

Lines changed: 211 additions & 350 deletions

File tree

src/game/client/c_baseanimating.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2734,17 +2734,7 @@ bool C_BaseAnimating::SetupBones( matrix3x4a_t *pBoneToWorldOut, int nMaxBones,
27342734
{
27352735
VPROF_BUDGET( "C_BaseAnimating::SetupBones", ( !g_bInThreadedBoneSetup ) ? VPROF_BUDGETGROUP_CLIENT_ANIMATION : "Client_Animation_Threaded" );
27362736

2737-
//=============================================================================
2738-
// HPE_BEGIN:
2739-
// [pfreese] Added the check for pBoneToWorldOut != NULL in this debug warning
2740-
// code. SetupBones is called in the CSS anytime an attachment wants its
2741-
// parent's transform, hence this warning is hit extremely frequently.
2742-
// I'm not actually sure if this is the right "fix" for this, as the bones are
2743-
// actually accessed as part of the setup process, but since I'm not clear on the
2744-
// purpose of this dev warning, I'm including this comment block.
2745-
//=============================================================================
2746-
2747-
if ( pBoneToWorldOut != NULL && !IsBoneAccessAllowed() )
2737+
if ( !IsBoneAccessAllowed() )
27482738
{
27492739
static float lastWarning = 0.0f;
27502740

src/game/client/c_sprite.cpp

Lines changed: 0 additions & 198 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
#include "tier1/KeyValues.h"
2121
#include "toolframework/itoolframework.h"
2222
#include "toolframework_client.h"
23-
#include "mapentities_shared.h"
24-
#include "gamestringpool.h"
2523

2624
// memdbgon must be the last include file in a .cpp file!!!
2725
#include "tier0/memdbgon.h"
@@ -501,199 +499,3 @@ void CSprite::GetToolRecordingState( KeyValues *msg )
501499

502500
msg->SetPtr( "sprite", &state );
503501
}
504-
505-
CUtlVector< CSprite * > g_ClientsideSprites;
506-
507-
// ===================== For clientside spawning of sprites =====================
508-
void CSprite::RecreateAllClientside()
509-
{
510-
DestroyAllClientside();
511-
ParseAllClientsideEntities( engine->GetMapEntitiesString() );
512-
}
513-
514-
void CSprite::DestroyAllClientside()
515-
{
516-
// This only gets called during LevelInitPostEntity and LevelShutdown so we're going to use
517-
// Release() instead of Remove() or UTIL_Remove
518-
while ( g_ClientsideSprites.Count() > 0 )
519-
{
520-
CSprite *p = g_ClientsideSprites[0];
521-
522-
// This will call into CSprite::~CSprite in sprite.cpp, which will FindAndRemove this sprite from the array
523-
p->Release();
524-
}
525-
}
526-
527-
bool CSprite::InitializeClientside()
528-
{
529-
if ( InitializeAsClientEntity( STRING( GetModelName() ), false ) == false )
530-
{
531-
return false;
532-
}
533-
534-
m_bClientOnly = true;
535-
g_ClientsideSprites.AddToTail( this );
536-
537-
Spawn();
538-
539-
const model_t *mod = GetModel();
540-
if ( mod )
541-
{
542-
Vector mins, maxs;
543-
modelinfo->GetModelBounds( mod, mins, maxs );
544-
SetCollisionBounds( mins, maxs );
545-
}
546-
547-
SetBlocksLOS( false ); // this should be a small object
548-
SetNextClientThink( CLIENT_THINK_NEVER );
549-
550-
return true;
551-
}
552-
553-
554-
const char *CSprite::ParseClientsideEntity( const char *pEntData )
555-
{
556-
CEntityMapData entData( (char*)pEntData );
557-
char className[MAPKEY_MAXLENGTH];
558-
559-
MDLCACHE_CRITICAL_SECTION();
560-
561-
if ( !entData.ExtractValue( "classname", className ) )
562-
{
563-
Error( "classname missing from entity!\n" );
564-
}
565-
566-
if ( !Q_strcmp( className, "env_sprite_clientside" ))
567-
{
568-
char targetName[MAPKEY_MAXLENGTH]{};
569-
char parentName[MAPKEY_MAXLENGTH]{};
570-
entData.ExtractValue( "targetname", targetName );
571-
entData.ExtractValue( "parentname", parentName );
572-
if ( targetName[0] != '\0' || parentName[0] != '\0' )
573-
{
574-
//simply skip
575-
}
576-
else
577-
{
578-
// always force clientside entities placed in maps
579-
CSprite* pEntity = new CSprite();
580-
581-
if ( pEntity )
582-
{
583-
// Set up keyvalues.
584-
pEntity->ParseMapData(&entData);
585-
586-
if ( !pEntity->InitializeClientside() )
587-
pEntity->Release();
588-
589-
return entData.CurrentBufferPosition();
590-
}
591-
}
592-
}
593-
594-
595-
// Just skip past all the keys.
596-
char keyName[MAPKEY_MAXLENGTH];
597-
char value[MAPKEY_MAXLENGTH];
598-
if ( entData.GetFirstKey(keyName, value) )
599-
{
600-
do
601-
{
602-
}
603-
while ( entData.GetNextKey(keyName, value) );
604-
}
605-
606-
//
607-
// Return the current parser position in the data block
608-
//
609-
return entData.CurrentBufferPosition();
610-
}
611-
612-
bool CSprite::KeyValue( const char *szKeyName, const char *szValue )
613-
{
614-
if ( FStrEq( szKeyName, "scale" ) )
615-
{
616-
m_flSpriteScale = atof(szValue);
617-
}
618-
else if ( FStrEq( szKeyName, "framerate" ) )
619-
{
620-
m_flSpriteFramerate = atof(szValue);
621-
}
622-
else if ( FStrEq( szKeyName, "GlowProxySize" ) )
623-
{
624-
m_flGlowProxySize = atof(szValue);
625-
}
626-
else if ( FStrEq( szKeyName, "frame" ) )
627-
{
628-
m_flFrame = atof(szValue);
629-
}
630-
else if ( FStrEq( szKeyName, "HDRColorScale" ) )
631-
{
632-
m_flHDRColorScale = atof(szValue);
633-
}
634-
else if ( FStrEq( szKeyName, "rendermode" ) )
635-
{
636-
SetRenderMode( (RenderMode_t) atoi( szValue ) );
637-
}
638-
else if ( FStrEq( szKeyName, "model" ) )
639-
{
640-
SetModelName( AllocPooledString( szValue ) );
641-
}
642-
else if ( FStrEq( szKeyName, "spritecontroller" ) )
643-
{
644-
m_iszSpriteControllerName = AllocPooledString( szValue );
645-
}
646-
else if ( ( FStrEq( szKeyName, "targetname" ) || FStrEq( szKeyName, "parentname" ) ) && *szValue )
647-
{
648-
Warning( "LEVEL DESIGN ERROR: env_sprite_clientside has %s '%s' - use env_sprite instead.\n", szKeyName, szValue );
649-
}
650-
else
651-
{
652-
return BaseClass::KeyValue( szKeyName, szValue );
653-
}
654-
655-
return true;
656-
}
657-
658-
//-----------------------------------------------------------------------------
659-
// Purpose: Only called on BSP load. Parses and spawns all the entities in the BSP.
660-
// Input : pMapData - Pointer to the entity data block to parse.
661-
//-----------------------------------------------------------------------------
662-
void CSprite::ParseAllClientsideEntities(const char *pMapData)
663-
{
664-
int nEntities = 0;
665-
666-
char szTokenBuffer[MAPKEY_MAXLENGTH];
667-
668-
//
669-
// Loop through all entities in the map data, creating each.
670-
//
671-
for ( ; true; pMapData = MapEntity_SkipToNextEntity( pMapData, szTokenBuffer ) )
672-
{
673-
//
674-
// Parse the opening brace.
675-
//
676-
char token[MAPKEY_MAXLENGTH];
677-
pMapData = MapEntity_ParseToken( pMapData, token );
678-
679-
//
680-
// Check to see if we've finished or not.
681-
//
682-
if ( !pMapData )
683-
break;
684-
685-
if ( token[0] != '{' )
686-
{
687-
Error( "CSprite::ParseAllEntities: found %s when expecting {", token);
688-
continue;
689-
}
690-
691-
//
692-
// Parse the entity and add it to the spawn list.
693-
//
694-
695-
pMapData = ParseClientsideEntity( pMapData );
696-
697-
nEntities++;
698-
}
699-
}

src/game/client/cdll_client_int.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
#include "GameStats.h"
101101
#include "videocfg/videocfg.h"
102102
#include "tier2/tier2_logging.h"
103-
#include "Sprite.h"
104103
#include "vscript/ivscript.h"
105104
#include "activitylist.h"
106105
#include "eventlist.h"
@@ -1886,7 +1885,6 @@ void CHLClient::LevelInitPostEntity( )
18861885

18871886
IGameSystem::LevelInitPostEntityAllSystems();
18881887
C_PhysPropClientside::RecreateAll();
1889-
C_Sprite::RecreateAllClientside();
18901888

18911889
for ( int hh = 0; hh < MAX_SPLITSCREEN_PLAYERS; ++hh )
18921890
{
@@ -1929,7 +1927,6 @@ void CHLClient::LevelShutdown( void )
19291927
// First do the pre-entity shutdown of all systems
19301928
IGameSystem::LevelShutdownPreEntityAllSystems();
19311929

1932-
C_Sprite::DestroyAllClientside();
19331930
C_PhysPropClientside::DestroyAll();
19341931

19351932
modemanager->LevelShutdown();

src/game/client/cdll_util.cpp

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -342,24 +342,6 @@ void UTIL_Tracer( const Vector &vecStart, const Vector &vecEnd, int iEntIndex, i
342342
}
343343
}
344344

345-
// Tried to include this in the actual trace function, but ran into
346-
// linker issues. Just dropped it here instead. Michael Dorgan
347-
348-
static bool HasValidDirection(trace_t *pTrace)
349-
{
350-
if(pTrace->fraction <= 0.0001f)
351-
{
352-
// Ok, there is a very, very strong chance our vectors are out of wack
353-
// Add a direct check against the actual start and end points to be sure.
354-
if( VectorsAreEqual( pTrace->startpos, pTrace->endpos, 0.0001f ) )
355-
{
356-
return false;
357-
}
358-
}
359-
360-
return true;
361-
}
362-
363345
//------------------------------------------------------------------------------
364346
// Purpose : Creates both an decal and any associated impact effects (such
365347
// as flecks) for the given iDamageType and the trace's end position
@@ -374,12 +356,7 @@ void UTIL_ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName
374356
if ( !pEntity || (pTrace->surface.flags & SURF_SKY) )
375357
return;
376358

377-
if (pTrace->fraction >= 1.0f)
378-
return;
379-
380-
// Very, very, very close range shots cause all sorts of issues with normal and correct
381-
// decal orientation. Just skip them to prevent heartache.
382-
if ( !HasValidDirection(pTrace) )
359+
if (pTrace->fraction == 1.0f)
383360
return;
384361

385362
// don't decal nodraw surfaces

src/game/client/swarm/asw_client_entities.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "tier0/vprof.h"
1010
#include "asw_client_entities.h"
1111
#include "c_asw_camera_volume.h"
12+
#include "Sprite.h"
1213
#include "c_asw_snow_volume.h"
1314
#include "c_asw_scanner_noise.h"
1415

@@ -23,14 +24,14 @@ void CASW_Client_Entities::LevelInitPostEntity()
2324
{
2425
//C_ASW_Camera_Volume::RecreateAll();
2526
C_ASW_Snow_Volume::RecreateAll();
26-
//C_Sprite::RecreateAll();
27+
C_Sprite_ClientSide::RecreateAll();
2728
C_ASW_Scanner_Noise::RecreateAll();
2829
}
2930

3031
void CASW_Client_Entities::LevelShutdownPreEntity()
3132
{
32-
//C_ASW_Camera_Volume::DestroyAll();
33-
C_ASW_Snow_Volume::DestroyAll();
34-
//C_Sprite::DestroyAll();
33+
//C_ASW_Camera_Volume::DestroyAll();
34+
C_ASW_Snow_Volume::DestroyAll();
35+
C_Sprite_ClientSide::DestroyAll();
3536
C_ASW_Scanner_Noise::DestroyAll();
3637
}

src/game/server/baseentity.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6948,15 +6948,6 @@ void CBaseEntity::UpdateCell()
69486948
m_cellX = CellFromCoord( cellwidth, m_vecOrigin.GetX() );
69496949
m_cellY = CellFromCoord( cellwidth, m_vecOrigin.GetY() );
69506950
m_cellZ = CellFromCoord( cellwidth, m_vecOrigin.GetZ() );
6951-
6952-
6953-
// PRB TODO : HACK fix for hostage warping.
6954-
// Somehow the above code does not flag the network vars as modified, but below does...
6955-
// Needs revisiting, but at this stage it fixes our bug
6956-
6957-
m_cellX.GetForModify();
6958-
m_cellY.GetForModify();
6959-
m_cellZ.GetForModify();
69606951
}
69616952

69626953
//-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)