This commit is contained in:
Charles 2001-04-20 16:13:23 +00:00
parent a1bf80bc35
commit 6a94ade948
4 changed files with 12 additions and 7 deletions

View file

@ -830,6 +830,13 @@ void CNpcEnemy::shutdown()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int CNpcEnemy::getFrameCount()
{
return( m_actorGfx->getFrameCount( m_animNo ) );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::think(int _frames)
{
CEnemyThing::think(_frames);
@ -843,13 +850,9 @@ void CNpcEnemy::think(int _frames)
if ( m_animPlaying )
{
s32 frameCount;
// BODGE!!!!!!!!!!!!!!!
if (m_actorGfx)
frameCount= m_actorGfx->getFrameCount(m_animNo);
else
frameCount= 6;
// BODGE END!!!!!!!!!!!
frameCount = getFrameCount();
s32 frameShift = ( _frames << 8 ) >> 1;
if ( ( frameCount << 8 ) - m_frame > frameShift ) //( _frames >> 1 ) )

View file

@ -176,6 +176,7 @@ public:
void hasBeenAttacked();
bool canBeCaughtByNet();
void caughtWithNet();
virtual int getFrameCount();
static CNpcEnemy *Create(sThingActor *ThisActor);

View file

@ -223,7 +223,7 @@ void CNpcSmallJellyfishEnemy::processMovementModifier( int _frames, s32 distX, s
dataPoint /= GameState::getOneSecondInFrames();
}
m_frame = ( ( m_movementTimer * ( m_actorGfx->getFrameCount(m_animNo) - 1 ) << 8 ) ) / GameState::getOneSecondInFrames();
m_frame = ( ( m_movementTimer * ( getFrameCount() - 1 ) << 8 ) ) / GameState::getOneSecondInFrames();
s32 resistance;
s32 absVelocity = abs( m_velocity );

View file

@ -22,6 +22,7 @@ class CNpcSmallJellyfishEnemy : public CNpcEnemy
{
public:
void render();
virtual int getFrameCount() {return( 6 );}
protected:
virtual bool processSensor();
virtual void processClose( int _frames );