From c8e52ea1acba021bf2d80016518349f7c0fbf6c3 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 5 Sep 2004 06:54:36 +0000 Subject: [PATCH] dumb temp debugging hack --- stepmania/src/RageBitmapTexture.cpp | 4 +++- stepmania/src/RageDisplay_OGL.cpp | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index 05f2bf96be..61096a2554 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -60,10 +60,12 @@ void RageBitmapTexture::Reload() * Dither forces dithering when loading 16-bit textures. * Stretch forces the loaded image to fill the texture completely. */ +extern bool g_bFoobar; /* temp hack */ void RageBitmapTexture::Create() { RageTextureID actualID = GetID(); - +g_bFoobar = ( Basename(actualID.filename) == "pledge.png" ); +if( g_bFoobar ) LOG->Trace("save %s", actualID.filename.c_str()); /* Create (and return) a surface ready to be loaded to OpenGL */ /* Load the image into a RageSurface. */ CString error; diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index 47fee74497..f550c9cbca 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -1614,6 +1614,7 @@ RageDisplay::PixelFormat RageDisplay_OGL::GetImgPixelFormat( RageSurface* &img, return pixfmt; } +bool g_bFoobar=false; /* temp hack */ unsigned RageDisplay_OGL::CreateTexture( PixelFormat pixfmt, RageSurface* img, @@ -1713,6 +1714,15 @@ unsigned RageDisplay_OGL::CreateTexture( FlushGLErrors(); + if( g_bFoobar ) + { + FILE *tmp = fopen("testing.raw", "w+b"); + ASSERT( tmp ); + fwrite( img->pixels, img->h * img->pitch, 1, tmp ); + fclose(tmp); + LOG->Trace("masks: %08x %08x %08x %08x", img->fmt.Rmask, img->fmt.Gmask, img->fmt.Bmask, img->fmt.Amask); + } + if( bGenerateMipMaps ) {