Proper logging of DDSCAPS / DDSCAPS2 structures.

This commit is contained in:
Lionel Ulmer 2002-11-11 22:23:10 +00:00 committed by Alexandre Julliard
parent b6aad50245
commit b103f7b679
3 changed files with 51 additions and 24 deletions

View File

@ -40,6 +40,7 @@
do { \
DWORD __size = (to)->dwSize; \
DWORD __copysize = __size; \
memset(to,0,__size); \
if ((from)->dwSize < __size) \
__copysize = (from)->dwSize; \
memcpy(to,from,__copysize); \
@ -350,7 +351,8 @@ void DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(const DDDEVICEIDENTIFIER2* pIn,
extern void DDRAW_dump_DDBLTFX(DWORD flagmask);
extern void DDRAW_dump_DDBLTFAST(DWORD flagmask);
extern void DDRAW_dump_DDBLT(DWORD flagmask);
extern void DDRAW_dump_DDSCAPS(const DDSCAPS2 *in);
extern void DDRAW_dump_DDSCAPS(const DDSCAPS *in);
extern void DDRAW_dump_DDSCAPS2(const DDSCAPS2 *in);
extern void DDRAW_dump_pixelformat_flag(DWORD flagmask);
extern void DDRAW_dump_paletteformat(DWORD dwFlags);
extern void DDRAW_dump_pixelformat(const DDPIXELFORMAT *in);

View File

@ -600,7 +600,7 @@ Main_DirectDrawSurface_GetAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
if (TRACE_ON(ddraw)) {
TRACE("(%p)->Looking for caps: %lx,%lx,%lx,%lx output: %p\n",This,pCaps->dwCaps, pCaps->dwCaps2,
pCaps->dwCaps3, pCaps->dwCaps4, ppSurface);
DPRINTF(" Caps are : "); DDRAW_dump_DDSCAPS(pCaps); DPRINTF("\n");
DPRINTF(" Caps are : "); DDRAW_dump_DDSCAPS2(pCaps); DPRINTF("\n");
}
our_caps = *pCaps;
@ -611,7 +611,7 @@ Main_DirectDrawSurface_GetAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
our_caps.dwCaps3 = 0;
our_caps.dwCaps4 = 0;
if (TRACE_ON(ddraw)) {
DPRINTF(" Real caps are : "); DDRAW_dump_DDSCAPS(&our_caps); DPRINTF("\n");
DPRINTF(" Real caps are : "); DDRAW_dump_DDSCAPS2(&our_caps); DPRINTF("\n");
}
}
@ -623,7 +623,7 @@ Main_DirectDrawSurface_GetAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
surf->surface_desc.ddsCaps.dwCaps2,
surf->surface_desc.ddsCaps.dwCaps3,
surf->surface_desc.ddsCaps.dwCaps4);
DPRINTF(" Surface caps are : "); DDRAW_dump_DDSCAPS(&(surf->surface_desc.ddsCaps)); DPRINTF("\n");
DPRINTF(" Surface caps are : "); DDRAW_dump_DDSCAPS2(&(surf->surface_desc.ddsCaps)); DPRINTF("\n");
}
if (((surf->surface_desc.ddsCaps.dwCaps & our_caps.dwCaps) == our_caps.dwCaps) &&
((surf->surface_desc.ddsCaps.dwCaps2 & our_caps.dwCaps2) == our_caps.dwCaps2))

View File

@ -155,7 +155,7 @@ void DDRAW_dump_DDBLT(DWORD flagmask)
DDRAW_dump_flags(flagmask, flags, sizeof(flags)/sizeof(flags[0]));
}
void DDRAW_dump_DDSCAPS(const DDSCAPS2 *in)
void DDRAW_dump_DDSCAPS2(const DDSCAPS2 *in)
{
static const flag_info flags[] = {
FE(DDSCAPS_RESERVED1),
@ -215,6 +215,17 @@ void DDRAW_dump_DDSCAPS(const DDSCAPS2 *in)
DDRAW_dump_flags_(in->dwCaps2, flags2, sizeof(flags2)/sizeof(flags2[0]), 0);
}
void DDRAW_dump_DDSCAPS(const DDSCAPS *in) {
DDSCAPS2 in_bis;
in_bis.dwCaps = in->dwCaps;
in_bis.dwCaps2 = 0;
in_bis.dwCaps3 = 0;
in_bis.dwCaps4 = 0;
DDRAW_dump_DDSCAPS2(&in_bis);
}
void DDRAW_dump_pixelformat_flag(DWORD flagmask)
{
static const flag_info flags[] =
@ -329,26 +340,40 @@ void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd)
{
#define STRUCT DDSURFACEDESC2
static const member_info members[] =
{
ME(DDSD_CAPS, DDRAW_dump_DDSCAPS, ddsCaps),
ME(DDSD_HEIGHT, DDRAW_dump_DWORD, dwHeight),
ME(DDSD_WIDTH, DDRAW_dump_DWORD, dwWidth),
ME(DDSD_PITCH, DDRAW_dump_DWORD, u1.lPitch),
ME(DDSD_LINEARSIZE, DDRAW_dump_DWORD, u1.dwLinearSize),
ME(DDSD_BACKBUFFERCOUNT, DDRAW_dump_DWORD, dwBackBufferCount),
ME(DDSD_MIPMAPCOUNT, DDRAW_dump_DWORD, u2.dwMipMapCount),
ME(DDSD_REFRESHRATE, DDRAW_dump_DWORD, u2.dwRefreshRate),
ME(DDSD_ALPHABITDEPTH, DDRAW_dump_DWORD, dwAlphaBitDepth),
ME(DDSD_LPSURFACE, DDRAW_dump_PTR, lpSurface),
ME(DDSD_CKDESTOVERLAY, DDRAW_dump_DDCOLORKEY, u3.ddckCKDestOverlay),
ME(DDSD_CKDESTBLT, DDRAW_dump_DDCOLORKEY, ddckCKDestBlt),
ME(DDSD_CKSRCOVERLAY, DDRAW_dump_DDCOLORKEY, ddckCKSrcOverlay),
ME(DDSD_CKSRCBLT, DDRAW_dump_DDCOLORKEY, ddckCKSrcBlt),
ME(DDSD_PIXELFORMAT, DDRAW_dump_pixelformat, u4.ddpfPixelFormat)
};
{
ME(DDSD_HEIGHT, DDRAW_dump_DWORD, dwHeight),
ME(DDSD_WIDTH, DDRAW_dump_DWORD, dwWidth),
ME(DDSD_PITCH, DDRAW_dump_DWORD, u1.lPitch),
ME(DDSD_LINEARSIZE, DDRAW_dump_DWORD, u1.dwLinearSize),
ME(DDSD_BACKBUFFERCOUNT, DDRAW_dump_DWORD, dwBackBufferCount),
ME(DDSD_MIPMAPCOUNT, DDRAW_dump_DWORD, u2.dwMipMapCount),
ME(DDSD_REFRESHRATE, DDRAW_dump_DWORD, u2.dwRefreshRate),
ME(DDSD_ALPHABITDEPTH, DDRAW_dump_DWORD, dwAlphaBitDepth),
ME(DDSD_LPSURFACE, DDRAW_dump_PTR, lpSurface),
ME(DDSD_CKDESTOVERLAY, DDRAW_dump_DDCOLORKEY, u3.ddckCKDestOverlay),
ME(DDSD_CKDESTBLT, DDRAW_dump_DDCOLORKEY, ddckCKDestBlt),
ME(DDSD_CKSRCOVERLAY, DDRAW_dump_DDCOLORKEY, ddckCKSrcOverlay),
ME(DDSD_CKSRCBLT, DDRAW_dump_DDCOLORKEY, ddckCKSrcBlt),
ME(DDSD_PIXELFORMAT, DDRAW_dump_pixelformat, u4.ddpfPixelFormat)
};
static const member_info members_caps[] =
{
ME(DDSD_CAPS, DDRAW_dump_DDSCAPS, ddsCaps)
};
static const member_info members_caps2[] =
{
ME(DDSD_CAPS, DDRAW_dump_DDSCAPS2, ddsCaps)
};
#undef STRUCT
if (lpddsd->dwSize >= sizeof(DDSURFACEDESC2)) {
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps2, 1);
} else {
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps, 1);
}
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members,
sizeof(members)/sizeof(members[0]));
sizeof(members)/sizeof(members[0]));
}
void DDRAW_dump_cooperativelevel(DWORD cooplevel)
@ -533,5 +558,5 @@ void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps) {
DPRINTF(" - dwMinOverlayStretch : %ld\n", lpcaps->dwMinOverlayStretch);
DPRINTF(" - dwMaxOverlayStretch : %ld\n", lpcaps->dwMaxOverlayStretch);
DPRINTF("...\n");
DPRINTF(" - ddsCaps : "); DDRAW_dump_DDSCAPS(&lpcaps->ddsCaps); DPRINTF("\n");
DPRINTF(" - ddsCaps : "); DDRAW_dump_DDSCAPS2(&lpcaps->ddsCaps); DPRINTF("\n");
}