From 6c28c8cc7f0828aa4b3919cc437e57999fe341cf Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 10 May 2001 22:35:10 +0000 Subject: [PATCH] --- source/enemy/nbuttfly.cpp | 7 +++---- source/enemy/nbuttfly.h | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/source/enemy/nbuttfly.cpp b/source/enemy/nbuttfly.cpp index 99ab4dfa7..90906b863 100644 --- a/source/enemy/nbuttfly.cpp +++ b/source/enemy/nbuttfly.cpp @@ -30,10 +30,9 @@ void CNpcButterflyBackgroundEnemy::processMovementModifier(int _frames, s32 dist Pos.vx += distX; Pos.vy += distY; - m_frame++; - - if ( m_frame > ( FRM_BUTTERFLY_FLAP04 - FRM_BUTTERFLY_FLAP01 ) ) + if ( !m_animPlaying ) { + m_animPlaying = true; m_frame = 0; } } @@ -73,7 +72,7 @@ void CNpcButterflyBackgroundEnemy::render() { if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() ) { - SprFrame = m_spriteBank->printRotatedScaledSprite( FRM_BUTTERFLY_FLAP01 + m_frame,renderPos.vx,renderPos.vy,4096,4096,0,10); + SprFrame = m_spriteBank->printFT4(FRM_BUTTERFLY_FLAP01 + ( m_frame >> 8 ),renderPos.vx,renderPos.vy,!m_reversed,0,10); setRGB0( SprFrame, 255, 128, 255 ); // Let me know if these change! ALso ket me know when the different coloured ones go in pls! (pkg) // get xmax, xmin, ymax, ymin diff --git a/source/enemy/nbuttfly.h b/source/enemy/nbuttfly.h index 0027fd26e..fb5bee38f 100644 --- a/source/enemy/nbuttfly.h +++ b/source/enemy/nbuttfly.h @@ -18,10 +18,15 @@ #include "enemy\nsjback.h" #endif +#ifndef __SPR_SPRITES_H__ +#include +#endif + class CNpcButterflyBackgroundEnemy : public CNpcSmallJellyfishBackgroundEnemy { public: virtual void render(); + virtual int getFrameCount() {return( FRM_BUTTERFLY_FLAP04 - FRM_BUTTERFLY_FLAP01 + 1 );} protected: virtual void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange ); };