This commit is contained in:
parent
1ea21741e4
commit
5138533e49
@ -19,6 +19,10 @@
|
||||
#include "utils\utils.h"
|
||||
#endif
|
||||
|
||||
#ifndef __VID_HEADER_
|
||||
#include "system\vid.h"
|
||||
#endif
|
||||
|
||||
#ifndef __GAME_GAME_H__
|
||||
#include "game\game.h"
|
||||
#endif
|
||||
@ -158,3 +162,69 @@ void CNpcBranchPlatform::processMovement( int _frames )
|
||||
|
||||
setCollisionAngle( newAngle );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcBranchPlatform::render()
|
||||
{
|
||||
if ( m_isActive )
|
||||
{
|
||||
CPlatformThing::render();
|
||||
|
||||
// Render
|
||||
DVECTOR renderPos;
|
||||
DVECTOR offset = CLevel::getCameraPos();
|
||||
|
||||
renderPos.vx = Pos.vx - offset.vx;
|
||||
renderPos.vy = Pos.vy - offset.vy;
|
||||
|
||||
if ( renderPos.vx >= 0 && renderPos.vx <= VidGetScrW() )
|
||||
{
|
||||
if ( renderPos.vy >= 0 && renderPos.vy <= VidGetScrH() )
|
||||
{
|
||||
SVECTOR rotation;
|
||||
rotation.vx = 0;
|
||||
if ( m_reversed )
|
||||
{
|
||||
rotation.vy = 0;
|
||||
rotation.vz = getCollisionAngle();
|
||||
}
|
||||
else
|
||||
{
|
||||
rotation.vy = 2048;
|
||||
rotation.vz = -getCollisionAngle();
|
||||
}
|
||||
|
||||
VECTOR scale;
|
||||
scale.vx = ONE;
|
||||
scale.vy = ONE;
|
||||
scale.vz = ONE;
|
||||
|
||||
m_modelGfx->Render(renderPos,&rotation,&scale);
|
||||
|
||||
#if defined (__USER_paul__) || defined (__USER_charles__)
|
||||
DVECTOR centre;
|
||||
int halfLength;
|
||||
int x1,y1,x2,y2;
|
||||
|
||||
centre=getCollisionCentre();
|
||||
halfLength=PLATFORMWIDTH/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;
|
||||
y1+=centre.vy;
|
||||
x2+=centre.vx;
|
||||
y2+=centre.vy;
|
||||
|
||||
DrawLine(x1,y1,x2,y2,0,255,0,0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ class CNpcBranchPlatform : public CNpcPlatform
|
||||
{
|
||||
public:
|
||||
virtual void postInit();
|
||||
virtual void render();
|
||||
protected:
|
||||
virtual void setWaypoints( sThingPlatform *ThisPlatform );
|
||||
virtual void processMovement( int _frames );
|
||||
|
@ -105,16 +105,6 @@
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// All platforms are fied to this width at the minute..
|
||||
#define PLATFORMWIDTH 80
|
||||
|
||||
// The collision box is this high.. if SB keeps falling through platforms then it *should* be sufficient
|
||||
// just to up this a bit
|
||||
#define PLATFORMCOLLISIONHEIGHT 80
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class CLayerCollision *CNpcPlatform::m_layerCollision;
|
||||
|
@ -35,6 +35,16 @@
|
||||
#include "gfx\sprbank.h"
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// All platforms are fied to this width at the minute..
|
||||
#define PLATFORMWIDTH 80
|
||||
|
||||
// The collision box is this high.. if SB keeps falling through platforms then it *should* be sufficient
|
||||
// just to up this a bit
|
||||
#define PLATFORMCOLLISIONHEIGHT 80
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
class CNpcPlatform : public CPlatformThing
|
||||
@ -68,7 +78,7 @@ public:
|
||||
virtual void postInit();
|
||||
void shutdown();
|
||||
void think(int _frames);
|
||||
void render();
|
||||
virtual void render();
|
||||
void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;}
|
||||
void setType( NPC_PLATFORM_UNIT_TYPE newType ) {m_type = newType;}
|
||||
void setTypeFromMapEdit( u16 newType );
|
||||
|
@ -19,6 +19,14 @@
|
||||
#include "game\game.h"
|
||||
#endif
|
||||
|
||||
#ifndef __VID_HEADER_
|
||||
#include "system\vid.h"
|
||||
#endif
|
||||
|
||||
#ifndef __UTILS_HEADER__
|
||||
#include "utils\utils.h"
|
||||
#endif
|
||||
|
||||
|
||||
void CNpcSeesawPlatform::postInit()
|
||||
{
|
||||
@ -99,4 +107,62 @@ void CNpcSeesawPlatform::processMovement( int _frames )
|
||||
m_currentAngle = newAngle;
|
||||
|
||||
setCollisionAngle( newAngle >> 8 );
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcSeesawPlatform::render()
|
||||
{
|
||||
if ( m_isActive )
|
||||
{
|
||||
CPlatformThing::render();
|
||||
|
||||
// Render
|
||||
DVECTOR renderPos;
|
||||
DVECTOR offset = CLevel::getCameraPos();
|
||||
|
||||
renderPos.vx = Pos.vx - offset.vx;
|
||||
renderPos.vy = Pos.vy - offset.vy;
|
||||
|
||||
if ( renderPos.vx >= 0 && renderPos.vx <= VidGetScrW() )
|
||||
{
|
||||
if ( renderPos.vy >= 0 && renderPos.vy <= VidGetScrH() )
|
||||
{
|
||||
SVECTOR rotation;
|
||||
rotation.vx = 0;
|
||||
rotation.vy = 0;
|
||||
rotation.vz = getCollisionAngle();
|
||||
|
||||
VECTOR scale;
|
||||
scale.vx = ONE;
|
||||
scale.vy = ONE;
|
||||
scale.vz = ONE;
|
||||
|
||||
m_modelGfx->Render(renderPos,&rotation,&scale);
|
||||
|
||||
#if defined (__USER_paul__) || defined (__USER_charles__)
|
||||
DVECTOR centre;
|
||||
int halfLength;
|
||||
int x1,y1,x2,y2;
|
||||
|
||||
centre=getCollisionCentre();
|
||||
halfLength=PLATFORMWIDTH/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;
|
||||
y1+=centre.vy;
|
||||
x2+=centre.vx;
|
||||
y2+=centre.vy;
|
||||
|
||||
DrawLine(x1,y1,x2,y2,0,255,0,0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ class CNpcSeesawPlatform : public CNpcPlatform
|
||||
{
|
||||
public:
|
||||
virtual void postInit();
|
||||
virtual void render();
|
||||
protected:
|
||||
virtual void processMovement( int _frames );
|
||||
|
||||
|
@ -82,7 +82,7 @@ void CPlayerStateSpring::enter(CPlayerModeBase *_playerMode)
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int maxplayerspringframes=40;
|
||||
int maxplayerspringframes=50;
|
||||
void CPlayerStateSpring::think(CPlayerModeBase *_playerMode)
|
||||
{
|
||||
const PlayerMetrics *metrics;
|
||||
|
Loading…
Reference in New Issue
Block a user