d3dx9: Implement adjacency in D3DXCreateSphere

Rico Schüller kgbricola at web.de
Sat Jun 22 04:24:23 CDT 2013


On 20.06.2013 21:25, Nozomi Kodama wrote:
> +    if (adjacency)
> +    {
> +        DWORD *buffer, size;
> +        ID3DXBuffer *temp;
> +
> +        size = 3 * sphere->lpVtbl->GetNumFaces(sphere) * sizeof(DWORD);
> +        hr = D3DXCreateBuffer(size, &temp);
> +        if (hr != D3D_OK)
> +            return hr;
> +
> +        buffer = (DWORD *)(ID3DXBuffer_GetBufferPointer(temp));
Are the outer parentheses needed? Is the cast needed?

> +        hr = sphere->lpVtbl->GenerateAdjacency(sphere, -0.000001f, buffer);
> +        if (hr != D3D_OK)
> +            return hr;
This may leak the temp ID3DXBuffer in the error case.

Cheers
Rico



More information about the wine-devel mailing list