summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/common.h2
-rw-r--r--src/core/re3.cpp14
2 files changed, 16 insertions, 0 deletions
diff --git a/src/core/common.h b/src/core/common.h
index 18f4715c..66a3ad81 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -209,6 +209,7 @@ void mysrand(unsigned int seed);
void re3_debug(const char *format, ...);
void re3_trace(const char *filename, unsigned int lineno, const char *func, const char *format, ...);
void re3_assert(const char *expr, const char *filename, unsigned int lineno, const char *func);
+void re3_usererror(const char *format, ...);
#define DEBUGBREAK() __debugbreak();
@@ -216,6 +217,7 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
#define DEV(f, ...) re3_debug("[DEV]: " f, ## __VA_ARGS__)
#define TRACE(f, ...) re3_trace(__FILE__, __LINE__, __FUNCTION__, f, ## __VA_ARGS__)
#define Error(f, ...) re3_debug("[ERROR]: " f, ## __VA_ARGS__)
+#define USERERROR(f, ...) re3_usererror(f, ## __VA_ARGS__)
#define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) )
#define ASSERT assert
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 2a9cbc77..b7eb6480 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -456,6 +456,20 @@ void re3_trace(const char *filename, unsigned int lineno, const char *func, cons
OutputDebugStringA(buff);
}
+void re3_usererror(const char *format, ...)
+{
+ va_list va;
+ va_start(va, format);
+ vsprintf_s(re3_buff, re3_buffsize, format, va);
+ va_end(va);
+
+ ::MessageBoxA(nil, re3_buff, "RE3 Error!",
+ MB_OK|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL);
+
+ raise(SIGABRT);
+ _exit(3);
+}
+
#ifdef VALIDATE_SAVE_SIZE
int32 _saveBufCount;
#endif