From e6c46bcc9ed6774f5ad41c26718088384453973e Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 3 May 2001 12:53:03 +0000 Subject: [PATCH] --- source/friend/fplnkton.cpp | 86 ++++++++++++++++++++++++++++++++++++++ source/friend/fplnkton.h | 32 ++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 source/friend/fplnkton.cpp create mode 100644 source/friend/fplnkton.h diff --git a/source/friend/fplnkton.cpp b/source/friend/fplnkton.cpp new file mode 100644 index 000000000..cea14ac60 --- /dev/null +++ b/source/friend/fplnkton.cpp @@ -0,0 +1,86 @@ +/*========================================================================= + + fplnkton.cpp + + Author: CRB + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2000 Climax Development Ltd + +===========================================================================*/ + +#ifndef __FRIEND_FPLNKTON_H__ +#include "friend\fplnkton.h" +#endif + +#ifndef __GFX_SPRBANK_H__ +#include "gfx\sprbank.h" +#endif + +#ifndef __LEVEL_LEVEL_H__ +#include "level\level.h" +#endif + +#ifndef __VID_HEADER_ +#include "system\vid.h" +#endif + +#ifndef __SPR_SPRITES_H__ +#include +#endif + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcPlanktonFriend::init() +{ + CNpcThing::init(); + + m_extension = EXTEND_RIGHT; + + m_spriteBank=new ("enemy sprites") SpriteBank(); + m_spriteBank->load(SPRITES_SPRITES_SPR); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcPlanktonFriend::shutdown() +{ + m_spriteBank->dump(); delete m_spriteBank; + + CNpcThing::shutdown(); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcPlanktonFriend::render() +{ + CNpcThing::render(); + + // Render + DVECTOR renderPos; + DVECTOR origRenderPos; + DVECTOR offset = CLevel::getCameraPos(); + int frame = FRM_PLANKTON_STATIC00; + int spriteWidth = m_spriteBank->getFrameWidth( frame ); + int spriteHeight = m_spriteBank->getFrameHeight( frame ); + + renderPos.vx = Pos.vx - offset.vx - ( spriteWidth >> 1 ); + renderPos.vy = Pos.vy - offset.vy - ( spriteHeight >> 1 ); + + if ( renderPos.vx >= 0 && renderPos.vx <= VidGetScrW() ) + { + if ( renderPos.vy >= 0 && renderPos.vy <= VidGetScrH() ) + { + m_spriteBank->printFT4(frame,renderPos.vx,renderPos.vy,0,0,10); + } + } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcPlanktonFriend::think( int _frames ) +{ +} \ No newline at end of file diff --git a/source/friend/fplnkton.h b/source/friend/fplnkton.h new file mode 100644 index 000000000..1f889979e --- /dev/null +++ b/source/friend/fplnkton.h @@ -0,0 +1,32 @@ +/*========================================================================= + + fplnkton.cpp + + Author: CRB + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2000 Climax Development Ltd + +===========================================================================*/ + +#ifndef __FRIEND_FPLNKTON_H__ +#define __FRIEND_FPLNKTON_H__ + +#ifndef __FRIEND_FRIEND_H__ +#include "friend\friend.h" +#endif + +class CNpcPlanktonFriend : public CNpcFriend +{ +public: + virtual void init(); + virtual void render(); + virtual void think(int _frames); + virtual void shutdown(); +protected: + SpriteBank *m_spriteBank; +}; + +#endif \ No newline at end of file