MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / ReadParticleTable

Method ReadParticleTable

CrySystem/ScriptObjectParticle.cpp:350–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348
349
350bool CScriptObjectParticle::ReadParticleTable(IScriptObject *pITable, ParticleParams &sParamOut)
351{
352 CScriptObjectColor oCol(m_pScriptSystem,true);
353 Vec3 v3Pos,v3Offset(0,0,0);
354 CScriptObjectVector oVec(m_pScriptSystem,true);
355
356 //default params
357 float focus = 0;
358 Vec3 vStartColor(1,1,1);
359 Vec3 vEndColor(1,1,1);
360 Vec3 vRotation(0,0,0);
361 Vec3 vGravity(0,0,0);
362 float speed = 0;
363 int count = 1;
364 float size = 0.05f;
365 float size_speed = 0;
366 float gravity = 0;
367 float lifetime = 0;
368 float fadeintime = 0;
369 INT_PTR tid = 0;
370 int frames = 0;
371 int draw_last = 0;
372 int blendType = ParticleBlendType_AlphaBased;
373 int color_based_blending = 0;
374 int iParticleType = 0;
375 float fTailLength = 0.0f;
376 int bRealPhys = 0;
377 float fDirVecScale = 1.0f;
378 int nEntityID=0;
379 if(!pITable->BeginSetGetChain())
380 return false;
381//FOCUS////////////////////////////////////
382 if(!pITable->GetValueChain( "focus",focus ))
383 m_pScriptSystem->RaiseError( "<CreateParticles> focus field not specified" );
384//START COLOR////////////////////////////////
385 if (pITable->GetValueChain( "start_color",oCol ))
386 vStartColor = oCol.Get();
387//END COLOR////////////////////////////////
388 if (pITable->GetValueChain( "end_color",oCol ))
389 vEndColor = oCol.Get();
390//SPEED////////////////////////////////
391 if(!pITable->GetValueChain( "speed",speed ))
392 m_pScriptSystem->RaiseError( "<CreateParticles> speed field not specified" );
393//ROTATION////////////////////////////////
394 if (pITable->GetValueChain( "rotation",oVec ))
395 vRotation = oVec.Get();
396//COUNT////////////////////////////////
397 if(!pITable->GetValueChain( "count",count ))
398 m_pScriptSystem->RaiseError( "<CreateParticles> count field not specified" );
399//SIZE////////////////////////////////
400 if(!pITable->GetValueChain( "size" ,size ))
401 m_pScriptSystem->RaiseError( "<CreateParticles> size field not specified" );
402//SIZE SPEED////////////////////////////////
403 if(!pITable->GetValueChain( "size_speed",size_speed ))
404 size_speed=0;
405//GRAVITY////////////////////////////////
406 if (pITable->GetValueChain( "gravity",oVec ))
407 vGravity = oVec.Get();

Callers

nothing calls this directly

Calls 7

BeginSetGetChainMethod · 0.80
GetValueChainMethod · 0.80
RaiseErrorMethod · 0.80
EndSetGetChainMethod · 0.80
GetMethod · 0.45
GetUDValueChainMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected