From 81c4f0b9e9a40b568d46b314eb7c2ea157fa7872 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 2 Oct 2003 03:11:35 +0000 Subject: [PATCH] reduce RageLog prefsman use --- stepmania/src/RageLog.cpp | 8 +++++++- stepmania/src/RageLog.h | 2 ++ stepmania/src/StepMania.cpp | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/stepmania/src/RageLog.cpp b/stepmania/src/RageLog.cpp index 593e4763e8..5fb7f4611a 100644 --- a/stepmania/src/RageLog.cpp +++ b/stepmania/src/RageLog.cpp @@ -86,6 +86,7 @@ enum { RageLog::RageLog() { m_bEnabled = true; + m_bFlush = false; // delete old log files remove( LOG_PATH ); @@ -140,6 +141,11 @@ void RageLog::SetLogging( bool b ) m_bEnabled = b; } +void RageLog::SetFlushing( bool b ) +{ + m_bFlush = b; +} + void RageLog::ShowConsole() { #if defined(WIN32) && !defined(_XBOX) @@ -230,7 +236,7 @@ void RageLog::Write( int where, CString str) printf("%s\n", str.c_str() ); - if( (PREFSMAN && PREFSMAN->m_bForceLogFlush) || (where & WRITE_TO_INFO) ) + if( m_bFlush || (where & WRITE_TO_INFO) ) Flush(); } diff --git a/stepmania/src/RageLog.h b/stepmania/src/RageLog.h index ce7d1d88b3..777e705672 100644 --- a/stepmania/src/RageLog.h +++ b/stepmania/src/RageLog.h @@ -35,9 +35,11 @@ public: static const char *GetRecentLog( int n ); void SetLogging( bool b ); // enable or disable logging + void SetFlushing( bool b ); // enable or disable flushing private: bool m_bEnabled; + bool m_bFlush; FILE *m_fileLog, *m_fileInfo; void Write( int, CString ); void UpdateMappedLog(); diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 665c4d2974..307e1e9b4a 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -636,6 +636,7 @@ int main(int argc, char* argv[]) HOOKS->DumpDebugInfo(); LOG->SetLogging( PREFSMAN->m_bLogging ); + LOG->SetFlushing( PREFSMAN->m_bForceLogFlush ); CheckSettings();