From 782b60b8245e37a6e93f5fcd2c52c5a9838829aa Mon Sep 17 00:00:00 2001 From: rogerman Date: Thu, 18 Feb 2016 22:55:19 +0000 Subject: [PATCH] SoftRasterizer: - Revert the z-depth calculation in r5191, since this fails to draw units properly in Advance Wars: Days of Ruin when running on big-endian systems. --- desmume/src/rasterize.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/desmume/src/rasterize.cpp b/desmume/src/rasterize.cpp index 3df312318..2c25e6dbf 100644 --- a/desmume/src/rasterize.cpp +++ b/desmume/src/rasterize.cpp @@ -576,8 +576,11 @@ public: u8 &dstAttributeIsTranslucentPoly = this->_softRender->_framebufferAttributes->isTranslucentPoly[fragmentIndex]; // not sure about the w-buffer depth value: this value was chosen to make the skybox, castle window decals, and water level render correctly in SM64 - // hack: when using z-depth, drop some LSBs so that the overworld map in Dragon Quest IV shows up correctly - const u32 newDepth = (gfx3d.renderState.wbuffer) ? u32floor(4096*w) : DS_DEPTH15TO24( u32floor(z*0x7FFF) ) & 0x00FFFFFC; + // + // When using z-depth, be sure to test against the following test cases: + // - The drawing of the overworld map in Dragon Quest IV + // - The drawing of all units on the map in Advance Wars: Days of Ruin + const u32 newDepth = (gfx3d.renderState.wbuffer) ? u32floor(4096*w) : (u32floor(z*0x7FFF) << 9); // run the depth test if (polyAttr.enableDepthEqualTest)