From 36819ae09f83a5a821e9f4331f803d9355345f75 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Mon, 17 May 2004 19:49:01 +0000 Subject: [PATCH] Handle XYZRHW vertex mode correctly in slow path. --- dlls/d3d8/drawprim.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dlls/d3d8/drawprim.c b/dlls/d3d8/drawprim.c index 0d73d292b33..b6198068375 100644 --- a/dlls/d3d8/drawprim.c +++ b/dlls/d3d8/drawprim.c @@ -1208,17 +1208,13 @@ void drawStridedSlow(LPDIRECT3DDEVICE8 iface, Direct3DVertexStridedData *sd, /* Position -------------------------------- */ if (sd->u.s.position.lpData != NULL) { - if (1.0f == rhw || rhw < 0.0001f) { + if (1.0f == rhw || ((rhw < 0.0001f) && (rhw > -0.0001f))) { VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f\n", x,y,z)); glVertex3f(x, y, z); } else { + GLfloat w = 1.0 / rhw; VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f / rhw=%f\n", x,y,z,rhw)); - /* Disable RHW mode as 'w' coord handling for rhw mode should - not impact screen position whereas in GL it does. This may - result in very slightly distored textures in rhw mode, but - a very minimal different. In slow mode a possible 'fix' is - glVertex4f(x*rhw,y*rhw,z*rhw,rhw) but not sure this is right */ - glVertex3f(x,y,z); + glVertex4f(x*w, y*w, z*w, w); } }