SBSPSS/source/pickups/pshoes.cpp

132 lines
2.9 KiB
C++
Raw Normal View History

2001-02-21 16:03:08 +01:00
/*=========================================================================
pshoes.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
2001-02-21 18:13:37 +01:00
#include "pickups\pshoes.h"
2001-02-21 16:03:08 +01:00
#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:
---------------------------------------------------------------------- */
2001-02-21 18:13:37 +01:00
void CShoesPickup::init()
2001-02-21 16:03:08 +01:00
{
CBasePickup::init();
m_sin=0;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-02-21 18:13:37 +01:00
void CShoesPickup::shutdown()
2001-02-21 16:03:08 +01:00
{
CBasePickup::shutdown();
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-02-21 18:13:37 +01:00
int shoes_bobspeed=100;
int shoes_bobscale=2;
int shoes_seperation=4;
void CShoesPickup::think(int _frames)
2001-02-21 16:03:08 +01:00
{
CBasePickup::think(_frames);
2001-02-21 18:13:37 +01:00
m_sin=(m_sin+(_frames*shoes_bobspeed))&4095;
2001-02-21 16:03:08 +01:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-02-21 18:13:37 +01:00
void CShoesPickup::render()
2001-02-21 16:03:08 +01:00
{
DVECTOR ofs;
SpriteBank *sprites;
sFrameHdr *fh;
2001-02-21 18:13:37 +01:00
int x,y,yoff;
2001-02-21 16:03:08 +01:00
ofs=getRenderOffset();
sprites=getSpriteBank();
2001-02-21 18:13:37 +01:00
fh=sprites->getFrameHeader(FRM__SHOE);
2001-02-21 16:03:08 +01:00
x=Pos.vx-ofs.vx-(fh->W/2);
2001-02-21 18:13:37 +01:00
y=Pos.vy-ofs.vy-(fh->H/2);
yoff=((msin(m_sin)*shoes_bobscale)>>12);
sprites->printFT4(fh,x+shoes_seperation,y+yoff,0,0,PICKUPS_OT_POS);
sprites->printFT4(fh,x-shoes_seperation,y-yoff,0,0,PICKUPS_OT_POS);
2001-02-21 16:03:08 +01:00
CBasePickup::render();
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-02-21 18:13:37 +01:00
void CShoesPickup::collect(class CPlayer *_player)
2001-02-21 16:03:08 +01:00
{
CBasePickup::collect(_player);
}
/*===========================================================================
end */