1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Fix vertex Y calculation in GraphicsDrawer::_drawThickLine

Fixed smoke direction in Micro Machines 64 Turbo (U) #1725
This commit is contained in:
Sergey Lipskiy 2018-05-02 20:47:16 +07:00
parent 2ef337223e
commit 8212a1faf6

View File

@ -850,15 +850,16 @@ void GraphicsDrawer::_drawThickLine(int _v0, int _v1, float _width)
setDMAVerticesSize(4);
SPVertex * pVtx = getDMAVerticesData();
const f32 ySign = GBI.isNegativeY() ? -1.0f : 1.0f;
pVtx[0] = triangles.vertices[_v0];
pVtx[0].x = pVtx[0].x / pVtx[0].w * gSP.viewport.vscale[0] + gSP.viewport.vtrans[0];
pVtx[0].y = pVtx[0].y / pVtx[0].w * gSP.viewport.vscale[1] + gSP.viewport.vtrans[1];
pVtx[0].y = ySign * pVtx[0].y / pVtx[0].w * gSP.viewport.vscale[1] + gSP.viewport.vtrans[1];
pVtx[0].z = pVtx[0].z / pVtx[0].w * gSP.viewport.vscale[2] + gSP.viewport.vtrans[2];
pVtx[1] = pVtx[0];
pVtx[2] = triangles.vertices[_v1];
pVtx[2].x = pVtx[2].x / pVtx[2].w * gSP.viewport.vscale[0] + gSP.viewport.vtrans[0];
pVtx[2].y = pVtx[2].y / pVtx[2].w * gSP.viewport.vscale[1] + gSP.viewport.vtrans[1];
pVtx[2].y = ySign * pVtx[2].y / pVtx[2].w * gSP.viewport.vscale[1] + gSP.viewport.vtrans[1];
pVtx[2].z = pVtx[2].z / pVtx[2].w * gSP.viewport.vscale[2] + gSP.viewport.vtrans[2];
pVtx[3] = pVtx[2];