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

LLETriangle::draw: correct Z for G_ZS_PRIM mode.

This commit is contained in:
Sergey Lipskiy 2020-03-04 22:35:37 +07:00
parent 0d0c47fb84
commit e3f0354565

View File

@ -1433,7 +1433,7 @@ void LLETriangle::draw(bool _shade, bool _texture, bool _zbuffer, s32 * _pData)
if (_zbuffer) {
//((gDP.otherMode.depthSource == G_ZS_PRIM) ? gDP.primDepth.z : f32(u32(z)) / 0xffff0000)
vtx->z = (gDP.otherMode.depthSource == G_ZS_PRIM) ?
f32(gDP.primDepth.z) / f32(0xffff0000) :
gDP.primDepth.z :
static_cast<f32>((zf + dzdef * diffY + dzdxf * diffx * 4.0f)*2.0f);
//if (vtx->z < 0.0f)
// vtx->z = 1.0f + vtx->z - ceil(vtx->z);