This commit is contained in:
parent
09d4c78350
commit
b3848be202
17 changed files with 964 additions and 0 deletions
130
source/pickups/plife.cpp
Normal file
130
source/pickups/plife.cpp
Normal file
|
@ -0,0 +1,130 @@
|
|||
/*=========================================================================
|
||||
|
||||
plife.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\plife.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 CLifePickup::init()
|
||||
{
|
||||
CBasePickup::init();
|
||||
m_sin=0;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CLifePickup::shutdown()
|
||||
{
|
||||
CBasePickup::shutdown();
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int life_pulsespeed=205;
|
||||
int life_pulsescale=75;
|
||||
void CLifePickup::think(int _frames)
|
||||
{
|
||||
CBasePickup::think(_frames);
|
||||
m_sin=(m_sin+(_frames*life_pulsespeed))&4095;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CLifePickup::render()
|
||||
{
|
||||
DVECTOR ofs;
|
||||
SpriteBank *sprites;
|
||||
sFrameHdr *fh;
|
||||
int x,y;
|
||||
int size;
|
||||
|
||||
ofs=getRenderOffset();
|
||||
sprites=getSpriteBank();
|
||||
fh=sprites->getFrameHeader(FRM__PANTS);
|
||||
x=Pos.vx-ofs.vx-(fh->W/2);
|
||||
y=Pos.vy-ofs.vy-(fh->H/2);
|
||||
size=256+((msin(m_sin)*life_pulsescale)>>12);
|
||||
sprites->printFT4Scaled(fh,x,y,0,0,0,size);
|
||||
|
||||
CBasePickup::render();
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CLifePickup::collect(class CPlayer *_player)
|
||||
{
|
||||
CBasePickup::collect(_player);
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
Loading…
Add table
Add a link
Reference in a new issue