#include "cg_local.h"#include "bg_saga.h"#include "cg_lights.h"#include "../namespace_begin.h"#include "../namespace_end.h"Go to the source code of this file.
|
|
|
|
|
Definition at line 1998 of file cg_view.c. Referenced by CG_SE_UpdateShake(). |
|
|
Definition at line 14 of file cg_view.c. Referenced by G_EstimateCamPos(). |
|
|
Definition at line 13 of file cg_view.c. Referenced by G_EstimateCamPos(). |
|
|
Definition at line 1999 of file cg_view.c. Referenced by CGCam_Shake(). |
|
|
Definition at line 2275 of file cg_view.c. Referenced by CG_DrawAutoMap(). |
|
|
Definition at line 2274 of file cg_view.c. Referenced by CG_DrawAutoMap(). |
|
|
|
|
|
|
|
||||||||||||||||||||
|
Definition at line 2703 of file bg_misc.c.
02704 {
02705 float dif = AngleSubtract(baseAngles[YAW], angles[YAW]);
02706
02707 if (dif > constraint ||
02708 dif < -constraint)
02709 {
02710 float amt;
02711
02712 if (dif > constraint)
02713 {
02714 amt = (dif-constraint);
02715 dif = constraint;
02716 }
02717 else if (dif < -constraint)
02718 {
02719 amt = (dif+constraint);
02720 dif = -constraint;
02721 }
02722 else
02723 {
02724 amt = 0.0f;
02725 }
02726
02727 *newYaw = AngleSubtract(angles[YAW], -dif);
02728
02729 if (amt > 1.0f || amt < -1.0f)
02730 { //significant, force the view
02731 return 2;
02732 }
02733 else
02734 { //just a little out of range
02735 return 1;
02736 }
02737 }
02738
02739 return 0;
02740 }
|
|
||||||||||||
|
Definition at line 7785 of file bg_pmove.c.
07786 {
07787 if ( bg_fighterAltControl.integer
07788 && ps->clientNum < MAX_CLIENTS //real client
07789 && ps->m_iVehicleNum//in a vehicle
07790 && pVeh //valid vehicle data pointer
07791 && pVeh->m_pVehicleInfo//valid vehicle info
07792 && pVeh->m_pVehicleInfo->type == VH_FIGHTER )//fighter
07793 //FIXME: specify per vehicle instead of assuming true for all fighters
07794 //FIXME: map/server setting?
07795 {//can roll and pitch without limitation!
07796 return qtrue;
07797 }
07798 return qfalse;
07799 }
|
|
||||||||||||||||||||
|
Definition at line 676 of file bg_pmove.c.
00677 {
00678 if ( pVeh && pVeh->m_pVehicleInfo )
00679 {
00680 float speedFrac = 1.0f;
00681 if ( pVeh->m_pVehicleInfo->speedDependantTurning )
00682 {
00683 if ( pVeh->m_LandTrace.fraction >= 1.0f
00684 || pVeh->m_LandTrace.plane.normal[2] < MIN_LANDING_SLOPE )
00685 {
00686 speedFrac = (speed/(pVeh->m_pVehicleInfo->speedMax*0.75f));
00687 if ( speedFrac < 0.25f )
00688 {
00689 speedFrac = 0.25f;
00690 }
00691 else if ( speedFrac > 1.0f )
00692 {
00693 speedFrac = 1.0f;
00694 }
00695 }
00696 }
00697 if ( pVeh->m_pVehicleInfo->mousePitch )
00698 {
00699 *mPitchOverride = pVeh->m_pVehicleInfo->mousePitch*speedFrac;
00700 }
00701 if ( pVeh->m_pVehicleInfo->mouseYaw )
00702 {
00703 *mYawOverride = pVeh->m_pVehicleInfo->mouseYaw*speedFrac;
00704 }
00705 }
00706 }
|
|
|
Definition at line 1953 of file cg_players.c. References CG_LoadClientInfo(), cgs, cgs_t::clientinfo, and cgs_t::maxclients. Referenced by CG_DrawActiveFrame().
01954 {
01955 int i;
01956 clientInfo_t *ci;
01957
01958 // scan for a deferred player to load
01959 for ( i = 0, ci = cgs.clientinfo ; i < cgs.maxclients ; i++, ci++ ) {
01960 if ( ci->infoValid && ci->deferred ) {
01961 CG_LoadClientInfo( ci );
01962 // break;
01963 }
01964 }
01965 }
|
|
|
Definition at line 1934 of file cg_view.c. References cg, MAX_SOUNDBUFFER, sfxHandle_t, cg_t::soundBuffer, cg_t::soundBufferIn, and cg_t::soundBufferOut. Referenced by CG_CheckLocalSounds(), and CG_EntityEvent().
01934 {
01935 if ( !sfx )
01936 return;
01937 cg.soundBuffer[cg.soundBufferIn] = sfx;
01938 cg.soundBufferIn = (cg.soundBufferIn + 1) % MAX_SOUNDBUFFER;
01939 if (cg.soundBufferIn == cg.soundBufferOut) {
01940 cg.soundBufferOut++;
01941 }
01942 }
|
|
|
Definition at line 2248 of file cg_view.c. References cg, cg_entities, playerState_s::clientNum, cg_t::predictedPlayerState, cg_t::radarEntities, and cg_t::radarEntityCount. Referenced by CG_DrawAutoMap().
02249 {
02250 int i = 0;
02251
02252 //first add yourself
02253 CG_AddRefentForAutoMap(&cg_entities[cg.predictedPlayerState.clientNum]);
02254
02255 while (i < cg.radarEntityCount)
02256 {
02257 CG_AddRefentForAutoMap(&cg_entities[cg.radarEntities[i]]);
02258 i++;
02259 }
02260 }
|
|
|
Definition at line 3064 of file cg_ents.c. References trace_t::allsolid, entityState_s::apos, BG_EvaluateTrajectory(), centity_t, cg, CG_AdjustPositionForMover(), cg_entities, cg_smoothClients, CG_Trace(), CLASS_VEHICLE, playerState_s::clientNum, centity_s::currentState, DEFAULT_MAXS_2, DEFAULT_MINS_2, EF_DEAD, EF_RAG, entityState_s::eFlags, ET_NPC, entityState_s::eType, trace_t::fraction, entityState_s::groundEntityNum, vmCvar_t::integer, centity_s::interpolate, centity_s::isRagging, centity_s::lerpAngles, centity_s::lerpOrigin, playerState_s::m_iVehicleNum, MASK_PLAYERSOLID, MAX_CLIENTS, centity_s::nextState, entityState_s::NPC_class, entityState_s::number, entityState_s::owner, playerMaxs, playerMins, entityState_s::pos, cg_t::predictedPlayerState, qboolean, qfalse, qtrue, snapshot_t::serverTime, cg_t::snap, trace_t::startsolid, cg_t::time, TR_INTERPOLATE, TR_LINEAR_STOP, trajectory_t::trType, vec3_t, VectorAdd, VectorClear, VectorCopy, VectorMA, and VectorNormalize(). Referenced by vmMain().
03064 {
03065 qboolean goAway = qfalse;
03066
03067 // if this player does not want to see extrapolated players
03068 if ( !cg_smoothClients.integer ) {
03069 // make sure the clients use TR_INTERPOLATE
03070 if ( cent->currentState.number < MAX_CLIENTS ) {
03071 cent->currentState.pos.trType = TR_INTERPOLATE;
03072 cent->nextState.pos.trType = TR_INTERPOLATE;
03073 }
03074 }
03075
03076 if (cg.predictedPlayerState.m_iVehicleNum &&
03077 cg.predictedPlayerState.m_iVehicleNum == cent->currentState.number &&
03078 cent->currentState.eType == ET_NPC && cent->currentState.NPC_class == CLASS_VEHICLE)
03079 { //special case for vehicle we are riding
03080 centity_t *veh = &cg_entities[cg.predictedPlayerState.m_iVehicleNum];
03081
03082 if (veh->currentState.owner == cg.predictedPlayerState.clientNum)
03083 { //only do this if the vehicle is pilotted by this client and predicting properly
03084 BG_EvaluateTrajectory( ¢->currentState.pos, cg.time, cent->lerpOrigin );
03085 BG_EvaluateTrajectory( ¢->currentState.apos, cg.time, cent->lerpAngles );
03086 return;
03087 }
03088 }
03089
03090 if ( cent->interpolate && cent->currentState.pos.trType == TR_INTERPOLATE ) {
03091 CG_InterpolateEntityPosition( cent );
03092 return;
03093 }
03094
03095 // first see if we can interpolate between two snaps for
03096 // linear extrapolated clients
03097 if ( cent->interpolate && cent->currentState.pos.trType == TR_LINEAR_STOP &&
03098 cent->currentState.number < MAX_CLIENTS) {
03099 CG_InterpolateEntityPosition( cent );
03100 goAway = qtrue;
03101 }
03102 else if (cent->interpolate &&
03103 cent->currentState.eType == ET_NPC && cent->currentState.NPC_class == CLASS_VEHICLE)
03104 {
03105 CG_InterpolateEntityPosition( cent );
03106 goAway = qtrue;
03107 }
03108 else
03109 {
03110 // just use the current frame and evaluate as best we can
03111 BG_EvaluateTrajectory( ¢->currentState.pos, cg.time, cent->lerpOrigin );
03112 BG_EvaluateTrajectory( ¢->currentState.apos, cg.time, cent->lerpAngles );
03113 }
03114
03115 #if 0
03116 if (cent->hasRagOffset && cent->ragOffsetTime < cg.time)
03117 { //take all of the offsets from last frame and normalize the total direction and add it in
03118 vec3_t slideDir;
03119 vec3_t preOffset;
03120 vec3_t addedOffset;
03121 vec3_t playerMins = {-15, -15, DEFAULT_MINS_2};
03122 vec3_t playerMaxs = {15, 15, DEFAULT_MAXS_2};
03123 trace_t tr;
03124
03125 //VectorSubtract(cent->lerpOrigin, callData->bonePos, slideDir);
03126 VectorCopy(cent->ragOffsets, slideDir);
03127 VectorNormalize(slideDir);
03128
03129 //Store it in case we want to go back
03130 VectorCopy(cent->lerpOriginOffset, preOffset);
03131
03132 //just add a little at a time
03133 VectorMA(cent->lerpOriginOffset, 0.4f, slideDir, cent->lerpOriginOffset);
03134
03135 if (VectorLength(cent->lerpOriginOffset) > 10.0f)
03136 { //don't go too far away
03137 VectorCopy(preOffset, cent->lerpOriginOffset);
03138 }
03139 else
03140 {
03141 //Let's trace there to make sure we can make it
03142 VectorAdd(cent->lerpOrigin, cent->lerpOriginOffset, addedOffset);
03143 CG_Trace(&tr, cent->lerpOrigin, playerMins, playerMaxs, addedOffset, cent->currentState.number, MASK_PLAYERSOLID);
03144
03145 if (tr.startsolid || tr.allsolid || tr.fraction != 1.0f)
03146 { //can't get there
03147 VectorCopy(preOffset, cent->lerpOriginOffset);
03148 }
03149 else
03150 {
03151 /*
03152 if (cent->lerpOriginOffset[2] > 4.0f)
03153 { //don't go too far off the ground
03154 cent->lerpOriginOffset[2] = 4.0f;
03155 }
03156 */
03157 //I guess I just don't want this happening.
03158 cent->lerpOriginOffset[2] = 0.0f;
03159 }
03160 }
03161
03162 //done with this bit
03163 cent->hasRagOffset = qfalse;
03164 VectorClear(cent->ragOffsets);
03165 cent->ragOffsetTime = cg.time + 50;
03166 }
03167
03168 //See if we should add in the offset for ragdoll
03169 if (cent->isRagging && ((cent->currentState.eFlags & EF_DEAD) || (cent->currentState.eFlags & EF_RAG)))
03170 {
03171 VectorAdd(cent->lerpOrigin, cent->lerpOriginOffset, cent->lerpOrigin);
03172 }
03173 #endif
03174
03175 if (goAway)
03176 {
03177 return;
03178 }
03179
03180 // adjust for riding a mover if it wasn't rolled into the predicted
03181 // player state
03182 if ( cent->currentState.number != cg.predictedPlayerState.clientNum ) {
03183 CG_AdjustPositionForMover( cent->lerpOrigin, cent->currentState.groundEntityNum,
03184 cg.snap->serverTime, cg.time, cent->lerpOrigin );
03185 }
03186 }
|
|
|
Definition at line 1130 of file cg_view.c. References atan2(), cg, refdef_t::fov_x, refdef_t::fov_y, refdef_t::height, M_PI, qboolean, qfalse, cg_t::refdef, tan(), and refdef_t::width.
01131 {
01132 float x;
01133 // float phase;
01134 // float v;
01135 // int contents;
01136 float fov_y;
01137 qboolean inwater;
01138
01139 x = cg.refdef.width / tan( fov_x / 360 * M_PI );
01140 fov_y = atan2( cg.refdef.height, x );
01141 fov_y = fov_y * 360 / M_PI;
01142
01143 // there's a problem with this, it only takes the leafbrushes into account, not the entity brushes,
01144 // so if you give slime/water etc properties to a func_door area brush in order to move the whole water
01145 // level up/down this doesn't take into account the door position, so warps the view the whole time
01146 // whether the water is up or not. Fortunately there's only one slime area in Trek that you can be under,
01147 // so lose it...
01148 #if 0
01149 /*
01150 // warp if underwater
01151 contents = CG_PointContents( cg.refdef.vieworg, -1 );
01152 if ( contents & ( CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA ) ){
01153 phase = cg.time / 1000.0 * WAVE_FREQUENCY * M_PI * 2;
01154 v = WAVE_AMPLITUDE * sin( phase );
01155 fov_x += v;
01156 fov_y -= v;
01157 inwater = qtrue;
01158 }
01159 else {
01160 inwater = qfalse;
01161 }
01162 */
01163 #else
01164 inwater = qfalse;
01165 #endif
01166
01167
01168 // set it
01169 cg.refdef.fov_x = fov_x;
01170 cg.refdef.fov_y = fov_y;
01171
01172 #ifdef _XBOX
01173 if(cg.widescreen)
01174 cg.refdef.fov_x *= 1.125f;
01175 #endif
01176
01177 return (inwater);
01178 }
|
|
|
Definition at line 2096 of file cg_view.c. References cg, CG_SE_UpdateMusic(), CG_SE_UpdateShake(), cg_t::refdef, refdef_t::viewangles, and refdef_t::vieworg. Referenced by CG_DrawActiveFrame().
02097 {
02098 CG_SE_UpdateShake(cg.refdef.vieworg, cg.refdef.viewangles);
02099 CG_SE_UpdateMusic();
02100 }
|
|
|
Definition at line 1477 of file cg_view.c. References AnglesSubtract(), centity_t, cg, cg_entities, cg_lastTurretViewAngles, cg_t::frametime, playerState_s::generic1, centity_s::ghoul2, turretStats_t::iAmmoMax, centity_s::lerpAngles, centity_s::lerpOrigin, Vehicle_s::m_iGunnerViewTag, playerState_s::m_iVehicleNum, centity_s::m_pVehicle, Vehicle_s::m_pVehicleInfo, MAX_VEHICLE_TURRETS, vehicleInfo_t::maxPassengers, centity_s::modelScale, NEGATIVE_X, NEGATIVE_Y, NULL, ORIGIN, turretStats_t::passengerNum, turretStats_t::pitchBone, cg_t::predictedPlayerState, qboolean, qfalse, qtrue, cg_t::refdef, cg_t::time, trap_G2API_AddBolt(), trap_G2API_GetBoltMatrix_NoRecNoRot(), vehicleInfo_t::turret, vec3_t, vectoangles(), VectorMA, refdef_t::viewangles, refdef_t::vieworg, and turretStats_t::yawBone.
01478 {
01479 if ( cg.predictedPlayerState.m_iVehicleNum //in a vehicle
01480 && cg.predictedPlayerState.generic1 )//as a passenger
01481 {//passenger in a vehicle
01482 centity_t *vehCent = &cg_entities[cg.predictedPlayerState.m_iVehicleNum];
01483 if ( vehCent->m_pVehicle
01484 && vehCent->m_pVehicle->m_pVehicleInfo
01485 && vehCent->m_pVehicle->m_pVehicleInfo->maxPassengers )
01486 {//a vehicle capable of carrying passengers
01487 int turretNum;
01488 for ( turretNum = 0; turretNum < MAX_VEHICLE_TURRETS; turretNum++ )
01489 {
01490 if ( vehCent->m_pVehicle->m_pVehicleInfo->turret[turretNum].iAmmoMax )
01491 {// valid turret
01492 if ( vehCent->m_pVehicle->m_pVehicleInfo->turret[turretNum].passengerNum == cg.predictedPlayerState.generic1 )
01493 {//I control this turret
01494 int boltIndex = -1;
01495 qboolean hackPosAndAngle = qfalse;
01496 if ( vehCent->m_pVehicle->m_iGunnerViewTag[turretNum] != -1 )
01497 {
01498 boltIndex = vehCent->m_pVehicle->m_iGunnerViewTag[turretNum];
01499 }
01500 else
01501 {//crap... guess?
01502 hackPosAndAngle = qtrue;
01503 if ( vehCent->m_pVehicle->m_pVehicleInfo->turret[turretNum].yawBone )
01504 {
01505 boltIndex = trap_G2API_AddBolt( vehCent->ghoul2, 0, vehCent->m_pVehicle->m_pVehicleInfo->turret[turretNum].yawBone );
01506 }
01507 else if ( vehCent->m_pVehicle->m_pVehicleInfo->turret[turretNum].pitchBone )
01508 {
01509 boltIndex = trap_G2API_AddBolt( vehCent->ghoul2, 0, vehCent->m_pVehicle->m_pVehicleInfo->turret[turretNum].pitchBone );
01510 }
01511 else
01512 {//well, no way of knowing, so screw it
01513 return qfalse;
01514 }
01515 }
01516 if ( boltIndex != -1 )
01517 {
01518 mdxaBone_t boltMatrix;
01519 vec3_t fwd, up;
01520 trap_G2API_GetBoltMatrix_NoRecNoRot(vehCent->ghoul2, 0, boltIndex, &boltMatrix, vehCent->lerpAngles,
01521 vehCent->lerpOrigin, cg.time, NULL, vehCent->modelScale);
01522 BG_GiveMeVectorFromMatrix(&boltMatrix, ORIGIN, cg.refdef.vieworg);
01523 if ( hackPosAndAngle )
01524 {
01525 //FIXME: these are assumptions, externalize? BETTER YET: give me a controller view bolt/tag for each turret
01526 BG_GiveMeVectorFromMatrix(&boltMatrix, NEGATIVE_X, fwd);
01527 BG_GiveMeVectorFromMatrix(&boltMatrix, NEGATIVE_Y, up);
01528 VectorMA( cg.refdef.vieworg, 8.0f, fwd, cg.refdef.vieworg );
01529 VectorMA( cg.refdef.vieworg, 4.0f, up, cg.refdef.vieworg );
01530 }
01531 else
01532 {
01533 BG_GiveMeVectorFromMatrix(&boltMatrix, NEGATIVE_Y, fwd);
01534 }
01535 {
01536 vec3_t newAngles, deltaAngles;
01537 vectoangles( fwd, newAngles );
01538 AnglesSubtract( newAngles, cg_lastTurretViewAngles, deltaAngles );
01539 VectorMA( cg_lastTurretViewAngles, 0.5f*(float)cg.frametime/100.0f, deltaAngles, cg.refdef.viewangles );
01540 }
01541 return qtrue;
01542 }
01543 }
01544 }
01545 }
01546 }
01547 }
01548 return qfalse;
01549 }
|
|
||||||||||||||||||||
|
Definition at line 2121 of file cg_view.c. References cg, CGCam_Shake(), cg_t::refdef, vec3_t, VectorNormalize(), VectorSubtract, and refdef_t::vieworg. Referenced by vmMain().
02122 {
02123 //FIXME: When exactly is the vieworg calculated in relation to the rest of the frame?s
02124
02125 vec3_t dir;
02126 float dist, intensityScale;
02127 float realIntensity;
02128
02129 VectorSubtract( cg.refdef.vieworg, origin, dir );
02130 dist = VectorNormalize( dir );
02131
02132 //Use the dir to add kick to the explosion
02133
02134 if ( dist > radius )
02135 return;
02136
02137 intensityScale = 1 - ( dist / (float) radius );
02138 realIntensity = intensity * intensityScale;
02139
02140 CGCam_Shake( realIntensity, time );
02141 }
|
|
||||||||||||||||
|
Definition at line 2439 of file cg_view.c. References AnglesToAxis(), snapshot_t::areamask, refdef_t::areamask, bg_fighterAltControl, BG_InGrappleMove(), BG_VehicleTurnRateForSpeed(), bgSiegeClasses, centity_t, cg, CG_ActualLoadDeferredPlayers(), CG_AddLagometerFrameInfo(), CG_AddLocalEntities(), CG_AddMarks(), CG_AddPacketEntities(), CG_AddParticles(), CG_AddViewWeapon(), CG_CalcScreenEffects(), CG_ConfigString(), CG_DrawActive(), CG_DrawAutoMap(), CG_DrawInformation(), CG_DrawMiscEnts(), CG_DrawSkyBoxPortal(), cg_entities, cg_fpls, CG_GetStringEdString(), cg_linearFogOverride, CG_PredictPlayerState(), CG_Printf(), CG_ProcessSnapshots(), CG_RunLightStyles(), cg_snapshotTimeout, cg_stats, cg_thirdPerson, cg_timescale, cg_timescaleFadeEnd, cg_timescaleFadeSpeed, CG_UpdateCvars(), CG_UpdateSoundTrackers(), cgQueueLoad, cgs, CLASS_VEHICLE, cg_t::clientFrame, cgs_t::clientinfo, playerState_s::clientNum, Com_Error(), CS_GLOBAL_AMBIENT_SET, CS_SKYBOXORG, centity_s::currentState, cg_t::demoPlayback, playerState_s::emplacedIndex, ERR_DROP, ET_NPC, entityState_s::eType, playerState_s::fallingToDeath, playerState_s::forceHandExtend, cg_t::forceSelect, refdef_t::fov_x, cg_t::frametime, cgs_t::gametype, gCGFallVector, gCGHasFallVector, playerState_s::generic1, GT_SIEGE, HANDEXTEND_KNOCKDOWN, refEntity_t::hModel, cg_t::hyperspace, cg_t::infoScreenText, vmCvar_t::integer, cg_t::itemSelect, playerState_s::legsAnim, playerState_s::m_iVehicleNum, centity_s::m_pVehicle, Vehicle_s::m_pVehicleInfo, memcpy(), name, entityState_s::NPC_class, NULL, cg_t::oldTime, playerState_s::origin, PERS_TEAM, playerState_s::persistant, PM_InKnockDown(), PM_SPECTATOR, playerState_s::pm_type, cg_t::predictedPlayerState, snapshot_t::ps, qboolean, qfalse, qtrue, cg_t::refdef, cg_t::renderingThirdPerson, playerState_s::saberLockTime, cg_t::snap, SNAPFLAG_NOT_ACTIVE, snapshot_t::snapFlags, entityState_s::speed, STAT_HEALTH, playerState_s::stats, STEREO_RIGHT, stereoFrame_t, TEAM_SPECTATOR, cg_t::testModelEntity, refdef_t::time, cg_t::time, playerState_s::torsoAnim, trap_Cvar_Set(), trap_FX_AddScheduledEffects(), trap_FX_AdjustTime(), trap_Milliseconds(), trap_R_ClearScene(), trap_R_SetRangeFog(), trap_ROFF_UpdateEntities(), trap_S_ClearLoopingSounds(), trap_S_Respatialize(), trap_S_UpdateAmbientSet(), trap_SetUserCmdValue(), vehicleInfo_t::type, ui_myteam, va(), vmCvar_t::value, vec3_t, vectoangles(), VectorCopy, VectorNormalize(), VectorSubtract, VH_FIGHTER, refdef_t::viewaxis, refdef_t::vieworg, playerState_s::weapon, cg_t::weaponSelect, WP_EMPLACED_GUN, WP_MELEE, WP_SABER, playerState_s::zoomMode, and cg_t::zoomSensitivity. Referenced by vmMain().
02439 {
02440 int inwater;
02441 const char *cstr;
02442 float mSensitivity = cg.zoomSensitivity;
02443 float mPitchOverride = 0.0f;
02444 float mYawOverride = 0.0f;
02445 static centity_t *veh = NULL;
02446 #ifdef VEH_CONTROL_SCHEME_4
02447 float mSensitivityOverride = 0.0f;
02448 qboolean bUseFighterPitch = qfalse;
02449 qboolean isFighter = qfalse;
02450 #endif
02451
02452 if (cgQueueLoad)
02453 { //do this before you start messing around with adding ghoul2 refents and crap
02454 CG_ActualLoadDeferredPlayers();
02455 cgQueueLoad = qfalse;
02456 }
02457
02458 cg.time = serverTime;
02459 cg.demoPlayback = demoPlayback;
02460
02461 if (cg.snap && ui_myteam.integer != cg.snap->ps.persistant[PERS_TEAM])
02462 {
02463 trap_Cvar_Set ( "ui_myteam", va("%i", cg.snap->ps.persistant[PERS_TEAM]) );
02464 }
02465 if (cgs.gametype == GT_SIEGE &&
02466 cg.snap &&
02467 cg_siegeClassIndex != cgs.clientinfo[cg.snap->ps.clientNum].siegeIndex)
02468 {
02469 cg_siegeClassIndex = cgs.clientinfo[cg.snap->ps.clientNum].siegeIndex;
02470 if (cg_siegeClassIndex == -1)
02471 {
02472 trap_Cvar_Set("ui_mySiegeClass", "<none>");
02473 }
02474 else
02475 {
02476 trap_Cvar_Set("ui_mySiegeClass", bgSiegeClasses[cg_siegeClassIndex].name);
02477 }
02478 }
02479
02480 // update cvars
02481 CG_UpdateCvars();
02482
02483 // if we are only updating the screen as a loading
02484 // pacifier, don't even try to read snapshots
02485 if ( cg.infoScreenText[0] != 0 ) {
02486 CG_DrawInformation();
02487 return;
02488 }
02489
02490 trap_FX_AdjustTime( cg.time );
02491
02492 CG_RunLightStyles();
02493
02494 // any looped sounds will be respecified as entities
02495 // are added to the render list
02496 trap_S_ClearLoopingSounds();
02497
02498 // clear all the render lists
02499 trap_R_ClearScene();
02500
02501 // set up cg.snap and possibly cg.nextSnap
02502 CG_ProcessSnapshots();
02503
02504 trap_ROFF_UpdateEntities();
02505
02506 // if we haven't received any snapshots yet, all
02507 // we can draw is the information screen
02508 if ( !cg.snap || ( cg.snap->snapFlags & SNAPFLAG_NOT_ACTIVE ) )
02509 {
02510 #if 0
02511 // Transition from zero to negative one on the snapshot timeout.
02512 // The reason we do this is because the first client frame is responsible for
02513 // some farily slow processing (such as weather) and we dont want to include
02514 // that processing time into our calculations
02515 if ( !cg.snapshotTimeoutTime )
02516 {
02517 cg.snapshotTimeoutTime = -1;
02518 }
02519 // Transition the snapshot timeout time from -1 to the current time in
02520 // milliseconds which will start the timeout.
02521 else if ( cg.snapshotTimeoutTime == -1 )
02522 {
02523 cg.snapshotTimeoutTime = trap_Milliseconds ( );
02524 }
02525
02526 // If we have been waiting too long then just error out
02527 if ( cg.snapshotTimeoutTime > 0 && (trap_Milliseconds ( ) - cg.snapshotTimeoutTime > cg_snapshotTimeout.integer * 1000) )
02528 {
02529 Com_Error ( ERR_DROP, CG_GetStringEdString("MP_SVGAME", "SNAPSHOT_TIMEOUT"));
02530 return;
02531 }
02532 #endif
02533 CG_DrawInformation();
02534 return;
02535 }
02536
02537 // let the client system know what our weapon and zoom settings are
02538 if (cg.snap && cg.snap->ps.saberLockTime > cg.time)
02539 {
02540 mSensitivity = 0.01f;
02541 }
02542 else if (cg.predictedPlayerState.weapon == WP_EMPLACED_GUN)
02543 { //lower sens for emplaced guns and vehicles
02544 mSensitivity = 0.2f;
02545 }
02546 #ifdef VEH_CONTROL_SCHEME_4
02547 else if (cg.predictedPlayerState.m_iVehicleNum//in a vehicle
02548 && !cg.predictedPlayerState.generic1 )//not as a passenger
02549 {
02550 centity_t *cent = &cg_entities[cg.predictedPlayerState.m_iVehicleNum];
02551 if ( cent->m_pVehicle
02552 && cent->m_pVehicle->m_pVehicleInfo
02553 && cent->m_pVehicle->m_pVehicleInfo->type == VH_FIGHTER )
02554 {
02555 BG_VehicleTurnRateForSpeed( cent->m_pVehicle, cent->currentState.speed, &mPitchOverride, &mYawOverride );
02556 //mSensitivityOverride = 5.0f;//old default value
02557 mSensitivityOverride = 0.0f;
02558 bUseFighterPitch = qtrue;
02559 trap_SetUserCmdValue( cg.weaponSelect, mSensitivity, mPitchOverride, mYawOverride, mSensitivityOverride, cg.forceSelect, cg.itemSelect, bUseFighterPitch );
02560 isFighter = qtrue;
02561 }
02562 }
02563
02564 if ( !isFighter )
02565 #endif //VEH_CONTROL_SCHEME_4
02566 {
02567 if (cg.predictedPlayerState.m_iVehicleNum)
02568 {
02569 veh = &cg_entities[cg.predictedPlayerState.m_iVehicleNum];
02570 }
02571 if (veh &&
02572 veh->currentState.eType == ET_NPC &&
02573 veh->currentState.NPC_class == CLASS_VEHICLE &&
02574 veh->m_pVehicle &&
02575 veh->m_pVehicle->m_pVehicleInfo->type == VH_FIGHTER &&
02576 bg_fighterAltControl.integer)
02577 {
02578 trap_SetUserCmdValue( cg.weaponSelect, mSensitivity, mPitchOverride, mYawOverride, 0.0f, cg.forceSelect, cg.itemSelect, qtrue );
02579 veh = NULL; //this is done because I don't want an extra assign each frame because I am so perfect and super efficient.
02580 }
02581 else
02582 {
02583 trap_SetUserCmdValue( cg.weaponSelect, mSensitivity, mPitchOverride, mYawOverride, 0.0f, cg.forceSelect, cg.itemSelect, qfalse );
02584 }
02585 }
02586
02587 // this counter will be bumped for every valid scene we generate
02588 cg.clientFrame++;
02589
02590 // update cg.predictedPlayerState
02591 CG_PredictPlayerState();
02592
02593 // decide on third person view
02594 cg.renderingThirdPerson = cg_thirdPerson.integer || (cg.snap->ps.stats[STAT_HEALTH] <= 0);
02595
02596 if (cg.snap->ps.stats[STAT_HEALTH] > 0)
02597 {
02598 if (cg.predictedPlayerState.weapon == WP_EMPLACED_GUN && cg.predictedPlayerState.emplacedIndex /*&&
02599 cg_entities[cg.predictedPlayerState.emplacedIndex].currentState.weapon == WP_NONE*/)
02600 { //force third person for e-web and emplaced use
02601 cg.renderingThirdPerson = 1;
02602 }
02603 else if (cg.predictedPlayerState.weapon == WP_SABER || cg.predictedPlayerState.weapon == WP_MELEE ||
02604 BG_InGrappleMove(cg.predictedPlayerState.torsoAnim) || BG_InGrappleMove(cg.predictedPlayerState.legsAnim) ||
02605 cg.predictedPlayerState.forceHandExtend == HANDEXTEND_KNOCKDOWN || cg.predictedPlayerState.fallingToDeath ||
02606 cg.predictedPlayerState.m_iVehicleNum || PM_InKnockDown(&cg.predictedPlayerState))
02607 {
02608 if (cg_fpls.integer && cg.predictedPlayerState.weapon == WP_SABER)
02609 { //force to first person for fpls
02610 cg.renderingThirdPerson = 0;
02611 }
02612 else
02613 {
02614 cg.renderingThirdPerson = 1;
02615 }
02616 }
02617 else if (cg.snap->ps.zoomMode)
02618 { //always force first person when zoomed
02619 cg.renderingThirdPerson = 0;
02620 }
02621 }
02622
02623 if (cg.predictedPlayerState.pm_type == PM_SPECTATOR)
02624 { //always first person for spec
02625 cg.renderingThirdPerson = 0;
02626 }
02627
02628
02629 if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR)
02630 {
02631 cg.renderingThirdPerson = 0;
02632 }
02633
02634 // build cg.refdef
02635 inwater = CG_CalcViewValues();
02636
02637 if (cg_linearFogOverride)
02638 {
02639 trap_R_SetRangeFog(-cg_linearFogOverride);
02640 }
02641 else if (cg.predictedPlayerState.zoomMode)
02642 { //zooming with binoculars or sniper, set the fog range based on the zoom level -rww
02643 cg_rangedFogging = qtrue;
02644 //smaller the fov the less fog we have between the view and cull dist
02645 trap_R_SetRangeFog(cg.refdef.fov_x*64.0f);
02646 }
02647 else if (cg_rangedFogging)
02648 { //disable it
02649 cg_rangedFogging = qfalse;
02650 trap_R_SetRangeFog(0.0f);
02651 }
02652
02653 cstr = CG_ConfigString(CS_SKYBOXORG);
02654
02655 if (cstr && cstr[0])
02656 { //we have a skyportal
02657 CG_DrawSkyBoxPortal(cstr);
02658 }
02659
02660 CG_CalcScreenEffects();
02661
02662 // first person blend blobs, done after AnglesToAxis
02663 if ( !cg.renderingThirdPerson && cg.predictedPlayerState.pm_type != PM_SPECTATOR ) {
02664 CG_DamageBlendBlob();
02665 }
02666
02667 // build the render lists
02668 if ( !cg.hyperspace ) {
02669 CG_AddPacketEntities(qfalse); // adter calcViewValues, so predicted player state is correct
02670 CG_AddMarks();
02671 CG_AddParticles ();
02672 CG_AddLocalEntities();
02673 CG_DrawMiscEnts();
02674 }
02675 CG_AddViewWeapon( &cg.predictedPlayerState );
02676
02677 if ( !cg.hyperspace)
02678 {
02679 trap_FX_AddScheduledEffects(qfalse);
02680 }
02681
02682 // add buffered sounds
02683 CG_PlayBufferedSounds();
02684
02685 // finish up the rest of the refdef
02686 if ( cg.testModelEntity.hModel ) {
02687 CG_AddTestModel();
02688 }
02689 cg.refdef.time = cg.time;
02690 memcpy( cg.refdef.areamask, cg.snap->areamask, sizeof( cg.refdef.areamask ) );
02691
02692 // warning sounds when powerup is wearing off
02693 CG_PowerupTimerSounds();
02694
02695 // if there are any entities flagged as sound trackers and attached to other entities, update their sound pos
02696 CG_UpdateSoundTrackers();
02697
02698 if (gCGHasFallVector)
02699 {
02700 vec3_t lookAng;
02701
02702 VectorSubtract(cg.snap->ps.origin, cg.refdef.vieworg, lookAng);
02703 VectorNormalize(lookAng);
02704 vectoangles(lookAng, lookAng);
02705
02706 VectorCopy(gCGFallVector, cg.refdef.vieworg);
02707 AnglesToAxis(lookAng, cg.refdef.viewaxis);
02708 }
02709
02710 //This is done from the vieworg to get origin for non-attenuated sounds
02711 cstr = CG_ConfigString( CS_GLOBAL_AMBIENT_SET );
02712
02713 if (cstr && cstr[0])
02714 {
02715 trap_S_UpdateAmbientSet( cstr, cg.refdef.vieworg );
02716 }
02717
02718 // update audio positions
02719 trap_S_Respatialize( cg.snap->ps.clientNum, cg.refdef.vieworg, cg.refdef.viewaxis, inwater );
02720
02721 // make sure the lagometerSample and frame timing isn't done twice when in stereo
02722 if ( stereoView != STEREO_RIGHT ) {
02723 cg.frametime = cg.time - cg.oldTime;
02724 if ( cg.frametime < 0 ) {
02725 cg.frametime = 0;
02726 }
02727 cg.oldTime = cg.time;
02728 CG_AddLagometerFrameInfo();
02729 }
02730 if (cg_timescale.value != cg_timescaleFadeEnd.value) {
02731 if (cg_timescale.value < cg_timescaleFadeEnd.value) {
02732 cg_timescale.value += cg_timescaleFadeSpeed.value * ((float)cg.frametime) / 1000;
02733 if (cg_timescale.value > cg_timescaleFadeEnd.value)
02734 cg_timescale.value = cg_timescaleFadeEnd.value;
02735 }
02736 else {
02737 cg_timescale.value -= cg_timescaleFadeSpeed.value * ((float)cg.frametime) / 1000;
02738 if (cg_timescale.value < cg_timescaleFadeEnd.value)
02739 cg_timescale.value = cg_timescaleFadeEnd.value;
02740 }
02741 if (cg_timescaleFadeSpeed.value) {
02742 trap_Cvar_Set("timescale", va("%f", cg_timescale.value));
02743 }
02744 }
02745
02746 // actually issue the rendering calls
02747 CG_DrawActive( stereoView );
02748
02749 CG_DrawAutoMap();
02750
02751 if ( cg_stats.integer ) {
02752 CG_Printf( "cg.clientFrame:%i\n", cg.clientFrame );
02753 }
02754 }
|
|
|
|
Definition at line 1740 of file cg_view.c. References atan2(), atof(), atoi(), cg, CG_AddPacketEntities(), CG_Error(), cg_fov, cg_noFogOutsidePortal, cg_skyOri, cg_skyOriPos, cg_skyOriScale, COM_ParseExt(), refdef_t::fov_x, refdef_t::fov_y, refdef_t::height, cg_t::hyperspace, M_PI, PM_INTERMISSION, playerState_s::pm_type, cg_t::predictedPlayerState, qfalse, qtrue, RDF_DRAWSKYBOX, RDF_NOFOG, RDF_SKYBOXPORTAL, refdef_t::rdflags, cg_t::refdef, tan(), refdef_t::time, cg_t::time, trap_FX_AddScheduledEffects(), trap_R_RenderScene(), vmCvar_t::value, vec3_t, vec4_t, VectorAdd, VectorScale, VectorSubtract, refdef_t::vieworg, refdef_t::width, ZOOM_OUT_TIME, zoomFov, playerState_s::zoomMode, and cg_t::zoomTime. Referenced by CG_DrawActiveFrame().
01741 {
01742 static float lastfov;
01743 refdef_t backuprefdef;
01744 float fov_x;
01745 float fov_y;
01746 float x;
01747 char *token;
01748 float f = 0;
01749
01750 lastfov = zoomFov; // for transitions back from zoomed in modes
01751
01752 backuprefdef = cg.refdef;
01753
01754 token = COM_ParseExt(&cstr, qfalse);
01755 if (!token || !token[0])
01756 {
01757 CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring\n");
01758 }
01759 cg.refdef.vieworg[0] = atof(token);
01760
01761 token = COM_ParseExt(&cstr, qfalse);
01762 if (!token || !token[0])
01763 {
01764 CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring\n");
01765 }
01766 cg.refdef.vieworg[1] = atof(token);
01767
01768 token = COM_ParseExt(&cstr, qfalse);
01769 if (!token || !token[0])
01770 {
01771 CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring\n");
01772 }
01773 cg.refdef.vieworg[2] = atof(token);
01774
01775 token = COM_ParseExt(&cstr, qfalse);
01776 if (!token || !token[0])
01777 {
01778 CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring\n");
01779 }
01780 fov_x = atoi(token);
01781
01782 if (!fov_x)
01783 {
01784 fov_x = cg_fov.value;
01785 }
01786
01787 // setup fog the first time, ignore this part of the configstring after that
01788 token = COM_ParseExt(&cstr, qfalse);
01789 if (!token || !token[0])
01790 {
01791 CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring. No fog state\n");
01792 }
01793 else
01794 {
01795 vec4_t fogColor;
01796 int fogStart, fogEnd;
01797
01798 if(atoi(token))
01799 { // this camera has fog
01800 token = COM_ParseExt(&cstr, qfalse);
01801
01802 if (!token || !token[0])
01803 {
01804 CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring. No fog[0]\n");
01805 }
01806 fogColor[0] = atof(token);
01807
01808 token = COM_ParseExt(&cstr, qfalse);
01809 if (!token || !token[0])
01810 {
01811 CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring. No fog[1]\n");
01812 }
01813 fogColor[1] = atof(token);
01814
01815 token = COM_ParseExt(&cstr, qfalse);
01816 if (!token || !token[0])
01817 {
01818 CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring. No fog[2]\n");
01819 }
01820 fogColor[2] = atof(token);
01821
01822 token = COM_ParseExt(&cstr, qfalse);
01823 if (!token || !token[0])
01824 {
01825 fogStart = 0;
01826 }
01827 else
01828 {
01829 fogStart = atoi(token);
01830 }
01831
01832 token = COM_ParseExt(&cstr, qfalse);
01833 if (!token || !token[0])
01834 {
01835 fogEnd = 0;
01836 }
01837 else
01838 {
01839 fogEnd = atoi(token);
01840 }
01841 }
01842 }
01843
01844 if ( cg.predictedPlayerState.pm_type == PM_INTERMISSION )
01845 {
01846 // if in intermission, use a fixed value
01847 fov_x = cg_fov.value;
01848 }
01849 else
01850 {
01851 fov_x = cg_fov.value;
01852 if ( fov_x < 1 )
01853 {
01854 fov_x = 1;
01855 }
01856 else if ( fov_x > 160 )
01857 {
01858 fov_x = 160;
01859 }
01860
01861 if (cg.predictedPlayerState.zoomMode)
01862 {
01863 fov_x = zoomFov;
01864 }
01865
01866 // do smooth transitions for zooming
01867 if (cg.predictedPlayerState.zoomMode)
01868 { //zoomed/zooming in
01869 f = ( cg.time - cg.zoomTime ) / (float)ZOOM_OUT_TIME;
01870 if ( f > 1.0 ) {
01871 fov_x = zoomFov;
01872 } else {
01873 fov_x = fov_x + f * ( zoomFov - fov_x );
01874 }
01875 lastfov = fov_x;
01876 }
01877 else
01878 { //zooming out
01879 f = ( cg.time - cg.zoomTime ) / (float)ZOOM_OUT_TIME;
01880 if ( f > 1.0 ) {
01881 fov_x = fov_x;
01882 } else {
01883 fov_x = zoomFov + f * ( fov_x - zoomFov);
01884 }
01885 }
01886 }
01887
01888 x = cg.refdef.width / tan( fov_x / 360 * M_PI );
01889 fov_y = atan2( cg.refdef.height, x );
01890 fov_y = fov_y * 360 / M_PI;
01891
01892 cg.refdef.fov_x = fov_x;
01893 cg.refdef.fov_y = fov_y;
01894
01895 cg.refdef.rdflags |= RDF_SKYBOXPORTAL;
01896 cg.refdef.rdflags |= RDF_DRAWSKYBOX;
01897
01898 cg.refdef.time = cg.time;
01899
01900 if ( !cg.hyperspace)
01901 { //rww - also had to add this to add effects being rendered in portal sky areas properly.
01902 trap_FX_AddScheduledEffects(qtrue);
01903 }
01904
01905 CG_AddPacketEntities(qtrue); //rww - There was no proper way to put real entities inside the portal view before.
01906 //This will put specially flagged entities in the render.
01907
01908 if (cg_skyOri)
01909 { //ok, we want to orient the sky refdef vieworg based on the normal vieworg's relation to the ori pos
01910 vec3_t dif;
01911
01912 VectorSubtract(backuprefdef.vieworg, cg_skyOriPos, dif);
01913 VectorScale(dif, cg_skyOriScale, dif);
01914 VectorAdd(cg.refdef.vieworg, dif, cg.refdef.vieworg);
01915 }
01916
01917 if (cg_noFogOutsidePortal)
01918 { //make sure no fog flag is stripped first, and make sure it is set on the normal refdef
01919 cg.refdef.rdflags &= ~RDF_NOFOG;
01920 backuprefdef.rdflags |= RDF_NOFOG;
01921 }
01922
01923 // draw the skybox
01924 trap_R_RenderScene( &cg.refdef );
01925
01926 cg.refdef = backuprefdef;
01927 }
|
|
|
Definition at line 2177 of file cg_view.c. References AnglesToAxis(), BG_EmplacedView(), cg, cg_entities, playerState_s::emplacedIndex, cg_t::predictedPlayerState, snapshot_t::ps, cg_t::refdef, cg_t::snap, cg_t::time, trap_SetClientForceAngle(), vec3_t, playerState_s::viewangles, refdef_t::viewangles, refdef_t::viewaxis, and YAW.
02178 {
02179 float yaw;
02180 int override;
02181
02182 override = BG_EmplacedView(cg.refdef.viewangles, angles, &yaw,
02183 cg_entities[cg.snap->ps.emplacedIndex].currentState.origin2[0]);
02184
02185 if (override)
02186 {
02187 cg.refdef.viewangles[YAW] = yaw;
02188 AnglesToAxis(cg.refdef.viewangles, cg.refdef.viewaxis);
02189
02190 if (override == 2)
02191 {
02192 trap_SetClientForceAngle(cg.time + 5000, cg.refdef.viewangles);
02193 }
02194 }
02195
02196 //we want to constrain the predicted player state viewangles as well
02197 override = BG_EmplacedView(cg.predictedPlayerState.viewangles, angles, &yaw,
02198 cg_entities[cg.snap->ps.emplacedIndex].currentState.origin2[0]);
02199 if (override)
02200 {
02201 cg.predictedPlayerState.viewangles[YAW] = yaw;
02202 }
02203 }
|
|
|
Definition at line 797 of file cg_view.c. References cg, cg_t::refdef, vec3_t, VectorCopy, and refdef_t::vieworg. Referenced by BG_VehTraceFromCamPos().
00798 {
00799 VectorCopy( cg.refdef.vieworg, camPos );
00800 }
|
|
|
||||||||||||
|
Definition at line 2003 of file cg_view.c. References CAMERA_DEFAULT_FOV, cg, cgScreenEffects, crandom, cgscreffects_s::FOV, cgscreffects_s::FOV2, cgscreffects_s::shake_duration, cgscreffects_s::shake_intensity, cgscreffects_s::shake_start, cg_t::time, vec3_t, and VectorAdd. Referenced by CG_CalcScreenEffects().
02004 {
02005 vec3_t moveDir;
02006 float intensity_scale, intensity;
02007 int i;
02008
02009 if ( cgScreenEffects.shake_duration <= 0 )
02010 return;
02011
02012 if ( cg.time > ( cgScreenEffects.shake_start + cgScreenEffects.shake_duration ) )
02013 {
02014 cgScreenEffects.shake_intensity = 0;
02015 cgScreenEffects.shake_duration = 0;
02016 cgScreenEffects.shake_start = 0;
02017 return;
02018 }
02019
02020 cgScreenEffects.FOV = CAMERA_DEFAULT_FOV;
02021 cgScreenEffects.FOV2 = CAMERA_DEFAULT_FOV;
02022
02023 //intensity_scale now also takes into account FOV with 90.0 as normal
02024 intensity_scale = 1.0f - ( (float) ( cg.time - cgScreenEffects.shake_start ) / (float) cgScreenEffects.shake_duration ) * (((cgScreenEffects.FOV+cgScreenEffects.FOV2)/2.0f)/90.0f);
02025
02026 intensity = cgScreenEffects.shake_intensity * intensity_scale;
02027
02028 for ( i = 0; i < 3; i++ )
02029 {
02030 moveDir[i] = ( crandom() * intensity );
02031 }
02032
02033 //Move the camera
02034 VectorAdd( origin, moveDir, origin );
02035
02036 for ( i=0; i < 2; i++ ) // Don't do ROLL
02037 moveDir[i] = ( crandom() * intensity );
02038
02039 //Move the angles
02040 VectorAdd( angles, moveDir, angles );
02041 }
|
|
|
Definition at line 98 of file cg_view.c. References cg, CG_TestModel_f(), qtrue, refEntity_t::renderfx, RF_DEPTHHACK, RF_FIRST_PERSON, cg_t::testGun, and cg_t::testModelEntity.
00098 {
00099 CG_TestModel_f();
00100 cg.testGun = qtrue;
00101 //cg.testModelEntity.renderfx = RF_MINLIGHT | RF_DEPTHHACK | RF_FIRST_PERSON;
00102
00103 // rww - 9-13-01 [1-26-01-sof2]
00104 cg.testModelEntity.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON;
00105 }
|
|
|
|
Definition at line 108 of file cg_view.c. References cg, CG_Printf(), refEntity_t::frame, and cg_t::testModelEntity.
00108 {
00109 cg.testModelEntity.frame++;
00110 CG_Printf( "frame %i\n", cg.testModelEntity.frame );
00111 }
|
|
|
Definition at line 121 of file cg_view.c. References cg, CG_Printf(), refEntity_t::skinNum, and cg_t::testModelEntity.
00121 {
00122 cg.testModelEntity.skinNum++;
00123 CG_Printf( "skin %i\n", cg.testModelEntity.skinNum );
00124 }
|
|
|
Definition at line 113 of file cg_view.c. References cg, CG_Printf(), refEntity_t::frame, and cg_t::testModelEntity.
00113 {
00114 cg.testModelEntity.frame--;
00115 if ( cg.testModelEntity.frame < 0 ) {
00116 cg.testModelEntity.frame = 0;
00117 }
00118 CG_Printf( "frame %i\n", cg.testModelEntity.frame );
00119 }
|
|
|
Definition at line 126 of file cg_view.c. References cg, CG_Printf(), refEntity_t::skinNum, and cg_t::testModelEntity.
00126 {
00127 cg.testModelEntity.skinNum--;
00128 if ( cg.testModelEntity.skinNum < 0 ) {
00129 cg.testModelEntity.skinNum = 0;
00130 }
00131 CG_Printf( "skin %i\n", cg.testModelEntity.skinNum );
00132 }
|
|
|
Definition at line 1960 of file cg_view.c. References centity_t, cg, cg_entities, CG_S_UpdateLoopingSounds(), playerState_s::clientNum, centity_s::currentState, EF_SOUNDTRACKER, entityState_s::eFlags, ENTITYNUM_NONE, centity_s::lerpOrigin, entityState_s::number, snapshot_t::ps, cg_t::refdef, cg_t::snap, trap_S_UpdateEntityPosition(), entityState_s::trickedentindex, VectorCopy, and refdef_t::vieworg. Referenced by CG_DrawActiveFrame().
01961 {
01962 int num;
01963 centity_t *cent;
01964
01965 for ( num = 0 ; num < ENTITYNUM_NONE ; num++ )
01966 {
01967 cent = &cg_entities[num];
01968
01969 if (cent && (cent->currentState.eFlags & EF_SOUNDTRACKER) && cent->currentState.number == num)
01970 //make sure the thing is valid at least.
01971 { //keep sound for this entity updated in accordance with its attached entity at all times
01972 if (cg.snap && cent->currentState.trickedentindex == cg.snap->ps.clientNum)
01973 { //this is actually the player, so center the sound origin right on top of us
01974 VectorCopy(cg.refdef.vieworg, cent->lerpOrigin);
01975 trap_S_UpdateEntityPosition( cent->currentState.number, cent->lerpOrigin );
01976 }
01977 else
01978 {
01979 trap_S_UpdateEntityPosition( cent->currentState.number, cg_entities[cent->currentState.trickedentindex].lerpOrigin );
01980 }
01981 }
01982
01983 if (cent->currentState.number == num)
01984 {
01985 //update all looping sounds..
01986 CG_S_UpdateLoopingSounds(num);
01987 }
01988 }
01989 }
|
|
|
Definition at line 1105 of file cg_view.c. References cg, qtrue, cg_t::time, cg_t::zoomed, and cg_t::zoomTime.
|
|
|
Definition at line 1113 of file cg_view.c. References cg, qfalse, cg_t::time, cg_t::zoomed, and cg_t::zoomTime.
|
|
||||||||||||
|
Definition at line 2143 of file cg_view.c. References cg, cgScreenEffects, cgscreffects_s::music_volume_multiplier, cgscreffects_s::music_volume_set, cgscreffects_s::music_volume_time, qfalse, and cg_t::time. Referenced by CG_EntityEvent().
02144 {
02145 if (multiplier < 0.1f)
02146 {
02147 multiplier = 0.1f;
02148 }
02149
02150 if (multiplier > 1.0f)
02151 {
02152 multiplier = 1.0f;
02153 }
02154
02155 cgScreenEffects.music_volume_multiplier = multiplier;
02156 cgScreenEffects.music_volume_time = cg.time + duration;
02157 cgScreenEffects.music_volume_set = qfalse;
02158 }
|
|
||||||||||||
|
Definition at line 2102 of file cg_view.c. References cg, cgScreenEffects, MAX_SHAKE_INTENSITY, cgscreffects_s::shake_duration, cgscreffects_s::shake_intensity, cgscreffects_s::shake_start, and cg_t::time. Referenced by CG_AddPlayerWeapon(), CG_DoCameraShake(), CG_EntityEvent(), CG_ExplosionEffects(), and CG_FireWeapon().
02103 {
02104 if ( intensity > MAX_SHAKE_INTENSITY )
02105 intensity = MAX_SHAKE_INTENSITY;
02106
02107 cgScreenEffects.shake_intensity = intensity;
02108 cgScreenEffects.shake_duration = duration;
02109
02110
02111 cgScreenEffects.shake_start = cg.time;
02112 //JLFRUMBLE
02113 #ifdef _XBOX
02114 extern void FF_XboxShake(float intensity, int duration);
02115
02116 FF_XboxShake(intensity, duration);
02117
02118 #endif
02119 }
|
|
|
Definition at line 1216 of file bg_panimate.c.
01217 {
01218 switch ( (ps->legsAnim) )
01219 {
01220 case BOTH_KNOCKDOWN1:
01221 case BOTH_KNOCKDOWN2:
01222 case BOTH_KNOCKDOWN3:
01223 case BOTH_KNOCKDOWN4:
01224 case BOTH_KNOCKDOWN5:
01225 return qtrue;
01226 break;
01227 case BOTH_GETUP1:
01228 case BOTH_GETUP2:
01229 case BOTH_GETUP3:
01230 case BOTH_GETUP4:
01231 case BOTH_GETUP5:
01232 case BOTH_FORCE_GETUP_F1:
01233 case BOTH_FORCE_GETUP_F2:
01234 case BOTH_FORCE_GETUP_B1:
01235 case BOTH_FORCE_GETUP_B2:
01236 case BOTH_FORCE_GETUP_B3:
01237 case BOTH_FORCE_GETUP_B4:
01238 case BOTH_FORCE_GETUP_B5:
01239 case BOTH_GETUP_BROLL_B:
01240 case BOTH_GETUP_BROLL_F:
01241 case BOTH_GETUP_BROLL_L:
01242 case BOTH_GETUP_BROLL_R:
01243 case BOTH_GETUP_FROLL_B:
01244 case BOTH_GETUP_FROLL_F:
01245 case BOTH_GETUP_FROLL_L:
01246 case BOTH_GETUP_FROLL_R:
01247 if ( ps->legsTimer )
01248 {
01249 return qtrue;
01250 }
01251 break;
01252 }
01253 return qfalse;
01254 }
|
|
|
Definition at line 227 of file cg_view.c. Referenced by G_EstimateCamPos(). |
|
|
Definition at line 225 of file cg_view.c. Referenced by G_EstimateCamPos(). |
|
|
Definition at line 225 of file cg_view.c. Referenced by G_EstimateCamPos(). |
|
|
Definition at line 223 of file cg_view.c. Referenced by G_EstimateCamPos(). |
|
|
Definition at line 226 of file cg_view.c. Referenced by G_EstimateCamPos(). |
|
|
Definition at line 226 of file cg_view.c. Referenced by G_EstimateCamPos(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 223 of file cg_view.c. Referenced by G_EstimateCamPos(). |
|
|
|
|
|
|
|
|
Definition at line 2271 of file cg_view.c. Referenced by CG_DrawAutoMap(), and vmMain(). |
|
|
Definition at line 2272 of file cg_view.c. Referenced by CG_DrawAutoMap(), and vmMain(). |
|
|
Definition at line 2273 of file cg_view.c. Referenced by CG_DrawAutoMap(), and vmMain(). |
|
|
Definition at line 2269 of file cg_view.c. Referenced by CG_DrawAutoMap(). |
|
|
Definition at line 2270 of file cg_view.c. Referenced by CG_DrawAutoMap(). |
|
|
Definition at line 1476 of file cg_view.c. Referenced by CG_CheckPassengerTurretView(). |
|
|
Definition at line 2427 of file cg_view.c. Referenced by CG_DrawActiveFrame(), and CG_SpawnCGameEntFromVars(). |
|
|
Definition at line 1739 of file cg_view.c. Referenced by CG_CreateSkyPortalFromSpawnEnt(), and CG_DrawSkyBoxPortal(). |
|
|
Definition at line 1736 of file cg_view.c. Referenced by CG_CreateSkyOriFromSpawnEnt(), and CG_DrawSkyBoxPortal(). |
|
|
Definition at line 1737 of file cg_view.c. Referenced by CG_CreateSkyOriFromSpawnEnt(), and CG_DrawSkyBoxPortal(). |
|
|
Definition at line 1738 of file cg_view.c. Referenced by CG_CreateSkyOriFromSpawnEnt(), and CG_DrawSkyBoxPortal(). |
|
|
|
|
|
Definition at line 2434 of file cg_view.c. Referenced by CG_DrawActiveFrame(), and CG_LoadDeferredPlayers(). |
|
|
Definition at line 2001 of file cg_view.c. Referenced by CG_SE_UpdateMusic(), CG_SE_UpdateShake(), CGCam_SetMusicMult(), and CGCam_Shake(). |
|
|
Definition at line 249 of file cg_view.c. Referenced by CG_DrawActiveFrame(). |
|
|
Definition at line 248 of file cg_view.c. Referenced by CG_DrawActiveFrame(). |
|
|
Definition at line 1189 of file cg_view.c. Referenced by CG_DrawSkyBoxPortal(). |