From 912c09b8ef1a96367eb2372599acb43d9ad7434b Mon Sep 17 00:00:00 2001 From: Jason Edmeades Date: Mon, 17 Nov 2003 20:04:44 +0000 Subject: [PATCH] Disable the use of the 'w' parm in rhw mode. --- dlls/d3d8/drawprim.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/d3d8/drawprim.c b/dlls/d3d8/drawprim.c index 86811321500..8195e246e75 100644 --- a/dlls/d3d8/drawprim.c +++ b/dlls/d3d8/drawprim.c @@ -660,7 +660,12 @@ void drawStridedFast(LPDIRECT3DDEVICE8 iface, Direct3DVertexStridedData *sd, sd->u.s.position.dwStride, sd->u.s.position.dwType + 1, sd->u.s.position.lpData)); - glVertexPointer(sd->u.s.position.dwType + 1, GL_FLOAT, + + /* 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 */ + glVertexPointer(3, GL_FLOAT, /* RHW: Was 'sd->u.s.position.dwType + 1' */ sd->u.s.position.dwStride, sd->u.s.position.lpData); checkGLcall("glVertexPointer(...)"); @@ -1196,7 +1201,12 @@ void drawStridedSlow(LPDIRECT3DDEVICE8 iface, Direct3DVertexStridedData *sd, glVertex3f(x, y, z); } else { VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f / rhw=%f\n", x,y,z,rhw)); - glVertex4f(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); } }