From 0584c9f8ef98203388ce26da240b393eb1276f8b Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 21 Feb 2001 15:35:38 +0000 Subject: [PATCH] --- source/pickups/pquest.cpp | 142 ++++++++++++++++++++++++++++++++++++++ source/pickups/pquest.h | 73 ++++++++++++++++++++ 2 files changed, 215 insertions(+) create mode 100644 source/pickups/pquest.cpp create mode 100644 source/pickups/pquest.h diff --git a/source/pickups/pquest.cpp b/source/pickups/pquest.cpp new file mode 100644 index 000000000..2fb0e828a --- /dev/null +++ b/source/pickups/pquest.cpp @@ -0,0 +1,142 @@ +/*========================================================================= + + pquest.cpp + + Author: PKG + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#ifndef __GFX_SPRBANK_H__ +#include "gfx\sprbank.h" // Damnit.. include order! :( (pkg) +#endif + +#include "pickups\pquest.h" + +#ifndef __MATHTABLE_HEADER__ +#include "utils\mathtab.h" +#endif + + +/* Std Lib + ------- */ + +/* Data + ---- */ + +#ifndef __SPR_INGAMEFX_H__ +#include +#endif + + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ + +/*---------------------------------------------------------------------- + Vars + ---- */ + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CBaseQuestItemPickup::init() +{ + CBasePickup::init(); +// m_sin=0; +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CBaseQuestItemPickup::shutdown() +{ + CBasePickup::shutdown(); +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +//int bubmix_bobspeed=10; +//int bubmix_bobscale=3; +void CBaseQuestItemPickup::think(int _frames) +{ + CBasePickup::think(_frames); +// m_sin=(m_sin+(_frames*bubmix_bobspeed))&4095; +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CBaseQuestItemPickup::render() +{ + DVECTOR ofs; + SpriteBank *sprites; + sFrameHdr *fh; + int x,y; + + ofs=getRenderOffset(); + sprites=getSpriteBank(); + fh=sprites->getFrameHeader(getFrameNumber()); + x=Pos.vx-ofs.vx-(fh->W/2); + y=Pos.vy-ofs.vy-(fh->H/2); + sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS); + + CBasePickup::render(); +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CBaseQuestItemPickup::collect(class CPlayer *_player) +{ + CBasePickup::collect(_player); +} + + + + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +int CTestQuestItemPickup::getFrameNumber() +{ + return FRM__TEETH; +} + +/*=========================================================================== +end */ diff --git a/source/pickups/pquest.h b/source/pickups/pquest.h new file mode 100644 index 000000000..d309c3c73 --- /dev/null +++ b/source/pickups/pquest.h @@ -0,0 +1,73 @@ +/*========================================================================= + + pquest.h + + Author: PKG + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __PICKUPS_PQUEST_H__ +#define __PICKUPS_PQUEST_H__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#ifndef __PICKUPS_PICKUP_H__ +#include "pickups/pickup.h" +#endif + + +/* Std Lib + ------- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +class CBaseQuestItemPickup : public CBasePickup +{ +public: + virtual void init(); + virtual void shutdown(); + virtual void think(int _frames); + virtual void render(); + + virtual void collect(class CPlayer *_player); + +protected: + virtual int getFrameNumber()=0; + +}; + +class CTestQuestItemPickup : public CBaseQuestItemPickup +{ +protected: + virtual int getFrameNumber(); + +}; + + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/*---------------------------------------------------------------------- + Functions + --------- */ + +/*---------------------------------------------------------------------- */ + +#endif /* __PICKUPS_PQUEST_H__ */ + +/*=========================================================================== + end */