This commit is contained in:
Charles 2001-05-31 17:58:55 +00:00
parent f18fde33b7
commit 8ae968183e
2 changed files with 55 additions and 0 deletions

View file

@ -19,6 +19,14 @@
#include "utils\utils.h" #include "utils\utils.h"
#endif #endif
#ifndef __VID_HEADER_
#include "system\vid.h"
#endif
#ifndef __GAME_GAME_H__
#include "game\game.h"
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -98,3 +106,49 @@ void CNpcRisingWeightHazard::processMovement( int _frames )
Pos.vy = m_base.vy - ( m_extension >> 8 ); Pos.vy = m_base.vy - ( m_extension >> 8 );
} }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcRisingWeightHazard::render()
{
int x1,y1,x2,y2;
DVECTOR offset = CLevel::getCameraPos();
if ( m_isActive )
{
CHazardThing::render();
if (canRender())
{
DVECTOR &renderPos=getRenderPos();
m_modelGfx->Render(renderPos);
}
x1 = x2 = m_base.vx - offset.vx;
y1 = m_base.vy - ( m_maxExtension >> 8 ) - offset.vy;
y2 = Pos.vy - offset.vy;
if ( x2 >= 0 && x1 <= VidGetScrW() )
{
if ( y2 >= 0 && y1 <= VidGetScrH() )
{
DrawLine( x1, y1, x2, y2, 0, 0, 0, 0 );
}
}
x1 = ( m_wheelPos.vx << 4 ) + 8 - offset.vx;
x2 = m_base.vx - offset.vx;
y1 = ( m_wheelPos.vy << 4 ) + 16 - offset.vy;
y2 = m_base.vy - ( m_maxExtension >> 8 ) - offset.vy;
if ( x2 >= 0 && x1 <= VidGetScrW() )
{
if ( y1 >= 0 && y2 <= VidGetScrH() )
{
DrawLine( x1, y1, x2, y2, 0, 0, 0, 0 );
}
}
}
}

View file

@ -22,6 +22,7 @@ class CNpcRisingWeightHazard : public CNpcHazard
{ {
public: public:
void init(); void init();
virtual void render();
DVECTOR const &getWheelPos() {return( m_wheelPos );} DVECTOR const &getWheelPos() {return( m_wheelPos );}
void setTriggered() {m_triggered = true;} void setTriggered() {m_triggered = true;}
protected: protected: