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

Function FX_AddLine

codeJK2/cgame/FxUtil.cpp:549–616  ·  view source on GitHub ↗

------------------------- FX_AddLine -------------------------

Source from the content-addressed store, hash-verified

547// FX_AddLine
548//-------------------------
549CLine *FX_AddLine( vec3_t start, vec3_t end, float size1, float size2, float sizeParm,
550 float alpha1, float alpha2, float alphaParm,
551 vec3_t sRGB, vec3_t eRGB, float rgbParm,
552 int killTime, qhandle_t shader, int flags = 0 )
553{
554 if ( theFxHelper.mFrameTime < 1 )
555 { // disallow adding new effects when the system is paused
556 return 0;
557 }
558
559 CLine *fx = new CLine;
560
561 if ( fx )
562 {
563 fx->SetOrigin1( start );
564 fx->SetOrigin2( end );
565
566 // RGB----------------
567 fx->SetRGBStart( sRGB );
568 fx->SetRGBEnd( eRGB );
569
570 if (( flags & FX_RGB_PARM_MASK ) == FX_RGB_WAVE )
571 {
572 fx->SetRGBParm( rgbParm * PI * 0.001f );
573 }
574 else if ( flags & FX_RGB_PARM_MASK )
575 {
576 // rgbParm should be a value from 0-100..
577 fx->SetRGBParm( rgbParm * 0.01f * killTime + theFxHelper.mTime );
578 }
579
580 // Alpha----------------
581 fx->SetAlphaStart( alpha1 );
582 fx->SetAlphaEnd( alpha2 );
583
584 if (( flags & FX_ALPHA_PARM_MASK ) == FX_ALPHA_WAVE )
585 {
586 fx->SetAlphaParm( alphaParm * PI * 0.001f );
587 }
588 else if ( flags & FX_ALPHA_PARM_MASK )
589 {
590 fx->SetAlphaParm( alphaParm * 0.01f * killTime + theFxHelper.mTime );
591 }
592
593 // Size----------------
594 fx->SetSizeStart( size1 );
595 fx->SetSizeEnd( size2 );
596
597 if (( flags & FX_SIZE_PARM_MASK ) == FX_SIZE_WAVE )
598 {
599 fx->SetSizeParm( sizeParm * PI * 0.001f );
600 }
601 else if ( flags & FX_SIZE_PARM_MASK )
602 {
603 fx->SetSizeParm( sizeParm * 0.01f * killTime + theFxHelper.mTime );
604 }
605
606 fx->SetShader( shader );

Callers 4

CreateEffectMethod · 0.70
FX_DisruptorMainShotFunction · 0.70
FX_DisruptorAltShotFunction · 0.70
CG_DrawEdgeFunction · 0.70

Calls 15

FX_AddPrimitiveFunction · 0.70
SetOrigin1Method · 0.45
SetOrigin2Method · 0.45
SetRGBStartMethod · 0.45
SetRGBEndMethod · 0.45
SetRGBParmMethod · 0.45
SetAlphaStartMethod · 0.45
SetAlphaEndMethod · 0.45
SetAlphaParmMethod · 0.45
SetSizeStartMethod · 0.45
SetSizeEndMethod · 0.45
SetSizeParmMethod · 0.45

Tested by

no test coverage detected