diff --git a/source/enemy/nghost.cpp b/source/enemy/nghost.cpp new file mode 100644 index 000000000..1b668664e --- /dev/null +++ b/source/enemy/nghost.cpp @@ -0,0 +1,46 @@ +/*========================================================================= + + nghost.cpp + + Author: CRB + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __ENEMY_NPC_H__ +#include "enemy\npc.h" +#endif + +#ifndef __ENEMY_NGHOST_H__ +#include "enemy\nghost.h" +#endif + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcGhostEnemy::render() +{ + SprFrame = NULL; + + if ( m_isActive ) + { + CEnemyThing::render(); + + if (canRender()) + { + DVECTOR &renderPos=getRenderPos(); + + SprFrame = m_actorGfx->Render(renderPos,m_animNo,( m_frame >> 8 ),m_reversed); + setSemiTrans( SprFrame, true ); + m_actorGfx->RotateScale( SprFrame, renderPos, m_drawRotation, 4096, 4096 ); + + sBBox boundingBox = m_actorGfx->GetBBox(); + setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) ); + setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 ); + } + } +}