2001-05-31 17:59:06 +02:00
|
|
|
/**************************/
|
|
|
|
/*** Emitter Base Class ***/
|
|
|
|
/**************************/
|
|
|
|
|
|
|
|
#include "system\global.h"
|
|
|
|
#include <DStructs.h>
|
|
|
|
#include "utils\utils.h"
|
|
|
|
#include "gfx\prim.h"
|
|
|
|
#include "gfx\sprbank.h"
|
|
|
|
#include <sprites.h>
|
|
|
|
#include "level\level.h"
|
|
|
|
#include "game\game.h"
|
2001-05-31 22:07:48 +02:00
|
|
|
#include "FX\FXBaseEmitter.h"
|
2001-05-31 17:59:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
2001-05-31 22:07:48 +02:00
|
|
|
void CFXBaseEmitter::init(DVECTOR const &_Pos)
|
2001-05-31 17:59:06 +02:00
|
|
|
{
|
2001-05-31 22:07:48 +02:00
|
|
|
CFX::init(_Pos);
|
|
|
|
Width=Height=16;
|
|
|
|
CurrentCount=DataPtr->Rate;
|
|
|
|
Life=DataPtr->Life;
|
2001-05-31 17:59:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2001-05-31 22:07:48 +02:00
|
|
|
void CFXBaseEmitter::shutdown()
|
2001-05-31 17:59:06 +02:00
|
|
|
{
|
|
|
|
CFX::shutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*** Think *******************************************************************/
|
|
|
|
/*****************************************************************************/
|
2001-05-31 22:07:48 +02:00
|
|
|
void CFXBaseEmitter::think(int _frames)
|
2001-05-31 17:59:06 +02:00
|
|
|
{
|
|
|
|
CFX::think(_frames);
|
|
|
|
|
2001-05-31 22:07:48 +02:00
|
|
|
CurrentCount-=_frames;
|
|
|
|
if (CurrentCount<=0)
|
2001-05-31 17:59:06 +02:00
|
|
|
{
|
2001-05-31 22:07:48 +02:00
|
|
|
CurrentCount=DataPtr->Rate;
|
|
|
|
createParticle(_frames);
|
2001-05-31 17:59:06 +02:00
|
|
|
}
|
2001-05-31 22:07:48 +02:00
|
|
|
|
2001-05-31 17:59:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2001-05-31 22:07:48 +02:00
|
|
|
void CFXBaseEmitter::createParticle(int _frames)
|
2001-05-31 17:59:06 +02:00
|
|
|
{
|
2001-05-31 22:07:48 +02:00
|
|
|
CFX::Create(DataPtr->ParticleType,getPos());
|
2001-05-31 17:59:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*** Render ******************************************************************/
|
|
|
|
/*****************************************************************************/
|
2001-05-31 22:07:48 +02:00
|
|
|
void CFXBaseEmitter::render()
|
2001-05-31 17:59:06 +02:00
|
|
|
{
|
2001-05-31 22:07:48 +02:00
|
|
|
/*
|
2001-05-31 17:59:06 +02:00
|
|
|
DVECTOR renderPos;
|
|
|
|
if (MapEmitter)
|
|
|
|
{
|
|
|
|
CFX::render();
|
|
|
|
if (!canRender()) return;
|
|
|
|
renderPos=getRenderPos();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-05-31 22:07:48 +02:00
|
|
|
renderPos=getPos();
|
2001-05-31 17:59:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
POLY_F4 *f4;
|
|
|
|
f4=GetPrimF4();
|
|
|
|
setPolyF4(f4);
|
2001-05-31 22:07:48 +02:00
|
|
|
setXYWH(f4,renderPos.vx,renderPos.vy,Width,Height);
|
2001-05-31 17:59:06 +02:00
|
|
|
setSemiTrans(f4,1);
|
|
|
|
setShadeTex(f4,0);
|
|
|
|
setRGB0(f4,30,40,50);
|
|
|
|
AddPrimToList(f4,0);
|
2001-05-31 22:07:48 +02:00
|
|
|
*/
|
2001-05-31 17:59:06 +02:00
|
|
|
}
|