remove HRESULT log and exception ctors; use hr_ssprintf instead
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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() { }
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user