/* ================= CG_UpdateCvars ================= */ void CG_UpdateCvars( void ) { int i; cvarTable_t *cv; for ( i = 0, cv = cvarTable ; i < cvarTableSize ; i++, cv++ ) { trap_Cvar_Update( cv->vmCvar ); } // check for modications here // If team overlay is on, ask for updates from the server. If its off, // let the server know so we don't receive it if ( drawTeamOverlayModificationCount != cg_drawTeamOverlay.modificationCount ) { drawTeamOverlayModificationCount = cg_drawTeamOverlay.modificationCount; if ( cg_drawTeamOverlay.integer > 0 ) { trap_Cvar_Set( "teamoverlay", "1" ); } else { trap_Cvar_Set( "teamoverlay", "0" ); } } // if force model changed if ( forceModelModificationCount != cg_forceModel.modificationCount ) { forceModelModificationCount = cg_forceModel.modificationCount; CG_ForceModelChange(); } }
/* ================= CG_UpdateCvars ================= */ void CG_UpdateCvars( void ) { // check for modications here // If team overlay is on, ask for updates from the server. If its off, // let the server know so we don't receive it if ( drawTeamOverlayModificationCount != cg_drawTeamOverlay->modificationCount ) { drawTeamOverlayModificationCount = cg_drawTeamOverlay->modificationCount; if ( cg_drawTeamOverlay->integer > 0 ) { cgi.Cvar_Set( "teamoverlay", "1" ); } else { cgi.Cvar_Set( "teamoverlay", "0" ); } } // if force model changed if ( forceModelModificationCount != cg_forceModel->modificationCount ) { forceModelModificationCount = cg_forceModel->modificationCount; CG_ForceModelChange(); } }
/* ================= CG_UpdateCvars ================= */ void CG_UpdateCvars( void ) { int i; cvarTable_t *cv; for ( i = 0, cv = cvarTable ; i < cvarTableSize ; i++, cv++ ) { trap_Cvar_Update( cv->vmCvar ); } // check for modications here // If team overlay is on, ask for updates from the server. If its off, // let the server know so we don't receive it if ( drawTeamOverlayModificationCount != cg_drawTeamOverlay.modificationCount ) { drawTeamOverlayModificationCount = cg_drawTeamOverlay.modificationCount; if ( cg_drawTeamOverlay.integer > 0 ) { trap_Cvar_Set( "teamoverlay", "1" ); } else { trap_Cvar_Set( "teamoverlay", "0" ); } // FIXME E3 HACK trap_Cvar_Set( "teamoverlay", "1" ); } // if force model changed if ( forceModelModificationCount != cg_forceModel.modificationCount ) { forceModelModificationCount = cg_forceModel.modificationCount; CG_ForceModelChange(); } // if cg_lodScale changed if ( cgLodScaleValue != cg_lodScale.integer ) { //copy the value from cg_lodScale to r_lodscale trap_Cvar_Set("r_lodscale", cg_lodScale.string); cgLodScaleValue = cg_lodScale.integer; } }
/** The transition point from snap to nextSnap has passed */ static void CG_TransitionSnapshot(void) { centity_t *cent; snapshot_t *oldFrame; int i; if (!cg.snap) { CG_Error("CG_TransitionSnapshot: NULL cg.snap"); } if (!cg.nextSnap) { CG_Error("CG_TransitionSnapshot: NULL cg.nextSnap"); } // execute any server string commands before transitioning entities CG_ExecuteNewServerCommands(cg.nextSnap->serverCommandSequence); // clear the currentValid flag for all entities in the existing snapshot for (i = 0; i < cg.snap->numEntities; i++) { cent = &cg_entities[cg.snap->entities[i].number]; cent->currentValid = qfalse; } // move nextSnap to snap and do the transitions oldFrame = cg.snap; cg.snap = cg.nextSnap; if (cg.snap->ps.clientNum != oldFrame->ps.clientNum) { memset(&cg.statsFollow, 0, sizeof cg.statsFollow); CG_ForceModelChange(); } BG_PlayerStateToEntityState(&cg.snap->ps, &cg_entities[cg.snap->ps.clientNum].currentState, qfalse); cg_entities[cg.snap->ps.clientNum].interpolate = qfalse; for (i = 0; i < cg.snap->numEntities; i++) { cent = &cg_entities[cg.snap->entities[i].number]; CG_TransitionEntity(cent); // remember time of snapshot this entity was last updated in cent->snapShotTime = cg.snap->serverTime; } cg.nextSnap = NULL; // check for playerstate transition events if (oldFrame) { playerState_t *ops, *ps; ops = &oldFrame->ps; ps = &cg.snap->ps; // teleporting checks are irrespective of prediction if ((ps->eFlags ^ ops->eFlags) & EF_TELEPORT_BIT) { cg.thisFrameTeleport = qtrue; // will be cleared by prediction code } // if we are not doing client side movement prediction for any // reason, then the client events and view changes will be issued now if (cg.demoPlayback || (cg.snap->ps.pm_flags & PMF_FOLLOW) || cg_nopredict.integer) { CG_TransitionPlayerState(ps, ops); } } }