Workaround an ICE in some versions of gcc.

This commit is contained in:
Unknown W. Brackets committed 2013-08-24 11:33:49 -07:00
1 parent d7c58956d5
commit 55e02369a5
1 file changed
+2 -1
+2 -1
View File
@@ -726,7 +726,8 @@ void DrawTriangle(const VertexData& v0, const VertexData& v1, const VertexData&
// TODO: Fogging
// TODO: Is that the correct way to interpolate?
u16 z = (u16)(((float)v0.screenpos.z * w0 + (float)v1.screenpos.z * w1 + (float)v2.screenpos.z * w2) / (w0+w1+w2));
// With the (u32), this causes an ICE in some versions of gcc.
u16 z = (u16)(u32)(((float)v0.screenpos.z * w0 + (float)v1.screenpos.z * w1 + (float)v2.screenpos.z * w2) / (w0+w1+w2));
// Depth range test
if (!gstate.isModeThrough())