This commit is contained in:
Paul 2001-02-21 15:35:38 +00:00
parent de6b297795
commit 0584c9f8ef
2 changed files with 215 additions and 0 deletions

142
source/pickups/pquest.cpp Normal file
View File

@ -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 <ingamefx.h>
#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 */

73
source/pickups/pquest.h Normal file
View File

@ -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 */