[D3D] Still more debug channels...
Lionel Ulmer
lionel.ulmer at free.fr
Sun Jul 27 09:29:56 CDT 2003
Changelog:
- added ddraw_tex to add texture snooping without needing to recompile
--
Lionel Ulmer - http://www.bbrox.org/
-------------- next part --------------
--- dlls/ddraw_CVS/d3dtexture.c Sun Jul 13 19:21:01 2003
+++ dlls/ddraw/d3dtexture.c Sun Jul 27 15:29:12 2003
@@ -34,13 +34,8 @@
#include "mesa_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
+WINE_DECLARE_DEBUG_CHANNEL(ddraw_tex);
-/* Define this if you want to save to a file all the textures used by a game
- (can be funny to see how they managed to cram all the pictures in
- texture memory) */
-#undef TEXTURE_SNOOP
-
-#ifdef TEXTURE_SNOOP
#include <stdio.h>
static void
@@ -48,18 +43,15 @@
IDirect3DTextureGLImpl *glThis = (IDirect3DTextureGLImpl *) This->tex_private;
char buf[128];
FILE *f;
+
+ TRACE_(ddraw_tex)("Dumping surface id (%5d) level (%2d) : \n", glThis->tex_name, This->mipmap_level);
+ DDRAW_dump_surface_desc(&(This->surface_desc));
sprintf(buf, "tex_%05d_%02d.pnm", glThis->tex_name, This->mipmap_level);
f = fopen(buf, "wb");
DDRAW_dump_surface_to_disk(This, f);
}
-#else
-
-#define snoop_texture(a)
-
-#endif
-
static IDirectDrawSurfaceImpl *
get_sub_mimaplevel(IDirectDrawSurfaceImpl *tex_ptr)
{
@@ -261,9 +253,11 @@
} else {
TRACE(" - uploading texture level %d (initial done = %d).\n",
surf_ptr->mipmap_level, gl_surf_ptr->initial_upload_done);
-
+
/* Texture snooping for the curious :-) */
- snoop_texture(surf_ptr);
+ if (TRACE_ON(ddraw_tex)) {
+ snoop_texture(surf_ptr);
+ }
if (upload_surface_to_tex_memory_init(surf_ptr, surf_ptr->mipmap_level, &(gl_surf_ptr->current_internal_format),
gl_surf_ptr->initial_upload_done == FALSE, TRUE, 0, 0) == DD_OK) {
--- dlls/ddraw_CVS/helper.c Thu Jan 30 22:07:23 2003
+++ dlls/ddraw/helper.c Sun Jul 27 15:04:33 2003
@@ -579,11 +579,6 @@
{
int i;
- if (TRACE_ON(ddraw)) {
- DPRINTF("Dumping surface : \n");
- DDRAW_dump_surface_desc(&(surface->surface_desc));
- }
-
fprintf(f, "P6\n%ld %ld\n255\n", surface->surface_desc.dwWidth, surface->surface_desc.dwHeight);
if (surface->surface_desc.u4.ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) {
More information about the wine-patches
mailing list