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_bSoloSingle = false;
m_bDelayedTextureDelete = true;
m_bTexturePreload = false;
m_bDelayedScreenLoad = false;
m_bBannerCache = true;
m_MusicWheelUsesSections = ALWAYS;
@@ -108,9 +109,9 @@ PrefsManager::PrefsManager()
m_iEndlessNumStagesUntilBreak = 5;
m_iEndlessBreakLength = 5;
#ifdef DEBUG
m_bShowLogWindow = true;
m_bShowLogOutput = true;
#else
m_bShowLogWindow = false;
m_bShowLogOutput = false;
#endif
m_bTenFooterInRed = true;
@@ -240,6 +241,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk()
ini.GetValue( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation );
ini.GetValue( "Options", "DWIPath", m_DWIPath );
ini.GetValue( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete );
ini.GetValue( "Options", "TexturePreload", m_bTexturePreload );
ini.GetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad );
ini.GetValue( "Options", "BannerCache", m_bBannerCache );
ini.GetValue( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections );
@@ -298,7 +300,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk()
ini.GetValue( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
ini.GetValue( "Options", "ForceLogFlush", m_bForceLogFlush );
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", "Language", m_sLanguage );
ini.GetValue( "Options", "EndlessBreakEnabled", m_bEndlessBreakEnabled );
@@ -374,6 +376,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
ini.SetValue( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation );
ini.SetValue( "Options", "DWIPath", m_DWIPath );
ini.SetValue( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete );
ini.SetValue( "Options", "TexturePreload", m_bTexturePreload );
ini.SetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad );
ini.SetValue( "Options", "BannerCache", m_bBannerCache );
ini.SetValue( "Options", "MusicWheelUsesSections", m_MusicWheelUsesSections );
@@ -417,7 +420,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
ini.SetValue( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
ini.SetValue( "Options", "ForceLogFlush", m_bForceLogFlush );
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", "CourseSortOrder", m_iCourseSortOrder );
+2 -1
View File
@@ -39,6 +39,7 @@ public:
bool m_bPAL;
#endif
bool m_bDelayedTextureDelete;
bool m_bTexturePreload;
bool m_bDelayedScreenLoad;
bool m_bBannerCache;
@@ -94,7 +95,7 @@ public:
float m_fGlobalOffsetSeconds;
bool m_bForceLogFlush;
bool m_bLogging;
bool m_bShowLogWindow;
bool m_bShowLogOutput;
bool m_bTenFooterInRed;
int m_iProgressiveLifebar;
int m_iProgressiveStageLifebar;
+17 -13
View File
@@ -131,7 +131,7 @@ RageLog::~RageLog()
this->Info( "%s", GetAdditionalLog() );
Flush();
HideConsole();
ShowLogOutput( false );
if(m_fileLog) fclose( m_fileLog );
if(m_fileInfo) fclose( m_fileInfo );
}
@@ -151,20 +151,23 @@ void RageLog::SetTimestamping( bool 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 )
{
#if defined(WIN32) && !defined(_XBOX)
// create a new console window and attach standard handles
AllocConsole();
freopen("CONOUT$","wb",stdout);
freopen("CONOUT$","wb",stderr);
#endif
}
m_bShowLogOutput = show;
void RageLog::HideConsole()
{
#if defined(WIN32) && !defined(_XBOX)
FreeConsole();
if( m_bShowLogOutput )
{
// create a new console window and attach standard handles
AllocConsole();
freopen("CONOUT$","wb",stdout);
freopen("CONOUT$","wb",stderr);
}
else
{
FreeConsole();
}
#endif
}
@@ -239,7 +242,8 @@ void RageLog::Write( int where, CString str)
if( m_fileLog )
fprintf(m_fileLog, "%s\n", str.c_str() );
printf("%s\n", str.c_str() );
if( m_bShowLogOutput || where != 0 )
printf("%s\n", str.c_str() );
if( m_bFlush || (where & WRITE_TO_INFO) )
Flush();
+2 -2
View File
@@ -23,8 +23,7 @@ public:
void Info( const char *fmt, ...) PRINTF(2,3);
void Flush();
void ShowConsole();
void HideConsole();
void ShowLogOutput( bool show );
void MapLog(const CString &key, const char *fmt, ...) PRINTF(3,4);
void UnmapLog(const CString &key);
@@ -42,6 +41,7 @@ private:
bool m_bEnabled;
bool m_bFlush;
bool m_bTimestamping;
bool m_bShowLogOutput;
FILE *m_fileLog, *m_fileInfo;
void Write( int, CString );
void UpdateMappedLog();
+1 -2
View File
@@ -781,8 +781,7 @@ int main(int argc, char* argv[])
GAMESTATE = new GameState;
PREFSMAN = new PrefsManager;
if( PREFSMAN->m_bShowLogWindow )
LOG->ShowConsole();
LOG->ShowLogOutput( PREFSMAN->m_bShowLogOutput );
CheckSDLVersion( 1,2,6 );