summaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
authorFire-Head <Fire-Head@users.noreply.github.com>2019-05-29 20:02:58 +0200
committerFire-Head <Fire-Head@users.noreply.github.com>2019-05-29 20:02:58 +0200
commit197767d1c83f8d940698cd200785e91fbc2ccc98 (patch)
treec1ee0bb77ae0dbef844cf45eb9d2ffb00b08895f /src/common.h
parentParticle, ParticleMgr done (diff)
downloadre3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar
re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.gz
re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.bz2
re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.lz
re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.xz
re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.zst
re3-197767d1c83f8d940698cd200785e91fbc2ccc98.zip
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index a96030e4..e8e3cf69 100644
--- a/src/common.h
+++ b/src/common.h
@@ -39,6 +39,9 @@ typedef double Double;
typedef Int8 Bool; //typedef bool Bool;
typedef char Char;
+typedef __int64 Int64;
+typedef unsigned __int64 UInt64;
+typedef signed __int64 SInt64;
#define nil NULL
@@ -144,12 +147,25 @@ 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
+#define MY_RAND_MAX 32767
+#else
+#define MY_RAND_MAX 65535
+#endif
+
int myrand(void);
void mysrand(unsigned int seed);
#define debug printf
#define ASSERT assert
+#define _TODO(x)
+#define _TODOCONST(x) (x)
+
+#define VALIDATE_SIZE(struc, size) static_assert(sizeof(struc) == size, "Invalid structure size of " #struc)
+#define VALIDATE_OFFSET(struc, member, offset) static_assert(offsetof(struc, member) == offset, "The offset of " #member " in " #struc " is not " #offset "...")
+
#define clamp(v, a, b) (max(min(v, b), a))
//#define min(a, b) ((a) < (b) ? (a) : (b))
//#define max(a, b) ((a) > (b) ? (a) : (b))