Multiple compilation errors fixes #1

This commit is contained in:
L 2023-04-30 01:42:57 +02:00
parent c3e027c54f
commit abfb82f340
13 changed files with 893 additions and 1476 deletions

View file

@ -28,13 +28,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Container <int> cachedModelList;
Vector vec_zero = "0 0 0";
refEntity_t *current_entity = NULL;
int current_entity_number = -1;
centity_t *current_centity = NULL;
float current_scale = -1;
int current_tiki = -1;
dtiki_t* current_tiki = -1;
cvar_t *cg_showtempmodels;
cvar_t *cg_showemitters;
cvar_t *cg_physics_fps;
@ -961,110 +959,110 @@ Event EV_Client_Print
CLASS_DECLARATION( Listener, ClientGameCommandManager, NULL )
{
{ &EV_Client_StartBlock, StartBlock },
{ &EV_Client_EndBlock, EndBlock },
{ &EV_Client_EmitterStartOff, EmitterStartOff },
{ &EV_Client_OriginSpawn, BeginOriginSpawn },
{ &EV_Client_OriginBeamSpawn, BeginOriginBeamSpawn },
{ &EV_Client_OriginBeamEmitter, BeginOriginBeamEmitter },
{ &EV_Client_TagSpawn, BeginTagSpawn },
{ &EV_Client_TagEmitter, BeginTagEmitter },
{ &EV_Client_BeginTagBeamEmitter, BeginTagBeamEmitter },
{ &EV_Client_BeginTagBeamSpawn, BeginTagBeamSpawn },
{ &EV_Client_OriginEmitter, BeginOriginEmitter },
{ &EV_Client_EmitterOn, EmitterOn },
{ &EV_Client_EmitterOff, EmitterOff },
{ &EV_Client_SetAlpha, SetAlpha },
{ &EV_Client_SetDieTouch, SetDieTouch },
{ &EV_Client_SetBounceFactor, SetBounceFactor },
{ &EV_Client_SetBounceSound, SetBounceSound },
{ &EV_Client_SetBounceSoundOnce, SetBounceSoundOnce },
{ &EV_Client_SetScale, SetScale },
{ &EV_Client_SetScaleUpDown, SetScaleUpDown },
{ &EV_Client_SetScaleMin, SetScaleMin },
{ &EV_Client_SetScaleMax, SetScaleMax },
{ &EV_Client_SetModel, SetModel },
{ &EV_Client_SetLife, SetLife },
{ &EV_Client_SetColor, SetColor },
{ &EV_Client_SetVelocity, SetVelocity },
{ &EV_Client_SetAngularVelocity, SetAngularVelocity },
{ &EV_Client_SetRandomVelocity, SetRandomVelocity },
{ &EV_Client_SetRandomVelocityAlongAxis, SetRandomVelocityAlongAxis },
{ &EV_Client_SetAccel, SetAccel },
{ &EV_Client_SetCount, SetCount },
{ &EV_Client_SetTraceCount, SetTraceCount },
{ &EV_Client_SetFade, SetFade },
{ &EV_Client_SetFadeDelay, SetFadeDelay },
{ &EV_Client_SetFadeIn, SetFadeIn },
{ &EV_Client_SetTwinkle, SetTwinkle },
{ &EV_Client_SetTrail, SetTrail },
{ &EV_Client_SetSpawnRate, SetSpawnRate },
{ &EV_Client_SetScaleRate, SetScaleRate },
{ &EV_Client_SetOriginOffset, SetOriginOffset },
{ &EV_Client_SetSphere, SetSphere },
{ &EV_Client_SetCircle, SetCircle },
{ &EV_Client_SetInwardSphere, SetInwardSphere },
{ &EV_Client_SetRadius, SetRadius },
{ &EV_Client_SetWavy, SetWavy },
{ &EV_Client_SetSwarm, SetSwarm },
{ &EV_Client_SetAlign, SetAlign },
{ &EV_Client_SetAlignOnce, SetAlignOnce },
{ &EV_Client_SetCollision, SetCollision },
{ &EV_Client_SetFlickerAlpha, SetFlickerAlpha },
{ &EV_Client_Sound, Sound },
{ &EV_Client_StopSound, StopSound },
{ &EV_Client_LoopSound, LoopSound },
{ &EV_Client_Cache, Cache },
{ &EV_Client_AliasCache, AliasCache },
{ &EV_Client_Alias, Alias },
{ &EV_Client_Footstep, Footstep },
{ &EV_Client_Client, Client },
{ &EV_Client_TagDynamicLight, TagDynamicLight },
{ &EV_Client_OriginDynamicLight, OriginDynamicLight },
{ &EV_Client_DynamicLight, DynamicLight },
{ &EV_Client_SetEntityColor, SetEntityColor },
{ &EV_Client_SetGlobalFade, SetGlobalFade },
{ &EV_Client_SetParentLink, SetParentLink },
{ &EV_Client_SetHardLink, SetHardLink },
{ &EV_Client_SetRandomRoll, SetRandomRoll },
{ &EV_Client_SetAngles, SetAngles },
{ &EV_Client_ParentAngles, ParentAngles },
{ &EV_Client_Swipe, Swipe },
{ &EV_Client_SwipeOn, SwipeOn },
{ &EV_Client_SwipeOff, SwipeOff },
{ &EV_Client_SetAnim, SetAnim },
{ &EV_Client_AnimateOnce, AnimateOnce },
{ &EV_Client_SetSubdivisions, SetSubdivisions },
{ &EV_Client_SetMinOffset, SetMinOffset },
{ &EV_Client_SetMaxOffset, SetMaxOffset },
{ &EV_Client_SetBeamShader, SetShader },
{ &EV_Client_SetBeamLength, SetLength },
{ &EV_Client_SetDecalShader, SetShader },
{ &EV_Client_SetTraceLength, SetLength },
{ &EV_Client_SetBeamDelay, SetBeamDelay },
{ &EV_Client_SetBeamToggleDelay, SetBeamToggleDelay },
{ &EV_Client_SetBeamPersist, SetBeamPersist },
{ &EV_Client_SetBeamOffsetEndpoints, SetBeamOffsetEndpoints },
{ &EV_Client_BeamSphere, SetBeamSphere },
{ &EV_Client_Spread, SetSpread },
{ &EV_Client_UseLastTraceEnd, SetUseLastTraceEnd },
{ &EV_Client_OffsetAlongAxis, SetOffsetAlongAxis },
{ &EV_Client_SetEndAlpha, SetEndAlpha },
{ &EV_Client_RandomChance, RandomChance },
{ &EV_Client_CommandDelay, CommandDelay },
{ &EV_Client_TagTraceImpactMark, BeginTagTraceImpactMark },
{ &EV_Client_BounceDecal, SetBounceDecal },
{ &EV_Client_SetDecalRadius, SetDecalRadius },
{ &EV_Client_SetDecalOrientation, SetDecalOrientation },
{ &EV_Client_TagTraceImpactSpawn, BeginTagTraceImpactSpawn },
{ &EV_Client_TagTraceImpactSound, TagTraceImpactSound },
{ &EV_Client_TagList, TagList },
{ &EV_Client_Lightstyle, SetLightstyle },
{ &EV_Client_DuplicateCount, SetDuplicateCount },
{ &EV_Client_PhysicsRate, SetPhysicsRate },
{ &EV_Client_Parallel, SetParallel },
{ &EV_Client_Detail, SetDetail },
{ &EV_Client_Print, Print },
{ &EV_Client_StartBlock, &ClientGameCommandManager::StartBlock },
{ &EV_Client_EndBlock, &ClientGameCommandManager::EndBlock },
{ &EV_Client_EmitterStartOff, &ClientGameCommandManager::EmitterStartOff },
{ &EV_Client_OriginSpawn, &ClientGameCommandManager::BeginOriginSpawn },
{ &EV_Client_OriginBeamSpawn, &ClientGameCommandManager::BeginOriginBeamSpawn },
{ &EV_Client_OriginBeamEmitter, &ClientGameCommandManager::BeginOriginBeamEmitter },
{ &EV_Client_TagSpawn, &ClientGameCommandManager::BeginTagSpawn },
{ &EV_Client_TagEmitter, &ClientGameCommandManager::BeginTagEmitter },
{ &EV_Client_BeginTagBeamEmitter, &ClientGameCommandManager::BeginTagBeamEmitter },
{ &EV_Client_BeginTagBeamSpawn, &ClientGameCommandManager::BeginTagBeamSpawn },
{ &EV_Client_OriginEmitter, &ClientGameCommandManager::BeginOriginEmitter },
{ &EV_Client_EmitterOn, &ClientGameCommandManager::EmitterOn },
{ &EV_Client_EmitterOff, &ClientGameCommandManager::EmitterOff },
{ &EV_Client_SetAlpha, &ClientGameCommandManager::SetAlpha },
{ &EV_Client_SetDieTouch, &ClientGameCommandManager::SetDieTouch },
{ &EV_Client_SetBounceFactor, &ClientGameCommandManager::SetBounceFactor },
{ &EV_Client_SetBounceSound, &ClientGameCommandManager::SetBounceSound },
{ &EV_Client_SetBounceSoundOnce, &ClientGameCommandManager::SetBounceSoundOnce },
{ &EV_Client_SetScale, &ClientGameCommandManager::SetScale },
{ &EV_Client_SetScaleUpDown, &ClientGameCommandManager::SetScaleUpDown },
{ &EV_Client_SetScaleMin, &ClientGameCommandManager::SetScaleMin },
{ &EV_Client_SetScaleMax, &ClientGameCommandManager::SetScaleMax },
{ &EV_Client_SetModel, &ClientGameCommandManager::SetModel },
{ &EV_Client_SetLife, &ClientGameCommandManager::SetLife },
{ &EV_Client_SetColor, &ClientGameCommandManager::SetColor },
{ &EV_Client_SetVelocity, &ClientGameCommandManager::SetVelocity },
{ &EV_Client_SetAngularVelocity, &ClientGameCommandManager::SetAngularVelocity },
{ &EV_Client_SetRandomVelocity, &ClientGameCommandManager::SetRandomVelocity },
{ &EV_Client_SetRandomVelocityAlongAxis, &ClientGameCommandManager::SetRandomVelocityAlongAxis },
{ &EV_Client_SetAccel, &ClientGameCommandManager::SetAccel },
{ &EV_Client_SetCount, &ClientGameCommandManager::SetCount },
{ &EV_Client_SetTraceCount, &ClientGameCommandManager::SetTraceCount },
{ &EV_Client_SetFade, &ClientGameCommandManager::SetFade },
{ &EV_Client_SetFadeDelay, &ClientGameCommandManager::SetFadeDelay },
{ &EV_Client_SetFadeIn, &ClientGameCommandManager::SetFadeIn },
{ &EV_Client_SetTwinkle, &ClientGameCommandManager::SetTwinkle },
{ &EV_Client_SetTrail, &ClientGameCommandManager::SetTrail },
{ &EV_Client_SetSpawnRate, &ClientGameCommandManager::SetSpawnRate },
{ &EV_Client_SetScaleRate, &ClientGameCommandManager::SetScaleRate },
{ &EV_Client_SetOriginOffset, &ClientGameCommandManager::SetOriginOffset },
{ &EV_Client_SetSphere, &ClientGameCommandManager::SetSphere },
{ &EV_Client_SetCircle, &ClientGameCommandManager::SetCircle },
{ &EV_Client_SetInwardSphere, &ClientGameCommandManager::SetInwardSphere },
{ &EV_Client_SetRadius, &ClientGameCommandManager::SetRadius },
{ &EV_Client_SetWavy, &ClientGameCommandManager::SetWavy },
{ &EV_Client_SetSwarm, &ClientGameCommandManager::SetSwarm },
{ &EV_Client_SetAlign, &ClientGameCommandManager::SetAlign },
{ &EV_Client_SetAlignOnce, &ClientGameCommandManager::SetAlignOnce },
{ &EV_Client_SetCollision, &ClientGameCommandManager::SetCollision },
{ &EV_Client_SetFlickerAlpha, &ClientGameCommandManager::SetFlickerAlpha },
{ &EV_Client_Sound, &ClientGameCommandManager::Sound },
{ &EV_Client_StopSound, &ClientGameCommandManager::StopSound },
{ &EV_Client_LoopSound, &ClientGameCommandManager::LoopSound },
{ &EV_Client_Cache, &ClientGameCommandManager::Cache },
{ &EV_Client_AliasCache, &ClientGameCommandManager::AliasCache },
{ &EV_Client_Alias, &ClientGameCommandManager::Alias },
{ &EV_Client_Footstep, &ClientGameCommandManager::Footstep },
{ &EV_Client_Client, &ClientGameCommandManager::Client },
{ &EV_Client_TagDynamicLight, &ClientGameCommandManager::TagDynamicLight },
{ &EV_Client_OriginDynamicLight, &ClientGameCommandManager::OriginDynamicLight },
{ &EV_Client_DynamicLight, &ClientGameCommandManager::DynamicLight },
{ &EV_Client_SetEntityColor, &ClientGameCommandManager::SetEntityColor },
{ &EV_Client_SetGlobalFade, &ClientGameCommandManager::SetGlobalFade },
{ &EV_Client_SetParentLink, &ClientGameCommandManager::SetParentLink },
{ &EV_Client_SetHardLink, &ClientGameCommandManager::SetHardLink },
{ &EV_Client_SetRandomRoll, &ClientGameCommandManager::SetRandomRoll },
{ &EV_Client_SetAngles, &ClientGameCommandManager::SetAngles },
{ &EV_Client_ParentAngles, &ClientGameCommandManager::ParentAngles },
{ &EV_Client_Swipe, &ClientGameCommandManager::Swipe },
{ &EV_Client_SwipeOn, &ClientGameCommandManager::SwipeOn },
{ &EV_Client_SwipeOff, &ClientGameCommandManager::SwipeOff },
{ &EV_Client_SetAnim, &ClientGameCommandManager::SetAnim },
{ &EV_Client_AnimateOnce, &ClientGameCommandManager::AnimateOnce },
{ &EV_Client_SetSubdivisions, &ClientGameCommandManager::SetSubdivisions },
{ &EV_Client_SetMinOffset, &ClientGameCommandManager::SetMinOffset },
{ &EV_Client_SetMaxOffset, &ClientGameCommandManager::SetMaxOffset },
{ &EV_Client_SetBeamShader, &ClientGameCommandManager::SetShader },
{ &EV_Client_SetBeamLength, &ClientGameCommandManager::SetLength },
{ &EV_Client_SetDecalShader, &ClientGameCommandManager::SetShader },
{ &EV_Client_SetTraceLength, &ClientGameCommandManager::SetLength },
{ &EV_Client_SetBeamDelay, &ClientGameCommandManager::SetBeamDelay },
{ &EV_Client_SetBeamToggleDelay, &ClientGameCommandManager::SetBeamToggleDelay },
{ &EV_Client_SetBeamPersist, &ClientGameCommandManager::SetBeamPersist },
{ &EV_Client_SetBeamOffsetEndpoints, &ClientGameCommandManager::SetBeamOffsetEndpoints },
{ &EV_Client_BeamSphere, &ClientGameCommandManager::SetBeamSphere },
{ &EV_Client_Spread, &ClientGameCommandManager::SetSpread },
{ &EV_Client_UseLastTraceEnd, &ClientGameCommandManager::SetUseLastTraceEnd },
{ &EV_Client_OffsetAlongAxis, &ClientGameCommandManager::SetOffsetAlongAxis },
{ &EV_Client_SetEndAlpha, &ClientGameCommandManager::SetEndAlpha },
{ &EV_Client_RandomChance, &ClientGameCommandManager::RandomChance },
{ &EV_Client_CommandDelay, &ClientGameCommandManager::CommandDelay },
{ &EV_Client_TagTraceImpactMark, &ClientGameCommandManager::BeginTagTraceImpactMark },
{ &EV_Client_BounceDecal, &ClientGameCommandManager::SetBounceDecal },
{ &EV_Client_SetDecalRadius, &ClientGameCommandManager::SetDecalRadius },
{ &EV_Client_SetDecalOrientation, &ClientGameCommandManager::SetDecalOrientation },
{ &EV_Client_TagTraceImpactSpawn, &ClientGameCommandManager::BeginTagTraceImpactSpawn },
{ &EV_Client_TagTraceImpactSound, &ClientGameCommandManager::TagTraceImpactSound },
{ &EV_Client_TagList, &ClientGameCommandManager::TagList },
{ &EV_Client_Lightstyle, &ClientGameCommandManager::SetLightstyle },
{ &EV_Client_DuplicateCount, &ClientGameCommandManager::SetDuplicateCount },
{ &EV_Client_PhysicsRate, &ClientGameCommandManager::SetPhysicsRate },
{ &EV_Client_Parallel, &ClientGameCommandManager::SetParallel },
{ &EV_Client_Detail, &ClientGameCommandManager::SetDetail },
{ &EV_Client_Print, &ClientGameCommandManager::Print },
{ NULL, NULL }
};
@ -1272,7 +1270,7 @@ void ClientGameCommandManager::BeginTagTraceImpactMark
)
{
// Setup ending function
endblockfcn = EndTagTraceImpactMark;
endblockfcn = &ClientGameCommandManager::EndTagTraceImpactMark;
m_spawnthing = InitializeSpawnthing( &m_localemitter );
// Get the tagname and orientation
@ -1348,7 +1346,7 @@ void ClientGameCommandManager::BeginTagTraceImpactSpawn
)
{
// Setup ending function
endblockfcn = EndTagTraceImpactSpawn;
endblockfcn = &ClientGameCommandManager::EndTagTraceImpactSpawn;
m_spawnthing = InitializeSpawnthing( &m_localemitter );
// Get the tagname and orientation
@ -2725,7 +2723,7 @@ void ClientGameCommandManager::BeginOriginSpawn
}
// Setup ending function
endblockfcn = EndOriginSpawn;
endblockfcn = &ClientGameCommandManager::EndOriginSpawn;
// Init the thing we are going to spawn
m_spawnthing = InitializeSpawnthing( &m_localemitter );
@ -2789,7 +2787,7 @@ void ClientGameCommandManager::BeginTagEmitter
{
// Setup ending function
endblockfcn = EndTagEmitter;
endblockfcn = &ClientGameCommandManager::EndTagEmitter;
// Init the emitter
m_spawnthing = CreateNewEmitter();
@ -2833,7 +2831,7 @@ void ClientGameCommandManager::BeginTagBeamEmitter
{
// Setup ending function
endblockfcn = EndTagBeamEmitter;
endblockfcn = &ClientGameCommandManager::EndTagBeamEmitter;
// Init the emitter
m_spawnthing = CreateNewEmitter();
@ -2891,7 +2889,7 @@ void ClientGameCommandManager::BeginOriginEmitter
{
// Setup ending function
endblockfcn = EndOriginEmitter;
endblockfcn = &ClientGameCommandManager::EndOriginEmitter;
// Init the emitter
m_spawnthing = CreateNewEmitter();
@ -2932,7 +2930,7 @@ void ClientGameCommandManager::BeginOriginBeamEmitter
{
// Setup ending function
endblockfcn = EndOriginBeamEmitter;
endblockfcn = &ClientGameCommandManager::EndOriginBeamEmitter;
// Init the emitter
m_spawnthing = CreateNewEmitter();
@ -3028,7 +3026,7 @@ void ClientGameCommandManager::BeginTagSpawn
str tagname;
// Setup ending function
endblockfcn = EndTagSpawn;
endblockfcn = &ClientGameCommandManager::EndTagSpawn;
// Init the thing we are going to spawn
m_spawnthing = InitializeSpawnthing( &m_localemitter );
@ -3063,7 +3061,7 @@ void ClientGameCommandManager::BeginTagBeamSpawn
str tagname;
// Setup ending function
endblockfcn = EndTagBeamSpawn;
endblockfcn = &ClientGameCommandManager::EndTagBeamSpawn;
// Init the thing we are going to spawn
m_spawnthing = InitializeSpawnthing( &m_localemitter );
@ -3161,7 +3159,7 @@ void ClientGameCommandManager::BeginOriginBeamSpawn
{
// Setup ending function
endblockfcn = EndOriginBeamSpawn;
endblockfcn = &ClientGameCommandManager::EndOriginBeamSpawn;
// Init the emitter
m_spawnthing = CreateNewEmitter();
@ -5236,7 +5234,7 @@ void ClientGameCommandManager::UpdateBeam
//===============
void ClientGameCommandManager::UpdateEmitter
(
int tikihandle,
dtiki_t* tiki,
vec3_t axis[3],
int entity_number,
int parent_number,
@ -5628,27 +5626,36 @@ void CG_ProcessInitCommands
//=================
//CG_UpdateEntity
//=================
void CG_UpdateEntity
void CG_UpdateEntityEmitters
(
int tikihandle,
int entnum,
refEntity_t *ent,
centity_t *cent
)
{
refEntity_t* old_entity = current_entity;
dtiki_t* old_tiki = current_tiki;
int oldnum = current_entity_number;
centity_t* oldcent = current_centity;
// Check to see if this model has any emitters
current_entity = ent;
current_tiki = tikihandle;
current_tiki = ent->tiki;
current_centity = cent;
current_entity_number = entnum;
if ( cent->currentState.parent != ENTITYNUM_NONE )
{
commandManager.UpdateEmitter( tikihandle, ent->axis, cent->currentState.number, cent->currentState.parent, ent->origin );
commandManager.UpdateEmitter(ent->tiki, ent->axis, cent->currentState.number, cent->currentState.parent, ent->origin );
}
else
{
commandManager.UpdateEmitter( tikihandle, ent->axis, cent->currentState.number, cent->currentState.parent, cent->lerpOrigin );
commandManager.UpdateEmitter(ent->tiki, ent->axis, cent->currentState.number, cent->currentState.parent, cent->lerpOrigin );
}
current_entity = NULL;
current_tiki = -1;
current_entity = old_entity;
current_tiki = old_tiki;
current_centity = oldcent;
current_entity_number = oldnum;
}
extern "C"

View file

@ -794,7 +794,7 @@ class ClientGameCommandManager : public Listener
ClientGameCommandManager();
void AddTempModels( void );
void UpdateEmitter( int tikihandle, vec3_t axis[3], int entity_number, int parent_number, Vector entity_origin );
void UpdateEmitter( dtiki_t* tiki, vec3_t axis[3], int entity_number, int parent_number, Vector entity_origin );
void UpdateBeam( int tikihandle, int entity_number, spawnthing_t *beamthing );
void PlaySound( str sound_name, vec3_t *origin=NULL, int channel = CHAN_AUTO, float volume = -1, float min_distance = -1 );

View file

@ -202,33 +202,6 @@ void CG_AddTestModel (void) {
#endif
/*
=================
CG_FlushModels_f
=================
*/
void CG_FlushModels_f( void )
{
int i;
// clear any tiki handles to bad values
memset( &cgs.model_tiki, -1, sizeof( cgs.model_tiki ) );
// reset all emitters
CG_FlushCommandManager();
// flush all the tikis
cgi.FlushAll();
// go through all the models and process them
for ( i = CS_MODELS ; i < MAX_MODELS ; i++ )
{
CG_ProcessConfigString( i );
}
}
typedef struct {
char *cmd;
void (*function)(void);
@ -258,7 +231,6 @@ static consoleCommand_t commands[] = {
{ "cg_dumpallclasses", CG_DumpAllClasses_f },
{ "testemitter", CG_TestEmitter_f },
{ "dumpemitter", CG_DumpEmitter_f },
{ "flushtikis", CG_FlushModels_f }
};

View file

@ -153,18 +153,18 @@ CG_General
void CG_General( centity_t *cent ) {
refEntity_t ent;
entityState_t *s1;
int i;
int tikihandle;
int i;
vec3_t vMins, vMaxs, vTmp;
s1 = &cent->currentState;
// add loop sound
if ( s1->loopSound )
{
cgi.S_AddLoopingSound( cent->lerpOrigin, vec3_origin, cgs.sound_precache[s1->loopSound], s1->loopSoundVolume, s1->loopSoundMinDist );
cgi.S_AddLoopingSound( cent->lerpOrigin, vec3_origin, cgs.sound_precache[s1->loopSound], s1->loopSoundVolume, s1->loopSoundMinDist, s1->loopSoundMaxDist, s1->loopSoundPitch, s1->loopSoundFlags );
}
if ( cent->tikiLoopSound )
cgi.S_AddLoopingSound( cent->lerpOrigin, vec3_origin, cent->tikiLoopSound, cent->tikiLoopSoundVolume, cent->tikiLoopSoundMinDist );
cgi.S_AddLoopingSound( cent->lerpOrigin, vec3_origin, cent->tikiLoopSound, cent->tikiLoopSoundVolume, cent->tikiLoopSoundMinDist, cent->tikiLoopSoundMaxDist, cent->tikiLoopSoundPitch, cent->tikiLoopSoundFlags );
// if set to invisible, skip
if (!s1->modelindex) {
@ -175,17 +175,20 @@ void CG_General( centity_t *cent ) {
// set frame
ent.frame = s1->frame;
ent.oldframe = ent.frame;
ent.backlerp = 0;
ent.uselegs = qtrue;
ent.wasframe = s1->wasframe;
VectorCopy( cent->lerpOrigin, ent.origin);
VectorCopy( cent->lerpOrigin, ent.oldorigin);
// set skin
ent.skinNum = s1->skinNum;
ent.customSkin = 0;
IntegerToBoundingBox(s1->solid, vMins, vMaxs);
VectorSubtract(vMins, vMaxs, vTmp);
ent.lightingOrigin[0] = ent.origin[0] + (vMins[0] + vMaxs[0]) * 0.5;
ent.lightingOrigin[1] = ent.origin[1] + (vMins[1] + vMaxs[1]) * 0.5;
ent.lightingOrigin[2] = ent.origin[2] + (vMins[2] + vMaxs[2]) * 0.5;
ent.radius = VectorLength(vTmp) * 0.5;
ent.skinNum = s1->skinNum;
ent.hModel = cgs.model_draw[s1->modelindex];
@ -232,21 +235,20 @@ void CG_General( centity_t *cent ) {
VectorCopy( ent.origin, cg.sky_origin );
}
tikihandle = cgs.model_tiki[ s1->modelindex ];
if ( tikihandle >= 0 )
{
// update any emitter's...
CG_UpdateEntity( tikihandle, &ent, cent );
}
if ( s1->eFlags & ( EF_LEFT_TARGETED | EF_RIGHT_TARGETED ) )
{
CG_EntityTargeted( tikihandle, cent, &ent );
}
ent.tiki = cgi.R_Model_GetHandle(cgs.model_draw[s1->modelindex]);
ent.frameInfo[0].index = s1->frameInfo[0].index;
ent.frameInfo[0].time = s1->frameInfo[0].time;
ent.frameInfo[0].weight = s1->frameInfo[0].weight;
ent.actionWeight = 1.0;
// add to refresh list
if ( !( ent.renderfx & RF_DONTDRAW ) )
cgi.R_AddRefEntityToScene (&ent);
if (ent.tiki >= 0)
{
// update any emitter's...
CG_UpdateEntityEmitters(s1->number, &ent, cent);
}
}
/*
@ -273,7 +275,7 @@ void CG_Speaker( centity_t *cent )
// ent->s.frame = ent->wait * 10;
// ent->s.clientNum = ent->random * 10;
cent->miscTime = cg.time + cent->currentState.frame * 100 + cent->currentState.clientNum * 100 * crandom();
cent->miscTime = cg.time + cent->currentState.wasframe * 100 + cent->currentState.clientNum * 100 * crandom();
}
@ -310,75 +312,6 @@ void CG_Mover( centity_t *cent ) {
cgi.R_AddRefEntityToScene(&ent);
}
/*
===============
CG_Sprite
===============
*/
void CG_Sprite( centity_t *cent )
{
refEntity_t ent;
entityState_t *s1;
int i;
s1 = &cent->currentState;
memset( &ent, 0, sizeof( refEntity_t ) );
if ( s1->parent != ENTITYNUM_NONE )
{
refEntity_t *parent;
int tikihandle;
parent = cgi.R_GetRenderEntity( s1->parent );
if ( !parent )
{
cgi.DPrintf( "CG_Sprite: Could not find parent entity\n" );
return;
}
tikihandle = cgi.TIKI_GetHandle( parent->hModel );
CG_AttachEntity( &ent, parent, tikihandle, s1->tag_num & TAG_MASK, s1->attach_use_angles, s1->attach_offset );
}
else
{
VectorCopy( cent->lerpOrigin, ent.origin);
VectorCopy( cent->lerpOrigin, ent.oldorigin);
}
ent.hModel = cgs.model_draw[s1->modelindex];
// Modulation based off the color
for( i=0; i<3; i++ )
ent.shaderRGBA[ i ] = cent->color[ i ] * 255;
// take the alpha from the entity if less than 1, else grab it from the client commands version
if ( s1->alpha < 1 )
ent.shaderRGBA[ 3 ] = s1->alpha * 255;
else
ent.shaderRGBA[ 3 ] = cent->color[ 3 ] * 255;
ent.renderfx |= s1->renderfx;
// convert angles to axis
AnglesToAxis( cent->lerpAngles, ent.axis );
// Interpolated state variables
if ( cent->interpolate )
{
ent.scale = s1->scale + cg.frameInterpolation * ( cent->nextState.scale - cent->currentState.scale );
}
else
{
ent.scale = s1->scale;
}
// add to refresh list
if ( !( cent->currentState.renderfx & RF_DONTDRAW ) )
cgi.R_AddRefSpriteToScene( &ent );
}
/*
==================
CG_Item
@ -530,10 +463,10 @@ void CG_Beam( centity_t *cent ) {
for ( i=0;i<4;i++ )
modulate[i] = cent->color[i] * 255;
if ( s1->torso_anim != ENTITYNUM_NONE )
if ( s1->beam_entnum != ENTITYNUM_NONE )
{
refEntity_t *parent;
parent = cgi.R_GetRenderEntity( s1->torso_anim );
parent = cgi.R_GetRenderEntity( s1->beam_entnum);
if ( !parent )
{
@ -610,180 +543,102 @@ void CG_Decal
CG_Portal
===============
*/
void CG_Portal( centity_t *cent )
{
refEntity_t ent;
entityState_t *s1;
s1 = &cent->currentState;
// create the render entity
memset (&ent, 0, sizeof(ent));
VectorCopy( cent->lerpOrigin, ent.origin );
VectorCopy( s1->origin2, ent.oldorigin );
AnglesToAxis( cent->currentState.angles, ent.axis );
// negating this tends to get the directions like they want
// we really should have a camera roll value
VectorSubtract( vec3_origin, ent.axis[1], ent.axis[1] );
VectorSubtract( vec3_origin, ent.axis[2], ent.axis[2] );
ent.reType = RT_PORTALSURFACE;
ent.frame = s1->frame; // rotation speed
ent.skinNum = s1->clientNum/256.0 * 360; // roll offset
// add to refresh list
cgi.R_AddRefEntityToScene(&ent);
}
/*
=========================
CG_AdjustPositionForMover
=========================
*/
void CG_AdjustPositionForMover( const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out ) {
centity_t *cent;
vec3_t oldOrigin, origin, deltaOrigin;
vec3_t oldAngles, angles;
if ( moverNum == ENTITYNUM_NONE ) {
VectorCopy( in, out );
return;
}
cent = &cg_entities[ moverNum ];
if ( cent->currentState.pos.trType == TR_LERP ) {
int i;
if ( cent->interpolate )
{
// we calculate lerpOrigin so we have always have the latest info. It is possible to call this before lerpOrigin
// is updated by AddEntities
for ( i=0; i<3; i++ )
{
cent->lerpOrigin[i] = cent->currentState.origin[i] +
cg.frameInterpolation * ( cent->nextState.origin[i] - cent->currentState.origin[i] );
}
}
for ( i=0; i<3; i++ )
{
out[ i ] = in[ i ] + ( cent->lerpOrigin[i] - cent->currentState.origin[i] );
}
return;
} else if ( cent->currentState.eType != ET_MOVER ) {
VectorCopy( in, out );
return;
}
EvaluateTrajectory( &cent->currentState.pos, fromTime, oldOrigin );
EvaluateTrajectory( &cent->currentState.apos, fromTime, oldAngles );
EvaluateTrajectory( &cent->currentState.pos, toTime, origin );
EvaluateTrajectory( &cent->currentState.apos, toTime, angles );
VectorSubtract( origin, oldOrigin, deltaOrigin );
VectorAdd( in, deltaOrigin, out );
// FIXME: origin change when on a rotating object
void CG_Portal(centity_t* cent)
{
}
/*
===============
CG_CalcEntityLerpPositions
===============
*/
void CG_CalcEntityLerpPositions( centity_t *cent ) {
int i;
float f;
void CG_CalcEntityLerpPositions( centity_t *cent )
{
int i;
float f;
f = cg.frameInterpolation;
f = cg.frameInterpolation;
if ( cg.snap->ps.pm_type < PM_DEAD )
{
if ( cent->currentState.number == cg.snap->ps.clientNum )
{
// if the player, take position from prediction
VectorCopy( cg.predicted_player_state.origin, cent->lerpOrigin );
for ( i=0; i<3; i++ ) {
cent->lerpAngles[i] = LerpAngle( cent->currentState.angles[i], cent->nextState.angles[i], f );
}
if (cent->currentState.eType == ET_PLAYER)
{
if (cent->currentState.number == cg.snap->ps.clientNum)
{
// if the player, take position from prediction
VectorCopy(cg.predicted_player_state.origin, cent->lerpOrigin);
for (i = 0; i < 3; i++) {
cent->lerpAngles[i] = LerpAngle(cent->currentState.angles[i], cent->nextState.angles[i], f);
}
return;
}
}
return;
}
}
if ( cent->currentState.pos.trType == TR_LERP ) {
float quat[ 4 ];
float mat[ 3 ][ 3 ];
if (cent->currentState.eType != ET_PLAYER || !cg_smoothClients->integer) {
float quat[4];
float mat[3][3];
if ( !cent->interpolate ) {
VectorCopy( cent->currentState.angles, cent->lerpAngles );
VectorCopy( cent->currentState.origin, cent->lerpOrigin );
return;
}
if (!cent->interpolate) {
VectorCopy(cent->currentState.angles, cent->lerpAngles);
VectorCopy(cent->currentState.origin, cent->lerpOrigin);
return;
}
// it would be an internal error to find an entity that interpolates without
// a snapshot ahead of the current one
if ( cg.nextSnap == NULL ) {
cgi.Error( ERR_DROP, "CG_AddCEntity: cg.nextSnap == NULL" );
}
for (i = 0; i < 3; i++) {
cent->lerpOrigin[i] = cent->currentState.origin[i] +
f * (cent->nextState.origin[i] - cent->currentState.origin[i]);
}
for ( i=0; i<3; i++ ) {
cent->lerpOrigin[i] = cent->currentState.origin[i] +
f * ( cent->nextState.origin[i] - cent->currentState.origin[i] );
}
if (!memcmp(cent->currentState.angles, cent->nextState.angles, sizeof(vec3_t))) {
VectorCopy(cent->currentState.angles, cent->lerpAngles);
}
else {
// use spherical interpolation using quaternions so that bound objects
// rotate properly without gimble lock.
SlerpQuaternion(cent->currentState.quat, cent->nextState.quat, f, quat);
QuatToMat(quat, mat);
MatrixToEulerAngles(mat, cent->lerpAngles);
}
}
else if (cent->interpolate) {
float quat[4];
float mat[3][3];
if ( !memcmp( cent->currentState.angles, cent->nextState.angles, sizeof( vec3_t ) ) ) {
VectorCopy( cent->currentState.angles, cent->lerpAngles );
} else {
// use spherical interpolation using quaternions so that bound objects
// rotate properly without gimble lock.
SlerpQuaternion( cent->currentState.quat, cent->nextState.quat, f, quat );
QuatToMat( quat, mat );
MatrixToEulerAngles( mat, cent->lerpAngles );
}
} else if ( cent->interpolate && cent->currentState.pos.trType == TR_INTERPOLATE ) {
// if the entity has a valid next state, interpolate a value between the frames
// unless it is a mover with a known start and stop
vec3_t current, next;
// if the entity has a valid next state, interpolate a value between the frames
// unless it is a mover with a known start and stop
vec3_t current, next;
// it would be an internal error to find an entity that interpolates without
// a snapshot ahead of the current one
if ( cg.nextSnap == NULL ) {
cgi.Error( ERR_DROP, "CG_AddCEntity: cg.nextSnap == NULL" );
}
// this will linearize a sine or parabolic curve, but it is important
// to not extrapolate player positions if more recent data is available
BG_EvaluateTrajectory(&cent->currentState.pos, cg.snap->serverTime, current);
BG_EvaluateTrajectory(&cent->nextState.pos, cg.nextSnap->serverTime, next);
// this will linearize a sine or parabolic curve, but it is important
// to not extrapolate player positions if more recent data is available
EvaluateTrajectory( &cent->currentState.pos, cg.snap->serverTime, current );
EvaluateTrajectory( &cent->nextState.pos, cg.nextSnap->serverTime, next );
cent->lerpOrigin[0] = current[0] + f * (next[0] - current[0]);
cent->lerpOrigin[1] = current[1] + f * (next[1] - current[1]);
cent->lerpOrigin[2] = current[2] + f * (next[2] - current[2]);
cent->lerpOrigin[0] = current[0] + f * ( next[0] - current[0] );
cent->lerpOrigin[1] = current[1] + f * ( next[1] - current[1] );
cent->lerpOrigin[2] = current[2] + f * ( next[2] - current[2] );
if (!memcmp(cent->currentState.angles, cent->nextState.angles, sizeof(vec3_t))) {
VectorCopy(cent->currentState.angles, cent->lerpAngles);
}
else {
// use spherical interpolation using quaternions so that bound objects
// rotate properly without gimble lock.
SlerpQuaternion(cent->currentState.quat, cent->nextState.quat, f, quat);
QuatToMat(quat, mat);
MatrixToEulerAngles(mat, cent->lerpAngles);
}
EvaluateTrajectory( &cent->currentState.apos, cg.snap->serverTime, current );
EvaluateTrajectory( &cent->nextState.apos, cg.nextSnap->serverTime, next );
// Lerp legs, torso, and head angles
for ( i=0; i<3; i++ ) {
cent->lerpAngles[i] = LerpAngle( current[i], next[i], f );
}
} else {
// just use the current frame and evaluate as best we can
EvaluateTrajectory( &cent->currentState.pos, cg.time, cent->lerpOrigin );
EvaluateTrajectory( &cent->currentState.apos, cg.time, cent->lerpAngles );
// adjust for riding a mover
CG_AdjustPositionForMover( cent->lerpOrigin, cent->currentState.groundEntityNum,
cg.snap->serverTime, cg.time, cent->lerpOrigin );
}
// Lerp legs, torso, and head angles
for (i = 0; i < 3; i++) {
cent->lerpAngles[i] = LerpAngle(current[i], next[i], f);
}
}
else {
// just use the current frame and evaluate as best we can
BG_EvaluateTrajectory(&cent->currentState.pos, cg.time, cent->lerpOrigin);
VectorCopy(cent->currentState.angles, cent->lerpAngles);
//BG_EvaluateTrajectory(&cent->currentState.apos, cg.time, cent->lerpAngles);
}
}
/*
@ -816,11 +671,11 @@ void CG_AddCEntity( centity_t *cent )
// intentional fallthrough
case ET_MODELANIM:
CG_Splash( cent );
CG_ModelAnim( cent );
CG_ModelAnim( cent, qfalse );
break;
case ET_ITEM:
CG_Item( cent );
CG_ModelAnim( cent );
CG_ModelAnim( cent, qfalse);
break;
case ET_GENERAL:
CG_General( cent );
@ -836,9 +691,6 @@ void CG_AddCEntity( centity_t *cent )
break;
case ET_MULTIBEAM: // skip
break;
case ET_SPRITE:
CG_Sprite( cent );
break;
case ET_PORTAL:
CG_Portal( cent );
break;
@ -900,48 +752,34 @@ void CG_AddPacketEntities( void ) {
}
void CG_GetOrigin( centity_t *cent, vec3_t origin )
{
if ( cent->currentState.parent == ENTITYNUM_NONE )
{
VectorCopy( cent->lerpOrigin, origin );
}
else
{
int i;
orientation_t or;
refEntity_t *parent;
int tikihandle;
void CG_GetOrigin(centity_t* cent, vec3_t origin)
{
if (cent->currentState.parent == ENTITYNUM_NONE)
{
VectorCopy(cent->lerpOrigin, origin);
}
else
{
int i;
orientation_t or;
refEntity_t* parent;
parent = cgi.R_GetRenderEntity( cent->currentState.parent );
parent = cgi.R_GetRenderEntity(cent->currentState.parent);
if ( !parent )
{
cgi.DPrintf( "CG_GetOrigin: Could not find parent entity\n" );
return;
}
if (!parent)
{
cgi.DPrintf("CG_GetOrigin: Could not find parent entity\n");
return;
}
tikihandle = cgi.TIKI_GetHandle( parent->hModel );
cgi.R_Model_GetHandle(parent->hModel);
or = cgi.TIKI_Orientation(parent, cent->currentState.tag_num);
// lerp the tag
if ( r_lerpmodels->integer )
{
or = cgi.Tag_LerpedOrientation( tikihandle, parent, cent->currentState.tag_num );
}
else
{
//FIXME
// doesn't handle torso animations
or = cgi.Tag_Orientation( tikihandle, parent->anim, parent->frame, cent->currentState.tag_num, parent->scale,
parent->bone_tag, parent->bone_quat );
}
VectorCopy( parent->origin, origin );
for ( i = 0 ; i < 3 ; i++ )
{
VectorMA( origin, or.origin[i], parent->axis[i], origin );
}
}
}
VectorCopy(parent->origin, origin);
for (i = 0; i < 3; i++)
{
VectorMA(origin, or .origin[i], parent->axis[i], origin);
}
}
}

View file

@ -386,8 +386,9 @@ void createLightstyleFromTGA( int num, const char *filename )
void CG_SetLightStyle( int num, const char *s )
{
char *r, *g, *b, *a;
int j, k, n, len;
const char *r, *g, *b, *a;
int j, k, n;
size_t len;
float t;
if ( ( num < 0 ) || ( num >= ( MAX_LIGHTSTYLES * 2 ) ) )

View file

@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// If you absolutely need something stored, it can either be kept
// by the server in the server stored userinfos, or stashed in a cvar.
#pragma once
#include "q_shared.h"
#include "tr_types.h"
@ -33,9 +34,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cm_public.h"
#include "cg_public.h"
#ifndef __CG_LOCAL_H__
#define __CG_LOCAL_H__
#ifdef __cplusplus
extern "C"
{
@ -97,9 +95,7 @@ typedef struct centity_s {
qboolean currentValid; // true if cg.frame holds this entity
int miscTime;
animstate_t am; // this holds the animation information for this model
animstate_t torso_am; // this holds the torso animation information for this model
int snapShotTime;
int errorTime; // decay the error from this time
vec3_t errorOrigin;
@ -117,7 +113,10 @@ typedef struct centity_s {
sfxHandle_t tikiLoopSound;
float tikiLoopSoundVolume;
float tikiLoopSoundMinDist;
float tikiLoopSoundMinDist;
float tikiLoopSoundMaxDist;
float tikiLoopSoundPitch;
int tikiLoopSoundFlags;
float color[4];
float client_color[4]; // the color set by client commands
@ -125,6 +124,15 @@ typedef struct centity_s {
int splash_last_spawn_time;
int splash_still_count;
quat_t bone_quat[NUM_BONE_CONTROLLERS];
float animLastTimes[MAX_FRAMEINFOS];
int animLast[MAX_FRAMEINFOS];
int animLastWeight;
int usageIndexLast;
qboolean bFootOnGround_Right;
qboolean bFootOnGround_Left;
int iNextLandTime;
} centity_t;
@ -411,35 +419,79 @@ typedef struct {
//==============================================================================
extern cvar_t* paused;
extern cvar_t* developer;
extern cgs_t cgs;
extern cg_t cg;
extern clientGameImport_t cgi;
extern centity_t cg_entities[MAX_GENTITIES];
extern markPoly_t cg_markPolys[MAX_MARK_POLYS];
extern cvar_t *cg_animSpeed;
extern cvar_t *cg_debugAnim;
extern cvar_t *cg_debugAnimWatch;
extern cvar_t *cg_errorDecay;
extern cvar_t *cg_nopredict;
extern cvar_t *cg_showmiss;
extern cvar_t *cg_addMarks;
extern cvar_t *cg_viewsize;
extern cvar_t *cg_3rd_person;
extern cvar_t *cg_syncronousClients;
extern cvar_t *cg_stereoSeparation;
extern cvar_t *cg_stats;
extern cvar_t *cg_lagometer;
extern cvar_t *paused;
extern cvar_t *r_lerpmodels;
extern cvar_t *cg_cameraheight;
extern cvar_t *cg_cameradist;
extern cvar_t *cg_cameraverticaldisplacement;
extern cvar_t *cg_camerascale;
extern cvar_t *cg_shadows;
extern cvar_t *cg_hidetempmodels;
extern cvar_t *cg_traceinfo;
extern cvar_t *cg_debugFootsteps;
extern cvar_t* cg_animSpeed;
extern cvar_t* cg_debugAnim;
extern cvar_t* cg_debugAnimWatch;
extern cvar_t* cg_errorDecay;
extern cvar_t* cg_nopredict;
extern cvar_t* cg_showmiss;
extern cvar_t* cg_addMarks;
extern cvar_t* cg_maxMarks;
extern cvar_t* cg_viewsize;
extern cvar_t* cg_3rd_person;
extern cvar_t* cg_drawviewmodel;
extern cvar_t* cg_synchronousClients;
extern cvar_t* cg_stereoSeparation;
extern cvar_t* cg_stats;
extern cvar_t* cg_lagometer;
extern cvar_t* r_lerpmodels;
extern cvar_t* cg_cameraheight;
extern cvar_t* cg_cameradist;
extern cvar_t* cg_cameraverticaldisplacement;
extern cvar_t* cg_camerascale;
extern cvar_t* cg_shadows;
extern cvar_t* cg_hidetempmodels;
extern cvar_t* cg_traceinfo;
extern cvar_t* cg_debugFootsteps;
extern cvar_t* cg_smoothClients;
extern cvar_t* cg_smoothClientsTime;
extern cvar_t* pmove_fixed;
extern cvar_t* pmove_msec;
extern cvar_t* cg_pmove_msec;
extern cvar_t* dm_playermodel;
extern cvar_t* dm_playergermanmodel;
extern cvar_t* cg_forceModel;
extern cvar_t* cg_animationviewmodel;
extern cvar_t* cg_hitmessages;
extern cvar_t* cg_acidtrip;
extern cvar_t* cg_hud;
extern cvar_t* cg_huddraw_force;
extern cvar_t* cg_drawsvlag;
extern cvar_t* vm_offset_max;
extern cvar_t* vm_offset_speed;
extern cvar_t* vm_sway_front;
extern cvar_t* vm_sway_side;
extern cvar_t* vm_sway_up;
extern cvar_t* vm_offset_air_front;
extern cvar_t* vm_offset_air_side;
extern cvar_t* vm_offset_air_up;
extern cvar_t* vm_offset_crouch_front;
extern cvar_t* vm_offset_crouch_side;
extern cvar_t* vm_offset_crouch_up;
extern cvar_t* vm_offset_rocketcrouch_front;
extern cvar_t* vm_offset_rocketcrouch_side;
extern cvar_t* vm_offset_rocketcrouch_up;
extern cvar_t* vm_offset_shotguncrouch_front;
extern cvar_t* vm_offset_shotguncrouch_side;
extern cvar_t* vm_offset_shotguncrouch_up;
extern cvar_t* vm_offset_vel_base;
extern cvar_t* vm_offset_vel_front;
extern cvar_t* vm_offset_vel_side;
extern cvar_t* vm_offset_vel_up;
extern cvar_t* vm_offset_upvel;
extern cvar_t* vm_lean_lower;
extern cvar_t* voiceChat;
extern cvar_t* cg_shadowscount;
extern cvar_t* cg_shadowdebug;
//
// cg_main.c
@ -458,16 +510,15 @@ void CG_ServerRestarted( void );
//
// cg_modelanim.cpp
//
void CG_ModelAnim( centity_t *cent );
void CG_EntityTargeted( int tikihandle, centity_t *cent, refEntity_t *model );
void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime);
void CG_ClearModelAnimation( int tikihandle, animstate_t * state, int animationNumber, int time, vec3_t origin, int entnum );
void CG_AttachEntity( refEntity_t *entity, refEntity_t *parent, int tikihandle, int tagnum, qboolean use_angles, vec3_t attach_offset );
void CG_AttachEntity( refEntity_t *entity, refEntity_t *parent, dtiki_t* tiki, int tagnum, qboolean use_angles, vec3_t attach_offset );
//
// cg_commands.cpp
//
void CG_Event( centity_t *cent );
void CG_UpdateEntity( int tikihandle, refEntity_t *ent, centity_t *cent );
void CG_UpdateEntityEmitters(int entnum, refEntity_t *ent, centity_t *cent );
void CG_RemoveClientEntity( int number, int tikihandle, centity_t *cent );
void CG_UpdateTestEmitter( void );
void CG_AddTempModels( void );
@ -714,6 +765,3 @@ void CG_ClearSwipes( void );
#ifdef __cplusplus
}
#endif
#endif // __CG_LOCAL_H__

View file

@ -31,34 +31,76 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
clientGameImport_t cgi;
cvar_t* paused;
cvar_t* developer;
cg_t cg;
cgs_t cgs;
centity_t cg_entities[MAX_GENTITIES];
cvar_t *cg_animSpeed;
cvar_t *cg_debugFootsteps;
cvar_t *cg_debugAnim;
cvar_t *cg_debugAnimWatch;
cvar_t *cg_errorDecay;
cvar_t *cg_nopredict;
cvar_t *cg_showmiss;
cvar_t *cg_addMarks;
cvar_t *cg_viewsize;
cvar_t *cg_3rd_person;
cvar_t *cg_syncronousClients;
cvar_t *cg_stats;
cvar_t *cg_hidetempmodels;
cvar_t *paused;
cvar_t *r_lerpmodels;
cvar_t *cg_stereoSeparation;
cvar_t *cg_lagometer;
cvar_t *cg_cameraheight;
cvar_t *cg_cameradist;
cvar_t *cg_camerascale;
cvar_t *cg_cameraverticaldisplacement;
cvar_t *cg_traceinfo;
cvar_t *cg_shadows;
cvar_t *developer;
cvar_t* cg_animSpeed;
cvar_t* cg_debugAnim;
cvar_t* cg_debugAnimWatch;
cvar_t* cg_errorDecay;
cvar_t* cg_nopredict;
cvar_t* cg_showmiss;
cvar_t* cg_addMarks;
cvar_t* cg_maxMarks;
cvar_t* cg_viewsize;
cvar_t* cg_3rd_person;
cvar_t* cg_drawviewmodel;
cvar_t* cg_synchronousClients;
cvar_t* cg_stereoSeparation;
cvar_t* cg_stats;
cvar_t* cg_lagometer;
cvar_t* r_lerpmodels;
cvar_t* cg_cameraheight;
cvar_t* cg_cameradist;
cvar_t* cg_cameraverticaldisplacement;
cvar_t* cg_camerascale;
cvar_t* cg_shadows;
cvar_t* cg_hidetempmodels;
cvar_t* cg_traceinfo;
cvar_t* cg_debugFootsteps;
cvar_t* cg_smoothClients;
cvar_t* cg_smoothClientsTime;
cvar_t* pmove_fixed;
cvar_t* pmove_msec;
cvar_t* cg_pmove_msec;
cvar_t* dm_playermodel;
cvar_t* dm_playergermanmodel;
cvar_t* cg_forceModel;
cvar_t* cg_animationviewmodel;
cvar_t* cg_hitmessages;
cvar_t* cg_acidtrip;
cvar_t* cg_hud;
cvar_t* cg_huddraw_force;
cvar_t* cg_drawsvlag;
cvar_t* vm_offset_max;
cvar_t* vm_offset_speed;
cvar_t* vm_sway_front;
cvar_t* vm_sway_side;
cvar_t* vm_sway_up;
cvar_t* vm_offset_air_front;
cvar_t* vm_offset_air_side;
cvar_t* vm_offset_air_up;
cvar_t* vm_offset_crouch_front;
cvar_t* vm_offset_crouch_side;
cvar_t* vm_offset_crouch_up;
cvar_t* vm_offset_rocketcrouch_front;
cvar_t* vm_offset_rocketcrouch_side;
cvar_t* vm_offset_rocketcrouch_up;
cvar_t* vm_offset_shotguncrouch_front;
cvar_t* vm_offset_shotguncrouch_side;
cvar_t* vm_offset_shotguncrouch_up;
cvar_t* vm_offset_vel_base;
cvar_t* vm_offset_vel_front;
cvar_t* vm_offset_vel_side;
cvar_t* vm_offset_vel_up;
cvar_t* vm_offset_upvel;
cvar_t* vm_lean_lower;
cvar_t* voiceChat;
cvar_t* cg_shadowscount;
cvar_t* cg_shadowdebug;
/*
=================
@ -79,7 +121,7 @@ void CG_RegisterCvars( void )
cg_showmiss = cgi.Cvar_Get( "cg_showmiss", "0", 0 );
cg_stats = cgi.Cvar_Get( "cg_stats", "0", 0 );
cg_hidetempmodels = cgi.Cvar_Get( "cg_hidetempmodels", "0", 0 );
cg_syncronousClients = cgi.Cvar_Get( "g_syncronousClients", "0", 0 );
cg_synchronousClients = cgi.Cvar_Get( "g_syncronousClients", "0", 0 );
cg_stereoSeparation = cgi.Cvar_Get( "cg_stereosep", "0.4", CVAR_ARCHIVE );
cg_lagometer = cgi.Cvar_Get( "cg_lagometer", "0", 0 );
paused = cgi.Cvar_Get( "paused", "0", 0 );

View file

@ -141,7 +141,9 @@ void CG_ImpactMark
float radius,
qboolean temporary,
int lightstyle,
qboolean fadein
qboolean fadein,
float fSCenter,
float fTCenter
)
{
@ -199,7 +201,7 @@ void CG_ImpactMark
// get the fragments
VectorScale( dir, -32, projection );
numFragments = cgi.CM_MarkFragments( 4, (void *)originalPoints,
numFragments = cgi.R_MarkFragments( 4, (void *)originalPoints,
projection, MAX_MARK_POINTS, markPoints[0],
MAX_MARK_FRAGMENTS, markFragments );

File diff suppressed because it is too large Load diff

View file

@ -236,7 +236,8 @@ void CG_PlayerTrace
const vec3_t end,
int skipNumber,
int mask,
qboolean cylinder
qboolean cylinder,
qboolean tracedeep
)
{
@ -457,7 +458,7 @@ void CG_PredictPlayerState( void ) {
// non-predicting local movement will grab the latest angles
//FIXME
// Noclip is jittery for some reason, so I'm disabling prediction while noclipping
if ( cg_nopredict->integer || cg_syncronousClients->integer || (cg.snap->ps.pm_type == PM_NOCLIP) ) {
if ( cg_nopredict->integer || cg_synchronousClients->integer || (cg.snap->ps.pm_type == PM_NOCLIP) ) {
CG_InterpolatePlayerState( qtrue );
return;
}
@ -466,7 +467,6 @@ void CG_PredictPlayerState( void ) {
cg_pmove.ps = &cg.predicted_player_state;
cg_pmove.trace = CG_PlayerTrace;
cg_pmove.pointcontents = CG_PointContents;
cg_pmove.trypush = NULL;
if ( cg_pmove.ps->pm_type == PM_DEAD )
{

View file

@ -34,6 +34,6 @@ void CG_ProcessSound( server_sound_t *sound )
else
{
cgi.S_StartSound( sound->origin, sound->entity_number, sound->channel, cgs.sound_precache[sound->sound_index],
sound->volume, sound->min_dist );
sound->volume, sound->min_dist, sound->pitch, sound->maxDist, sound->streamed );
}
}

View file

@ -25,9 +25,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_local.h"
#include "cg_commands.h"
#include "../game/surfaceflags.h"
extern refEntity_t *current_entity;
extern int current_tiki;
extern dtiki_t* current_tiki;
/*
==============================================================

View file

@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
swipething_t m_swipes[MAX_SWIPES];
extern int current_entity_number;
extern refEntity_t *current_entity;
extern int current_tiki;
extern dtiki_t* current_tiki;
extern centity_t *current_centity;
void ClientGameCommandManager::SwipeOn