ShowLogWindow -> ShowLogOutput, now also affects stdout output

in *nix
(unimplemented, possibly temporary TexturePreload tags along to avoid
more recompiling ...)
This commit is contained in:
Glenn Maynard
2003-10-19 07:30:06 +00:00
parent 66926c478c
commit cfbd136989
5 changed files with 29 additions and 22 deletions
+7 -4
View File
@@ -77,6 +77,7 @@ PrefsManager::PrefsManager()
m_bArcadeOptionsNavigation = false; m_bArcadeOptionsNavigation = false;
m_bSoloSingle = false; m_bSoloSingle = false;
m_bDelayedTextureDelete = true; m_bDelayedTextureDelete = true;
m_bTexturePreload = false;
m_bDelayedScreenLoad = false; m_bDelayedScreenLoad = false;
m_bBannerCache = true; m_bBannerCache = true;
m_MusicWheelUsesSections = ALWAYS; m_MusicWheelUsesSections = ALWAYS;
@@ -108,9 +109,9 @@ PrefsManager::PrefsManager()
m_iEndlessNumStagesUntilBreak = 5; m_iEndlessNumStagesUntilBreak = 5;
m_iEndlessBreakLength = 5; m_iEndlessBreakLength = 5;
#ifdef DEBUG #ifdef DEBUG
m_bShowLogWindow = true; m_bShowLogOutput = true;
#else #else
m_bShowLogWindow = false; m_bShowLogOutput = false;
#endif #endif
m_bTenFooterInRed = true; m_bTenFooterInRed = true;
@@ -240,6 +241,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk()
ini.GetValue( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation ); ini.GetValue( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation );
ini.GetValue( "Options", "DWIPath", m_DWIPath ); ini.GetValue( "Options", "DWIPath", m_DWIPath );
ini.GetValue( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete ); ini.GetValue( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete );
ini.GetValue( "Options", "TexturePreload", m_bTexturePreload );
ini.GetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad ); ini.GetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad );
ini.GetValue( "Options", "BannerCache", m_bBannerCache ); ini.GetValue( "Options", "BannerCache", m_bBannerCache );
ini.GetValue( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections ); ini.GetValue( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections );
@@ -298,7 +300,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk()
ini.GetValue( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds ); ini.GetValue( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
ini.GetValue( "Options", "ForceLogFlush", m_bForceLogFlush ); ini.GetValue( "Options", "ForceLogFlush", m_bForceLogFlush );
ini.GetValue( "Options", "Logging", m_bLogging ); ini.GetValue( "Options", "Logging", m_bLogging );
ini.GetValue( "Options", "ShowLogWindow", m_bShowLogWindow ); ini.GetValue( "Options", "ShowLogOutput", m_bShowLogOutput );
ini.GetValue( "Options", "ShowBeginnerHelper", m_bShowBeginnerHelper ); ini.GetValue( "Options", "ShowBeginnerHelper", m_bShowBeginnerHelper );
ini.GetValue( "Options", "Language", m_sLanguage ); ini.GetValue( "Options", "Language", m_sLanguage );
ini.GetValue( "Options", "EndlessBreakEnabled", m_bEndlessBreakEnabled ); ini.GetValue( "Options", "EndlessBreakEnabled", m_bEndlessBreakEnabled );
@@ -374,6 +376,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
ini.SetValue( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation ); ini.SetValue( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation );
ini.SetValue( "Options", "DWIPath", m_DWIPath ); ini.SetValue( "Options", "DWIPath", m_DWIPath );
ini.SetValue( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete ); ini.SetValue( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete );
ini.SetValue( "Options", "TexturePreload", m_bTexturePreload );
ini.SetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad ); ini.SetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad );
ini.SetValue( "Options", "BannerCache", m_bBannerCache ); ini.SetValue( "Options", "BannerCache", m_bBannerCache );
ini.SetValue( "Options", "MusicWheelUsesSections", m_MusicWheelUsesSections ); ini.SetValue( "Options", "MusicWheelUsesSections", m_MusicWheelUsesSections );
@@ -417,7 +420,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
ini.SetValue( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds ); ini.SetValue( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
ini.SetValue( "Options", "ForceLogFlush", m_bForceLogFlush ); ini.SetValue( "Options", "ForceLogFlush", m_bForceLogFlush );
ini.SetValue( "Options", "Logging", m_bLogging ); ini.SetValue( "Options", "Logging", m_bLogging );
ini.SetValue( "Options", "ShowLogWindow", m_bShowLogWindow ); ini.SetValue( "Options", "ShowLogOutput", m_bShowLogOutput );
ini.SetValue( "Options", "TenFooterInRed", m_bTenFooterInRed ); ini.SetValue( "Options", "TenFooterInRed", m_bTenFooterInRed );
ini.SetValue( "Options", "CourseSortOrder", m_iCourseSortOrder ); ini.SetValue( "Options", "CourseSortOrder", m_iCourseSortOrder );
+2 -1
View File
@@ -39,6 +39,7 @@ public:
bool m_bPAL; bool m_bPAL;
#endif #endif
bool m_bDelayedTextureDelete; bool m_bDelayedTextureDelete;
bool m_bTexturePreload;
bool m_bDelayedScreenLoad; bool m_bDelayedScreenLoad;
bool m_bBannerCache; bool m_bBannerCache;
@@ -94,7 +95,7 @@ public:
float m_fGlobalOffsetSeconds; float m_fGlobalOffsetSeconds;
bool m_bForceLogFlush; bool m_bForceLogFlush;
bool m_bLogging; bool m_bLogging;
bool m_bShowLogWindow; bool m_bShowLogOutput;
bool m_bTenFooterInRed; bool m_bTenFooterInRed;
int m_iProgressiveLifebar; int m_iProgressiveLifebar;
int m_iProgressiveStageLifebar; int m_iProgressiveStageLifebar;
+12 -8
View File
@@ -131,7 +131,7 @@ RageLog::~RageLog()
this->Info( "%s", GetAdditionalLog() ); this->Info( "%s", GetAdditionalLog() );
Flush(); Flush();
HideConsole(); ShowLogOutput( false );
if(m_fileLog) fclose( m_fileLog ); if(m_fileLog) fclose( m_fileLog );
if(m_fileInfo) fclose( m_fileInfo ); if(m_fileInfo) fclose( m_fileInfo );
} }
@@ -151,20 +151,23 @@ void RageLog::SetTimestamping( bool b )
m_bTimestamping = b; m_bTimestamping = b;
} }
void RageLog::ShowConsole() /* Enable or disable display of output to stdout, or a console window in Windows. */
void RageLog::ShowLogOutput( bool show )
{ {
m_bShowLogOutput = show;
#if defined(WIN32) && !defined(_XBOX) #if defined(WIN32) && !defined(_XBOX)
if( m_bShowLogOutput )
{
// create a new console window and attach standard handles // create a new console window and attach standard handles
AllocConsole(); AllocConsole();
freopen("CONOUT$","wb",stdout); freopen("CONOUT$","wb",stdout);
freopen("CONOUT$","wb",stderr); freopen("CONOUT$","wb",stderr);
#endif }
} else
{
void RageLog::HideConsole()
{
#if defined(WIN32) && !defined(_XBOX)
FreeConsole(); FreeConsole();
}
#endif #endif
} }
@@ -239,6 +242,7 @@ void RageLog::Write( int where, CString str)
if( m_fileLog ) if( m_fileLog )
fprintf(m_fileLog, "%s\n", str.c_str() ); fprintf(m_fileLog, "%s\n", str.c_str() );
if( m_bShowLogOutput || where != 0 )
printf("%s\n", str.c_str() ); printf("%s\n", str.c_str() );
if( m_bFlush || (where & WRITE_TO_INFO) ) if( m_bFlush || (where & WRITE_TO_INFO) )
+2 -2
View File
@@ -23,8 +23,7 @@ public:
void Info( const char *fmt, ...) PRINTF(2,3); void Info( const char *fmt, ...) PRINTF(2,3);
void Flush(); void Flush();
void ShowConsole(); void ShowLogOutput( bool show );
void HideConsole();
void MapLog(const CString &key, const char *fmt, ...) PRINTF(3,4); void MapLog(const CString &key, const char *fmt, ...) PRINTF(3,4);
void UnmapLog(const CString &key); void UnmapLog(const CString &key);
@@ -42,6 +41,7 @@ private:
bool m_bEnabled; bool m_bEnabled;
bool m_bFlush; bool m_bFlush;
bool m_bTimestamping; bool m_bTimestamping;
bool m_bShowLogOutput;
FILE *m_fileLog, *m_fileInfo; FILE *m_fileLog, *m_fileInfo;
void Write( int, CString ); void Write( int, CString );
void UpdateMappedLog(); void UpdateMappedLog();
+1 -2
View File
@@ -781,8 +781,7 @@ int main(int argc, char* argv[])
GAMESTATE = new GameState; GAMESTATE = new GameState;
PREFSMAN = new PrefsManager; PREFSMAN = new PrefsManager;
if( PREFSMAN->m_bShowLogWindow ) LOG->ShowLogOutput( PREFSMAN->m_bShowLogOutput );
LOG->ShowConsole();
CheckSDLVersion( 1,2,6 ); CheckSDLVersion( 1,2,6 );