Commit 5b68233d authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

- fixed the creation of back-buffers in DGA mode

- added a check on the validity of the Locking rectangle - fixed the enumeration for DX-6.0
parent 62c90d60
......@@ -205,7 +205,7 @@ HRESULT WINAPI DirectDrawEnumerateExA(
DPRINTF("\n");
}
if (dwFlags & DDENUM_NONDISPLAYDEVICES) {
if (dwFlags == DDENUM_NONDISPLAYDEVICES) {
/* For the moment, Wine does not support any 3D only accelerators */
return DD_OK;
}
......@@ -663,9 +663,17 @@ static HRESULT WINAPI IDirectDrawSurface4Impl_Lock(
/* If asked only for a part, change the surface pointer */
if (lprect) {
FIXME(" lprect: %dx%d-%dx%d\n",
TRACE(" lprect: %dx%d-%dx%d\n",
lprect->top,lprect->left,lprect->bottom,lprect->right
);
if ((lprect->top < 0) ||
(lprect->left < 0) ||
(lprect->bottom < 0) ||
(lprect->right < 0)) {
ERR(" Negative values in LPRECT !!!\n");
return DDERR_INVALIDPARAMS;
}
lpddsd->y.lpSurface = (LPVOID) ((char *) This->s.surface_desc.y.lpSurface +
(lprect->top*This->s.surface_desc.lPitch) +
(lprect->left*(This->s.surface_desc.ddpfPixelFormat.x.dwRGBBitCount / 8)));
......@@ -957,7 +965,7 @@ static HRESULT _Blt_ColorFill(LPBYTE buf, int width, int height, int bpp, LONG l
case 2: COLORFILL_ROW(WORD)
case 4: COLORFILL_ROW(DWORD)
default:
FIXME("Stretched blit not implemented for bpp %d!\n", bpp*8);
FIXME("Color fill not implemented for bpp %d!\n", bpp*8);
return DDERR_UNSUPPORTED;
}
......@@ -990,12 +998,12 @@ static HRESULT WINAPI IDirectDrawSurface4Impl_Blt(
IDirectDrawSurface4_Lock(iface,NULL,&ddesc,0,0);
if (TRACE_ON(ddraw)) {
if (rdst) TRACE(" destrect :%dx%d-%dx%d\n",rdst->left,rdst->top,rdst->right,rdst->bottom);
if (rsrc) TRACE(" srcrect :%dx%d-%dx%d\n",rsrc->left,rsrc->top,rsrc->right,rsrc->bottom);
if (rdst) TRACE("\tdestrect :%dx%d-%dx%d\n",rdst->left,rdst->top,rdst->right,rdst->bottom);
if (rsrc) TRACE("\tsrcrect :%dx%d-%dx%d\n",rsrc->left,rsrc->top,rsrc->right,rsrc->bottom);
TRACE("\tflags: ");
_dump_DDBLT(dwFlags);
if (dwFlags & DDBLT_DDFX) {
TRACE(" blitfx: \n");
TRACE("\tblitfx: ");
_dump_DDBLTFX(lpbltfx->dwDDFX);
}
}
......@@ -1121,8 +1129,7 @@ static HRESULT WINAPI IDirectDrawSurface4Impl_Blt(
type *s = (type *) sbuf, *d = (type *) dbuf; \
for (x = sx = 0; x < dstwidth; x++, sx += xinc) \
d[x] = s[sx >> 16]; \
break; \
}
break; }
switch(bpp) {
case 1: STRETCH_ROW(BYTE)
......@@ -1154,17 +1161,17 @@ static HRESULT WINAPI IDirectDrawSurface4Impl_Blt(
keyhigh = ddesc.ddckCKDestBlt.dwColorSpaceHighValue;
}
for (y = sy = 0; y < dstheight; y++, sy += yinc) {
sbuf = sbase + (sy >> 16) * sdesc.lPitch;
#define COPYROW_COLORKEY(type) { \
type *s = (type *) sbuf, *d = (type *) dbuf, tmp; \
for (x = sx = 0; x < dstwidth; x++, sx += xinc) { \
tmp = s[sx >> 16]; \
if (tmp < keylow || tmp > keyhigh) d[x] = tmp; \
} \
break; \
}
for (y = sy = 0; y < dstheight; y++, sy += yinc) {
sbuf = sbase + (sy >> 16) * sdesc.lPitch;
break; }
switch (bpp) {
case 1: COPYROW_COLORKEY(BYTE)
......@@ -1186,7 +1193,7 @@ static HRESULT WINAPI IDirectDrawSurface4Impl_Blt(
}
}
error:
error:
if (dwFlags && FIXME_ON(ddraw)) {
FIXME("\tUnsupported flags: ");
......@@ -2904,9 +2911,11 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface(
if (lpddsd->dwFlags & DDSD_BACKBUFFERCOUNT) {
IDirectDrawSurface4Impl* back;
int bbc;
for (bbc=lpddsd->dwBackBufferCount;bbc--;) {
int i;
for (i=lpddsd->dwBackBufferCount;i--;) {
back = (IDirectDrawSurface4Impl*)HeapAlloc(
GetProcessHeap(),
HEAP_ZERO_MEMORY,
......@@ -2918,7 +2927,7 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface(
for (i=0;i<32;i++)
if (!(This->e.dga.vpmask & (1<<i)))
break;
TRACE("using viewport %d for backbuffer\n",i);
TRACE("using viewport %d for backbuffer %d\n",i, bbc);
/* if i == 32 or maximum ... return error */
This->e.dga.vpmask|=(1<<i);
back->t.dga.fb_height = i*fbheight;
......
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