mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Fix issues with software clipping:
* fixed max screen Y calculation. It fixes bug in Top Gear Overdrive, #2450 * fixed typo in rasterise().
This commit is contained in:
parent
e07b09b4d0
commit
92c9bd8408
|
@ -359,7 +359,6 @@ f32 renderAndDrawTriangles(const SPVertex *_pVertices,
|
|||
{
|
||||
int dzdx = calcDzDx(pVtxClip);
|
||||
vertexi vdraw[3];
|
||||
for (u32 k = 0; k < 3; ++k) {
|
||||
for (u32 k = 0; k < 3; ++k) {
|
||||
const u32 idx = clockwise ? k : 3 - k - 1;
|
||||
maxY = std::max(maxY, pVtxClip[idx].y);
|
||||
|
@ -367,10 +366,15 @@ f32 renderAndDrawTriangles(const SPVertex *_pVertices,
|
|||
vdraw[k].y = floatToFixed16(pVtxClip[idx].y);
|
||||
vdraw[k].z = floatToFixed16(pVtxClip[idx].z);
|
||||
}
|
||||
}
|
||||
Rasterize(vdraw, 3, dzdx);
|
||||
};
|
||||
|
||||
auto calcMaxY = [&maxY](const vertexclip* pVtxClip)
|
||||
{
|
||||
for (u32 k = 0; k < 3; ++k)
|
||||
maxY = std::max(maxY, pVtxClip[k].y);
|
||||
};
|
||||
|
||||
for (u32 i = 0; i < _numElements; i += 3) {
|
||||
u32 orbits = 0;
|
||||
u32 modify = 0;
|
||||
|
@ -402,6 +406,8 @@ f32 renderAndDrawTriangles(const SPVertex *_pVertices,
|
|||
|
||||
if (needResterise)
|
||||
rasterise(vclip, clockwise);
|
||||
else
|
||||
calcMaxY(vclip);
|
||||
} else {
|
||||
assert(modify == 0);
|
||||
// No screen space coordinates, so use clipping in homogeneous space.
|
||||
|
|
Loading…
Reference in New Issue
Block a user