On Wed, Mar 11, 2009 at 5:18 AM, Henri Verbeet <hverbeet(a)codeweavers.com> wrote:
> @@ -4051,10 +4097,11 @@ static void WINE_GLAPI diffuse_d3dcolor(const void *data)
> static void WINE_GLAPI specular_d3dcolor(const void *data)
> {
> DWORD specularColor = *((const DWORD *)data);
> + GLbyte d[] = {D3DCOLOR_B_R(specularColor),
> + D3DCOLOR_B_G(specularColor),
> + D3DCOLOR_B_B(specularColor)};
>
> - GL_EXTCALL(glSecondaryColor3ubEXT)(D3DCOLOR_B_R(specularColor),
> - D3DCOLOR_B_G(specularColor),
> - D3DCOLOR_B_B(specularColor));
> + specular_func_3ubv(d);
> }
>
> static void WINE_GLAPI warn_no_specular_func(const void *data)
> @@ -4110,6 +4157,7 @@ static void fillGLAttribFuncs(const WineD3D_GL_Info *gl_info)
> }
> specular_funcs[WINED3DDECLTYPE_FLOAT4] = invalid_func;
> if(GL_SUPPORT(EXT_SECONDARY_COLOR)) {
> + specular_func_3ubv = (glAttribFunc)GL_EXTCALL(glSecondaryColor3ubvEXT);
> specular_funcs[WINED3DDECLTYPE_D3DCOLOR] = specular_d3dcolor;
> } else {
> specular_funcs[WINED3DDECLTYPE_D3DCOLOR] = warn_no_specular_func;
This looks like an unrelated change.
> @@ -4182,7 +4231,7 @@ BOOL InitAdapters(void) {
> /* No need to hold any lock. The calling library makes sure only one thread calls
> * wined3d simultaneously
> */
> - if(numAdapters > 0) return Adapters[0].opengl;
> + if (This->adapter_count) return This->adapters[0].opengl;
>
> TRACE("Initializing adapters\n");
Is this check still necessary? InitAdapters should only be called
once per IWineD3DImpl object.
- Allan