From fddcc849b2dd0959dca67a82245bde45f7ef748d Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 9 Dec 2002 22:25:57 +0000 Subject: [PATCH] remove HRESULT log and exception ctors; use hr_ssprintf instead --- stepmania/src/RageException.cpp | 12 ------------ stepmania/src/RageException.h | 1 - stepmania/src/RageLog.cpp | 23 +++-------------------- stepmania/src/RageLog.h | 1 - 4 files changed, 3 insertions(+), 34 deletions(-) diff --git a/stepmania/src/RageException.cpp b/stepmania/src/RageException.cpp index bb1c2aa440..a773e48b3b 100644 --- a/stepmania/src/RageException.cpp +++ b/stepmania/src/RageException.cpp @@ -28,18 +28,6 @@ RageException::RageException( const char *fmt, ...) #endif } -RageException::RageException( HRESULT hr, const char *fmt, ...) -{ - va_list va; - va_start(va, fmt); - m_sError = vssprintf( fmt, va ); - m_sError += ssprintf( "(%s)", DXGetErrorString8(hr) ); -#ifdef _DEBUG - MessageBox( NULL, m_sError, "Fatal Error", MB_OK ); - DebugBreak(); -#endif -} - const char* RageException::what() const throw () { return m_sError; diff --git a/stepmania/src/RageException.h b/stepmania/src/RageException.h index 42fd693206..b7ff52e064 100644 --- a/stepmania/src/RageException.h +++ b/stepmania/src/RageException.h @@ -17,7 +17,6 @@ class RageException : public exception { public: RageException( const char *fmt, ...); - RageException( HRESULT hr, const char *fmt, ...); virtual const char *what() const throw(); virtual ~RageException() throw() { } diff --git a/stepmania/src/RageLog.cpp b/stepmania/src/RageLog.cpp index e0203cc951..fc9741d36e 100644 --- a/stepmania/src/RageLog.cpp +++ b/stepmania/src/RageLog.cpp @@ -14,25 +14,19 @@ #include "RageUtil.h" #include -//#include "crash.h" - -#include "dxerr8.h" -#pragma comment(lib, "DxErr8.lib") - +#include "crash.h" RageLog* LOG; // global and accessable from anywhere in the program - // constants #define LOG_FILE_NAME "log.txt" - RageLog::RageLog() { // delete old log files DeleteFile( LOG_FILE_NAME ); - // Open log file and leave it open. Let the OS close it when the app exits + // Open log file and leave it open. m_fileLog = fopen( LOG_FILE_NAME, "w" ); SYSTEMTIME st; @@ -76,24 +70,13 @@ void RageLog::Trace( const char *fmt, ...) fprintf( m_fileLog, "%s\n", sBuff.GetString() ); printf( "%s\n", sBuff.GetString() ); -// CrashLog(sBuff); + CrashLog(sBuff); #ifdef DEBUG this->Flush(); // implicit flush #endif } -void RageLog::Trace( HRESULT hr, const char *fmt, ...) -{ - va_list va; - va_start(va, fmt); - CString s = vssprintf( fmt, va ); - va_end(va); - - s += ssprintf( "(%s)", DXGetErrorString8(hr) ); - this->Trace( "%s", s.GetString() ); -} - void RageLog::Warn( const char *fmt, ...) { va_list va; diff --git a/stepmania/src/RageLog.h b/stepmania/src/RageLog.h index c19cb25923..032043b776 100644 --- a/stepmania/src/RageLog.h +++ b/stepmania/src/RageLog.h @@ -21,7 +21,6 @@ public: ~RageLog(); void Trace( const char *fmt, ...); - void Trace( HRESULT hr, const char *fmt, ...); void Warn( const char *fmt, ...); void Flush();