- proper names for the global includes
[genesis3d.git] / include / BaseType.h
diff --git a/include/BaseType.h b/include/BaseType.h
new file mode 100644 (file)
index 0000000..d219f53
--- /dev/null
@@ -0,0 +1,85 @@
+/****************************************************************************************/\r
+/*  BASETYPE.H                                                                          */\r
+/*                                                                                      */\r
+/*  Author:                                                                             */\r
+/*  Description: Basic type definitions and calling convention defines                  */\r
+/*                                                                                      */\r
+/*  The contents of this file are subject to the Genesis3D Public License               */\r
+/*  Version 1.01 (the "License"); you may not use this file except in                   */\r
+/*  compliance with the License. You may obtain a copy of the License at                */\r
+/*  http://www.genesis3d.com                                                            */\r
+/*                                                                                      */\r
+/*  Software distributed under the License is distributed on an "AS IS"                 */\r
+/*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See                */\r
+/*  the License for the specific language governing rights and limitations              */\r
+/*  under the License.                                                                  */\r
+/*                                                                                      */\r
+/*  The Original Code is Genesis3D, released March 25, 1999.                            */\r
+/*  Genesis3D Version 1.1 released November 15, 1999                                 */\r
+/*  Copyright (C) 1999 WildTangent, Inc. All Rights Reserved           */\r
+/*                                                                                      */\r
+/****************************************************************************************/\r
+#ifndef GE_BASETYPE_H\r
+#define GE_BASETYPE_H\r
\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/******** The Genesis Calling Conventions ***********/ \r
+\r
+#define        GENESISCC       _fastcall\r
+\r
+#if    defined(BUILDGENESIS) && defined(GENESISDLLVERSION)\r
+  #define GENESISAPI   _declspec(dllexport)\r
+#else\r
+  #if  defined(GENESISDLLVERSION)\r
+    #define GENESISAPI _declspec(dllimport)\r
+  #else\r
+    #define GENESISAPI\r
+  #endif\r
+#endif\r
+\r
+/******** The Basic Types ****************************/\r
+\r
+typedef signed int geBoolean;\r
+#define GE_FALSE       (0)\r
+#define GE_TRUE                (1)\r
+\r
+typedef float geFloat;\r
+typedef double geDouble;\r
+\r
+#ifndef NULL\r
+/* #define NULL        ((void *)0) */\r
+#define NULL 0\r
+#endif\r
+\r
+typedef signed long     int32;\r
+typedef signed short    int16;\r
+typedef signed char     int8 ;\r
+typedef unsigned long  uint32;\r
+typedef unsigned short uint16;\r
+typedef unsigned char  uint8 ;\r
+\r
+/******** Macros on Genesis basic types *************/\r
+\r
+#define GE_ABS(x)                              ( (x) < 0 ? (-(x)) : (x) )\r
+#define GE_CLAMP(x,lo,hi)              ( (x) < (lo) ? (lo) : ( (x) > (hi) ? (hi) : (x) ) )\r
+#define GE_CLAMP8(x)                   GE_CLAMP(x,0,255)\r
+#define GE_CLAMP16(x)                  GE_CLAMP(x,0,65536)\r
+#define GE_BOOLSAME(x,y)               ( ( (x) && (y) ) || ( !(x) && !(y) ) )\r
+\r
+#define GE_EPSILON                             ((geFloat)0.000797f)\r
+#define GE_FLOATS_EQUAL(x,y)   ( GE_ABS((x) - (y)) < GE_EPSILON )\r
+#define GE_FLOAT_ISZERO(x)             GE_FLOATS_EQUAL(x,0.0f)\r
+\r
+#define        GE_PI                                   ((geFloat)3.14159265358979323846f)\r
+\r
+/****************************************************/\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif\r
\r