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

Method ReadParticleTable

CrySystem/ScriptObjectEntity.cpp:4432–4626  ·  view source on GitHub ↗

copy of function from ScriptObjectParticle

Source from the content-addressed store, hash-verified

4430
4431// copy of function from ScriptObjectParticle
4432bool CScriptObjectEntity::ReadParticleTable(IScriptObject *pITable, ParticleParams &sParamOut)
4433{
4434 CScriptObjectColor oCol(m_pScriptSystem,true);
4435 Vec3 v3Pos,v3Offset(0,0,0);
4436 CScriptObjectVector oVec(m_pScriptSystem,true);
4437
4438 //default params
4439 float focus = 0;
4440 Vec3 vStartColor(1,1,1);
4441 Vec3 vEndColor(1,1,1);
4442 Vec3 vRotation(0,0,0);
4443 Vec3 vGravity(0,0,0);
4444 float speed = 0;
4445 int count = 1;
4446 float size = 0.05f;
4447 float size_speed = 0;
4448 float gravity = 0;
4449 float lifetime = 0;
4450 float fadeintime = 0;
4451 INT_PTR tid = 0;
4452 int frames = 0;
4453 int draw_last = 0;
4454 int blendType = ParticleBlendType_AlphaBased;
4455 int color_based_blending = 0;
4456 int iParticleType = 0;
4457 float fTailLength = 0.0f;
4458 int bRealPhys = 0;
4459 float fDirVecScale = 1.0f;
4460 int nEntityID=0;
4461 IShader * pShader = 0;
4462 Vec3d vSpaceLoopBoxSize(0,0,0);
4463 int nBindToCamera=0;
4464 int nNoIndoor=0;
4465
4466 if(!pITable->BeginSetGetChain())
4467 return false;
4468 //FOCUS////////////////////////////////////
4469 if(!pITable->GetValueChain( "focus",focus ))
4470 m_pScriptSystem->RaiseError( "<CreateParticleEmitter> focus field not specified" );
4471 //START COLOR////////////////////////////////
4472 if (pITable->GetValueChain( "start_color",oCol ))
4473 vStartColor = oCol.Get();
4474 //END COLOR////////////////////////////////
4475 if (pITable->GetValueChain( "end_color",oCol ))
4476 vEndColor = oCol.Get();
4477 //SPEED////////////////////////////////
4478 if(!pITable->GetValueChain( "speed",speed ))
4479 m_pScriptSystem->RaiseError( "<CreateParticleEmitter> speed field not specified" );
4480 //ROTATION////////////////////////////////
4481 if (pITable->GetValueChain( "rotation",oVec ))
4482 vRotation = oVec.Get();
4483 //COUNT////////////////////////////////
4484 if(!pITable->GetValueChain( "count",count ))
4485 m_pScriptSystem->RaiseError( "<CreateParticleEmitter> count field not specified" );
4486 //SIZE////////////////////////////////
4487 if(!pITable->GetValueChain( "size" ,size ))
4488 m_pScriptSystem->RaiseError( "<CreateParticleEmitter> size field not specified" );
4489 //SIZE SPEED////////////////////////////////

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected