diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index e971c5feb..3f35d9a18 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -629,6 +629,7 @@ void CNpcEnemy::init() m_isBlowerOn = false; m_speed = m_data[m_type].speed; m_heading = 0; + m_RGB = 0; updateCollisionArea(); } @@ -1696,10 +1697,3 @@ void CNpcEnemy::processCoralBlower( int _frames ) m_isBlowerOn = false; } - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -u32 CNpcEnemy::getRGB() -{ - return( 0 ); -} diff --git a/source/enemy/npc.h b/source/enemy/npc.h index 595bdfcc7..9620d9048 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -109,8 +109,8 @@ public: void caughtWithNet(); virtual int getFrameCount(); virtual int getFrame() {return( m_frame );} - void setSpeed( s16 newSpeed ) {m_speed = newSpeed;} - virtual u32 getRGB(); + void setSpeed( s16 newSpeed ) {m_speed = newSpeed;} + virtual u32 getRGB() {return( m_RGB );} static CNpcEnemy *Create(sThingActor *ThisActor); virtual void setupWaypoints( sThingActor *ThisActor ); @@ -298,6 +298,7 @@ protected: DVECTOR m_caughtPos; s16 m_speed; u8 m_isDying; + u32 m_RGB; s32 m_frame; int m_animNo; diff --git a/source/enemy/nprojjf.cpp b/source/enemy/nprojjf.cpp index 041de0183..ee8b2c802 100644 --- a/source/enemy/nprojjf.cpp +++ b/source/enemy/nprojjf.cpp @@ -42,6 +42,8 @@ void CNpcSmallJellyfishProjectileEnemy::postInit() CNpcEnemy::postInit(); m_lifetime = 8 * GameState::getOneSecondInFrames(); + + m_RGB = 255 + ( 128 << 8 ) + ( 255 << 16 ); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/enemy/nsj2back.cpp b/source/enemy/nsj2back.cpp index 329f64676..fa74cbca0 100644 --- a/source/enemy/nsj2back.cpp +++ b/source/enemy/nsj2back.cpp @@ -28,6 +28,15 @@ #endif +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcSmallJellyfish2BackgroundEnemy::postInit() +{ + CNpcEnemy::postInit(); + + m_RGB = 128 + ( 128 << 8 ) + ( 255 << 16 ); +} + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void CNpcSmallJellyfish2BackgroundEnemy::render() @@ -141,19 +150,3 @@ void CNpcSmallJellyfish2BackgroundEnemy::collidedWith( CThing *_thisThing ) } } } - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -u32 CNpcSmallJellyfish2BackgroundEnemy::getRGB() -{ - CVECTOR rgb; - - rgb.r = 128; - rgb.g = 128; - rgb.b = 255; - - u32 rgbVal; - rgbVal = rgb.r + ( rgb.g << 8 ) + ( rgb.b << 16 ); - - return( rgbVal ); -} diff --git a/source/enemy/nsj2back.h b/source/enemy/nsj2back.h index 841577c75..944674f1a 100644 --- a/source/enemy/nsj2back.h +++ b/source/enemy/nsj2back.h @@ -21,8 +21,8 @@ class CNpcSmallJellyfish2BackgroundEnemy : public CNpcSmallJellyfishBackgroundEnemy { public: + virtual void postInit(); virtual void render(); - virtual u32 getRGB(); protected: virtual void collidedWith(CThing *_thisThing); }; diff --git a/source/enemy/nsjfish.cpp b/source/enemy/nsjfish.cpp index fc4e3a74f..235fe970e 100644 --- a/source/enemy/nsjfish.cpp +++ b/source/enemy/nsjfish.cpp @@ -40,6 +40,15 @@ #endif +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcSmallJellyfishEnemy::postInit() +{ + CNpcEnemy::postInit(); + + m_RGB = 255 + ( 128 << 8 ) + ( 255 << 16 ); +} + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void CNpcSmallJellyfishEnemy::render() @@ -376,19 +385,3 @@ void CNpcSmallJellyfishEnemy::fireAsProjectile( s16 heading ) projectile->setHasRGB( true ); projectile->setRGB( 255, 128, 255 ); } - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -u32 CNpcSmallJellyfishEnemy::getRGB() -{ - CVECTOR rgb; - - rgb.r = 255; - rgb.g = 128; - rgb.b = 255; - - u32 rgbVal; - - rgbVal = rgb.r + ( rgb.g << 8 ) + ( rgb.b << 16 ); - return( rgbVal ); -} diff --git a/source/enemy/nsjfish.h b/source/enemy/nsjfish.h index 3558c0347..b35c2cf45 100644 --- a/source/enemy/nsjfish.h +++ b/source/enemy/nsjfish.h @@ -25,10 +25,10 @@ class CNpcSmallJellyfishEnemy : public CNpcEnemy { public: + virtual void postInit(); virtual void render(); virtual int getFrameCount() {return( FRM_JELLYFISH1_SWIM7 - FRM_JELLYFISH1_SWIM1 + 1 );} virtual u8 canCollideWithEnemy() {return( false );} - virtual u32 getRGB(); protected: virtual bool processSensor(); virtual void processClose( int _frames );