This commit is contained in:
parent
9f667e7bbc
commit
c7e46d02ef
24 changed files with 328 additions and 469 deletions
|
@ -82,16 +82,8 @@ void CNpcGeyserPlatformGenerator::think( int _frames )
|
|||
startPos.vx += ( -5 + ( getRnd() % 11 ) );
|
||||
newPlatform->init( startPos );
|
||||
|
||||
CNpcWaypoint *sourceWaypoint = m_npcPath.getWaypointList();
|
||||
|
||||
if ( sourceWaypoint )
|
||||
{
|
||||
while( sourceWaypoint )
|
||||
{
|
||||
newPlatform->addWaypoint( sourceWaypoint->pos.vx >> 4, sourceWaypoint->pos.vy >> 4 );
|
||||
sourceWaypoint = sourceWaypoint->nextWaypoint;
|
||||
}
|
||||
}
|
||||
newPlatform->setWaypointCount( m_npcPath.getWaypointCount() );
|
||||
newPlatform->setWaypointPtr( m_npcPath.getWaypointPtr() );
|
||||
|
||||
newPlatform->setTiltable( false );
|
||||
newPlatform->postInit();
|
||||
|
|
|
@ -59,7 +59,7 @@ void CNpcConveyorPlatformGenerator::think( int _frames )
|
|||
|
||||
//m_timer = ( 3 * GameState::getOneSecondInFrames() ) + ( getRnd() % ( ( m_data[m_type].initTimer - 1 ) * GameState::getOneSecondInFrames() ) );
|
||||
|
||||
// generate new falling platform
|
||||
// generate new conveyor platform
|
||||
|
||||
CNpcPlatform *newPlatform = NULL;
|
||||
newPlatform = CNpcPlatform::Create( NPC_CONVEYOR_PLATFORM );
|
||||
|
@ -69,24 +69,11 @@ void CNpcConveyorPlatformGenerator::think( int _frames )
|
|||
newPlatform->setThingSubType( NPC_CONVEYOR_PLATFORM );
|
||||
newPlatform->setGraphic( m_graphicNum );
|
||||
|
||||
CNpcWaypoint *sourceWaypoint = m_npcPath.getWaypointList();
|
||||
DVECTOR startPos = Pos;
|
||||
newPlatform->init( startPos );
|
||||
|
||||
if ( sourceWaypoint )
|
||||
{
|
||||
DVECTOR startPos;
|
||||
startPos.vx = sourceWaypoint->pos.vx;
|
||||
startPos.vy = sourceWaypoint->pos.vy;
|
||||
//startPos.vx = 100;
|
||||
//startPos.vy = 100;
|
||||
|
||||
newPlatform->init( startPos );
|
||||
|
||||
while( sourceWaypoint )
|
||||
{
|
||||
newPlatform->addWaypoint( sourceWaypoint->pos.vx >> 4, sourceWaypoint->pos.vy >> 4 );
|
||||
sourceWaypoint = sourceWaypoint->nextWaypoint;
|
||||
}
|
||||
}
|
||||
newPlatform->setWaypointCount( m_npcPath.getWaypointCount() );
|
||||
newPlatform->setWaypointPtr( m_npcPath.getWaypointPtr() );
|
||||
|
||||
newPlatform->setTiltable( false );
|
||||
newPlatform->postInit();
|
||||
|
|
|
@ -87,24 +87,28 @@ void CNpcFallingPlatformGenerator::think( int _frames )
|
|||
newPlatform->setThingSubType( m_targetType );
|
||||
newPlatform->setGraphic( m_graphicNum );
|
||||
|
||||
CNpcWaypoint *sourceWaypoint = m_npcPath.getWaypointList();
|
||||
DVECTOR startPos = Pos;
|
||||
newPlatform->init( startPos );
|
||||
|
||||
newPlatform->setWaypointCount( m_npcPath.getWaypointCount() );
|
||||
newPlatform->setWaypointPtr( m_npcPath.getWaypointPtr() );
|
||||
|
||||
/*CNpcWaypoint *sourceWaypoint = m_npcPath.getWaypointList();
|
||||
|
||||
if ( sourceWaypoint )
|
||||
{
|
||||
DVECTOR startPos;
|
||||
startPos.vx = sourceWaypoint->pos.vx;
|
||||
startPos.vy = sourceWaypoint->pos.vy;
|
||||
//startPos.vx = 100;
|
||||
//startPos.vy = 100;
|
||||
startPos.vx = *sourceWaypoint->posX << 4;
|
||||
startPos.vy = *sourceWaypoint->posY << 4;
|
||||
|
||||
newPlatform->init( startPos );
|
||||
|
||||
while( sourceWaypoint )
|
||||
{
|
||||
newPlatform->addWaypoint( sourceWaypoint->pos.vx >> 4, sourceWaypoint->pos.vy >> 4 );
|
||||
newPlatform->addWaypoint( sourceWaypoint->posX, sourceWaypoint->posY );
|
||||
sourceWaypoint = sourceWaypoint->nextWaypoint;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
newPlatform->setTiltable( false );
|
||||
newPlatform->postInit();
|
||||
|
|
|
@ -449,10 +449,12 @@ void CNpcPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
|||
int pointNum;
|
||||
|
||||
u16 *PntList=(u16*)MakePtr(ThisPlatform,sizeof(sThingPlatform));
|
||||
u16 *waypoints;
|
||||
|
||||
u16 newXPos, newYPos;
|
||||
|
||||
newXPos = (u16) *PntList;
|
||||
waypoints = PntList;
|
||||
PntList++;
|
||||
newYPos = (u16) *PntList;
|
||||
PntList++;
|
||||
|
@ -463,20 +465,9 @@ void CNpcPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
|||
|
||||
init( startPos );
|
||||
|
||||
addWaypoint( newXPos, newYPos );
|
||||
setWaypointCount( ThisPlatform->PointCount - 1 );
|
||||
|
||||
if ( ThisPlatform->PointCount > 1 )
|
||||
{
|
||||
for ( pointNum = 1 ; pointNum < ThisPlatform->PointCount ; pointNum++ )
|
||||
{
|
||||
newXPos = (u16) *PntList;
|
||||
PntList++;
|
||||
newYPos = (u16) *PntList;
|
||||
PntList++;
|
||||
|
||||
addWaypoint( newXPos, newYPos );
|
||||
}
|
||||
}
|
||||
setWaypointPtr( waypoints );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -605,7 +596,7 @@ void CNpcPlatform::postInit()
|
|||
void CNpcPlatform::shutdown()
|
||||
{
|
||||
delete m_modelGfx;
|
||||
m_npcPath.removeAllWaypoints();
|
||||
//m_npcPath.removeAllWaypoints();
|
||||
|
||||
// temporary
|
||||
CPlatformThing::shutdown();
|
||||
|
@ -1191,18 +1182,20 @@ int CNpcPlatform::getHeightFromPlatformAtPosition(int _x,int _y, int offsetX, in
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcPlatform::addWaypoint( s32 xPos, s32 yPos )
|
||||
/*void CNpcPlatform::addWaypoint( u16 *ptr )
|
||||
{
|
||||
DVECTOR newPos;
|
||||
|
||||
newPos.vx = xPos << 4;
|
||||
newPos.vy = yPos << 4;
|
||||
|
||||
m_npcPath.addWaypoint( newPos );
|
||||
m_npcPath.addWaypoint( ptr );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcPlatform::addWaypoint( u16 *ptrX, u16 *ptrY )
|
||||
{
|
||||
m_npcPath.addWaypoint( ptrX, ptrY );
|
||||
}*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcPlatform::setTypeFromMapEdit( u16 newType )
|
||||
{
|
||||
int Type= mapEditConvertTable[newType];
|
||||
|
|
|
@ -108,7 +108,8 @@ public:
|
|||
virtual u8 checkCollisionDelta( CThing *_thisThing, int threshold, CRECT collisionArea );
|
||||
virtual int getHeightFromPlatformAtPosition(int _x,int _y, int offsetX = 0, int offsetY = 0);
|
||||
void setTiltable( bool isTiltable );
|
||||
void addWaypoint( s32 xPos, s32 yPos );
|
||||
void setWaypointPtr( u16 *newPtr ) {m_npcPath.setWaypointPtr( newPtr );}
|
||||
void setWaypointCount( u8 newCount ) {m_npcPath.setWaypointCount( newCount );}
|
||||
void setGraphic( sThingPlatform *ThisPlatform );
|
||||
void setGraphic( u8 graphicNum );
|
||||
virtual void setWaypoints( sThingPlatform *ThisPlatform );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue