diff --git a/src/core/common.h b/src/core/common.h index 21fbe30c..6fc5c6a0 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -367,6 +367,9 @@ void re3_usererror(const char *format, ...); #define DEV(f, ...) re3_debug("[DEV]: " f, ## __VA_ARGS__) #endif +#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) +#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__) + #ifdef __MWERKS__ void debug(char *f, ...); void Error(char *f, ...); @@ -376,7 +379,7 @@ __inline__ void TRACE(char *f, ...) { } // this is re3 only, and so the function #define debug(f, ...) re3_debug("[DBG]: " f, ## __VA_ARGS__) #define Error(f, ...) re3_debug("[ERROR]: " f, ## __VA_ARGS__) #ifndef MASTER -#define TRACE(f, ...) re3_trace(__FILE__, __LINE__, __FUNCTION__, f, ## __VA_ARGS__) +#define TRACE(f, ...) re3_trace(__FILENAME__, __LINE__, __FUNCTION__, f, ## __VA_ARGS__) #define USERERROR(f, ...) re3_usererror(f, ## __VA_ARGS__) #else #define TRACE(f, ...) @@ -385,8 +388,8 @@ __inline__ void TRACE(char *f, ...) { } // this is re3 only, and so the function #endif #undef assert -#ifndef MASTER -#define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) ) +#if !defined(MASTER) || defined(__WIIU__) +#define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILENAME__, __LINE__, __FUNCTION__), 0) ) #else #define assert(_Expression) #endif diff --git a/src/core/config.h b/src/core/config.h index 2d61de22..527c3984 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -156,7 +156,7 @@ enum Config { // This is enabled for all released games except mobile // any debug stuff that is only left in mobile, is not in MASTER -//#define MASTER +#define MASTER // once and for all: // pc: FINAL & MASTER diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 2d04aff9..a6f5fbbc 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -984,7 +984,7 @@ const int re3_buffsize = 1024; static char re3_buff[re3_buffsize]; #endif -#ifndef MASTER +#if !defined(MASTER) || defined(__WIIU__) void re3_assert(const char *expr, const char *filename, unsigned int lineno, const char *func) { #ifdef _WIN32 @@ -1034,7 +1034,10 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con abort(); #elif __WIIU__ WHBLogPrintf("\nRE3 ASSERT FAILED\n\tFile: %s\n\tLine: %d\n\tFunction: %s\n\tExpression: %s\n",filename,lineno,func,expr); - OSFatal("RE3 ASSERT FAILED"); + + char buf[2048]; + sprintf(buf, "RE3 ASSERT FAILED\nFile: %s\nLine: %d\nFunction: %s\nExpression: %s\n",filename,lineno,func,expr); + OSFatal(buf); #else // TODO printf("\nRE3 ASSERT FAILED\n\tFile: %s\n\tLine: %d\n\tFunction: %s\n\tExpression: %s\n",filename,lineno,func,expr);