CHANGE: cleaned up debug messages

This commit is contained in:
Chris Danford
2002-01-20 07:51:09 +00:00
parent d2d2e6ac08
commit 40df826636
10 changed files with 51 additions and 29 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ BitmapText::BitmapText()
bool BitmapText::Load( CString sFontFilePath ) bool BitmapText::Load( CString sFontFilePath )
{ {
RageLog( "BitmapText::LoadFromFontName(%s)", sFontFilePath ); //RageLog( "BitmapText::LoadFromFontName(%s)", sFontFilePath );
m_sFontFilePath = sFontFilePath; // save m_sFontFilePath = sFontFilePath; // save
+9 -2
View File
@@ -492,8 +492,15 @@ void MusicWheel::Update( float fDeltaTime )
void MusicWheel::PrevMusic() void MusicWheel::PrevMusic()
{ {
if( m_WheelState != STATE_IDLE ) switch( m_WheelState )
return; {
//case STATE_SWITCHING_TO_PREV_MUSIC:
case STATE_IDLE:
break; // fall through
default:
return; // don't fall through
}
MUSIC->Stop(); MUSIC->Stop();
+3 -3
View File
@@ -71,7 +71,7 @@ LPRageTexture RageTextureManager::LoadTexture( CString sTexturePath )
} }
else else
{ {
RageLog( ssprintf("Didn't find '%s' already loaded. Creating a new texture.", sTexturePath) ); RageLog( ssprintf("RageTextureManager: allocating space for '%s'.", sTexturePath) );
CString sDrive, sDir, sFName, sExt; CString sDrive, sDir, sFName, sExt;
splitpath( FALSE, sTexturePath, sDrive, sDir, sFName, sExt ); splitpath( FALSE, sTexturePath, sDrive, sDir, sFName, sExt );
@@ -105,7 +105,7 @@ void RageTextureManager::UnloadTexture( CString sTexturePath )
if( sTexturePath == "" ) if( sTexturePath == "" )
{ {
RageLog( "RageTextureManager::UnloadTexture() tried to Unload a blank" ); RageLog( "RageTextureManager::UnloadTexture(): tried to Unload a blank" );
return; return;
} }
@@ -120,7 +120,7 @@ void RageTextureManager::UnloadTexture( CString sTexturePath )
pTexture->m_iRefCount--; pTexture->m_iRefCount--;
if( pTexture->m_iRefCount == 0 ) // there are no more references to this texture if( pTexture->m_iRefCount == 0 ) // there are no more references to this texture
{ {
RageLog( ssprintf("The texture '%s' has no more references. It will be deleted.", sTexturePath) ); RageLog( ssprintf("RageTextureManager: deallocating '%s'.", sTexturePath) );
SAFE_DELETE( pTexture ); // free the texture SAFE_DELETE( pTexture ); // free the texture
m_mapPathToTexture.RemoveKey( sTexturePath ); // and remove the key in the map m_mapPathToTexture.RemoveKey( sTexturePath ); // and remove the key in the map
} }
+9 -4
View File
@@ -92,8 +92,6 @@ void RageLogStart()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void RageLog( LPCTSTR fmt, ...) void RageLog( LPCTSTR fmt, ...)
{ {
#if defined(DEBUG) | defined(_DEBUG)
va_list va; va_list va;
va_start(va, fmt); va_start(va, fmt);
@@ -110,8 +108,15 @@ void RageLog( LPCTSTR fmt, ...)
fprintf(fp, sBuff); fprintf(fp, sBuff);
fclose(fp); fclose(fp);
#endif }
void RageLogHr( HRESULT hr, LPCTSTR fmt, ...)
{
va_list va;
va_start(va, fmt);
CString s = vssprintf( fmt, va );
s += ssprintf( "(%s)", DXGetErrorString8(hr) );
RageLog( s );
} }
@@ -364,7 +369,7 @@ DWORD GetFileSizeInBytes( CString sFilePath )
bool DoesFileExist( CString sPath ) bool DoesFileExist( CString sPath )
{ {
RageLog( "DoesFileExist(%s)", sPath ); //RageLog( "DoesFileExist(%s)", sPath );
DWORD dwAttr = GetFileAttributes( sPath ); DWORD dwAttr = GetFileAttributes( sPath );
if( dwAttr == (DWORD)-1 ) if( dwAttr == (DWORD)-1 )
+6 -4
View File
@@ -11,6 +11,11 @@
#ifndef _RAGEUTIL_H_ #ifndef _RAGEUTIL_H_
#define _RAGEUTIL_H_ #define _RAGEUTIL_H_
#include "dxerr8.h"
#pragma comment(lib, "DxErr8.lib")
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// SAFE_ Macros // SAFE_ Macros
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -98,14 +103,11 @@ void SortCStringArray( CStringArray &AddTo, BOOL bSortAcsending = TRUE );
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void RageLogStart(); void RageLogStart();
void RageLog( LPCTSTR fmt, ...); void RageLog( LPCTSTR fmt, ...);
void RageLogHr( HRESULT hr, LPCTSTR fmt, ...);
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Error helpers // Error helpers
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "dxerr8.h"
#pragma comment(lib, "DxErr8.lib")
VOID DisplayErrorAndDie( CString sError ); VOID DisplayErrorAndDie( CString sError );
+6 -6
View File
@@ -15,13 +15,13 @@
const int SCREEN_WIDTH = 640; const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480; const int SCREEN_HEIGHT = 480;
const float LEFT_EDGE = 0; const float SCREEN_LEFT = 0;
const float RIGHT_EDGE = SCREEN_WIDTH; const float SCREEN_RIGHT = SCREEN_WIDTH;
const float TOP_EDGE = 0; const float SCREEN_TOP = 0;
const float BOTTOM_EDGE = SCREEN_HEIGHT; const float SCREEN_BOTTOM = SCREEN_HEIGHT;
const float CENTER_X = LEFT_EDGE + (RIGHT_EDGE - LEFT_EDGE)/2.0f; const float CENTER_X = SCREEN_LEFT + (SCREEN_RIGHT - SCREEN_LEFT)/2.0f;
const float CENTER_Y = TOP_EDGE + (BOTTOM_EDGE - TOP_EDGE)/2.0f; const float CENTER_Y = SCREEN_TOP + (SCREEN_BOTTOM - SCREEN_TOP)/2.0f;
#endif #endif
-4
View File
@@ -211,8 +211,6 @@ bool Song::LoadSongInfoFromBMSDir( CString sDir )
// get group name // get group name
CStringArray sDirectoryParts; CStringArray sDirectoryParts;
split( m_sSongDir, "\\", sDirectoryParts, true ); split( m_sSongDir, "\\", sDirectoryParts, true );
for( int p=0; p<sDirectoryParts.GetSize(); p++ )
RageLog( "sDirectoryParts[p] = '%s'", sDirectoryParts[p] );
m_sGroupName = sDirectoryParts[1]; m_sGroupName = sDirectoryParts[1];
@@ -369,8 +367,6 @@ bool Song::LoadSongInfoFromDWIFile( CString sPath )
// get group name // get group name
CStringArray sDirectoryParts; CStringArray sDirectoryParts;
split( m_sSongDir, "\\", sDirectoryParts, true ); split( m_sSongDir, "\\", sDirectoryParts, true );
for( int p=0; p<sDirectoryParts.GetSize(); p++ )
RageLog( "sDirectoryParts[p] = '%s'", sDirectoryParts[p] );
m_sGroupName = sDirectoryParts[1]; m_sGroupName = sDirectoryParts[1];
} }
+2
View File
@@ -70,6 +70,8 @@ CString ThemeManager::GetPathTo( ThemeElement te, CString sThemeName )
case GRAPHIC_SECTION_BACKGROUND: sAssetPath = "Graphics\\section background"; break; case GRAPHIC_SECTION_BACKGROUND: sAssetPath = "Graphics\\section background"; break;
case GRAPHIC_MUSIC_SORT_ICONS: sAssetPath = "Graphics\\music sort icons 1x5"; break; case GRAPHIC_MUSIC_SORT_ICONS: sAssetPath = "Graphics\\music sort icons 1x5"; break;
case GRAPHIC_MUSIC_STATUS_ICONS: sAssetPath = "Graphics\\music status icons 1x4"; break; case GRAPHIC_MUSIC_STATUS_ICONS: sAssetPath = "Graphics\\music status icons 1x4"; break;
case GRAPHIC_DANGER: sAssetPath = "Graphics\\danger"; break;
case GRAPHIC_DANGER_BACKGROUND: sAssetPath = "Graphics\\danger background"; break;
case SOUND_FAILED: sAssetPath = "Sounds\\failed"; break; case SOUND_FAILED: sAssetPath = "Sounds\\failed"; break;
case SOUND_ASSIST: sAssetPath = "Sounds\\Assist"; break; case SOUND_ASSIST: sAssetPath = "Sounds\\Assist"; break;
+13 -1
View File
@@ -60,6 +60,8 @@ enum ThemeElement {
GRAPHIC_SECTION_BACKGROUND, GRAPHIC_SECTION_BACKGROUND,
GRAPHIC_MUSIC_SORT_ICONS, GRAPHIC_MUSIC_SORT_ICONS,
GRAPHIC_MUSIC_STATUS_ICONS, GRAPHIC_MUSIC_STATUS_ICONS,
GRAPHIC_DANGER,
GRAPHIC_DANGER_BACKGROUND,
SOUND_FAILED, SOUND_FAILED,
SOUND_ASSIST, SOUND_ASSIST,
@@ -129,7 +131,17 @@ public:
void GetThemeNames( CStringArray& AddTo ) void GetThemeNames( CStringArray& AddTo )
{ {
GetDirListing( "Themes\\*.*", AddTo, true ); GetDirListing( "Themes\\*", AddTo, true );
// strip out the folder called "CVS"
for( int i=0; i<AddTo.GetSize(); i++ )
{
if( 0 == stricmp( AddTo[i], "cvs" ) )
{
AddTo.RemoveAt(i);
i--;
}
}
}; };
bool SetTheme( CString sThemeName ) // return false if theme doesn't exist bool SetTheme( CString sThemeName ) // return false if theme doesn't exist
-2
View File
@@ -7,8 +7,6 @@
#define IDI_ICON 1003 #define IDI_ICON 1003
#define IDC_CURSOR 1004 #define IDC_CURSOR 1004
#define IDM_EXIT 40003 #define IDM_EXIT 40003
#define IDM_WINDOWED 40008
#define IDM_PADS 40011
// Next default values for new objects // Next default values for new objects
// //