Added ddraw_tex to add texture snooping without needing to recompile.
This commit is contained in:
parent
152b98fa63
commit
8297fec7d2
|
@ -34,13 +34,8 @@
|
||||||
#include "mesa_private.h"
|
#include "mesa_private.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
|
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>
|
#include <stdio.h>
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -49,17 +44,14 @@ snoop_texture(IDirectDrawSurfaceImpl *This) {
|
||||||
char buf[128];
|
char buf[128];
|
||||||
FILE *f;
|
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);
|
sprintf(buf, "tex_%05d_%02d.pnm", glThis->tex_name, This->mipmap_level);
|
||||||
f = fopen(buf, "wb");
|
f = fopen(buf, "wb");
|
||||||
DDRAW_dump_surface_to_disk(This, f);
|
DDRAW_dump_surface_to_disk(This, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define snoop_texture(a)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static IDirectDrawSurfaceImpl *
|
static IDirectDrawSurfaceImpl *
|
||||||
get_sub_mimaplevel(IDirectDrawSurfaceImpl *tex_ptr)
|
get_sub_mimaplevel(IDirectDrawSurfaceImpl *tex_ptr)
|
||||||
{
|
{
|
||||||
|
@ -263,7 +255,9 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *surf_ptr, IDirect3DDeviceImpl *d3dd
|
||||||
surf_ptr->mipmap_level, gl_surf_ptr->initial_upload_done);
|
surf_ptr->mipmap_level, gl_surf_ptr->initial_upload_done);
|
||||||
|
|
||||||
/* Texture snooping for the curious :-) */
|
/* Texture snooping for the curious :-) */
|
||||||
|
if (TRACE_ON(ddraw_tex)) {
|
||||||
snoop_texture(surf_ptr);
|
snoop_texture(surf_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
if (upload_surface_to_tex_memory_init(surf_ptr, surf_ptr->mipmap_level, &(gl_surf_ptr->current_internal_format),
|
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) {
|
gl_surf_ptr->initial_upload_done == FALSE, TRUE, 0, 0) == DD_OK) {
|
||||||
|
|
|
@ -579,11 +579,6 @@ void DDRAW_dump_surface_to_disk(IDirectDrawSurfaceImpl *surface, FILE *f)
|
||||||
{
|
{
|
||||||
int i;
|
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);
|
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) {
|
if (surface->surface_desc.u4.ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) {
|
||||||
|
|
Loading…
Reference in New Issue