SBSPSS/source/fx/fx.cpp

175 lines
3.4 KiB
C++
Raw Normal View History

2001-05-05 20:12:30 +02:00
/*********************/
/*** FX 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"
2001-05-09 21:57:57 +02:00
#include "gfx\otpos.h"
2001-05-05 20:12:30 +02:00
#include "FX\FX.h"
#include "FX\FXjfish.h"
2001-05-16 21:06:02 +02:00
#include "FX\FXfallingTile.h"
2001-05-05 20:12:30 +02:00
/* FX
Jellyfish legs
Bubbles (inc acid)
Electricity lightning bolt
Electricity sheet lightning
Electricity Blast
Electricity Radial?
Electricity projectile
Shockwave - From falling items
Daze stars
water/acid/lava/oil
drip
splashes
water/acid/lava.oil
drops
waterfall
waterfall end (splash)
fireballs
steam
smoke
flames
marsh gas
explosions (implode!!)
Coral debris
***************************
Level Effect Emitters
Bubble
Acid drip
Acid Flow
steam
smoke
fireballs
flames
gas
*/
/*****************************************************************************/
2001-05-16 21:06:02 +02:00
CFX *CFX::Create(const FX_TYPE Type)
2001-05-05 20:12:30 +02:00
{
CFX *NewFX;
switch(Type)
{
case FX_TYPE_JELLYFISH_LEGS:
NewFX=new ("JellyFish Legs") CFXJellyFishLegs();
break;
2001-05-16 21:06:02 +02:00
case FX_TYPE_FALLINGTILE:
NewFX=new ("Falling Tile") CFXFallingTile();
break;
2001-05-05 20:12:30 +02:00
case FX_TYPE_BUBBLE:
2001-05-15 23:36:31 +02:00
case FX_TYPE_BUBBLE_WATER:
case FX_TYPE_BUBBLE_ACID:
case FX_TYPE_BUBBLE_LAVA:
case FX_TYPE_BUBBLE_OIL:
2001-05-05 20:12:30 +02:00
case FX_TYPE_LIGHTNING_BOLT:
case FX_TYPE_LIGHTNING_SHEET:
case FX_TYPE_LIGHTNING_BLAST:
case FX_TYPE_LIGHTNING_RADIAL:
case FX_TYPE_LIGHTNING_PROJECTILE:
case FX_TYPE_SHOCKWAVE:
case FX_TYPE_DAZE:
case FX_TYPE_DROP:
2001-05-15 23:36:31 +02:00
case FX_TYPE_DROP_WATER:
case FX_TYPE_DROP_ACID:
case FX_TYPE_DROP_LAVA:
case FX_TYPE_DROP_OIL:
case FX_TYPE_SPLASH:
case FX_TYPE_SPLASH_WATER:
case FX_TYPE_SPLASH_ACID:
case FX_TYPE_SPLASH_LAVA:
case FX_TYPE_SPLASH_OIL:
2001-05-05 20:12:30 +02:00
case FX_TYPE_CASCADE:
case FX_TYPE_CASCADE_SPLASH:
case FX_TYPE_FIREBALL:
case FX_TYPE_CLOUD:
2001-05-15 23:36:31 +02:00
case FX_TYPE_CLOUD_STEAN:
case FX_TYPE_CLOUD_SMOKE:
case FX_TYPE_CLOUD_GAS:
2001-05-05 20:12:30 +02:00
case FX_TYPE_FLAMES:
case FX_TYPE_EXPLODE:
case FX_TYPE_DEBRIS:
default:
ASSERT(!"UNKNOWN FX TYPE");
return NULL;
}
2001-05-16 21:06:02 +02:00
return NewFX;
}
2001-05-05 20:12:30 +02:00
2001-05-16 21:06:02 +02:00
/*****************************************************************************/
CFX *CFX::Create(const FX_TYPE Type,CThing *Parent)
{
CFX *NewFX=CFX::Create(Type);
2001-05-15 23:36:31 +02:00
2001-05-16 21:06:02 +02:00
if (Parent)
{
Parent->addChild(NewFX);
}
NewFX->init();
return NewFX;
}
/*****************************************************************************/
CFX *CFX::Create(const FX_TYPE Type,DVECTOR const &Pos)
{
CFX *NewFX=CFX::Create(Type);
NewFX->init(Pos);
return NewFX;
2001-05-05 20:12:30 +02:00
}
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
void CFX::init()
{
2001-05-09 21:57:57 +02:00
CFXThing::init();
2001-05-05 20:12:30 +02:00
2001-05-09 21:57:57 +02:00
m_spriteBank=new ("FX Sprite") SpriteBank();
m_spriteBank->load(SPRITES_SPRITES_SPR);
OtPos=OTPOS__ACTOR_POS;
2001-05-05 20:12:30 +02:00
}
/*****************************************************************************/
void CFX::shutdown()
{
2001-05-15 23:36:31 +02:00
m_spriteBank->dump(); delete m_spriteBank;
CFXThing::shutdown();
2001-05-05 20:12:30 +02:00
}
/*****************************************************************************/
void CFX::think(int _frames)
{
CFXThing::think(_frames);
}
/*****************************************************************************/
void CFX::render()
{
2001-05-16 21:06:02 +02:00
CFXThing::render();
2001-05-05 20:12:30 +02:00
}