This commit is contained in:
parent
1270b12cd8
commit
cfb4cb7ea2
2 changed files with 100 additions and 0 deletions
59
source/projectl/prnpc.cpp
Normal file
59
source/projectl/prnpc.cpp
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
/*=========================================================================
|
||||||
|
|
||||||
|
prnpc.cpp
|
||||||
|
|
||||||
|
Author: CRB
|
||||||
|
Created:
|
||||||
|
Project: Spongebob
|
||||||
|
Purpose:
|
||||||
|
|
||||||
|
Copyright (c) 2000 Climax Development Ltd
|
||||||
|
|
||||||
|
===========================================================================*/
|
||||||
|
|
||||||
|
#ifndef __PROJECTL_PRNPC_H__
|
||||||
|
#include "projectl\prnpc.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __VID_HEADER_
|
||||||
|
#include "system\vid.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __LEVEL_LEVEL_H__
|
||||||
|
#include "level\level.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void CEnemyAsProjectile::think( int _frames )
|
||||||
|
{
|
||||||
|
CPlayerProjectile::think( _frames );
|
||||||
|
|
||||||
|
m_rotation += 512;
|
||||||
|
m_rotation &= 4095;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEnemyAsProjectile::setGraphic( CActorGfx *graphic )
|
||||||
|
{
|
||||||
|
m_actorGfx = graphic;
|
||||||
|
m_rotation = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEnemyAsProjectile::render()
|
||||||
|
{
|
||||||
|
SprFrame = NULL;
|
||||||
|
|
||||||
|
// Render
|
||||||
|
DVECTOR renderPos;
|
||||||
|
DVECTOR offset = CLevel::getCameraPos();
|
||||||
|
|
||||||
|
renderPos.vx = Pos.vx - offset.vx;
|
||||||
|
renderPos.vy = Pos.vy - offset.vy;
|
||||||
|
|
||||||
|
if ( renderPos.vx >= 0 && renderPos.vx <= VidGetScrW() )
|
||||||
|
{
|
||||||
|
if ( renderPos.vy >= 0 && renderPos.vy <= VidGetScrH() )
|
||||||
|
{
|
||||||
|
SprFrame = m_actorGfx->Render(renderPos,0,0,0);
|
||||||
|
m_actorGfx->RotateScale( SprFrame, renderPos, m_rotation, 4096, 4096 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
41
source/projectl/prnpc.h
Normal file
41
source/projectl/prnpc.h
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/*=========================================================================
|
||||||
|
|
||||||
|
prnpc.h
|
||||||
|
|
||||||
|
Author: CRB
|
||||||
|
Created:
|
||||||
|
Project: Spongebob
|
||||||
|
Purpose:
|
||||||
|
|
||||||
|
Copyright (c) 2000 Climax Development Ltd
|
||||||
|
|
||||||
|
===========================================================================*/
|
||||||
|
|
||||||
|
#ifndef __PROJECTL_PRNPC_H__
|
||||||
|
#define __PROJECTL_PRNPC_H__
|
||||||
|
|
||||||
|
#ifndef __PROJECTL_PROJECTL_H__
|
||||||
|
#include "projectl\projectl.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __GFX_SPRBANK_H__
|
||||||
|
#include "gfx\sprbank.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ACTOR_HEADER__
|
||||||
|
#include "gfx\actor.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class CEnemyAsProjectile : public CPlayerProjectile
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void render();
|
||||||
|
void setGraphic( CActorGfx *graphic );
|
||||||
|
virtual void think(int _frames);
|
||||||
|
protected:
|
||||||
|
CActorGfx *m_actorGfx;
|
||||||
|
POLY_FT4 *SprFrame;
|
||||||
|
s16 m_rotation;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Loading…
Add table
Reference in a new issue