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

Function FX_AddLight

code/cgame/FxUtil.cpp:970–1020  ·  view source on GitHub ↗

------------------------- FX_AddLight -------------------------

Source from the content-addressed store, hash-verified

968// FX_AddLight
969//-------------------------
970CLight *FX_AddLight( vec3_t org, float size1, float size2, float sizeParm,
971 vec3_t rgb1, vec3_t rgb2, float rgbParm,
972 int killTime, int flags )
973{
974 if ( theFxHelper.mFrameTime < 1 )
975 { // disallow adding effects when the system is paused
976 return 0;
977 }
978
979 CLight *fx = new CLight;
980
981 if ( fx )
982 {
983 fx->SetOrigin1( org );
984
985 // RGB----------------
986 fx->SetRGBStart( rgb1 );
987 fx->SetRGBEnd( rgb2 );
988
989 if (( flags & FX_RGB_PARM_MASK ) == FX_RGB_WAVE )
990 {
991 fx->SetRGBParm( rgbParm * PI * 0.001f );
992 }
993 else if ( flags & FX_RGB_PARM_MASK )
994 {
995 // rgbParm should be a value from 0-100..
996 fx->SetRGBParm( rgbParm * 0.01f * killTime + theFxHelper.mTime );
997 }
998
999 // Size----------------
1000 fx->SetSizeStart( size1 );
1001 fx->SetSizeEnd( size2 );
1002
1003 if (( flags & FX_SIZE_PARM_MASK ) == FX_SIZE_WAVE )
1004 {
1005 fx->SetSizeParm( sizeParm * PI * 0.001f );
1006 }
1007 else if ( flags & FX_SIZE_PARM_MASK )
1008 {
1009 fx->SetSizeParm( sizeParm * 0.01f * killTime + theFxHelper.mTime );
1010 }
1011
1012 fx->SetFlags( flags );
1013
1014 FX_AddPrimitive( (CEffect**)&fx, killTime );
1015 // in the editor, fx may now be NULL
1016 }
1017
1018 return fx;
1019
1020}
1021
1022
1023//-------------------------

Callers 1

CreateEffectMethod · 0.70

Calls 9

FX_AddPrimitiveFunction · 0.70
SetOrigin1Method · 0.45
SetRGBStartMethod · 0.45
SetRGBEndMethod · 0.45
SetRGBParmMethod · 0.45
SetSizeStartMethod · 0.45
SetSizeEndMethod · 0.45
SetSizeParmMethod · 0.45
SetFlagsMethod · 0.45

Tested by

no test coverage detected