Commit a300efc8 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Return failure from DescribePixelFormat() for invalid pixel format.

Also use the proper function for checking the format and looking up the internal format description.
parent d33a4da5
......@@ -3307,16 +3307,16 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share)
*/
int macdrv_wglDescribePixelFormat(HDC hdc, int fmt, UINT size, PIXELFORMATDESCRIPTOR *descr)
{
int ret = nb_displayable_formats;
const pixel_format *pf;
const struct color_mode *mode;
TRACE("hdc %p fmt %d size %u descr %p\n", hdc, fmt, size, descr);
if (fmt <= 0 || fmt > ret || !descr) return ret;
if (!descr) return nb_displayable_formats;
if (size < sizeof(*descr)) return 0;
pf = &pixel_formats[fmt - 1];
if (!(pf = get_pixel_format(fmt, FALSE)))
return 0;
memset(descr, 0, sizeof(*descr));
descr->nSize = sizeof(*descr);
......@@ -3363,7 +3363,7 @@ int macdrv_wglDescribePixelFormat(HDC hdc, int fmt, UINT size, PIXELFORMATDESCRI
descr->cStencilBits = pf->stencil_bits;
descr->cAuxBuffers = pf->aux_buffers;
descr->iLayerType = PFD_MAIN_PLANE;
return ret;
return nb_displayable_formats;
}
/***********************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment