summaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2019-06-03 16:08:24 +0200
committerGitHub <noreply@github.com>2019-06-03 16:08:24 +0200
commit8ec8c0c5db0fe999d378a074e8d3e7682d2a32eb (patch)
tree1efa74ceaa2134691a803bcad370b848b6edac67 /src/common.h
parentadded CPhysical flags from Nick (diff)
parentadded NO_MOVIES (diff)
downloadre3-8ec8c0c5db0fe999d378a074e8d3e7682d2a32eb.tar
re3-8ec8c0c5db0fe999d378a074e8d3e7682d2a32eb.tar.gz
re3-8ec8c0c5db0fe999d378a074e8d3e7682d2a32eb.tar.bz2
re3-8ec8c0c5db0fe999d378a074e8d3e7682d2a32eb.tar.lz
re3-8ec8c0c5db0fe999d378a074e8d3e7682d2a32eb.tar.xz
re3-8ec8c0c5db0fe999d378a074e8d3e7682d2a32eb.tar.zst
re3-8ec8c0c5db0fe999d378a074e8d3e7682d2a32eb.zip
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/common.h b/src/common.h
index 9acf7638..4844353b 100644
--- a/src/common.h
+++ b/src/common.h
@@ -10,7 +10,7 @@
#include <stdint.h>
#include <math.h>
-#include <assert.h>
+//#include <assert.h>
#include <new>
#ifdef WITHD3D
@@ -125,7 +125,7 @@ inline float sq(float x) { return x*x; }
#define DEGTORAD(x) ((x) * PI / 180.0f)
#define RADTODEG(x) ((x) * 180.0f / PI)
-#if USE_PS2_RAND == TRUE
+#ifdef USE_PS2_RAND
#define MYRAND_MAX 65535
#else
#define MYRAND_MAX 32767
@@ -134,8 +134,15 @@ inline float sq(float x) { return x*x; }
int myrand(void);
void mysrand(unsigned int seed);
-#define debug(f, ...) printf("[DBG]: " f "\n", __VA_ARGS__)
-#define DEV(f, ...) printf("[DEV]: " f "", __VA_ARGS__)
+void re3_debug(char *format, ...);
+void re3_trace(const char *filename, unsigned int lineno, const char *func, char *format, ...);
+void re3_assert(const char *expr, const char *filename, unsigned int lineno, const char *func);
+
+#define debug(f, ...) re3_debug("[DBG]: " f, __VA_ARGS__)
+#define DEV(f, ...) re3_debug("[DEV]: " f, __VA_ARGS__)
+#define TRACE(f, ...) re3_trace(__FILE__, __LINE__, __FUNCTION__, f, __VA_ARGS__)
+
+#define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) )
#define ASSERT assert
#define _TODO(x)