Files
wagic/JGE/include/DebugRoutines.h
wrenczes@gmail.com eea91e9a1a Two changes here:
1) Consolidated the Loggers so that we only have one in JGE.  Added a helper constructor/destructor to the JLogger class so that you can instantiate one at the top of a function, it'll trace out a 'start' and 'end' message when it goes in & out of scope.
2) Fixed the crash part of a bug I've been chasing down where, on the psp, after saturating the cache, the game dies when trying to reload the background PNG image of the deck menu. We still need to fix the root cause of the failure (not enough memory to allocate a temporary buffer for the swizzle operation), but at least the psp doesn't lock up anymore.  I've also left behind all the log traces I inserted into the LoadPNG code, since we'll probably need them again.
2010-11-10 02:24:39 +00:00

38 lines
839 B
C++

#ifndef DEBUGROUTINES_H
#define DEBUGROUTINES_H
// dirty, but I get OS header includes this way
#include "JGE.h"
#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#if defined (WIN32) || defined (LINUX)
#ifdef _DEBUG
#ifndef QT_CONFIG
#define DebugTrace(inString) \
{ \
std::ostringstream stream; \
stream << inString << std::endl; \
OutputDebugString(stream.str().c_str()); \
}
#else
#define DebugTrace(inString) \
{ \
std::ostringstream stream; \
stream << inString << std::endl; \
qDebug(stream.str().c_str()); \
}
#endif //QT_CONFIG
#endif //#ifdef _DEBUG
#endif // Win32, Linux
#ifndef DebugTrace
#define DebugTrace(inString) (void (0))
#endif
#endif // DEBUGROUTINES_H