-/*===========================================================================*/\r
-/* */\r
-/* Mesa-3.0 DirectX 6 Driver */\r
-/* */\r
-/* By Leigh McRae */\r
-/* */\r
-/* http://www.altsoftware.com/ */\r
-/* */\r
-/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */\r
-/*===========================================================================*/\r
-#include "Debug.h"\r
-/*===========================================================================*/\r
-/* Global variables. */\r
-/*===========================================================================*/\r
-DWORD g_DBGMask = DBG_ALL_ERROR;\r
-/*===========================================================================*/\r
-/* This is your basic DPF function with printf like support. The function */\r
-/* also works with a global debug mask variable. I have written support that*/\r
-/* allows for the user's enviroment variable space to be read and set the */\r
-/* masks. This is done when the dll starts and is only in the debug version.*/\r
-/*===========================================================================*/\r
-/* RETURN: */\r
-/*===========================================================================*/\r
-void _cdecl DebugPrint( int mask, char *pszFormat, ... )\r
-{\r
- char buffer[512];\r
- va_list args;\r
-\r
- /* A mask of 0 will always pass. Easy to remeber. */\r
- if ( (mask == 0) || (mask & g_DBGMask) ) \r
- {\r
- va_start( args, pszFormat );\r
-\r
- if ( mask & DBG_ALL_ERROR ) \r
- OutputDebugString( "MesaD3D: (ERROR)" ); \r
- else\r
- OutputDebugString( "MesaD3D: " ); \r
-\r
- vsprintf( buffer, pszFormat, args );\r
- strcat( buffer, "\n" );\r
- OutputDebugString( buffer );\r
-\r
- va_end( args );\r
- }\r
-}\r
-/*===========================================================================*/\r
-/* This call reads the users enviroment variables and sets any debug mask */\r
-/* that they have set to TRUE. Now the value must be "TRUE". */\r
-/*===========================================================================*/\r
-/* RETURN: */\r
-/*===========================================================================*/\r
-void ReadDBGEnv( void )\r
-{\r
- g_DBGMask = DBG_ALL_ERROR;\r
-\r
-#define IS_VAR_SET(v) if ( getenv( # v ) && !strcmp(getenv( # v ),"TRUE") ) g_DBGMask |= v;\r
- \r
- IS_VAR_SET( DBG_FUNC );\r
- IS_VAR_SET( DBG_STATES );\r
-\r
- IS_VAR_SET( DBG_CNTX_INFO );\r
- IS_VAR_SET( DBG_CNTX_WARN );\r
- IS_VAR_SET( DBG_CNTX_PROFILE );\r
- IS_VAR_SET( DBG_CNTX_ERROR );\r
- IS_VAR_SET( DBG_CNTX_ALL );\r
-\r
- IS_VAR_SET( DBG_PRIM_INFO );\r
- IS_VAR_SET( DBG_PRIM_WARN );\r
- IS_VAR_SET( DBG_PRIM_PROFILE );\r
- IS_VAR_SET( DBG_PRIM_ERROR );\r
- IS_VAR_SET( DBG_PRIM_ALL );\r
-\r
- IS_VAR_SET( DBG_TXT_INFO );\r
- IS_VAR_SET( DBG_TXT_WARN );\r
- IS_VAR_SET( DBG_TXT_PROFILE );\r
- IS_VAR_SET( DBG_TXT_ERROR );\r
- IS_VAR_SET( DBG_TXT_ALL );\r
-\r
- IS_VAR_SET( DBG_ALL_INFO );\r
- IS_VAR_SET( DBG_ALL_WARN );\r
- IS_VAR_SET( DBG_ALL_PROFILE );\r
- IS_VAR_SET( DBG_ALL_ERROR );\r
- IS_VAR_SET( DBG_ALL );\r
-\r
-#undef IS_VAR_SET\r
-}\r
-/*===========================================================================*/\r
-/* This function will take a pointer to a DDSURFACEDESC2 structure & display*/\r
-/* the parsed information using a DPF call. */\r
-/*===========================================================================*/\r
-/* RETURN: */\r
-/*===========================================================================*/\r
-void DebugPixelFormat( char *pszSurfaceName, DDPIXELFORMAT *pddpf )\r
-{\r
- char buffer[256];\r
-\r
- /* Parse the flag type and write the string equivalent. */\r
- if ( pddpf->dwFlags & DDPF_ALPHA )\r
- strcat( buffer, "DDPF_ALPHA " );\r
- if ( pddpf->dwFlags & DDPF_ALPHAPIXELS )\r
- strcat( buffer, "DDPF_ALPHAPIXELS " );\r
- if ( pddpf->dwFlags & DDPF_ALPHAPREMULT )\r
- strcat( buffer, "DDPF_ALPHAPREMULT " );\r
- if ( pddpf->dwFlags & DDPF_BUMPLUMINANCE )\r
- strcat( buffer, "DDPF_BUMPLUMINANCE " );\r
- if ( pddpf->dwFlags & DDPF_BUMPDUDV )\r
- strcat( buffer, "DDPF_BUMPDUDV " );\r
- if ( pddpf->dwFlags & DDPF_COMPRESSED )\r
- strcat( buffer, "DDPF_COMPRESSED " );\r
- if ( pddpf->dwFlags & DDPF_FOURCC )\r
- strcat( buffer, "DDPF_FOURCC " );\r
- if ( pddpf->dwFlags & DDPF_LUMINANCE )\r
- strcat( buffer, "DDPF_LUMINANCE " );\r
- if ( pddpf->dwFlags & DDPF_PALETTEINDEXED1 )\r
- strcat( buffer, "DDPF_PALETTEINDEXED1 " );\r
- if ( pddpf->dwFlags & DDPF_PALETTEINDEXED2 )\r
- strcat( buffer, "DDPF_PALETTEINDEXED2 " );\r
- if ( pddpf->dwFlags & DDPF_PALETTEINDEXED4 )\r
- strcat( buffer, "DDPF_PALETTEINDEXED4 " );\r
- if ( pddpf->dwFlags & DDPF_PALETTEINDEXED8 )\r
- strcat( buffer, "DDPF_PALETTEINDEXED8 " );\r
- if ( pddpf->dwFlags & DDPF_PALETTEINDEXEDTO8 )\r
- strcat( buffer, "DDPF_PALETTEINDEXEDTO8 " );\r
- if ( pddpf->dwFlags & DDPF_RGB )\r
- strcat( buffer, "DDPF_RGB " );\r
- if ( pddpf->dwFlags & DDPF_RGBTOYUV )\r
- strcat( buffer, "DDPF_RGBTOYUV " );\r
- if ( pddpf->dwFlags & DDPF_STENCILBUFFER )\r
- strcat( buffer, "DDPF_STENCILBUFFER " );\r
- if ( pddpf->dwFlags & DDPF_YUV )\r
- strcat( buffer, "DDPF_YUV " );\r
- if ( pddpf->dwFlags & DDPF_ZBUFFER )\r
- strcat( buffer, "DDPF_ZBUFFER " );\r
- if ( pddpf->dwFlags & DDPF_ZPIXELS )\r
- strcat( buffer, "DDPF_ZPIXELS " );\r
-\r
- DPF(( (DBG_TXT_INFO|DBG_CNTX_INFO),"%s", buffer ));\r
-}\r
-\r
-\r
-\r
-\r
-\r
+/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#include "Debug.h"
+/*===========================================================================*/
+/* Global variables. */
+/*===========================================================================*/
+DWORD g_DBGMask = DBG_ALL_ERROR;
+/*===========================================================================*/
+/* This is your basic DPF function with printf like support. The function */
+/* also works with a global debug mask variable. I have written support that*/
+/* allows for the user's enviroment variable space to be read and set the */
+/* masks. This is done when the dll starts and is only in the debug version.*/
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void _cdecl DebugPrint( int mask, char *pszFormat, ... )
+{
+ char buffer[512];
+ va_list args;
+
+ /* A mask of 0 will always pass. Easy to remeber. */
+ if ( (mask == 0) || (mask & g_DBGMask) )
+ {
+ va_start( args, pszFormat );
+
+ if ( mask & DBG_ALL_ERROR )
+ OutputDebugString( "MesaD3D: (ERROR)" );
+ else
+ OutputDebugString( "MesaD3D: " );
+
+ vsprintf( buffer, pszFormat, args );
+ strcat( buffer, "\n" );
+ OutputDebugString( buffer );
+
+ va_end( args );
+ }
+}
+/*===========================================================================*/
+/* This call reads the users enviroment variables and sets any debug mask */
+/* that they have set to TRUE. Now the value must be "TRUE". */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void ReadDBGEnv( void )
+{
+ g_DBGMask = DBG_ALL_ERROR;
+
+#define IS_VAR_SET(v) if ( getenv( # v ) && !strcmp(getenv( # v ),"TRUE") ) g_DBGMask |= v;
+
+ IS_VAR_SET( DBG_FUNC );
+ IS_VAR_SET( DBG_STATES );
+
+ IS_VAR_SET( DBG_CNTX_INFO );
+ IS_VAR_SET( DBG_CNTX_WARN );
+ IS_VAR_SET( DBG_CNTX_PROFILE );
+ IS_VAR_SET( DBG_CNTX_ERROR );
+ IS_VAR_SET( DBG_CNTX_ALL );
+
+ IS_VAR_SET( DBG_PRIM_INFO );
+ IS_VAR_SET( DBG_PRIM_WARN );
+ IS_VAR_SET( DBG_PRIM_PROFILE );
+ IS_VAR_SET( DBG_PRIM_ERROR );
+ IS_VAR_SET( DBG_PRIM_ALL );
+
+ IS_VAR_SET( DBG_TXT_INFO );
+ IS_VAR_SET( DBG_TXT_WARN );
+ IS_VAR_SET( DBG_TXT_PROFILE );
+ IS_VAR_SET( DBG_TXT_ERROR );
+ IS_VAR_SET( DBG_TXT_ALL );
+
+ IS_VAR_SET( DBG_ALL_INFO );
+ IS_VAR_SET( DBG_ALL_WARN );
+ IS_VAR_SET( DBG_ALL_PROFILE );
+ IS_VAR_SET( DBG_ALL_ERROR );
+ IS_VAR_SET( DBG_ALL );
+
+#undef IS_VAR_SET
+}
+/*===========================================================================*/
+/* This function will take a pointer to a DDSURFACEDESC2 structure & display*/
+/* the parsed information using a DPF call. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void DebugPixelFormat( char *pszSurfaceName, DDPIXELFORMAT *pddpf )
+{
+ char buffer[256];
+
+ /* Parse the flag type and write the string equivalent. */
+ if ( pddpf->dwFlags & DDPF_ALPHA )
+ strcat( buffer, "DDPF_ALPHA " );
+ if ( pddpf->dwFlags & DDPF_ALPHAPIXELS )
+ strcat( buffer, "DDPF_ALPHAPIXELS " );
+ if ( pddpf->dwFlags & DDPF_ALPHAPREMULT )
+ strcat( buffer, "DDPF_ALPHAPREMULT " );
+ if ( pddpf->dwFlags & DDPF_BUMPLUMINANCE )
+ strcat( buffer, "DDPF_BUMPLUMINANCE " );
+ if ( pddpf->dwFlags & DDPF_BUMPDUDV )
+ strcat( buffer, "DDPF_BUMPDUDV " );
+ if ( pddpf->dwFlags & DDPF_COMPRESSED )
+ strcat( buffer, "DDPF_COMPRESSED " );
+ if ( pddpf->dwFlags & DDPF_FOURCC )
+ strcat( buffer, "DDPF_FOURCC " );
+ if ( pddpf->dwFlags & DDPF_LUMINANCE )
+ strcat( buffer, "DDPF_LUMINANCE " );
+ if ( pddpf->dwFlags & DDPF_PALETTEINDEXED1 )
+ strcat( buffer, "DDPF_PALETTEINDEXED1 " );
+ if ( pddpf->dwFlags & DDPF_PALETTEINDEXED2 )
+ strcat( buffer, "DDPF_PALETTEINDEXED2 " );
+ if ( pddpf->dwFlags & DDPF_PALETTEINDEXED4 )
+ strcat( buffer, "DDPF_PALETTEINDEXED4 " );
+ if ( pddpf->dwFlags & DDPF_PALETTEINDEXED8 )
+ strcat( buffer, "DDPF_PALETTEINDEXED8 " );
+ if ( pddpf->dwFlags & DDPF_PALETTEINDEXEDTO8 )
+ strcat( buffer, "DDPF_PALETTEINDEXEDTO8 " );
+ if ( pddpf->dwFlags & DDPF_RGB )
+ strcat( buffer, "DDPF_RGB " );
+ if ( pddpf->dwFlags & DDPF_RGBTOYUV )
+ strcat( buffer, "DDPF_RGBTOYUV " );
+ if ( pddpf->dwFlags & DDPF_STENCILBUFFER )
+ strcat( buffer, "DDPF_STENCILBUFFER " );
+ if ( pddpf->dwFlags & DDPF_YUV )
+ strcat( buffer, "DDPF_YUV " );
+ if ( pddpf->dwFlags & DDPF_ZBUFFER )
+ strcat( buffer, "DDPF_ZBUFFER " );
+ if ( pddpf->dwFlags & DDPF_ZPIXELS )
+ strcat( buffer, "DDPF_ZPIXELS " );
+
+ DPF(( (DBG_TXT_INFO|DBG_CNTX_INFO),"%s", buffer ));
+}
+
+
+
+
+