This commit is contained in:
parent
3bffe91fde
commit
61ba89c24c
1 changed files with 83 additions and 0 deletions
|
@ -209,6 +209,8 @@ void CNpcDualPlatform::render()
|
||||||
{
|
{
|
||||||
int x1,y1,x2,y2;
|
int x1,y1,x2,y2;
|
||||||
|
|
||||||
|
DVECTOR offset = CLevel::getCameraPos();
|
||||||
|
|
||||||
if ( m_isActive )
|
if ( m_isActive )
|
||||||
{
|
{
|
||||||
CPlatformThing::render();
|
CPlatformThing::render();
|
||||||
|
@ -219,6 +221,87 @@ void CNpcDualPlatform::render()
|
||||||
|
|
||||||
m_modelGfx->Render(renderPos);
|
m_modelGfx->Render(renderPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
x1 = Pos.vx - offset.vx;
|
||||||
|
x2 = m_lineBase.vx - offset.vx;
|
||||||
|
|
||||||
|
if ( x1 > x2 )
|
||||||
|
{
|
||||||
|
int tempX = x1;
|
||||||
|
x1 = x2;
|
||||||
|
x2 = tempX;
|
||||||
|
}
|
||||||
|
|
||||||
|
y1 = Pos.vy - offset.vy;
|
||||||
|
y2 = m_lineBase.vy - offset.vy;
|
||||||
|
|
||||||
|
if ( y1 > y2 )
|
||||||
|
{
|
||||||
|
int tempY = y1;
|
||||||
|
y1 = y2;
|
||||||
|
y2 = tempY;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( y1 < 0 )
|
||||||
|
{
|
||||||
|
y1 = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( y2 > VidGetScrH() )
|
||||||
|
{
|
||||||
|
y2 = VidGetScrH();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( x2 >= 0 && x1 <= VidGetScrW() )
|
||||||
|
{
|
||||||
|
if ( y2 >= 0 && y1 <= VidGetScrH() )
|
||||||
|
{
|
||||||
|
DrawLine( x1, y1, x2, y2, 0, 0, 0, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( m_isMaster )
|
||||||
|
{
|
||||||
|
DVECTOR otherLineBase = m_otherPlatform->getLineBase();
|
||||||
|
|
||||||
|
x1 = otherLineBase.vx - offset.vx;
|
||||||
|
x2 = m_lineBase.vx - offset.vx;
|
||||||
|
|
||||||
|
if ( x1 > x2 )
|
||||||
|
{
|
||||||
|
int tempX = x1;
|
||||||
|
x1 = x2;
|
||||||
|
x2 = tempX;
|
||||||
|
}
|
||||||
|
|
||||||
|
y1 = otherLineBase.vy - offset.vy;
|
||||||
|
y2 = m_lineBase.vy - offset.vy;
|
||||||
|
|
||||||
|
if ( y1 > y2 )
|
||||||
|
{
|
||||||
|
int tempY = y1;
|
||||||
|
y1 = y2;
|
||||||
|
y2 = tempY;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( x1 < 0 )
|
||||||
|
{
|
||||||
|
x1 = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( x2 > VidGetScrW() )
|
||||||
|
{
|
||||||
|
x2 = VidGetScrW();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( x2 >= 0 && x1 <= VidGetScrW() )
|
||||||
|
{
|
||||||
|
if ( y2 >= 0 && y1 <= VidGetScrH() )
|
||||||
|
{
|
||||||
|
DrawLine( x1, y1, x2, y2, 0, 0, 0, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue