This commit is contained in:
Daveo 2001-05-10 16:16:57 +00:00
parent 0b65d9d4a7
commit c110d56dc5
15 changed files with 403 additions and 536 deletions

View file

@ -77,34 +77,14 @@ void CNpcFishHookPlatform::render()
{
int x1,y1,x2,y2;
setOnScreenFlag(false);
if ( m_isActive )
{
CPlatformThing::render();
// Render
DVECTOR renderPos;
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = Pos.vx - offset.vx;
renderPos.vy = Pos.vy - offset.vy;
CRECT collisionRect = getCollisionArea();
collisionRect.x1 -= Pos.vx;
collisionRect.x2 -= Pos.vx;
collisionRect.y1 -= Pos.vy;
collisionRect.y2 -= Pos.vy;
if ( renderPos.vx + collisionRect.x2 >= 0 && renderPos.vx + collisionRect.x1 <= VidGetScrW() )
DVECTOR &renderPos=getRenderPos();
if (canRender())
{
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() )
{
setOnScreenFlag(true);
m_modelGfx->Render(renderPos);
// POLY_F4 *F4=GetPrimF4();
// setXYWH(F4,renderPos.vx-32,renderPos.vy-32,64,16);
// setRGB0(F4,127,127,64);
// AddPrimToList(F4,2);
m_modelGfx->Render(renderPos);
#if defined (__USER_paul__) || defined (__USER_charles__)
DVECTOR size;
@ -129,45 +109,45 @@ void CNpcFishHookPlatform::render()
DrawLine(x1,y1,x2,y2,0,255,0,0);
#endif
}
}
x1 = Pos.vx - offset.vx;
x2 = m_lineBase.vx - offset.vx;
if ( x1 > x2 )
// draw Line (Literally!!)
if (renderPos.vx>0 && renderPos.vx<512)
{
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;
}
DVECTOR const &CamPos=CLevel::getCameraPos();
if ( y2 > VidGetScrH() )
{
y2 = VidGetScrH();
}
x1 = renderPos.vx;
x2 = m_lineBase.vx - CamPos.vx;
if ( x2 >= 0 && x1 <= VidGetScrW() )
{
if ( y2 >= 0 && y1 <= VidGetScrH() )
if ( x1 > x2 )
{
DrawLine( x1, y1, x2, y2, 0, 0, 0, 0 );
int tempX = x1;
x1 = x2;
x2 = tempX;
}
y1 = renderPos.vy;
y2 = m_lineBase.vy - CamPos.vy;
if ( y1 > y2 )
{
int tempY = y1;
y1 = y2;
y2 = tempY;
}
if ( y1 < 0 )
{
y1 = 0;
}
if ( y2 > VidGetScrH() )
{
y2 = VidGetScrH();
}
DrawLine( x1, y1, x2, y2, 0, 0, 0, 0 );
}
}
}