From 4ce365f31ec022013c63742375e0512a2a56ff24 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 4 Jun 2001 14:04:03 +0000 Subject: [PATCH] --- source/triggers/tbemit.cpp | 48 ++++++++++++++++++++++++++++ source/triggers/tbemit.h | 64 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 source/triggers/tbemit.cpp create mode 100644 source/triggers/tbemit.h diff --git a/source/triggers/tbemit.cpp b/source/triggers/tbemit.cpp new file mode 100644 index 000000000..42bf90d2a --- /dev/null +++ b/source/triggers/tbemit.cpp @@ -0,0 +1,48 @@ +/*========================================================================= + + tbemit.h + + Author: CRB + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __TRIGGERS_TBEMIT_H__ +#include "triggers\tbemit.h" +#endif + +#ifndef __GAME_GAME_H__ +#include "game\game.h" +#endif + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CBubbleEmitterTrigger::think(int _frames) +{ + CTrigger::think( _frames ); + + if ( m_timer <= 0 ) + { + CFX::Create( CFX::FX_TYPE_BUBBLE_WATER, Pos ); + + m_timer = GameState::getOneSecondInFrames() >> 2; + } + else + { + m_timer -= _frames; + } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CBubbleEmitterTrigger::setPositionAndSize(int _x,int _y,int _w,int _h) +{ + CTrigger::setPositionAndSize( _x, _y, _w, _h ); + + m_timer = 0; +} diff --git a/source/triggers/tbemit.h b/source/triggers/tbemit.h new file mode 100644 index 000000000..8bfafadc0 --- /dev/null +++ b/source/triggers/tbemit.h @@ -0,0 +1,64 @@ +/*========================================================================= + + tbemit.h + + Author: CRB + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __TRIGGERS_TBEMIT_H__ +#define __TRIGGERS_TBEMIT_H__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#ifndef __THING_THING_H__ +#include "thing/thing.h" +#endif + +#ifndef __TRIGGER_TRIGGER_HEADER__ +#include "triggers\trigger.h" +#endif + +#include "fx\fx.h" + +/* Std Lib + ------- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +class CBubbleEmitterTrigger : public CTrigger +{ +public: + virtual void think(int _frames); + virtual void setPositionAndSize(int _x,int _y,int _w,int _h); +protected: + s32 m_timer; +}; + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/*---------------------------------------------------------------------- + Functions + --------- */ + +/*---------------------------------------------------------------------- */ + +#endif + +/*=========================================================================== + end */