From da0b4dc74ea5879a7c83f3a28f0f8953d619e396 Mon Sep 17 00:00:00 2001 From: Lionel Ulmer Date: Sat, 30 Nov 2002 01:49:08 +0000 Subject: [PATCH] - fix caps filling to be more in line with what we support - optimize a little bit the DrawPrimitive function --- dlls/ddraw/d3ddevice/mesa.c | 38 +++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/dlls/ddraw/d3ddevice/mesa.c b/dlls/ddraw/d3ddevice/mesa.c index c8fb8fd87a5..f559039c187 100644 --- a/dlls/ddraw/d3ddevice/mesa.c +++ b/dlls/ddraw/d3ddevice/mesa.c @@ -192,9 +192,22 @@ static void fill_opengl_caps(D3DDEVICEDESC *d1) d1->dwMinStippleHeight = 1; d1->dwMaxStippleWidth = 32; d1->dwMaxStippleHeight = 32; + d1->dwMaxTextureRepeat = 16; + d1->dwMaxTextureAspectRatio = 1024; + d1->dwMaxAnisotropy = 0; + d1->dvGuardBandLeft = 0.0; + d1->dvGuardBandRight = 0.0; + d1->dvGuardBandTop = 0.0; + d1->dvGuardBandBottom = 0.0; + d1->dvExtentsAdjust = 0.0; + d1->dwStencilCaps = 0; /* TODO add proper caps according to what OpenGL can do */ + d1->dwFVFCaps = D3DFVFCAPS_DONOTSTRIPELEMENTS | 1; + d1->dwTextureOpCaps = 0; /* TODO add proper caps according to OpenGL multi-texture stuff */ + d1->wMaxTextureBlendStages = 1; /* TODO add proper caps according to OpenGL multi-texture stuff */ + d1->wMaxSimultaneousTextures = 1; /* TODO add proper caps according to OpenGL multi-texture stuff */ } -#if 0 /* TODO : fix this... */ +#if 0 /* TODO : fix this and add multitexturing and other needed stuff */ static void fill_device_capabilities(IDirectDrawImpl* ddraw) { x11_dd_private *private = (x11_dd_private *) ddraw->d->private; @@ -601,8 +614,11 @@ inline static void draw_primitive(IDirect3DDeviceGLImpl *glThis, DWORD maxvert, /* Puts GL in the correct lighting mode */ if (glThis->vertex_type != d3dvt) { - if (glThis->vertex_type == D3DVT_TLVERTEX) { - /* Need to put the correct transformation again */ + 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. + */ glMatrixMode(GL_MODELVIEW); glLoadMatrixf((float *) glThis->world_mat); glMatrixMode(GL_PROJECTION); @@ -625,14 +641,16 @@ inline static void draw_primitive(IDirect3DDeviceGLImpl *glThis, DWORD maxvert, GLdouble height, width, minZ, maxZ; TRACE("Transformed - Lighted Vertex\n"); - /* First, disable lighting */ - glDisable(GL_LIGHTING); + if (glThis->vertex_type != D3DVT_TLVERTEX) { + /* First, disable lighting */ + glDisable(GL_LIGHTING); - /* Then do not put any transformation matrixes */ - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); + /* Then do not put any transformation matrixes */ + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + } if (glThis->parent.current_viewport == NULL) { ERR("No current viewport !\n");