This one fixes one small problem in patch 10. It is thus dependant on patch 10. Plus it 'fixes' (not sure though) the setting of the WORLD matrix in OpenGL's PROJECTION matrix (to not do any 'projection abuse'). It also corrects the conv_mat2 macro although it is never used anymore :-) With this, the DX6.1 version of the Boids demo somewhat runs (no texturing, no colors, just white, but it runs). Lionel Changelog: - fixed D3DFVF_VERTEX case - some other miscellaneous fixes -- Lionel Ulmer - http://www.bbrox.org/
--- ../wine_work_base/dlls/ddraw/d3dviewport.c Fri Nov 29 23:20:10 2002 +++ dlls/ddraw/d3dviewport.c Fri Nov 29 23:28:54 2002 @@ -141,7 +141,7 @@ memcpy(lpData, &(This->viewports.vp1), dwSize); if (TRACE_ON(ddraw)) { - TRACE(" returning D3DVIEWPORT :"); + TRACE(" returning D3DVIEWPORT :\n"); _dump_D3DVIEWPORT(lpData); } @@ -308,7 +308,7 @@ memcpy(lpData, &(This->viewports.vp2), dwSize); if (TRACE_ON(ddraw)) { - TRACE(" returning D3DVIEWPORT2 :"); + TRACE(" returning D3DVIEWPORT2 :\n"); _dump_D3DVIEWPORT2(lpData); } --- ../wine_work_base/dlls/ddraw/mesa_private.h Wed Nov 27 23:01:56 2002 +++ dlls/ddraw/mesa_private.h Fri Nov 29 23:50:46 2002 @@ -132,22 +132,22 @@ TRACE("%f %f %f %f\n", (mat)->_21, (mat)->_22, (mat)->_23, (mat)->_24); \ TRACE("%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \ TRACE("%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44); \ - (gl_mat)[ 0] = (mat)->_11; \ - (gl_mat)[ 1] = (mat)->_21; \ - (gl_mat)[ 2] = (mat)->_31; \ - (gl_mat)[ 3] = (mat)->_41; \ - (gl_mat)[ 4] = (mat)->_12; \ - (gl_mat)[ 5] = (mat)->_22; \ - (gl_mat)[ 6] = (mat)->_32; \ - (gl_mat)[ 7] = (mat)->_42; \ - (gl_mat)[ 8] = (mat)->_13; \ - (gl_mat)[ 9] = (mat)->_23; \ - (gl_mat)[10] = (mat)->_33; \ - (gl_mat)[11] = (mat)->_43; \ - (gl_mat)[12] = (mat)->_14; \ - (gl_mat)[13] = (mat)->_24; \ - (gl_mat)[14] = (mat)->_34; \ - (gl_mat)[15] = (mat)->_44; \ + (gl_mat)->_11 = (mat)->_11; \ + (gl_mat)->_12 = (mat)->_21; \ + (gl_mat)->_13 = (mat)->_31; \ + (gl_mat)->_14 = (mat)->_41; \ + (gl_mat)->_21 = (mat)->_12; \ + (gl_mat)->_22 = (mat)->_22; \ + (gl_mat)->_23 = (mat)->_32; \ + (gl_mat)->_24 = (mat)->_42; \ + (gl_mat)->_31 = (mat)->_13; \ + (gl_mat)->_32 = (mat)->_23; \ + (gl_mat)->_33 = (mat)->_33; \ + (gl_mat)->_34 = (mat)->_43; \ + (gl_mat)->_41 = (mat)->_14; \ + (gl_mat)->_42 = (mat)->_24; \ + (gl_mat)->_43 = (mat)->_34; \ + (gl_mat)->_44 = (mat)->_44; \ }; /* Matrix copy WITHOUT transposition */ --- ../wine_work_base/dlls/ddraw/d3ddevice/mesa.c Fri Nov 29 23:20:10 2002 +++ dlls/ddraw/d3ddevice/mesa.c Sat Nov 30 00:04:30 2002 @@ -579,23 +579,26 @@ switch (dtstTransformStateType) { case D3DTRANSFORMSTATE_WORLD: { + TRACE(" D3DTRANSFORMSTATE_WORLD :\n"); conv_mat(lpD3DMatrix, glThis->world_mat); glMatrixMode(GL_MODELVIEW); - glLoadMatrixf((float *) glThis->world_mat); + glLoadMatrixf((float *) glThis->view_mat); + glMultMatrixf((float *) glThis->world_mat); } break; case D3DTRANSFORMSTATE_VIEW: { + TRACE(" D3DTRANSFORMSTATE_VIEW :\n"); conv_mat(lpD3DMatrix, glThis->view_mat); - glMatrixMode(GL_PROJECTION); - glLoadMatrixf((float *) glThis->proj_mat); - glMultMatrixf((float *) glThis->view_mat); + glMatrixMode(GL_MODELVIEW); + glLoadMatrixf((float *) glThis->view_mat); + glMultMatrixf((float *) glThis->world_mat); } break; case D3DTRANSFORMSTATE_PROJECTION: { + TRACE(" D3DTRANSFORMSTATE_PROJECTION :\n"); conv_mat(lpD3DMatrix, glThis->proj_mat); glMatrixMode(GL_PROJECTION); glLoadMatrixf((float *) glThis->proj_mat); - glMultMatrixf((float *) glThis->view_mat); } break; default: @@ -656,13 +659,13 @@ if ((glThis->vertex_type == D3DVT_TLVERTEX) && (d3dvt != D3DVT_TLVERTEX)) { /* Need to put the correct transformation again if we go from Transformed / Lighted - vertices to non-transfromed ones. + vertices to non-transformed ones. */ glMatrixMode(GL_MODELVIEW); - glLoadMatrixf((float *) glThis->world_mat); + glLoadMatrixf((float *) glThis->view_mat); + glMultMatrixf((float *) glThis->world_mat); glMatrixMode(GL_PROJECTION); glLoadMatrixf((float *) glThis->proj_mat); - glMultMatrixf((float *) glThis->view_mat); } switch (d3dvt) { @@ -880,7 +883,6 @@ typedef struct { float x, y, z; float nx, ny, nz; - DWORD dwDiffuseRGBA; float tu1, tv1; } D3DFVF_VERTEX_1; @@ -905,23 +907,17 @@ D3DFVF_VERTEX_1 *vertices = (D3DFVF_VERTEX_1 *) lpvVertices; int index; + glEnable(GL_LIGHTING); + for (index = 0; index < dwIndexCount; index++) { int i = (dwIndices == NULL) ? index : dwIndices[index]; glNormal3f(vertices[i].nx, vertices[i].ny, vertices[i].nz); glTexCoord2f(vertices[i].tu1, vertices[i].tv1); - glColor4ub((vertices[i].dwDiffuseRGBA >> 24) & 0xFF, - (vertices[i].dwDiffuseRGBA >> 16) & 0xFF, - (vertices[i].dwDiffuseRGBA >> 8) & 0xFF, - (vertices[i].dwDiffuseRGBA >> 0) & 0xFF); glVertex3f(vertices[i].x, vertices[i].y, vertices[i].z); - TRACE(" %f %f %f / %f %f %f (%02lx %02lx %02lx %02lx) (%f %f)\n", + TRACE(" %f %f %f / %f %f %f (%f %f)\n", vertices[i].x, vertices[i].y, vertices[i].z, vertices[i].nx, vertices[i].ny, vertices[i].nz, - (vertices[i].dwDiffuseRGBA >> 24) & 0xFF, - (vertices[i].dwDiffuseRGBA >> 16) & 0xFF, - (vertices[i].dwDiffuseRGBA >> 8) & 0xFF, - (vertices[i].dwDiffuseRGBA >> 0) & 0xFF, vertices[i].tu1, vertices[i].tv1); } } @@ -1248,7 +1244,7 @@ /* Application wants to lock the back buffer */ glDrawBuffer(GL_BACK); } else { - WARN(" do not support 3D surface locking for this surface type - trying to use default buffer.\n"); + WARN(" do not support 3D surface unlocking for this surface type - trying to use default buffer.\n"); } if (This->surface_desc.u4.ddpfPixelFormat.u1.dwRGBBitCount == 16) {