SBSPSS/source/pickups/pkelp.cpp

136 lines
2.9 KiB
C++
Raw Normal View History

2001-05-29 22:19:24 +02:00
/*=========================================================================
pkelp.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\pkelp.h"
#ifndef __GFX_OTPOS_H__
#include "gfx\otpos.h"
#endif
#ifndef __MATHTABLE_HEADER__
#include "utils\mathtab.h"
#endif
#ifndef __GAME_GAMESLOT_H__
#include "game\gameslot.h"
#endif
#ifndef __GAME_GAME_H__
#include "game\game.h"
#endif
#include "game/game.h"
/* Std Lib
------- */
/* Data
---- */
#ifndef __SPR_SPRITES_H__
#include <sprites.h>
#endif
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-05-29 22:42:16 +02:00
void CKelpTokenPickup::init()
2001-05-29 22:19:24 +02:00
{
sFrameHdr *fh;
CBasePickup::init();
fh=CGameScene::getSpriteBank()->getFrameHeader(FRM__TOKEN);
setCollisionSize(fh->W,fh->H);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-05-29 22:42:16 +02:00
DVECTOR CKelpTokenPickup::getSizeForPlacement()
2001-05-29 22:19:24 +02:00
{
DVECTOR size;
sFrameHdr *fh;
fh=CGameScene::getSpriteBank()->getFrameHeader(FRM__TOKEN);
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-05-29 22:42:16 +02:00
void CKelpTokenPickup::collect(class CPlayer *_player)
2001-05-29 22:19:24 +02:00
{
CBasePickup::collect(_player);
// CGameSlotManager::getSlotData()->collectSpatula(GameScene.getChapterNumber(),GameScene.getLevelNumber(),m_spatulaNumber);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-05-29 22:42:16 +02:00
void CKelpTokenPickup::renderPickup(DVECTOR *_pos)
2001-05-29 22:19:24 +02:00
{
SpriteBank *sprites;
sFrameHdr *fh;
int x,y;
sprites=CGameScene::getSpriteBank();
fh=sprites->getFrameHeader(FRM__TOKEN);
x=_pos->vx-(fh->W/2);
y=_pos->vy-(fh->H/2);
sprites->printFT4(fh,x,y,0,0,OTPOS__PICKUP_POS);
}
/*===========================================================================
end */