summaryrefslogtreecommitdiff
path: root/src/cgame/cg_ents.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2001-12-30 02:20:36 +0000
committerTim Angus <tim@ngus.net>2001-12-30 02:20:36 +0000
commit969f12211fb141c6e7b68c662294002a177dc386 (patch)
tree81a5775900668b9147621e8405c9cd993a048a9e /src/cgame/cg_ents.c
parent8b42b0ff0714ff211801a7c7ec57197c1576884f (diff)
bg_itemlist is dead. Yay
Diffstat (limited to 'src/cgame/cg_ents.c')
-rw-r--r--src/cgame/cg_ents.c149
1 files changed, 0 insertions, 149 deletions
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c
index a2f5a2b0..a7e95e1c 100644
--- a/src/cgame/cg_ents.c
+++ b/src/cgame/cg_ents.c
@@ -212,152 +212,6 @@ static void CG_Speaker( centity_t *cent ) {
cent->miscTime = cg.time + cent->currentState.frame * 100 + cent->currentState.clientNum * 100 * crandom();
}
-/*
-==================
-CG_Item
-==================
-*/
-static void CG_Item( centity_t *cent ) {
- refEntity_t ent;
- entityState_t *es;
- gitem_t *item;
- int msec;
- float frac;
- float scale;
- weaponInfo_t *wi;
-
-
- es = &cent->currentState;
- if ( es->modelindex >= bg_numItems ) {
- CG_Error( "Bad item index %i on entity", es->modelindex );
- }
-
- // if set to invisible, skip
- if ( !es->modelindex || ( es->eFlags & EF_NODRAW ) ) {
- return;
- }
-
- item = &bg_itemlist[ es->modelindex ];
- if ( cg_simpleItems.integer && item->giType != IT_TEAM ) {
- memset( &ent, 0, sizeof( ent ) );
- ent.reType = RT_SPRITE;
- VectorCopy( cent->lerpOrigin, ent.origin );
- ent.radius = 14;
- ent.customShader = cg_items[es->modelindex].icon;
- ent.shaderRGBA[0] = 255;
- ent.shaderRGBA[1] = 255;
- ent.shaderRGBA[2] = 255;
- ent.shaderRGBA[3] = 255;
- trap_R_AddRefEntityToScene(&ent);
- return;
- }
-
- // items bob up and down continuously
- scale = 0.005 + cent->currentState.number * 0.00001;
- cent->lerpOrigin[2] += 4 + cos( ( cg.time + 1000 ) * scale ) * 4;
-
- memset (&ent, 0, sizeof(ent));
-
- // autorotate at one of two speeds
- if ( item->giType == IT_HEALTH ) {
- VectorCopy( cg.autoAnglesFast, cent->lerpAngles );
- AxisCopy( cg.autoAxisFast, ent.axis );
- } else {
- VectorCopy( cg.autoAngles, cent->lerpAngles );
- AxisCopy( cg.autoAxis, ent.axis );
- }
-
- // the weapons have their origin where they attatch to player
- // models, so we need to offset them or they will rotate
- // eccentricly
- wi = NULL;
- if ( item->giType == IT_WEAPON ) {
-
- wi = &cg_weapons[item->giTag];
- cent->lerpOrigin[0] -=
- wi->weaponMidpoint[0] * ent.axis[0][0] +
- wi->weaponMidpoint[1] * ent.axis[1][0] +
- wi->weaponMidpoint[2] * ent.axis[2][0];
- cent->lerpOrigin[1] -=
- wi->weaponMidpoint[0] * ent.axis[0][1] +
- wi->weaponMidpoint[1] * ent.axis[1][1] +
- wi->weaponMidpoint[2] * ent.axis[2][1];
- cent->lerpOrigin[2] -=
- wi->weaponMidpoint[0] * ent.axis[0][2] +
- wi->weaponMidpoint[1] * ent.axis[1][2] +
- wi->weaponMidpoint[2] * ent.axis[2][2];
-
- cent->lerpOrigin[2] += 8; // an extra height boost
- }
-
- ent.hModel = cg_items[es->modelindex].models[0];
-
- VectorCopy( cent->lerpOrigin, ent.origin);
- VectorCopy( cent->lerpOrigin, ent.oldorigin);
-
- ent.nonNormalizedAxes = qfalse;
-
- // if just respawned, slowly scale up
- msec = cg.time - cent->miscTime;
- if ( msec >= 0 && msec < ITEM_SCALEUP_TIME ) {
- frac = (float)msec / ITEM_SCALEUP_TIME;
- VectorScale( ent.axis[0], frac, ent.axis[0] );
- VectorScale( ent.axis[1], frac, ent.axis[1] );
- VectorScale( ent.axis[2], frac, ent.axis[2] );
- ent.nonNormalizedAxes = qtrue;
- } else {
- frac = 1.0;
- }
-
- // items without glow textures need to keep a minimum light value
- // so they are always visible
- if ( ( item->giType == IT_WEAPON ) ||
- ( item->giType == IT_ARMOR ) ) {
- ent.renderfx |= RF_MINLIGHT;
- }
-
- // increase the size of the weapons when they are presented as items
- if ( item->giType == IT_WEAPON ) {
- VectorScale( ent.axis[0], 1.5, ent.axis[0] );
- VectorScale( ent.axis[1], 1.5, ent.axis[1] );
- VectorScale( ent.axis[2], 1.5, ent.axis[2] );
- ent.nonNormalizedAxes = qtrue;
- }
-
- // add to refresh list
- trap_R_AddRefEntityToScene(&ent);
-
- // accompanying rings / spheres for powerups
- if ( !cg_simpleItems.integer )
- {
- vec3_t spinAngles;
-
- VectorClear( spinAngles );
-
- if ( item->giType == IT_HEALTH || item->giType == IT_POWERUP )
- {
- if ( ( ent.hModel = cg_items[es->modelindex].models[1] ) != 0 )
- {
- if ( item->giType == IT_POWERUP )
- {
- ent.origin[2] += 12;
- spinAngles[1] = ( cg.time & 1023 ) * 360 / -1024.0f;
- }
- AnglesToAxis( spinAngles, ent.axis );
-
- // scale up if respawning
- if ( frac != 1.0 ) {
- VectorScale( ent.axis[0], frac, ent.axis[0] );
- VectorScale( ent.axis[1], frac, ent.axis[1] );
- VectorScale( ent.axis[2], frac, ent.axis[2] );
- ent.nonNormalizedAxes = qtrue;
- }
- trap_R_AddRefEntityToScene( &ent );
- }
- }
- }
-}
-
//============================================================================
@@ -968,9 +822,6 @@ static void CG_AddCEntity( centity_t *cent ) {
case ET_PLAYER:
CG_Player( cent );
break;
- case ET_ITEM:
- CG_Item( cent );
- break;
case ET_BUILDABLE:
CG_Buildable( cent );
break;