[PATCH] d3dx9_36: Beginning of constants parsing + tests (based on work from Luis Busquets) (try 3) (resend)

Alexandre Julliard julliard at winehq.org
Fri Apr 9 04:33:52 CDT 2010


Christian Costa <titan.costa at wanadoo.fr> writes:

> @@ -650,6 +650,29 @@ HRESULT WINAPI D3DXCompileShader(LPCSTR pSrcData,
>      return D3DERR_INVALIDCALL;
>  }
>  
> +typedef struct ctab_constant ctab_constant;
> +
> +struct ctab_constant {
> +    D3DXCONSTANT_DESC desc;
> +    ctab_constant* members;
> +};
> +
> +inline ctab_constant* get_constant(D3DXHANDLE ptr)
> +{
> +    if (!ptr) return NULL;
> +    return (ctab_constant*)~((UINT_PTR)ptr);
> +}
> +
> +inline D3DXHANDLE get_handle(ctab_constant* ptr)
> +{
> +    return (D3DXHANDLE)~((UINT_PTR)ptr);
> +}
> +
> +inline BOOL isstring(D3DXHANDLE ptr)
> +{
> +    return !(((UINT_PTR)ptr) & (1 << (sizeof(UINT_PTR)*8-1)));
> +}

This is broken, you can't make assumptions about the high bit of pointer
values. The handle management needs more thought.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list