diff --git a/source/platform/platform.cpp b/source/platform/platform.cpp index bcb38d1a7..acc7b3c46 100644 --- a/source/platform/platform.cpp +++ b/source/platform/platform.cpp @@ -247,11 +247,19 @@ void CNpcPlatform::setGraphic( sThingPlatform *ThisPlatform ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +void CNpcPlatform::setGraphic( u8 graphicNum ) +{ + m_modelGfx = new ("ModelGfx") CModelGfx; + m_modelGfx->SetModel( graphicNum ); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + void CNpcPlatform::init() { CPlatformThing::init(); - + m_animPlaying = true; m_animNo = m_data[m_type].initAnim; m_frame = 0; @@ -412,7 +420,7 @@ void CNpcPlatform::processLifetime( int _frames ) void CNpcPlatform::think(int _frames) { - + if ( m_isActive ) { if ( m_tiltable ) @@ -650,12 +658,12 @@ void CNpcPlatform::render() centre=getCollisionCentre(); area=getCollisionArea(); halfLength=(area.x2-area.x1)/2; - + x1=-halfLength*mcos(getCollisionAngle()&4095)>>12; y1=-halfLength*msin(getCollisionAngle()&4095)>>12; x2=+halfLength*mcos(getCollisionAngle()&4095)>>12; y2=+halfLength*msin(getCollisionAngle()&4095)>>12; - + centre.vx-=offset.vx; centre.vy-=offset.vy; x1+=centre.vx; @@ -714,7 +722,7 @@ s32 CNpcPlatform::getNewYPos(CThing *_thisThing) // now find the highest y pos // first set highestY to lowest of the four points - + s16 highestY = testPoints[0].vy; for ( i = 1 ; i < 4 ; i++ ) @@ -976,4 +984,4 @@ void CNpcPlatform::setTypeFromMapEdit( u16 newType ) CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::getTypeFromMapEdit( u16 newType ) { return( mapEditConvertTable[newType] ); -} +} \ No newline at end of file diff --git a/source/platform/platform.h b/source/platform/platform.h index 5a45fa89b..55006e916 100644 --- a/source/platform/platform.h +++ b/source/platform/platform.h @@ -3,9 +3,9 @@ platform.h Author: CRB - Created: + Created: Project: Spongebob - Purpose: + Purpose: Copyright (c) 2000 Climax Development Ltd @@ -76,8 +76,9 @@ public: void setTiltable( bool isTiltable ); void addWaypoint( s32 xPos, s32 yPos ); void setGraphic( sThingPlatform *ThisPlatform ); + void setGraphic( u8 graphicNum ); virtual void setWaypoints( sThingPlatform *ThisPlatform ); - + static NPC_PLATFORM_UNIT_TYPE getTypeFromMapEdit( u16 newType ); static CNpcPlatform *Create(sThingPlatform *ThisPlatform); @@ -154,7 +155,7 @@ protected: static class CLayerCollision *m_layerCollision; // internal variables - + NPC_PLATFORM_UNIT_TYPE m_type; CNpcPath m_npcPath; s32 m_heading; @@ -191,4 +192,4 @@ protected: /*****************************************************************************/ -#endif +#endif \ No newline at end of file diff --git a/source/player/pmbubble.cpp b/source/player/pmbubble.cpp index a377a51f8..689637905 100644 --- a/source/player/pmbubble.cpp +++ b/source/player/pmbubble.cpp @@ -3,9 +3,9 @@ pmbubble.cpp Author: PKG - Created: + Created: Project: Spongebob - Purpose: + Purpose: Copyright (c) 2001 Climax Development Ltd @@ -106,6 +106,8 @@ void CPlayerModeBubbleMixture::think() DVECTOR pos; bubble=new ("bubble platform") CNpcPlayerBubblePlatform; bubble->setType( CNpcPlatform::NPC_PLAYER_BUBBLE_PLATFORM ); + bubble->setGraphic( (u8) 0 ); + bubble->setTiltable( false ); pos=m_player->getPos(); pos.vx+=buboff.vx*m_player->getFacing(); pos.vy+=buboff.vy; @@ -211,4 +213,4 @@ int CPlayerModeBubbleMixture::canBlowBubbleFromThisState() } /*=========================================================================== -end */ +end */ \ No newline at end of file