46 HDC surface_dc, screen_dc;
79 ERR(
"Failed to get surface DC, hr %#x.\n",
hr);
88 ERR(
"Failed to get screen DC.\n");
104 ERR(
"Failed to blit to/from screen.\n");
147 IDirectDrawSurface7_AddRef(iface);
149 TRACE(
"(%p) returning IDirectDrawSurface7 interface at %p\n",
This, *
obj);
155 IDirectDrawSurface4_AddRef(&
This->IDirectDrawSurface4_iface);
156 *
obj = &
This->IDirectDrawSurface4_iface;
157 TRACE(
"(%p) returning IDirectDrawSurface4 interface at %p\n",
This, *
obj);
163 IDirectDrawSurface3_AddRef(&
This->IDirectDrawSurface3_iface);
164 *
obj = &
This->IDirectDrawSurface3_iface;
165 TRACE(
"(%p) returning IDirectDrawSurface3 interface at %p\n",
This, *
obj);
171 IDirectDrawSurface2_AddRef(&
This->IDirectDrawSurface2_iface);
172 *
obj = &
This->IDirectDrawSurface2_iface;
173 TRACE(
"(%p) returning IDirectDrawSurface2 interface at %p\n",
This, *
obj);
180 IDirectDrawSurface_AddRef(&
This->IDirectDrawSurface_iface);
181 *
obj = &
This->IDirectDrawSurface_iface;
182 TRACE(
"(%p) returning IDirectDrawSurface interface at %p\n",
This, *
obj);
188 IDirectDrawGammaControl_AddRef(&
This->IDirectDrawGammaControl_iface);
189 *
obj = &
This->IDirectDrawGammaControl_iface;
190 TRACE(
"(%p) returning IDirectDrawGammaControl interface at %p\n",
This, *
obj);
196 WARN(
"Color control not implemented.\n");
201 if (
This->version != 7)
217 WARN(
"Failed to create device, hr %#x.\n",
hr);
224 *
obj = &
This->device1->IDirect3DDevice_iface;
231 *
obj = &
This->IDirect3DTexture2_iface;
238 *
obj = &
This->IDirect3DTexture_iface;
245 if (
This->version != 7)
346 TRACE(
"iface %p increasing refcount to %u.\n", iface, refcount);
361 TRACE(
"iface %p increasing refcount to %u.\n", iface, refcount);
376 TRACE(
"iface %p increasing refcount to %u.\n", iface, refcount);
391 TRACE(
"iface %p increasing refcount to %u.\n", iface, refcount);
406 TRACE(
"iface %p increasing refcount to %u.\n", iface, refcount);
421 TRACE(
"iface %p increasing refcount to %u.\n", iface, refcount);
435 TRACE(
"iface %p.\n", iface);
444 TRACE(
"iface %p.\n", iface);
459 WARN(
"Alpha palette set on non-texture surface, returning DDERR_INVALIDSURFACETYPE.\n");
472 prev->
flags &= ~DDPCAPS_PRIMARYSURFACE;
483 surface->
palette = palette_impl;
495 TRACE(
"surface %p.\n", surface);
517 IUnknown_Release(&surface->
device1->IUnknown_inner);
524 WARN(
"Destroying surface %p with refcounts 7: %u 4: %u 3: %u 2: %u 1: %u.\n",
539 if (
This->iface_count == 1 &&
This->attached_iface)
540 IUnknown_AddRef(
This->attached_iface);
553 if(!
This->is_complex_root)
555 WARN(
"(%p) Attempt to destroy a surface that is not a complex root\n",
This);
606 TRACE(
"iface %p decreasing refcount to %u.\n", iface, refcount);
621 TRACE(
"iface %p decreasing refcount to %u.\n", iface, refcount);
636 TRACE(
"iface %p decreasing refcount to %u.\n", iface, refcount);
651 TRACE(
"iface %p decreasing refcount to %u.\n", iface, refcount);
666 TRACE(
"iface %p decreasing refcount to %u.\n", iface, refcount);
681 TRACE(
"iface %p decreasing refcount to %u.\n", iface, refcount);
695 TRACE(
"iface %p.\n", iface);
704 TRACE(
"iface %p.\n", iface);
744 TRACE(
"iface %p, caps %p, attachment %p.\n", iface, Caps, Surface);
748 if(
This->version < 7)
765 surf =
This->complex_array[
i];
768 TRACE(
"Surface: (%p) caps: %#x, %#x, %#x, %#x.\n", surf,
783 TRACE(
"(%p): Returning surface %p\n",
This, surf);
797 TRACE(
"Surface: (%p) caps: %#x, %#x, %#x, %#x.\n", surf,
806 TRACE(
"(%p): Returning surface %p\n",
This, surf);
814 TRACE(
"(%p) Didn't find a valid surface\n",
This);
864 &caps2, &attachment7);
895 &caps2, &attachment7);
926 &caps2, &attachment7);
964 TRACE(
"surface %p, rect %s, surface_desc %p, surface_desc_size %u, flags %#x, h %p.\n",
981 if ((
rect->left < 0) || (
rect->top < 0)
985 WARN(
"Trying to lock an invalid rectangle, returning DDERR_INVALIDPARAMS\n");
1028 TRACE(
"locked surface returning description :\n");
1060 WARN(
"Invalid structure size %u.\n",
desc->dwSize);
1068 unsigned int surface_desc_size;
1070 TRACE(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
1083 unsigned int surface_desc_size;
1085 TRACE(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
1098 unsigned int surface_desc_size;
1102 TRACE(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
1120 unsigned int surface_desc_size;
1124 TRACE(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
1142 unsigned int surface_desc_size;
1146 TRACE(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
1192 TRACE(
"iface %p, rect %p.\n", iface, pRect);
1201 TRACE(
"iface %p, data %p.\n", iface,
data);
1211 TRACE(
"iface %p, data %p.\n", iface,
data);
1221 TRACE(
"iface %p, data %p.\n", iface,
data);
1252 WARN(
"Not in exclusive mode.\n");
1259 ERR(
"Invalid sub-resource index %u on surface %p.\n", dst_impl->
sub_resource_idx, dst_impl);
1270 WARN(
"Surface %p is not on the same flip chain as surface %p.\n",
src, iface);
1277 WARN(
"Surface %p is not on the same flip chain as surface %p.\n",
src, iface);
1292 ERR(
"Invalid sub-resource index %u on surface %p.\n", src_impl->
sub_resource_idx, src_impl);
1302 ERR(
"Can't find a flip target\n");
1324 ERR(
"Invalid sub-resource index %u on surface %p.\n", src_impl->
sub_resource_idx, src_impl);
1326 dst_impl = src_impl;
1413 DWORD wined3d_flags;
1418 dst_surface->
palette, fill_colour, &colour))
1429 dst_surface->
palette, fill_colour, &colour))
1437 wined3d_flags =
flags & ~DDBLT_ASYNC;
1455 RECT src_rect, dst_rect;
1456 float scale_x, scale_y;
1457 const RECT *clip_rect;
1458 UINT clip_list_size;
1467 dst_rect = *dst_rect_in;
1478 src_rect = *src_rect_in;
1503 if (
FAILED(
hr = IDirectDrawClipper_GetClipList(&dst_surface->
clipper->IDirectDrawClipper_iface,
1504 &dst_rect,
NULL, &clip_list_size)))
1506 WARN(
"Failed to get clip list size, hr %#x.\n",
hr);
1510 if (!(clip_list =
heap_alloc(clip_list_size)))
1512 WARN(
"Failed to allocate clip list.\n");
1516 if (
FAILED(
hr = IDirectDrawClipper_GetClipList(&dst_surface->
clipper->IDirectDrawClipper_iface,
1517 &dst_rect, clip_list, &clip_list_size)))
1519 WARN(
"Failed to get clip list, hr %#x.\n",
hr);
1527 RECT src_rect_clipped = src_rect;
1532 src_rect_clipped.
top += (
LONG)((clip_rect[
i].
top - dst_rect.
top) * scale_y);
1544 src_surface, &src_rect_clipped,
flags, fill_colour,
fx,
filter)))
1580 DWORD unsupported_flags;
1581 DWORD fill_colour = 0;
1585 TRACE(
"iface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p.\n",
1602 if (
flags & unsupported_flags)
1604 WARN(
"Ignoring unsupported flags %#x.\n",
flags & unsupported_flags);
1605 flags &= ~unsupported_flags;
1610 WARN(
"Invalid source color key parameters, returning DDERR_INVALIDPARAMS\n");
1616 WARN(
"Invalid destination color key parameters, returning DDERR_INVALIDPARAMS\n");
1622 FIXME(
"DDBLT_DDROPS not implemented.\n");
1624 FIXME(
" rop %#x, pattern %p.\n",
fx->dwDDROP,
fx->u5.lpDDSPattern);
1635 WARN(
"DDBLT_ROP used with DDBLT_COLORFILL or DDBLT_DEPTHFILL, returning DDERR_INVALIDPARAMS.\n");
1641 WARN(
"Depth or colorfill is not compatible with source surfaces, returning DDERR_INVALIDPARAMS\n");
1647 WARN(
"Depth or colorfill used with NULL fx, returning DDERR_INVALIDPARAMS.\n");
1652 flags &= ~DDBLT_DEPTHFILL;
1657 WARN(
"DDBLT_COLORFILL used on a depth buffer, returning DDERR_INVALIDPARAMS.\n");
1663 WARN(
"DDBLT_DEPTHFILL used on a color buffer, returning DDERR_INVALIDPARAMS.\n");
1673 WARN(
"DDBLT_ROP used with NULL fx, returning DDERR_INVALIDPARAMS.\n");
1677 if (src_impl && src_rect
1681 WARN(
"Invalid source rectangle.\n");
1685 flags &= ~DDBLT_ROP;
1710 WARN(
"Unsupported ROP %#x used, returning DDERR_NORASTEROPHW.\n",
fx->dwROP);
1717 WARN(
"No source surface.\n");
1723 WARN(
"DDBLT_KEYSRC blit without color key in surface, returning DDERR_INVALIDPARAMS\n");
1729 WARN(
"DDBLT_KEYDEST blit without color key in surface, returning DDERR_INVALIDPARAMS\n");
1736 wined3d_fx.
fx =
fx->dwDDFX;
1737 fill_colour =
fx->u5.dwFillColor;
1738 wined3d_fx.
dst_color_key.color_space_low_value =
fx->ddckDestColorkey.dwColorSpaceLowValue;
1739 wined3d_fx.
dst_color_key.color_space_high_value =
fx->ddckDestColorkey.dwColorSpaceHighValue;
1740 wined3d_fx.
src_color_key.color_space_low_value =
fx->ddckSrcColorkey.dwColorSpaceLowValue;
1741 wined3d_fx.
src_color_key.color_space_high_value =
fx->ddckSrcColorkey.dwColorSpaceHighValue;
1761 TRACE(
"iface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p.\n",
1774 TRACE(
"iface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p.\n",
1787 TRACE(
"iface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p.\n",
1800 TRACE(
"iface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p.\n",
1853 TRACE(
"surface %p, attachment %p.\n",
This, Surf);
1866 WARN(
"Surface %p is already attached somewhere. next_attached %p, first_attached %p.\n",
1876 This->next_attached = Surf;
1879 if (
This->ddraw->d3ddevice)
1899 WARN(
"Application tries to attach a non Z buffer surface. caps %08x\n",
1934 WARN(
"Surface sizes do not match.\n");
1941 WARN(
"Invalid attachment combination.\n");
2027 TRACE(
"surface %p, attachment %p, detach_iface %p.\n", surface,
attachment, detach_iface);
2036 if (
attachment->attached_iface != detach_iface)
2038 WARN(
"attachment->attach_iface %p != detach_iface %p.\n",
attachment->attached_iface, detach_iface);
2046 attachment->surface_desc.ddsCaps.dwCaps2 &= ~DDSCAPS2_MIPMAPSUBLEVEL;
2080 IUnknown_Release(detach_iface);
2213 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2236 else if (surface->
ddraw->primary)
2264 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2273 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2282 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2291 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2313 TRACE(
"iface %p, dc %p.\n", iface,
hdc);
2338 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2347 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2356 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2365 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2387 TRACE(
"iface %p, caps %p.\n", iface, Caps);
2401 TRACE(
"iface %p, caps %p.\n", iface, caps);
2412 TRACE(
"iface %p, caps %p.\n", iface, caps);
2427 TRACE(
"iface %p, caps %p.\n", iface, caps);
2442 TRACE(
"iface %p, caps %p.\n", iface, caps);
2465 WARN(
"Called on non-managed texture returning DDERR_INVALIDPARAMS.\n");
2491 WARN(
"Called on offscreenplain surface, returning DDERR_INVALIDOBJECT.\n");
2496 WARN(
"Called on non-managed texture or non-root surface, returning DDERR_INVALIDPARAMS.\n");
2532 TRACE(
"iface %p, tag %s, data %p, data_size %u, flags %#x.\n",
2537 WARN(
"data is NULL, returning DDERR_INVALIDPARAMS.\n");
2552 TRACE(
"iface %p, tag %s, data %p, data_size %u, flags %#x.\n",
2579 TRACE(
"iface %p, tag %s, data %p, data_size %p.\n",
2594 if (*size < stored_data->
size)
2619 TRACE(
"iface %p, tag %s, data %p, data_size %p.\n",
2681 TRACE(
"iface %p, flags %#x.\n", iface,
Flags);
2691 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
2700 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
2709 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
2728 TRACE(
"iface %p, flags %#x.\n", iface,
Flags);
2737 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
2746 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
2755 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
2784 TRACE(
"iface %p, batch %p, count %u, flags %#x.\n", iface, batch,
count,
flags);
2793 TRACE(
"iface %p, batch %p, count %u, flags %#x.\n", iface, batch,
count,
flags);
2802 TRACE(
"iface %p, batch %p, count %u, flags %#x.\n", iface, batch,
count,
flags);
2811 TRACE(
"iface %p, batch %p, count %u, flags %#x.\n", iface, batch,
count,
flags);
2839 TRACE(
"iface %p, context %p, callback %p.\n", iface,
context,
cb);
2873 TRACE(
" end of enumeration.\n");
3069 TRACE(
"iface %p, flags %#x.\n", iface,
Flags);
3086 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3095 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3104 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3113 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3136 TRACE(
"iface %p, flags %#x, color_key %p.\n", iface,
Flags, CKey);
3151 *CKey =
This->surface_desc.ddckCKDestBlt;
3160 *CKey =
This->surface_desc.u3.ddckCKDestOverlay;
3169 *CKey =
This->surface_desc.ddckCKSrcBlt;
3178 *CKey =
This->surface_desc.ddckCKSrcOverlay;
3238 TRACE(
"iface %p, flags %#x.\n", iface,
Flags);
3257 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3266 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3275 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3284 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3306 TRACE(
"iface %p, x %p, y %p.\n", iface,
x,
y);
3320 TRACE(
"iface %p, x %p, y %p.\n", iface,
x,
y);
3329 TRACE(
"iface %p, x %p, y %p.\n", iface,
x,
y);
3338 TRACE(
"iface %p, x %p, y %p.\n", iface,
x,
y);
3347 TRACE(
"iface %p, x %p, y %p.\n", iface,
x,
y);
3437 TRACE(
"iface %p, surface_desc %p.\n", iface, DDSD);
3444 WARN(
"Incorrect struct size %d, returning DDERR_INVALIDPARAMS\n",DDSD->
dwSize);
3450 TRACE(
"Returning surface desc:\n");
3461 TRACE(
"iface %p, surface_desc %p.\n", iface, DDSD);
3482 TRACE(
"Returning surface desc:\n");
3497 TRACE(
"iface %p, surface_desc %p.\n", iface, DDSD);
3506 TRACE(
"iface %p, surface_desc %p.\n", iface, DDSD);
3595 IDirect3DDevice *
device, IDirectDrawSurface *surface)
3597 TRACE(
"iface %p, device %p, surface %p.\n", iface,
device, surface);
3616 TRACE(
"iface %p.\n", iface);
3628 TRACE(
"iface %p.\n", iface);
3637 TRACE(
"iface %p.\n", iface);
3646 TRACE(
"iface %p.\n", iface);
3655 TRACE(
"iface %p.\n", iface);
3674 TRACE(
"iface %p.\n", iface);
3685 WARN(
"Failed to get display mode, hr %#x.\n",
hr);
3691 WARN(
"Failed to get resource desc, hr %#x.\n",
hr);
3697 WARN(
"Display mode dimensions %ux%u don't match surface dimensions %ux%u.\n",
3704 WARN(
"Display mode format %#x doesn't match surface format %#x.\n",
3720 TRACE(
"iface %p.\n", iface);
3729 TRACE(
"iface %p.\n", iface);
3738 TRACE(
"iface %p.\n", iface);
3747 TRACE(
"iface %p.\n", iface);
3769 TRACE(
"iface %p, x %d, y %d.\n", iface,
x,
y);
3783 TRACE(
"iface %p, x %d, y %d.\n", iface,
x,
y);
3792 TRACE(
"iface %p, x %d, y %d.\n", iface,
x,
y);
3801 TRACE(
"iface %p, x %d, y %d.\n", iface,
x,
y);
3810 TRACE(
"iface %p, x %d, y %d.\n", iface,
x,
y);
3836 unsigned int dst_sub_resource_idx = 0;
3839 TRACE(
"iface %p, src_rect %s, dst_surface %p, dst_rect %s, flags %#x, fx %p.\n",
3843 FIXME(
"Ignoring fx %p.\n",
fx);
3852 src_rect, dst_wined3d_texture, dst_sub_resource_idx, dst_rect,
flags);
3871 TRACE(
"iface %p, src_rect %s, dst_surface %p, dst_rect %s, flags %#x, fx %p.\n",
3884 TRACE(
"iface %p, src_rect %s, dst_surface %p, dst_rect %s, flags %#x, fx %p.\n",
3897 TRACE(
"iface %p, src_rect %s, dst_surface %p, dst_rect %s, flags %#x, fx %p.\n",
3910 TRACE(
"iface %p, src_rect %s, dst_surface %p, dst_rect %s, flags %#x, fx %p.\n",
3930 TRACE(
"iface %p, flags %#x.\n", iface,
Flags);
3939 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3948 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3957 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3966 TRACE(
"iface %p, flags %#x.\n", iface,
flags);