diff --git a/source/hazard/hrweight.cpp b/source/hazard/hrweight.cpp index 8bf7d313d..b2b1b108a 100644 --- a/source/hazard/hrweight.cpp +++ b/source/hazard/hrweight.cpp @@ -19,6 +19,14 @@ #include "utils\utils.h" #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 ); } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +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 ); + } + } + } +} diff --git a/source/hazard/hrweight.h b/source/hazard/hrweight.h index db01925c6..5e06e7843 100644 --- a/source/hazard/hrweight.h +++ b/source/hazard/hrweight.h @@ -22,6 +22,7 @@ class CNpcRisingWeightHazard : public CNpcHazard { public: void init(); + virtual void render(); DVECTOR const &getWheelPos() {return( m_wheelPos );} void setTriggered() {m_triggered = true;} protected: