remove HRESULT log and exception ctors; use hr_ssprintf instead

This commit is contained in:
Glenn Maynard
2002-12-09 22:25:57 +00:00
parent bee3937d59
commit fddcc849b2
4 changed files with 3 additions and 34 deletions
-12
View File
@@ -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;
-1
View File
@@ -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() { }
+3 -20
View File
@@ -14,25 +14,19 @@
#include "RageUtil.h"
#include <fstream>
//#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;
-1
View File
@@ -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();