2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 04:27:42 +00:00

Fix ShotSmoke effect

This commit is contained in:
Jack Andersen
2018-02-12 12:27:40 -10:00
parent 46a4a37cc6
commit e263345b0a
6 changed files with 18 additions and 14 deletions

View File

@@ -386,7 +386,7 @@ zeus::CVector2i CGraphics::ProjectPoint(const zeus::CVector3f& point)
{
zeus::CVector3f projPt = GetPerspectiveProjectionMatrix(false).multiplyOneOverW(point);
return {int(projPt.x * g_Viewport.x10_halfWidth) + int(g_Viewport.x10_halfWidth),
int(g_Viewport.x14_halfHeight) - (int(projPt.y * g_Viewport.x14_halfHeight) +
int(g_Viewport.xc_height) - (int(projPt.y * g_Viewport.x14_halfHeight) +
int(g_Viewport.x14_halfHeight))};
}
@@ -406,9 +406,9 @@ SClipScreenRect CGraphics::ClipScreenRectFromVS(const zeus::CVector3f& p1,
if (p2.x == 0.f && p2.y == 0.f && p2.z == 0.f)
return {};
if (p1.y < GetProjectionState().x14_near || p2.y < GetProjectionState().x14_near)
if (-p1.z < GetProjectionState().x14_near || -p2.z < GetProjectionState().x14_near)
return {};
if (p1.y > GetProjectionState().x18_far || p2.y > GetProjectionState().x18_far)
if (-p1.z > GetProjectionState().x18_far || -p2.z > GetProjectionState().x18_far)
return {};
zeus::CVector2i sp1 = ProjectPoint(p1);