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

Function FX_AddFlash

code/cgame/FxUtil.cpp:1271–1336  ·  view source on GitHub ↗

------------------------- FX_AddFlash -------------------------

Source from the content-addressed store, hash-verified

1269// FX_AddFlash
1270//-------------------------
1271CFlash *FX_AddFlash( vec3_t origin, vec3_t sRGB, vec3_t eRGB, float rgbParm,
1272 int killTime, qhandle_t shader, int flags = 0 )
1273{
1274 if ( theFxHelper.mFrameTime < 1 )
1275 { // disallow adding new effects when the system is paused
1276 return 0;
1277 }
1278
1279 CFlash *fx = new CFlash;
1280
1281 if ( fx )
1282 {
1283 fx->SetOrigin1( origin );
1284
1285 // RGB----------------
1286 fx->SetRGBStart( sRGB );
1287 fx->SetRGBEnd( eRGB );
1288
1289 if (( flags & FX_RGB_PARM_MASK ) == FX_RGB_WAVE )
1290 {
1291 fx->SetRGBParm( rgbParm * PI * 0.001f );
1292 }
1293 else if ( flags & FX_RGB_PARM_MASK )
1294 {
1295 // rgbParm should be a value from 0-100..
1296 fx->SetRGBParm( rgbParm * 0.01f * killTime + theFxHelper.mTime );
1297 }
1298
1299/* // Alpha----------------
1300 fx->SetAlphaStart( alpha1 );
1301 fx->SetAlphaEnd( alpha2 );
1302
1303 if (( flags & FX_ALPHA_PARM_MASK ) == FX_ALPHA_WAVE )
1304 {
1305 fx->SetAlphaParm( alphaParm * PI * 0.001f );
1306 }
1307 else if ( flags & FX_ALPHA_PARM_MASK )
1308 {
1309 fx->SetAlphaParm( alphaParm * 0.01f * killTime + theFxHelper.mTime );
1310 }
1311
1312 // Size----------------
1313 fx->SetSizeStart( size1 );
1314 fx->SetSizeEnd( size2 );
1315
1316 if (( flags & FX_SIZE_PARM_MASK ) == FX_SIZE_WAVE )
1317 {
1318 fx->SetSizeParm( sizeParm * PI * 0.001f );
1319 }
1320 else if ( flags & FX_SIZE_PARM_MASK )
1321 {
1322 fx->SetSizeParm( sizeParm * 0.01f * killTime + theFxHelper.mTime );
1323 }
1324*/
1325 fx->SetShader( shader );
1326 fx->SetFlags( flags );
1327
1328// fx->SetSTScale( 1.0f, 1.0f );

Callers 1

CreateEffectMethod · 0.70

Calls 8

FX_AddPrimitiveFunction · 0.70
SetOrigin1Method · 0.45
SetRGBStartMethod · 0.45
SetRGBEndMethod · 0.45
SetRGBParmMethod · 0.45
SetShaderMethod · 0.45
SetFlagsMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected