This commit is contained in:
parent
7bb3c7353e
commit
579cb15a9d
20 changed files with 71 additions and 71 deletions
|
@ -91,7 +91,7 @@ void CNpcMotherJellyfishEnemy::setupWaypoints( sThingActor *ThisActor )
|
||||||
|
|
||||||
setStartPos( newXPos, newYPos );
|
setStartPos( newXPos, newYPos );
|
||||||
|
|
||||||
startX = newXPos << 4;
|
startX = ( newXPos << 4 ) + 8;
|
||||||
|
|
||||||
if ( ThisActor->PointCount > 1 )
|
if ( ThisActor->PointCount > 1 )
|
||||||
{
|
{
|
||||||
|
@ -109,13 +109,13 @@ void CNpcMotherJellyfishEnemy::setupWaypoints( sThingActor *ThisActor )
|
||||||
|
|
||||||
if ( pointNum == ThisActor->PointCount - 2 )
|
if ( pointNum == ThisActor->PointCount - 2 )
|
||||||
{
|
{
|
||||||
startX = newXPos << 4;
|
startX = ( newXPos << 4 ) + 8;
|
||||||
m_base.vx = startX;
|
m_base.vx = startX;
|
||||||
m_base.vy = newYPos << 4;
|
m_base.vy = ( newYPos << 4 ) + 16;
|
||||||
}
|
}
|
||||||
else if ( pointNum == ThisActor->PointCount - 1 )
|
else if ( pointNum == ThisActor->PointCount - 1 )
|
||||||
{
|
{
|
||||||
m_cycleWidth = abs( startX - ( newXPos << 4 ) );
|
m_cycleWidth = abs( startX - ( ( newXPos << 4 ) + 8 ) );
|
||||||
m_halfCycleWidth = m_cycleWidth >> 1;
|
m_halfCycleWidth = m_cycleWidth >> 1;
|
||||||
m_base.vx += m_halfCycleWidth;
|
m_base.vx += m_halfCycleWidth;
|
||||||
}
|
}
|
||||||
|
|
|
@ -507,8 +507,8 @@ void CNpcEnemy::addWaypoint( u16 *ptrX, u16 *ptrY )
|
||||||
|
|
||||||
void CNpcEnemy::setStartPos( s32 xPos, s32 yPos )
|
void CNpcEnemy::setStartPos( s32 xPos, s32 yPos )
|
||||||
{
|
{
|
||||||
Pos.vx = xPos << 4;
|
Pos.vx = ( xPos << 4 ) + 8;
|
||||||
Pos.vy = yPos << 4;
|
Pos.vy = ( yPos << 4 ) + 16;
|
||||||
|
|
||||||
m_initPos = m_base = Pos;
|
m_initPos = m_base = Pos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,12 +25,12 @@ bool CNpcPath::isPointNear( DVECTOR testPos, s32 *xDist, s32 *yDist )
|
||||||
u16 *waypoint = waypointPtr;
|
u16 *waypoint = waypointPtr;
|
||||||
waypoint += 2 * currentWaypoint;
|
waypoint += 2 * currentWaypoint;
|
||||||
|
|
||||||
*xDist = ( *waypoint << 4 ) - testPos.vx;
|
*xDist = ( ( *waypoint << 4 ) + 8 ) - testPos.vx;
|
||||||
xDistSqr = (*xDist) * (*xDist);
|
xDistSqr = (*xDist) * (*xDist);
|
||||||
|
|
||||||
waypoint++;
|
waypoint++;
|
||||||
|
|
||||||
*yDist = ( *waypoint << 4 ) - testPos.vy;
|
*yDist = ( ( *waypoint << 4 ) + 16 ) - testPos.vy;
|
||||||
yDistSqr = (*yDist) * (*yDist);
|
yDistSqr = (*yDist) * (*yDist);
|
||||||
|
|
||||||
if ( xDistSqr + yDistSqr < 100 )
|
if ( xDistSqr + yDistSqr < 100 )
|
||||||
|
@ -114,9 +114,9 @@ void CNpcPath::setPathExtents()
|
||||||
|
|
||||||
if ( tempPtr )
|
if ( tempPtr )
|
||||||
{
|
{
|
||||||
mapPos.vx = *tempPtr << 4;
|
mapPos.vx = ( *tempPtr << 4 ) + 8;
|
||||||
*tempPtr++;
|
*tempPtr++;
|
||||||
mapPos.vy = *tempPtr << 4;
|
mapPos.vy = ( *tempPtr << 4 ) + 16;
|
||||||
*tempPtr++;
|
*tempPtr++;
|
||||||
|
|
||||||
minX = maxX = mapPos.vx;
|
minX = maxX = mapPos.vx;
|
||||||
|
@ -124,9 +124,9 @@ void CNpcPath::setPathExtents()
|
||||||
|
|
||||||
for ( tempWaypoint = 1 ; tempWaypoint <= waypointCount ; tempWaypoint++ )
|
for ( tempWaypoint = 1 ; tempWaypoint <= waypointCount ; tempWaypoint++ )
|
||||||
{
|
{
|
||||||
mapPos.vx = *tempPtr << 4;
|
mapPos.vx = ( *tempPtr << 4 ) + 8;
|
||||||
*tempPtr++;
|
*tempPtr++;
|
||||||
mapPos.vy = *tempPtr << 4;
|
mapPos.vy = ( *tempPtr << 4 ) + 16;
|
||||||
*tempPtr++;
|
*tempPtr++;
|
||||||
|
|
||||||
if ( mapPos.vx < minX )
|
if ( mapPos.vx < minX )
|
||||||
|
@ -263,9 +263,9 @@ s32 CNpcPath::think( DVECTOR currentPos, bool *pathComplete, bool *waypointChang
|
||||||
u16 *waypoint = waypointPtr;
|
u16 *waypoint = waypointPtr;
|
||||||
waypoint += 2 * currentWaypoint;
|
waypoint += 2 * currentWaypoint;
|
||||||
|
|
||||||
*distX = ( *waypoint << 4 ) - currentPos.vx;
|
*distX = ( ( *waypoint << 4 ) + 8 ) - currentPos.vx;
|
||||||
waypoint++;
|
waypoint++;
|
||||||
*distY = ( *waypoint << 4 ) - currentPos.vy;
|
*distY = ( ( *waypoint << 4 ) + 16 ) - currentPos.vy;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 headingToTarget = ratan2( *distY, *distX );
|
s32 headingToTarget = ratan2( *distY, *distX );
|
||||||
|
@ -289,9 +289,9 @@ bool CNpcPath::thinkFlat( DVECTOR currentPos, bool *pathComplete, s32 *distX, s3
|
||||||
u16 *waypoint = waypointPtr;
|
u16 *waypoint = waypointPtr;
|
||||||
waypoint += 2 * currentWaypoint;
|
waypoint += 2 * currentWaypoint;
|
||||||
|
|
||||||
*distX = ( *waypoint << 4 ) - currentPos.vx;
|
*distX = ( ( *waypoint << 4 ) + 8 ) - currentPos.vx;
|
||||||
waypoint++;
|
waypoint++;
|
||||||
*distY = ( *waypoint << 4 ) - currentPos.vy;
|
*distY = ( ( *waypoint << 4 ) + 16 ) - currentPos.vy;
|
||||||
|
|
||||||
if ( abs( *distX ) < waypointDist )
|
if ( abs( *distX ) < waypointDist )
|
||||||
{
|
{
|
||||||
|
@ -302,9 +302,9 @@ bool CNpcPath::thinkFlat( DVECTOR currentPos, bool *pathComplete, s32 *distX, s3
|
||||||
waypoint = waypointPtr;
|
waypoint = waypointPtr;
|
||||||
waypoint += 2 * currentWaypoint;
|
waypoint += 2 * currentWaypoint;
|
||||||
|
|
||||||
*distX = ( *waypoint << 4 ) - currentPos.vx;
|
*distX = ( ( *waypoint << 4 ) + 8 ) - currentPos.vx;
|
||||||
waypoint++;
|
waypoint++;
|
||||||
*distY = ( *waypoint << 4 ) - currentPos.vy;
|
*distY = ( ( *waypoint << 4 ) + 16 ) - currentPos.vy;
|
||||||
|
|
||||||
if ( *distX > 0 )
|
if ( *distX > 0 )
|
||||||
{
|
{
|
||||||
|
@ -334,9 +334,9 @@ bool CNpcPath::thinkVertical( DVECTOR currentPos, bool *pathComplete, s32 *distX
|
||||||
u16 *waypoint = waypointPtr;
|
u16 *waypoint = waypointPtr;
|
||||||
waypoint += 2 * currentWaypoint;
|
waypoint += 2 * currentWaypoint;
|
||||||
|
|
||||||
*distX = ( *waypoint << 4 ) - currentPos.vx;
|
*distX = ( ( *waypoint << 4 ) + 8 ) - currentPos.vx;
|
||||||
waypoint++;
|
waypoint++;
|
||||||
*distY = ( *waypoint << 4 ) - currentPos.vy;
|
*distY = ( ( *waypoint << 4 ) + 16 ) - currentPos.vy;
|
||||||
|
|
||||||
if ( abs( *distY ) < 10 )
|
if ( abs( *distY ) < 10 )
|
||||||
{
|
{
|
||||||
|
@ -347,9 +347,9 @@ bool CNpcPath::thinkVertical( DVECTOR currentPos, bool *pathComplete, s32 *distX
|
||||||
waypoint = waypointPtr;
|
waypoint = waypointPtr;
|
||||||
waypoint += 2 * currentWaypoint;
|
waypoint += 2 * currentWaypoint;
|
||||||
|
|
||||||
*distX = ( *waypoint << 4 ) - currentPos.vx;
|
*distX = ( ( *waypoint << 4 ) + 8 ) - currentPos.vx;
|
||||||
waypoint++;
|
waypoint++;
|
||||||
*distY = ( *waypoint << 4 ) - currentPos.vy;
|
*distY = ( ( *waypoint << 4 ) + 16 ) - currentPos.vy;
|
||||||
|
|
||||||
if ( *distY > 0 )
|
if ( *distY > 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -166,8 +166,8 @@ CNpcFriend *CNpcFriend::Create(sThingActor *ThisActor)
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = ( newYPos + 1 ) << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
friendNpc->init( startPos );
|
friendNpc->init( startPos );
|
||||||
|
|
||||||
|
|
|
@ -326,8 +326,8 @@ void CNpcHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
Pos = startPos;
|
Pos = startPos;
|
||||||
m_base = Pos;
|
m_base = Pos;
|
||||||
|
|
|
@ -249,8 +249,8 @@ void CNpcFallingHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
Pos = startPos;
|
Pos = startPos;
|
||||||
m_base = Pos;
|
m_base = Pos;
|
||||||
|
|
|
@ -56,8 +56,8 @@ void CNpcFireballHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
Pos = startPos;
|
Pos = startPos;
|
||||||
m_base = Pos;
|
m_base = Pos;
|
||||||
|
|
|
@ -47,8 +47,8 @@ void CNpcPendulumHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
if ( ThisHazard->PointCount > 1 )
|
if ( ThisHazard->PointCount > 1 )
|
||||||
{
|
{
|
||||||
|
@ -58,8 +58,8 @@ void CNpcPendulumHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR pivotPos;
|
DVECTOR pivotPos;
|
||||||
pivotPos.vx = newXPos << 4;
|
pivotPos.vx = ( newXPos << 4 ) + 8;
|
||||||
pivotPos.vy = newYPos << 4;
|
pivotPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
s32 xDist = startPos.vx - pivotPos.vx;
|
s32 xDist = startPos.vx - pivotPos.vx;
|
||||||
s32 yDist = startPos.vy - pivotPos.vy;
|
s32 yDist = startPos.vy - pivotPos.vy;
|
||||||
|
|
|
@ -52,8 +52,8 @@ void CNpcPressureSwitchHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||||
m_triggerPos.vy = newYPos;
|
m_triggerPos.vy = newYPos;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
Pos = startPos;
|
Pos = startPos;
|
||||||
m_base = Pos;
|
m_base = Pos;
|
||||||
|
|
|
@ -47,8 +47,8 @@ void CNpcRisingWeightHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
Pos = startPos;
|
Pos = startPos;
|
||||||
m_base = Pos;
|
m_base = Pos;
|
||||||
|
@ -60,7 +60,7 @@ void CNpcRisingWeightHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||||
newYPos = (u16) *PntList;
|
newYPos = (u16) *PntList;
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
m_maxExtension = abs( ( newYPos << 4 ) - startPos.vy ) << 8;
|
m_maxExtension = abs( ( ( newYPos << 4 ) + 16 ) - startPos.vy ) << 8;
|
||||||
|
|
||||||
// get slave trigger position
|
// get slave trigger position
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,8 @@ void CNpcRisingWeightWheelHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
Pos = startPos;
|
Pos = startPos;
|
||||||
m_base = Pos;
|
m_base = Pos;
|
||||||
|
|
|
@ -138,8 +138,8 @@ void CNpcBalloonBridgePlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
init( startPos );
|
init( startPos );
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ void CNpcBalloonBridgePlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
newYPos = (u16) *PntList;
|
newYPos = (u16) *PntList;
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
m_maxExtension = abs( ( newYPos << 4 ) - startPos.vy );
|
m_maxExtension = abs( ( ( newYPos << 4 ) + 16 ) - startPos.vy );
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -73,8 +73,8 @@ void CNpcBranchPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
init( startPos );
|
init( startPos );
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,8 @@ void CNpcBigWheelPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
if ( ThisPlatform->PointCount > 1 )
|
if ( ThisPlatform->PointCount > 1 )
|
||||||
{
|
{
|
||||||
|
@ -71,8 +71,8 @@ void CNpcBigWheelPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR pivotPos;
|
DVECTOR pivotPos;
|
||||||
pivotPos.vx = newXPos << 4;
|
pivotPos.vx = ( newXPos << 4 ) + 8;
|
||||||
pivotPos.vy = newYPos << 4;
|
pivotPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
s32 xDist = startPos.vx - pivotPos.vx;
|
s32 xDist = startPos.vx - pivotPos.vx;
|
||||||
s32 yDist = startPos.vy - pivotPos.vy;
|
s32 yDist = startPos.vy - pivotPos.vy;
|
||||||
|
|
|
@ -64,8 +64,8 @@ void CNpcDualPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
init( startPos );
|
init( startPos );
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ void CNpcDualPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
newYPos = (u16) *PntList;
|
newYPos = (u16) *PntList;
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
m_maxExtension = ( newYPos << 4 ) - startPos.vy;
|
m_maxExtension = ( ( newYPos << 4 ) + 16 ) - startPos.vy;
|
||||||
|
|
||||||
ASSERT( m_maxExtension >= 0 );
|
ASSERT( m_maxExtension >= 0 );
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ void CNpcDualPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR slavePos;
|
DVECTOR slavePos;
|
||||||
slavePos.vx = newXPos << 4;
|
slavePos.vx = ( newXPos << 4 ) + 8;
|
||||||
slavePos.vy = startPos.vy + m_maxExtension;
|
slavePos.vy = startPos.vy + m_maxExtension;
|
||||||
|
|
||||||
m_otherPlatform->init( slavePos );
|
m_otherPlatform->init( slavePos );
|
||||||
|
|
|
@ -45,8 +45,8 @@ void CNpcLanternPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
if ( ThisPlatform->PointCount > 1 )
|
if ( ThisPlatform->PointCount > 1 )
|
||||||
{
|
{
|
||||||
|
@ -56,8 +56,8 @@ void CNpcLanternPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR pivotPos;
|
DVECTOR pivotPos;
|
||||||
pivotPos.vx = newXPos << 4;
|
pivotPos.vx = ( newXPos << 4 ) + 8;
|
||||||
pivotPos.vy = newYPos << 4;
|
pivotPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
s32 xDist = startPos.vx - pivotPos.vx;
|
s32 xDist = startPos.vx - pivotPos.vx;
|
||||||
s32 yDist = startPos.vy - pivotPos.vy;
|
s32 yDist = startPos.vy - pivotPos.vy;
|
||||||
|
|
|
@ -460,8 +460,8 @@ void CNpcPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
init( startPos );
|
init( startPos );
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,8 @@ void CNpcPendulumPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
if ( ThisPlatform->PointCount > 1 )
|
if ( ThisPlatform->PointCount > 1 )
|
||||||
{
|
{
|
||||||
|
@ -73,8 +73,8 @@ void CNpcPendulumPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR pivotPos;
|
DVECTOR pivotPos;
|
||||||
pivotPos.vx = newXPos << 4;
|
pivotPos.vx = ( newXPos << 4 ) + 8;
|
||||||
pivotPos.vy = newYPos << 4;
|
pivotPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
s32 xDist = startPos.vx - pivotPos.vx;
|
s32 xDist = startPos.vx - pivotPos.vx;
|
||||||
s32 yDist = startPos.vy - pivotPos.vy;
|
s32 yDist = startPos.vy - pivotPos.vy;
|
||||||
|
|
|
@ -60,8 +60,8 @@ void CNpcRisingBridgePlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
init( startPos );
|
init( startPos );
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ void CNpcRisingBridgePlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
newYPos = (u16) *PntList;
|
newYPos = (u16) *PntList;
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
m_maxExtension = abs( ( newYPos << 4 ) - startPos.vy ) << 8;
|
m_maxExtension = abs( ( ( newYPos << 4 ) + 16 ) - startPos.vy ) << 8;
|
||||||
|
|
||||||
// get slave trigger position
|
// get slave trigger position
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ void CNpcRisingBridgePlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
|
|
||||||
// trigger = new ("PlatformTrigger") CPlatformTrigger();
|
// trigger = new ("PlatformTrigger") CPlatformTrigger();
|
||||||
trigger=(CPlatformTrigger*)CTrigger::Create(CTrigger::TRIGGER_PLATFORM);
|
trigger=(CPlatformTrigger*)CTrigger::Create(CTrigger::TRIGGER_PLATFORM);
|
||||||
trigger->setPositionAndSize( newXPos << 4, newYPos << 4, 100, 0 );
|
trigger->setPositionAndSize( ( newXPos << 4 ) + 8, ( newYPos << 4 ) + 16, 100, 0 );
|
||||||
//trigger->setTargetBox(TriggerList->TargetPos.X<<4,TriggerList->TargetPos.Y<<4,TriggerList->TargetSize.X<<4,TriggerList->TargetSize.Y<<4);
|
//trigger->setTargetBox(TriggerList->TargetPos.X<<4,TriggerList->TargetPos.Y<<4,TriggerList->TargetSize.X<<4,TriggerList->TargetSize.Y<<4);
|
||||||
trigger->setPlatform( this );
|
trigger->setPlatform( this );
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,8 +56,8 @@ void CNpcTrapdoorPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
DVECTOR startPos;
|
DVECTOR startPos;
|
||||||
startPos.vx = newXPos << 4;
|
startPos.vx = ( newXPos << 4 ) + 8;
|
||||||
startPos.vy = newYPos << 4;
|
startPos.vy = ( newYPos << 4 ) + 16;
|
||||||
|
|
||||||
Pos = startPos;
|
Pos = startPos;
|
||||||
m_base = Pos;
|
m_base = Pos;
|
||||||
|
@ -71,7 +71,7 @@ void CNpcTrapdoorPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
newYPos = (u16) *PntList;
|
newYPos = (u16) *PntList;
|
||||||
PntList++;
|
PntList++;
|
||||||
|
|
||||||
if ( ( newXPos << 4 ) > m_base.vx )
|
if ( ( ( newXPos << 4 ) + 8 ) > m_base.vx )
|
||||||
{
|
{
|
||||||
m_pointRight = true;
|
m_pointRight = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue