MCPcopy Create free account
hub / github.com/JACoders/OpenJK / CG_AddRefEntWithTransportEffect

Function CG_AddRefEntWithTransportEffect

code/cgame/cg_ents.cpp:203–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203void CG_AddRefEntWithTransportEffect ( centity_t *cent, refEntity_t *ent )
204{
205 // We are a normal thing....
206 cgi_R_AddRefEntityToScene (ent);
207
208 if ( ent->renderfx & RF_PULSATE && cent->gent->owner && cent->gent->owner->health &&
209 !cent->gent->owner->s.number && cent->gent->owner->client && //only for player
210 cent->gent->owner->client->ps.saberEntityState == SES_RETURNING &&
211 cent->currentState.saberActive == qfalse )
212 {
213 // if we are the saber and we have been dropped, do a glow so it can be spotted easier
214 float wv;
215 vec3_t org;
216
217 ent->customShader = cgi_R_RegisterShader( "gfx/effects/solidWhite_cull" );
218 ent->renderfx = RF_RGB_TINT;
219 wv = sin( cg.time * 0.003f ) * 0.08f + 0.1f;
220 ent->shaderRGBA[0] = wv * 255;
221 ent->shaderRGBA[1] = wv * 255;
222 ent->shaderRGBA[2] = wv * 0;
223 cgi_R_AddRefEntityToScene (ent);
224
225 for ( int i = -4; i < 10; i += 1 )
226 {
227 VectorMA( ent->origin, -i, ent->axis[2], org );
228
229 FX_AddSprite( org, NULL, NULL, 5.5f, 5.5f, wv, wv, 0.0f, 0.0f, 1.0f, cgs.media.yellowDroppedSaberShader, 0x08000000 );
230 }
231 if ( cent->gent->owner->s.weapon == WP_SABER )
232 {//he's still controlling me
233 FX_AddSprite( cent->gent->owner->client->renderInfo.handRPoint, NULL, NULL, 8.0f, 8.0f, wv, wv, 0.0f, 0.0f, 1.0f, cgs.media.yellowDroppedSaberShader, 0x08000000 );
234 }
235 }
236}
237
238
239/*

Callers 2

CG_GeneralFunction · 0.70
CG_MoverFunction · 0.70

Calls 4

cgi_R_RegisterShaderFunction · 0.70
FX_AddSpriteFunction · 0.70
VectorMAFunction · 0.50

Tested by

no test coverage detected