192 lines
6.3 KiB
C
192 lines
6.3 KiB
C
/*
|
|
0 1 2 3 4 5 6 7
|
|
01234567890123456789012345678901234567890123456789012345678901234567890123456789
|
|
--------------------------------------------------------------------------------
|
|
-- Description : Particles system
|
|
--------------------------------------------------------------------------------
|
|
-- Creation date : 12 jun 1997 Author : FPI
|
|
--------------------------------------------------------------------------------
|
|
*/
|
|
#ifndef D_THROW_PRT
|
|
|
|
#include "acp_base.h"
|
|
#include "MTH.h"
|
|
#include "RND.h"
|
|
#include "MEC.h"
|
|
#include "GMT.h"
|
|
#include "GEO.h"
|
|
#include "GLI.h"
|
|
#include "COL.h"
|
|
|
|
#include "PRT/PrtMeca.h"
|
|
|
|
/*
|
|
--------------------------------------------------------------------------------
|
|
-- Description : Global variables
|
|
--------------------------------------------------------------------------------
|
|
*/
|
|
|
|
/*
|
|
--------------------------------------------------------------------------------
|
|
-- Description : Particles system destruction
|
|
--------------------------------------------------------------------------------
|
|
-- Creation date : 12 jun 1997 Author : FPI
|
|
--------------------------------------------------------------------------------
|
|
*/
|
|
|
|
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
|
|
void PRT_fn_vDestructParticlesSystem( PRT_tdstParticlesSystem *_p_stParticlesSystem )
|
|
{
|
|
switch ( _p_stParticlesSystem->xParticlesType )
|
|
{
|
|
case PRT_C_xPointParticles :
|
|
PRT_fn_vDestructPointParticles ( _p_stParticlesSystem );
|
|
break;
|
|
case PRT_C_xSegmentParticles :
|
|
PRT_fn_vDestructSegmentParticles ( _p_stParticlesSystem );
|
|
break;
|
|
case PRT_C_xSpriteParticles :
|
|
PRT_fn_vDestructSpriteParticles ( _p_stParticlesSystem );
|
|
break;
|
|
default :
|
|
break;
|
|
}
|
|
GEO_M_CPAFree ( _p_stParticlesSystem );
|
|
}
|
|
|
|
/*
|
|
--------------------------------------------------------------------------------
|
|
-- Description : Particles system creation
|
|
--------------------------------------------------------------------------------
|
|
-- Creation date : 12 jun 1997 Author : FPI
|
|
--------------------------------------------------------------------------------
|
|
*/
|
|
|
|
void PRT_fn_vCopyCloneParticlesSystem
|
|
(
|
|
PRT_tdstParticlesSystem *_p_stParticlesSystemDst,
|
|
PRT_tdstParticlesSystem *_p_stParticlesSystemSrc
|
|
)
|
|
{
|
|
_p_stParticlesSystemDst->xNbParticles = _p_stParticlesSystemSrc->xNbParticles;
|
|
_p_stParticlesSystemDst->xNbActiveParticles = _p_stParticlesSystemSrc->xNbActiveParticles;
|
|
|
|
switch ( _p_stParticlesSystemSrc->xParticlesType )
|
|
{
|
|
case PRT_C_xPointParticles :
|
|
PRT_fn_vCreatePointParticles ( _p_stParticlesSystemDst, ((PRT_tdstPointCommonData *)(_p_stParticlesSystemDst->p_stCommonData))->hMaterial );
|
|
break;
|
|
case PRT_C_xSegmentParticles :
|
|
PRT_fn_vCreateSegmentParticles ( _p_stParticlesSystemDst, ((PRT_tdstSegmentCommonData *)(_p_stParticlesSystemDst->p_stCommonData))->hMaterial );
|
|
break;
|
|
case PRT_C_xSpriteParticles :
|
|
PRT_fn_vCreateSpriteParticles ( _p_stParticlesSystemDst, ((PRT_tdstSpriteCommonData *)(_p_stParticlesSystemDst->p_stCommonData))->hSprite );
|
|
break;
|
|
default :
|
|
break;
|
|
}
|
|
}
|
|
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
|
|
|
|
|
|
/*
|
|
--------------------------------------------------------------------------------
|
|
-- Description : Particles system mechanic
|
|
--------------------------------------------------------------------------------
|
|
-- Creation date : 02 sep 1997 Author : FPI
|
|
--------------------------------------------------------------------------------
|
|
*/
|
|
|
|
/*
|
|
void PRT_fn_vMecaParticlesSystem
|
|
(
|
|
PRT_tdstParticlesSystem *_p_stParticlesSystem,
|
|
PRT_tdstParticlesEnvironment *_p_stParticlesEnvironment,
|
|
MTH_tdxReal _xTimeT,
|
|
MTH_tdxReal _xDeltaT
|
|
)
|
|
*/
|
|
void PRT_fn_vMecaParticlesSystem
|
|
(
|
|
tdstParticleGenerator *_p_stPrtGen,
|
|
MTH_tdxReal _xTimeT,
|
|
MTH_tdxReal _xDeltaT
|
|
)
|
|
{
|
|
switch ( _p_stPrtGen->p_stPrtSys->xParticlesType )
|
|
{
|
|
case PRT_C_xSpriteParticles :
|
|
PRT_fn_vMecaSpriteParticlesSystem ( _p_stPrtGen, _xTimeT, _xDeltaT );
|
|
break;
|
|
case PRT_C_xPointParticles :
|
|
PRT_fn_vMecaPointParticlesSystem ( _p_stPrtGen->p_stPrtSys, _p_stPrtGen->p_stPrtEnv, _xTimeT, _xDeltaT );
|
|
break;
|
|
case PRT_C_xSegmentParticles :
|
|
PRT_fn_vMecaSegmentParticlesSystem ( _p_stPrtGen->p_stPrtSys, _p_stPrtGen->p_stPrtEnv, _xTimeT, _xDeltaT );
|
|
break;
|
|
default :
|
|
break;
|
|
}
|
|
}
|
|
|
|
/*
|
|
--------------------------------------------------------------------------------
|
|
-- Description : Particles system generation
|
|
--------------------------------------------------------------------------------
|
|
-- Creation date : 02 sep 1997 Author : FPI
|
|
--------------------------------------------------------------------------------
|
|
*/
|
|
|
|
void PRT_fn_vSourceGenerateParticle
|
|
(
|
|
PRT_tdstParticlesSystem *_p_stParticlesSystem,
|
|
PRT_tdstParticlesSource *_p_stParticlesSource,
|
|
POS_tdstCompletePosition *_p_stSourceMatrix,
|
|
MTH_tdxReal _xTimeT
|
|
)
|
|
{
|
|
switch ( _p_stParticlesSystem->xParticlesType )
|
|
{
|
|
case PRT_C_xSpriteParticles :
|
|
PRT_fn_vSourceGenerateSpriteParticle ( _p_stParticlesSystem, _p_stParticlesSource, _p_stSourceMatrix, _xTimeT );
|
|
break;
|
|
case PRT_C_xPointParticles :
|
|
PRT_fn_vSourceGeneratePointParticle ( _p_stParticlesSystem, _p_stParticlesSource, _p_stSourceMatrix, _xTimeT );
|
|
break;
|
|
case PRT_C_xSegmentParticles :
|
|
PRT_fn_vSourceGenerateSegmentParticle ( _p_stParticlesSystem, _p_stParticlesSource, _p_stSourceMatrix, _xTimeT );
|
|
break;
|
|
default :
|
|
break;
|
|
}
|
|
}
|
|
|
|
/*
|
|
--------------------------------------------------------------------------------
|
|
-- Description :
|
|
--------------------------------------------------------------------------------
|
|
-- Creation date : 12 jun 1997 Author : FPI
|
|
--------------------------------------------------------------------------------
|
|
*/
|
|
|
|
/*void PRT_fn_vPreDrawParticlesSystem ( PRT_tdstParticlesSystem *_p_stParticlesSystem )*/
|
|
void PRT_fn_vPreDrawParticlesSystem ( tdstParticleGenerator *_p_stPrtGen )
|
|
{
|
|
switch ( _p_stPrtGen->p_stPrtSys->xParticlesType )
|
|
{
|
|
case PRT_C_xPointParticles :
|
|
PRT_fn_vPreDrawPointParticlesSystem ( _p_stPrtGen->p_stPrtSys );
|
|
break;
|
|
case PRT_C_xSegmentParticles :
|
|
PRT_fn_vPreDrawSegmentParticlesSystem ( _p_stPrtGen->p_stPrtSys );
|
|
break;
|
|
case PRT_C_xSpriteParticles :
|
|
PRT_fn_vPreDrawSpriteParticlesSystem ( _p_stPrtGen->p_stPrtSys );
|
|
break;
|
|
default :
|
|
break;
|
|
}
|
|
}
|
|
|
|
#endif /* D_THROW_PRT */
|