This commit is contained in:
parent
918abff5fa
commit
37be262782
24 changed files with 404 additions and 697 deletions
|
@ -47,34 +47,20 @@ void CNpcFanHazard::render()
|
|||
{
|
||||
CHazardThing::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() )
|
||||
if (canRender())
|
||||
{
|
||||
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() )
|
||||
{
|
||||
SVECTOR rotation;
|
||||
rotation.vx = m_rotation;
|
||||
rotation.vy = 0;
|
||||
rotation.vz = 0;
|
||||
DVECTOR &renderPos=getRenderPos();
|
||||
|
||||
VECTOR scale;
|
||||
scale.vx = ONE;
|
||||
scale.vy = ONE;
|
||||
scale.vz = ONE;
|
||||
SVECTOR rotation;
|
||||
rotation.vx = m_rotation;
|
||||
rotation.vy = 0;
|
||||
rotation.vz = 0;
|
||||
|
||||
m_modelGfx->Render(renderPos,&rotation,&scale);
|
||||
}
|
||||
VECTOR scale;
|
||||
scale.vx = ONE;
|
||||
scale.vy = ONE;
|
||||
scale.vz = ONE;
|
||||
|
||||
m_modelGfx->Render(renderPos,&rotation,&scale);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue