47 HDC surface_dc, screen_dc;
90 ERR(
"Failed to get surface DC, hr %#x.\n",
hr);
99 ERR(
"Failed to get screen DC.\n");
115 ERR(
"Failed to blit to/from screen.\n");
158 IDirectDrawSurface7_AddRef(iface);
160 TRACE(
"(%p) returning IDirectDrawSurface7 interface at %p\n",
This, *
obj);
166 IDirectDrawSurface4_AddRef(&
This->IDirectDrawSurface4_iface);
167 *
obj = &
This->IDirectDrawSurface4_iface;
168 TRACE(
"(%p) returning IDirectDrawSurface4 interface at %p\n",
This, *
obj);
174 IDirectDrawSurface3_AddRef(&
This->IDirectDrawSurface3_iface);
175 *
obj = &
This->IDirectDrawSurface3_iface;
176 TRACE(
"(%p) returning IDirectDrawSurface3 interface at %p\n",
This, *
obj);
182 IDirectDrawSurface2_AddRef(&
This->IDirectDrawSurface2_iface);
183 *
obj = &
This->IDirectDrawSurface2_iface;
184 TRACE(
"(%p) returning IDirectDrawSurface2 interface at %p\n",
This, *
obj);
191 IDirectDrawSurface_AddRef(&
This->IDirectDrawSurface_iface);
192 *
obj = &
This->IDirectDrawSurface_iface;
193 TRACE(
"(%p) returning IDirectDrawSurface interface at %p\n",
This, *
obj);
199 IDirectDrawGammaControl_AddRef(&
This->IDirectDrawGammaControl_iface);
200 *
obj = &
This->IDirectDrawGammaControl_iface;
201 TRACE(
"(%p) returning IDirectDrawGammaControl interface at %p\n",
This, *
obj);
207 WARN(
"Color control not implemented.\n");
212 if (
This->version != 7)
228 WARN(
"Failed to create device, hr %#x.\n",
hr);
235 *
obj = &
This->device1->IDirect3DDevice_iface;
242 *
obj = &
This->IDirect3DTexture2_iface;
249 *
obj = &
This->IDirect3DTexture_iface;
256 if (
This->version != 7)
357 TRACE(
"iface %p increasing refcount to %u.\n", iface, refcount);
372 TRACE(
"iface %p increasing refcount to %u.\n", iface, refcount);
387 TRACE(
"iface %p increasing refcount to %u.\n", iface, refcount);
402 TRACE(
"iface %p increasing refcount to %u.\n", iface, refcount);
417 TRACE(
"iface %p increasing refcount to %u.\n", iface, refcount);
432 TRACE(
"iface %p increasing refcount to %u.\n", iface, refcount);
446 TRACE(
"iface %p.\n", iface);
455 TRACE(
"iface %p.\n", iface);
470 WARN(
"Alpha palette set on non-texture surface, returning DDERR_INVALIDSURFACETYPE.\n");
483 prev->
flags &= ~DDPCAPS_PRIMARYSURFACE;
494 surface->
palette = palette_impl;
506 TRACE(
"surface %p.\n", surface);
528 IUnknown_Release(&surface->
device1->IUnknown_inner);
535 WARN(
"Destroying surface %p with refcounts 7: %u 4: %u 3: %u 2: %u 1: %u.\n",
550 if (
This->iface_count == 1 &&
This->attached_iface)
551 IUnknown_AddRef(
This->attached_iface);
564 if(!
This->is_complex_root)
566 WARN(
"(%p) Attempt to destroy a surface that is not a complex root\n",
This);
617 TRACE(
"iface %p decreasing refcount to %u.\n", iface, refcount);
632 TRACE(
"iface %p decreasing refcount to %u.\n", iface, refcount);
647 TRACE(
"iface %p decreasing refcount to %u.\n", iface, refcount);
662 TRACE(
"iface %p decreasing refcount to %u.\n", iface, refcount);
677 TRACE(
"iface %p decreasing refcount to %u.\n", iface, refcount);
692 TRACE(
"iface %p decreasing refcount to %u.\n", iface, refcount);
706 TRACE(
"iface %p.\n", iface);
715 TRACE(
"iface %p.\n", iface);
755 TRACE(
"iface %p, caps %p, attachment %p.\n", iface, Caps, Surface);
759 if(
This->version < 7)
776 surf =
This->complex_array[
i];
779 TRACE(
"Surface: (%p) caps: %#x, %#x, %#x, %#x.\n", surf,
794 TRACE(
"(%p): Returning surface %p\n",
This, surf);
808 TRACE(
"Surface: (%p) caps: %#x, %#x, %#x, %#x.\n", surf,
817 TRACE(
"(%p): Returning surface %p\n",
This, surf);
825 TRACE(
"(%p) Didn't find a valid surface\n",
This);
875 &caps2, &attachment7);
906 &caps2, &attachment7);
937 &caps2, &attachment7);
975 TRACE(
"surface %p, rect %s, surface_desc %p, surface_desc_size %u, flags %#x, h %p.\n",
992 if ((
rect->left < 0) || (
rect->top < 0)
996 WARN(
"Trying to lock an invalid rectangle, returning DDERR_INVALIDPARAMS\n");
1039 TRACE(
"locked surface returning description :\n");
1071 WARN(
"Invalid structure size %u.\n",
desc->dwSize);
1079 unsigned int surface_desc_size;
1081 TRACE(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
1094 unsigned int surface_desc_size;
1096 TRACE(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
1109 unsigned int surface_desc_size;
1113 TRACE(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
1131 unsigned int surface_desc_size;
1135 TRACE(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
1153 unsigned int surface_desc_size;
1157 TRACE(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
1203 TRACE(
"iface %p, rect %p.\n", iface, pRect);
1212 TRACE(
"iface %p, data %p.\n", iface,
data);
1222 TRACE(
"iface %p, data %p.\n", iface,
data);
1232 TRACE(
"iface %p, data %p.\n", iface,
data);
1281 WARN(
"Not in exclusive mode.\n");
1288 ERR(
"Invalid sub-resource index %u on surface %p.\n", dst_impl->
sub_resource_idx, dst_impl);
1299 WARN(
"Surface %p is not on the same flip chain as surface %p.\n",
src, iface);
1306 WARN(
"Surface %p is not on the same flip chain as surface %p.\n",
src, iface);
1321 ERR(
"Invalid sub-resource index %u on surface %p.\n", src_impl->
sub_resource_idx, src_impl);
1331 ERR(
"Can't find a flip target\n");
1353 ERR(
"Invalid sub-resource index %u on surface %p.\n", src_impl->
sub_resource_idx, src_impl);
1355 dst_impl = src_impl;
1442 DWORD wined3d_flags;
1447 dst_surface->
palette, fill_colour, &colour))
1458 dst_surface->
palette, fill_colour, &colour))
1466 wined3d_flags =
flags & ~DDBLT_ASYNC;
1484 RECT src_rect, dst_rect;
1485 float scale_x, scale_y;
1486 const RECT *clip_rect;
1487 UINT clip_list_size;
1496 dst_rect = *dst_rect_in;
1507 src_rect = *src_rect_in;
1532 if (
FAILED(
hr = IDirectDrawClipper_GetClipList(&dst_surface->
clipper->IDirectDrawClipper_iface,
1533 &dst_rect,
NULL, &clip_list_size)))
1535 WARN(
"Failed to get clip list size, hr %#x.\n",
hr);
1539 if (!(clip_list =
heap_alloc(clip_list_size)))
1541 WARN(
"Failed to allocate clip list.\n");
1545 if (
FAILED(
hr = IDirectDrawClipper_GetClipList(&dst_surface->
clipper->IDirectDrawClipper_iface,
1546 &dst_rect, clip_list, &clip_list_size)))
1548 WARN(
"Failed to get clip list, hr %#x.\n",
hr);
1556 RECT src_rect_clipped = src_rect;
1561 src_rect_clipped.
top += (
LONG)((clip_rect[
i].
top - dst_rect.
top) * scale_y);
1573 src_surface, &src_rect_clipped,
flags, fill_colour,
fx,
filter)))
1609 DWORD unsupported_flags;
1610 DWORD fill_colour = 0;
1614 TRACE(
"iface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p.\n",
1631 if (
flags & unsupported_flags)
1633 WARN(
"Ignoring unsupported flags %#x.\n",
flags & unsupported_flags);
1634 flags &= ~unsupported_flags;
1639 WARN(
"Invalid source color key parameters, returning DDERR_INVALIDPARAMS\n");
1645 WARN(
"Invalid destination color key parameters, returning DDERR_INVALIDPARAMS\n");
1651 FIXME(
"DDBLT_DDROPS not implemented.\n");
1653 FIXME(
" rop %#x, pattern %p.\n",
fx->dwDDROP,
fx->u5.lpDDSPattern);
1664 WARN(
"DDBLT_ROP used with DDBLT_COLORFILL or DDBLT_DEPTHFILL, returning DDERR_INVALIDPARAMS.\n");
1670 WARN(
"Depth or colorfill is not compatible with source surfaces, returning DDERR_INVALIDPARAMS\n");
1676 WARN(
"Depth or colorfill used with NULL fx, returning DDERR_INVALIDPARAMS.\n");
1681 flags &= ~DDBLT_DEPTHFILL;
1686 WARN(
"DDBLT_COLORFILL used on a depth buffer, returning DDERR_INVALIDPARAMS.\n");
1692 WARN(
"DDBLT_DEPTHFILL used on a color buffer, returning DDERR_INVALIDPARAMS.\n");
1702 WARN(
"DDBLT_ROP used with NULL fx, returning DDERR_INVALIDPARAMS.\n");
1706 if (src_impl && src_rect
1710 WARN(
"Invalid source rectangle.\n");
1714 flags &= ~DDBLT_ROP;
1739 WARN(
"Unsupported ROP %#x used, returning DDERR_NORASTEROPHW.\n",
fx->dwROP);
1746 WARN(
"No source surface.\n");
1752 WARN(
"DDBLT_KEYSRC blit without color key in surface, returning DDERR_INVALIDPARAMS\n");
1758 WARN(
"DDBLT_KEYDEST blit without color key in surface, returning DDERR_INVALIDPARAMS\n");
1765 wined3d_fx.
fx =
fx->dwDDFX;
1766 fill_colour =
fx->u5.dwFillColor;
1767 wined3d_fx.
dst_color_key.color_space_low_value =
fx->ddckDestColorkey.dwColorSpaceLowValue;
1768 wined3d_fx.
dst_color_key.color_space_high_value =
fx->ddckDestColorkey.dwColorSpaceHighValue;
1769 wined3d_fx.
src_color_key.color_space_low_value =
fx->ddckSrcColorkey.dwColorSpaceLowValue;
1770 wined3d_fx.
src_color_key.color_space_high_value =
fx->ddckSrcColorkey.dwColorSpaceHighValue;
1790 TRACE(
"iface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p.\n",
1803 TRACE(
"iface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p.\n",
1816 TRACE(
"iface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p.\n",
1829 TRACE(
"iface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p.\n",
1882 TRACE(
"surface %p, attachment %p.\n",
This, Surf);
1895 WARN(
"Surface %p is already attached somewhere. next_attached %p, first_attached %p.\n",
1905 This->next_attached = Surf;
1908 if (
This->ddraw->d3ddevice)
1928 WARN(
"Application tries to attach a non Z buffer surface. caps %08x\n",
1963 WARN(
"Surface sizes do not match.\n");
1970 WARN(
"Invalid attachment combination.\n");
2056 TRACE(
"surface %p, attachment %p, detach_iface %p.\n", surface,
attachment, detach_iface);
2065 if (
attachment->attached_iface != detach_iface)
2067 WARN(
"attachment->attach_iface %p != detach_iface %p.\n",
attachment->attached_iface, detach_iface);
2075 attachment->surface_desc.ddsCaps.dwCaps2 &= ~DDSCAPS2_MIPMAPSUBLEVEL;
2109 IUnknown_Release(detach_iface);
2242 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2265 else if (surface->
ddraw->primary)
2293 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2302 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2311 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2320 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2342 TRACE(
"iface %p, dc %p.\n", iface,
hdc);
2367 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2376 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2385 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2394 TRACE(
"iface %p, dc %p.\n", iface,
dc);
2416 TRACE(
"iface %p, caps %p.\n", iface, Caps);
2430 TRACE(
"iface %p, caps %p.\n", iface, caps);
2441 TRACE(
"iface %p, caps %p.\n", iface, caps);
2456 TRACE(
"iface %p, caps %p.\n", iface, caps);
2471 TRACE(
"iface %p, caps %p.\n", iface, caps);
2494 WARN(
"Called on non-managed texture returning DDERR_INVALIDPARAMS.\n");
2520 WARN(
"Called on offscreenplain surface, returning DDERR_INVALIDOBJECT.\n");
2525 WARN(
"Called on non-managed texture or non-root surface, returning DDERR_INVALIDPARAMS.\n");
2561 TRACE(
"iface %p, tag %s, data %p, data_size %u, flags %#x.\n",
2566 WARN(
"data is NULL, returning DDERR_INVALIDPARAMS.\n");
2581 TRACE(
"iface %p, tag %s, data %p, data_size %u, flags %#x.\n",
2608 TRACE(
"iface %p, tag %s, data %p, data_size %p.\n",
2623 if (*size < stored_data->
size)
2648 TRACE(
"iface %p, tag %s, data %p, data_size %p.\n",
2710 TRACE(
"iface %p, flags %#x.\n", iface,
Flags);
2720 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
2729 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
2738 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
2757 TRACE(
"iface %p, flags %#x.\n", iface,
Flags);
2766 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
2775 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
2784 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
2813 TRACE(
"iface %p, batch %p, count %u, flags %#x.\n", iface, batch,
count,
flags);
2822 TRACE(
"iface %p, batch %p, count %u, flags %#x.\n", iface, batch,
count,
flags);
2831 TRACE(
"iface %p, batch %p, count %u, flags %#x.\n", iface, batch,
count,
flags);
2840 TRACE(
"iface %p, batch %p, count %u, flags %#x.\n", iface, batch,
count,
flags);
2868 TRACE(
"iface %p, context %p, callback %p.\n", iface,
context,
cb);
2902 TRACE(
" end of enumeration.\n");
3098 TRACE(
"iface %p, flags %#x.\n", iface,
Flags);
3115 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3124 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3133 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3142 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3165 TRACE(
"iface %p, flags %#x, color_key %p.\n", iface,
Flags, CKey);
3180 *CKey =
This->surface_desc.ddckCKDestBlt;
3189 *CKey =
This->surface_desc.u3.ddckCKDestOverlay;
3198 *CKey =
This->surface_desc.ddckCKSrcBlt;
3207 *CKey =
This->surface_desc.ddckCKSrcOverlay;
3267 TRACE(
"iface %p, flags %#x.\n", iface,
Flags);
3286 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3295 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3304 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3313 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3335 TRACE(
"iface %p, x %p, y %p.\n", iface,
x,
y);
3349 TRACE(
"iface %p, x %p, y %p.\n", iface,
x,
y);
3358 TRACE(
"iface %p, x %p, y %p.\n", iface,
x,
y);
3367 TRACE(
"iface %p, x %p, y %p.\n", iface,
x,
y);
3376 TRACE(
"iface %p, x %p, y %p.\n", iface,
x,
y);
3466 TRACE(
"iface %p, surface_desc %p.\n", iface, DDSD);
3473 WARN(
"Incorrect struct size %d, returning DDERR_INVALIDPARAMS\n",DDSD->
dwSize);
3479 TRACE(
"Returning surface desc:\n");
3490 TRACE(
"iface %p, surface_desc %p.\n", iface, DDSD);
3511 TRACE(
"Returning surface desc:\n");
3526 TRACE(
"iface %p, surface_desc %p.\n", iface, DDSD);
3535 TRACE(
"iface %p, surface_desc %p.\n", iface, DDSD);
3624 IDirect3DDevice *
device, IDirectDrawSurface *surface)
3626 TRACE(
"iface %p, device %p, surface %p.\n", iface,
device, surface);
3645 TRACE(
"iface %p.\n", iface);
3657 TRACE(
"iface %p.\n", iface);
3666 TRACE(
"iface %p.\n", iface);
3675 TRACE(
"iface %p.\n", iface);
3684 TRACE(
"iface %p.\n", iface);
3703 TRACE(
"iface %p.\n", iface);
3714 WARN(
"Failed to get display mode, hr %#x.\n",
hr);
3720 WARN(
"Failed to get resource desc, hr %#x.\n",
hr);
3726 WARN(
"Display mode dimensions %ux%u don't match surface dimensions %ux%u.\n",
3733 WARN(
"Display mode format %#x doesn't match surface format %#x.\n",
3749 TRACE(
"iface %p.\n", iface);
3758 TRACE(
"iface %p.\n", iface);
3767 TRACE(
"iface %p.\n", iface);
3776 TRACE(
"iface %p.\n", iface);
3798 TRACE(
"iface %p, x %d, y %d.\n", iface,
x,
y);
3812 TRACE(
"iface %p, x %d, y %d.\n", iface,
x,
y);
3821 TRACE(
"iface %p, x %d, y %d.\n", iface,
x,
y);
3830 TRACE(
"iface %p, x %d, y %d.\n", iface,
x,
y);
3839 TRACE(
"iface %p, x %d, y %d.\n", iface,
x,
y);
3865 unsigned int dst_sub_resource_idx = 0;
3868 TRACE(
"iface %p, src_rect %s, dst_surface %p, dst_rect %s, flags %#x, fx %p.\n",
3872 FIXME(
"Ignoring fx %p.\n",
fx);
3881 src_rect, dst_wined3d_texture, dst_sub_resource_idx, dst_rect,
flags);
3900 TRACE(
"iface %p, src_rect %s, dst_surface %p, dst_rect %s, flags %#x, fx %p.\n",
3913 TRACE(
"iface %p, src_rect %s, dst_surface %p, dst_rect %s, flags %#x, fx %p.\n",
3926 TRACE(
"iface %p, src_rect %s, dst_surface %p, dst_rect %s, flags %#x, fx %p.\n",
3939 TRACE(
"iface %p, src_rect %s, dst_surface %p, dst_rect %s, flags %#x, fx %p.\n",
3959 TRACE(
"iface %p, flags %#x.\n", iface,
Flags);
3968 TRACE(
"iface %p, flags %#x.\n", iface,
flags);
3977 TRACE(
"iface %p, flags %#x.\n", iface,
flags);