void R_StoreEfrags (efrag_t **ppefrag) { entity_t *pent; model_t *model; efrag_t *pefrag; for (pefrag = *ppefrag; pefrag; pefrag = pefrag->leafnext) { pent = pefrag->entity; model = pent->model; if (model->modhint == MOD_FLAME && !r_drawflame.value) continue; switch (model->type) { case mod_alias: case mod_alias3: case mod_brush: case mod_sprite: if (pent->visframe != r_framecount) { CL_AddEntity (pent); pent->visframe = r_framecount; // mark that we've recorded this entity for this frame } break; default: Sys_Error ("R_StoreEfrags: Bad entity type %d", model->type); } } }
int HUD_AddVisibleEntity( edict_t *pEnt, int ed_type ) { float oldScale, oldRenderAmt; float shellScale = 1.0f; int result; if ( pEnt->v.renderfx == kRenderFxGlowShell ) { oldRenderAmt = pEnt->v.renderamt; oldScale = pEnt->v.scale; pEnt->v.renderamt = 255; // clear amount } result = CL_AddEntity( pEnt, ed_type, -1 ); if ( pEnt->v.renderfx == kRenderFxGlowShell ) { shellScale = (oldRenderAmt * 0.0015f); // shellOffset pEnt->v.scale = oldScale + shellScale; // sets new scale pEnt->v.renderamt = 128; // render glowshell result |= CL_AddEntity( pEnt, ed_type, g_pTempEnts->hSprGlowShell ); // restore parms pEnt->v.scale = oldScale; pEnt->v.renderamt = oldRenderAmt; } if ( pEnt->v.effects & EF_BRIGHTFIELD ) { g_engfuncs.pEfxAPI->R_EntityParticles( pEnt ); } // add in muzzleflash effect if ( pEnt->v.effects & EF_MUZZLEFLASH ) { if( ed_type == ED_VIEWMODEL ) pEnt->v.effects &= ~EF_MUZZLEFLASH; g_pTempEnts->WeaponFlash( pEnt, 1 ); } // add light effect if ( pEnt->v.effects & EF_LIGHT ) { g_pTempEnts->AllocDLight( pEnt->v.origin, 100, 100, 100, 200, 0.001f, 0 ); g_pTempEnts->RocketFlare( pEnt->v.origin ); } // add dimlight if ( pEnt->v.effects & EF_DIMLIGHT ) { if ( ed_type == ED_CLIENT ) { EV_UpadteFlashlight( pEnt ); } else { g_pTempEnts->AllocDLight( pEnt->v.origin, RANDOM_LONG( 200, 230 ), 0.001f, 0 ); } } if ( pEnt->v.effects & EF_BRIGHTLIGHT ) { Vector pos( pEnt->v.origin.x, pEnt->v.origin.y, pEnt->v.origin.z + 16 ); g_pTempEnts->AllocDLight( pos, RANDOM_LONG( 400, 430 ), 0.001f, 0 ); } return result; }