From 40df82663633b9e88439aa98de2a1c4912bb24ab Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 20 Jan 2002 07:51:09 +0000 Subject: [PATCH] CHANGE: cleaned up debug messages --- stepmania/src/BitmapText.cpp | 2 +- stepmania/src/MusicWheel.cpp | 11 +++++++++-- stepmania/src/RageTextureManager.cpp | 6 +++--- stepmania/src/RageUtil.cpp | 13 +++++++++---- stepmania/src/RageUtil.h | 10 ++++++---- stepmania/src/ScreenDimensions.h | 16 ++++++++-------- stepmania/src/Song.cpp | 4 ---- stepmania/src/ThemeManager.cpp | 2 ++ stepmania/src/ThemeManager.h | 14 +++++++++++++- stepmania/src/resource.h | 2 -- 10 files changed, 51 insertions(+), 29 deletions(-) diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 035f97772c..726ad71bf6 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -34,7 +34,7 @@ BitmapText::BitmapText() bool BitmapText::Load( CString sFontFilePath ) { - RageLog( "BitmapText::LoadFromFontName(%s)", sFontFilePath ); + //RageLog( "BitmapText::LoadFromFontName(%s)", sFontFilePath ); m_sFontFilePath = sFontFilePath; // save diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index f6053f315a..e49daaab6c 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -492,8 +492,15 @@ void MusicWheel::Update( float fDeltaTime ) void MusicWheel::PrevMusic() { - if( m_WheelState != STATE_IDLE ) - return; + switch( m_WheelState ) + { + //case STATE_SWITCHING_TO_PREV_MUSIC: + + case STATE_IDLE: + break; // fall through + default: + return; // don't fall through + } MUSIC->Stop(); diff --git a/stepmania/src/RageTextureManager.cpp b/stepmania/src/RageTextureManager.cpp index 0a348417fe..6a84028064 100644 --- a/stepmania/src/RageTextureManager.cpp +++ b/stepmania/src/RageTextureManager.cpp @@ -71,7 +71,7 @@ LPRageTexture RageTextureManager::LoadTexture( CString sTexturePath ) } 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; splitpath( FALSE, sTexturePath, sDrive, sDir, sFName, sExt ); @@ -105,7 +105,7 @@ void RageTextureManager::UnloadTexture( CString sTexturePath ) if( sTexturePath == "" ) { - RageLog( "RageTextureManager::UnloadTexture() tried to Unload a blank" ); + RageLog( "RageTextureManager::UnloadTexture(): tried to Unload a blank" ); return; } @@ -120,7 +120,7 @@ void RageTextureManager::UnloadTexture( CString sTexturePath ) pTexture->m_iRefCount--; 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 m_mapPathToTexture.RemoveKey( sTexturePath ); // and remove the key in the map } diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index c85c32a7b1..20267b9187 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -92,8 +92,6 @@ void RageLogStart() //----------------------------------------------------------------------------- void RageLog( LPCTSTR fmt, ...) { - -#if defined(DEBUG) | defined(_DEBUG) va_list va; va_start(va, fmt); @@ -110,8 +108,15 @@ void RageLog( LPCTSTR fmt, ...) fprintf(fp, sBuff); 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 ) { - RageLog( "DoesFileExist(%s)", sPath ); + //RageLog( "DoesFileExist(%s)", sPath ); DWORD dwAttr = GetFileAttributes( sPath ); if( dwAttr == (DWORD)-1 ) diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index 3e4fa77f85..74b7c4a59d 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -11,6 +11,11 @@ #ifndef _RAGEUTIL_H_ #define _RAGEUTIL_H_ + +#include "dxerr8.h" +#pragma comment(lib, "DxErr8.lib") + + //----------------------------------------------------------------------------- // SAFE_ Macros //----------------------------------------------------------------------------- @@ -98,14 +103,11 @@ void SortCStringArray( CStringArray &AddTo, BOOL bSortAcsending = TRUE ); //----------------------------------------------------------------------------- void RageLogStart(); void RageLog( LPCTSTR fmt, ...); +void RageLogHr( HRESULT hr, LPCTSTR fmt, ...); //----------------------------------------------------------------------------- // Error helpers //----------------------------------------------------------------------------- -#include "dxerr8.h" -#pragma comment(lib, "DxErr8.lib") - - VOID DisplayErrorAndDie( CString sError ); diff --git a/stepmania/src/ScreenDimensions.h b/stepmania/src/ScreenDimensions.h index 9bc1d54b65..109c6a3387 100644 --- a/stepmania/src/ScreenDimensions.h +++ b/stepmania/src/ScreenDimensions.h @@ -12,16 +12,16 @@ #define _SCREENDIMENSIONS_H_ -const int SCREEN_WIDTH = 640; -const int SCREEN_HEIGHT = 480; +const int SCREEN_WIDTH = 640; +const int SCREEN_HEIGHT = 480; -const float LEFT_EDGE = 0; -const float RIGHT_EDGE = SCREEN_WIDTH; -const float TOP_EDGE = 0; -const float BOTTOM_EDGE = SCREEN_HEIGHT; +const float SCREEN_LEFT = 0; +const float SCREEN_RIGHT = SCREEN_WIDTH; +const float SCREEN_TOP = 0; +const float SCREEN_BOTTOM = SCREEN_HEIGHT; -const float CENTER_X = LEFT_EDGE + (RIGHT_EDGE - LEFT_EDGE)/2.0f; -const float CENTER_Y = TOP_EDGE + (BOTTOM_EDGE - TOP_EDGE)/2.0f; +const float CENTER_X = SCREEN_LEFT + (SCREEN_RIGHT - SCREEN_LEFT)/2.0f; +const float CENTER_Y = SCREEN_TOP + (SCREEN_BOTTOM - SCREEN_TOP)/2.0f; #endif \ No newline at end of file diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 1e71abb1ba..0c286aadef 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -211,8 +211,6 @@ bool Song::LoadSongInfoFromBMSDir( CString sDir ) // get group name CStringArray sDirectoryParts; split( m_sSongDir, "\\", sDirectoryParts, true ); - for( int p=0; p