|
|
@@ -24,190 +24,128 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
OTHER DEALINGS IN THE SOFTWARE.
|
|
|
*/
|
|
|
|
|
|
-// Adapted from Branimir Karadžić's platform.h (https://github.com/bkaradzic/bx)
|
|
|
+// Adapted from Branimir Karadžić's config.h (https://github.com/bkaradzic/bx)
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
-#define CROWN_VERSION_MAJOR "0"
|
|
|
-#define CROWN_VERSION_MINOR "1"
|
|
|
-#define CROWN_VERSION_MICRO "13"
|
|
|
-
|
|
|
-#define CROWN_COMPILER_CLANG 0
|
|
|
-#define CROWN_COMPILER_GCC 0
|
|
|
-#define CROWN_COMPILER_MSVC 0
|
|
|
-
|
|
|
-#define CROWN_PLATFORM_ANDROID 0
|
|
|
-#define CROWN_PLATFORM_IOS 0
|
|
|
-#define CROWN_PLATFORM_LINUX 0
|
|
|
-#define CROWN_PLATFORM_OSX 0
|
|
|
-#define CROWN_PLATFORM_WINDOWS 0
|
|
|
-
|
|
|
-#define CROWN_CPU_ARM 0
|
|
|
-#define CROWN_CPU_JIT 0
|
|
|
-#define CROWN_CPU_MIPS 0
|
|
|
-#define CROWN_CPU_PPC 0
|
|
|
-#define CROWN_CPU_X86 0
|
|
|
-
|
|
|
-#define CROWN_ARCH_32BIT 0
|
|
|
-#define CROWN_ARCH_64BIT 0
|
|
|
-
|
|
|
-#define CROWN_CPU_ENDIAN_BIG 0
|
|
|
-#define CROWN_CPU_ENDIAN_LITTLE 0
|
|
|
-
|
|
|
-// http://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers
|
|
|
-#if defined(_MSC_VER)
|
|
|
- #undef CROWN_COMPILER_MSVC
|
|
|
- #define CROWN_COMPILER_MSVC 1
|
|
|
-#elif defined(__clang__)
|
|
|
- // clang defines __GNUC__
|
|
|
- #undef CROWN_COMPILER_CLANG
|
|
|
- #define CROWN_COMPILER_CLANG 1
|
|
|
-#elif defined(__GNUC__)
|
|
|
- #undef CROWN_COMPILER_GCC
|
|
|
- #define CROWN_COMPILER_GCC 1
|
|
|
-#else
|
|
|
- #error "CROWN_COMPILER_* is not defined!"
|
|
|
-#endif
|
|
|
-
|
|
|
-// http://sourceforge.net/apps/mediawiki/predef/index.php?title=Operating_Systems
|
|
|
-#if defined(_WIN32) || defined(_WIN64)
|
|
|
- #undef CROWN_PLATFORM_WINDOWS
|
|
|
-// http://msdn.microsoft.com/en-us/library/6sehtctf.aspx
|
|
|
- #if !defined(WINVER) && !defined(_WIN32_WINNT)
|
|
|
-// Windows Server 2003 with SP1, Windows XP with SP2 and above
|
|
|
- #define WINVER 0x0502
|
|
|
- #define _WIN32_WINNT 0x0502
|
|
|
- #endif // !defined(WINVER) && !defined(_WIN32_WINNT)
|
|
|
- #define CROWN_PLATFORM_WINDOWS 1
|
|
|
-#elif defined(__ANDROID__)
|
|
|
-// Android compiler defines __linux__
|
|
|
- #undef CROWN_PLATFORM_ANDROID
|
|
|
- #define CROWN_PLATFORM_ANDROID 1
|
|
|
-#elif defined(__linux__)
|
|
|
- #undef CROWN_PLATFORM_LINUX
|
|
|
- #define CROWN_PLATFORM_LINUX 1
|
|
|
-#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
|
|
|
- #undef CROWN_PLATFORM_IOS
|
|
|
- #define CROWN_PLATFORM_IOS 1
|
|
|
-#elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
|
|
|
- #undef CROWN_PLATFORM_OSX
|
|
|
- #define CROWN_PLATFORM_OSX 1
|
|
|
-#else
|
|
|
-# error "CROWN_PLATFORM_* is not defined!"
|
|
|
-#endif
|
|
|
-
|
|
|
-#define CROWN_PLATFORM_POSIX (CROWN_PLATFORM_ANDROID \
|
|
|
- || CROWN_PLATFORM_IOS \
|
|
|
- || CROWN_PLATFORM_LINUX \
|
|
|
- || CROWN_PLATFORM_OSX)
|
|
|
-
|
|
|
-// http://sourceforge.net/apps/mediawiki/predef/index.php?title=Architectures
|
|
|
-#if defined(__arm__)
|
|
|
- #undef CROWN_CPU_ARM
|
|
|
- #define CROWN_CPU_ARM 1
|
|
|
- #define CROWN_CACHE_LINE_SIZE 64
|
|
|
-#elif defined(__MIPSEL__) || defined(__mips_isa_rev) // defined(mips)
|
|
|
- #undef CROWN_CPU_MIPS
|
|
|
- #define CROWN_CPU_MIPS 1
|
|
|
- #define CROWN_CACHE_LINE_SIZE 64
|
|
|
-#elif defined(_M_PPC) || defined(__powerpc__) || defined(__powerpc64__)
|
|
|
- #undef CROWN_CPU_PPC
|
|
|
- #define CROWN_CPU_PPC 1
|
|
|
- #define CROWN_CACHE_LINE_SIZE 128
|
|
|
-#elif defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__x86_64__)
|
|
|
- #undef CROWN_CPU_X86
|
|
|
- #define CROWN_CPU_X86 1
|
|
|
- #define CROWN_CACHE_LINE_SIZE 64
|
|
|
-#else // PNaCl doesn't have CPU defined.
|
|
|
- #undef CROWN_CPU_JIT
|
|
|
- #define CROWN_CPU_JIT 1
|
|
|
- #define CROWN_CACHE_LINE_SIZE 64
|
|
|
-#endif //
|
|
|
-
|
|
|
-#if defined(__x86_64__) || defined(_M_X64) || defined(__64BIT__) || defined(__powerpc64__) || defined(__ppc64__)
|
|
|
- #undef CROWN_ARCH_64BIT
|
|
|
- #define CROWN_ARCH_64BIT 64
|
|
|
-#else
|
|
|
- #undef CROWN_ARCH_32BIT
|
|
|
- #define CROWN_ARCH_32BIT 32
|
|
|
-#endif //
|
|
|
-
|
|
|
-#if CROWN_CPU_PPC
|
|
|
- #undef CROWN_CPU_ENDIAN_BIG
|
|
|
- #define CROWN_CPU_ENDIAN_BIG 1
|
|
|
-#else
|
|
|
- #undef CROWN_CPU_ENDIAN_LITTLE
|
|
|
- #define CROWN_CPU_ENDIAN_LITTLE 1
|
|
|
-#endif
|
|
|
-
|
|
|
-#if CROWN_COMPILER_GCC
|
|
|
- #define CROWN_COMPILER_NAME "GCC"
|
|
|
-#elif CROWN_COMPILER_MSVC
|
|
|
- #define CROWN_COMPILER_NAME "MSVC"
|
|
|
-#endif
|
|
|
-
|
|
|
-#if CROWN_PLATFORM_ANDROID
|
|
|
- #define CROWN_PLATFORM_NAME "Android"
|
|
|
-#elif CROWN_PLATFORM_IOS
|
|
|
- #define CROWN_PLATFORM_NAME "iOS"
|
|
|
-#elif CROWN_PLATFORM_LINUX
|
|
|
- #define CROWN_PLATFORM_NAME "Linux"
|
|
|
-#elif CROWN_PLATFORM_OSX
|
|
|
- #define CROWN_PLATFORM_NAME "OSX"
|
|
|
-#elif CROWN_PLATFORM_WINDOWS
|
|
|
- #define CROWN_PLATFORM_NAME "Windows"
|
|
|
-#endif // CROWN_PLATFORM_
|
|
|
-
|
|
|
-#if CROWN_CPU_ARM
|
|
|
- #define CROWN_CPU_NAME "ARM"
|
|
|
-#elif CROWN_CPU_MIPS
|
|
|
- #define CROWN_CPU_NAME "MIPS"
|
|
|
-#elif CROWN_CPU_PPC
|
|
|
- #define CROWN_CPU_NAME "PowerPC"
|
|
|
-#elif CROWN_CPU_JIT
|
|
|
- #define CROWN_CPU_NAME "JIT-VM"
|
|
|
-#elif CROWN_CPU_X86
|
|
|
- #define CROWN_CPU_NAME "x86"
|
|
|
-#endif // CROWN_CPU_
|
|
|
-
|
|
|
-#if CROWN_ARCH_32BIT
|
|
|
- #define CROWN_ARCH_NAME "32-bit"
|
|
|
-#elif CROWN_ARCH_64BIT
|
|
|
- #define CROWN_ARCH_NAME "64-bit"
|
|
|
-#endif // CROWN_ARCH_
|
|
|
-
|
|
|
-#define CE_PIXELS_PER_METER 32
|
|
|
-
|
|
|
-#define CE_MAX_WORLDS 1024
|
|
|
-#define CE_MAX_UNITS 65000 // Per world
|
|
|
-#define CE_MAX_CAMERAS 16 // Per world
|
|
|
-#define CE_MAX_ACTORS 1024 // Per world
|
|
|
-#define CE_MAX_CONTROLLERS 16 // Per world
|
|
|
-#define CE_MAX_TRIGGERS 1024 // Per world
|
|
|
-#define CE_MAX_JOINTS 512 // Per world
|
|
|
-#define CE_MAX_SOUND_INSTANCES 64 // Per world
|
|
|
-#define CE_MAX_RAYCASTS 8 // Per World
|
|
|
-#define CE_MAX_RAY_INTERSECTIONS 16
|
|
|
-
|
|
|
-#define CE_MAX_CAMERA_COMPONENTS 16 // Per unit
|
|
|
-#define CE_MAX_MESH_COMPONENTS 16 // Per unit
|
|
|
-#define CE_MAX_SPRITE_COMPONENTS 16 // Per unit
|
|
|
-#define CE_MAX_ACTOR_COMPONENTS 16 // Per unit
|
|
|
-#define CE_MAX_MATERIAL_COMPONENTS 16 // Per unit
|
|
|
-
|
|
|
-#define CE_MAX_CONSOLE_CLIENTS 32
|
|
|
-
|
|
|
-#define CE_MAX_GUI_RECTS 64 // Per Gui
|
|
|
-#define CE_MAX_GUI_TRIANGLES 64 // Per Gui
|
|
|
-#define CE_MAX_GUI_IMAGES 64 // Per Gui
|
|
|
-#define CE_MAX_GUI_TEXTS 64 // Per Gui
|
|
|
-
|
|
|
-#define CE_MAX_DEBUG_LINES 2 * 1024 // Per DebugLine
|
|
|
-
|
|
|
-#define CE_MAX_LUA_VECTOR2 4096
|
|
|
-#define CE_MAX_LUA_VECTOR3 4096
|
|
|
-#define CE_MAX_LUA_MATRIX4X4 4096
|
|
|
-#define CE_MAX_LUA_QUATERNION 4096
|
|
|
-
|
|
|
-#define CROWN_DEFAULT_WINDOW_WIDTH 1280
|
|
|
-#define CROWN_DEFAULT_WINDOW_HEIGHT 720
|
|
|
+#include "platform.h"
|
|
|
+
|
|
|
+#ifndef CE_PIXELS_PER_METER
|
|
|
+ #define CE_PIXELS_PER_METER 32
|
|
|
+#endif // CE_PIXELS_PER_METER
|
|
|
+
|
|
|
+#ifndef CROWN_DEFAULT_WINDOW_WIDTH
|
|
|
+ #define CROWN_DEFAULT_WINDOW_WIDTH 1280
|
|
|
+#endif // CROWN_DEFAULT_WINDOW_WIDTH
|
|
|
+
|
|
|
+#ifndef CROWN_DEFAULT_WINDOW_HEIGHT
|
|
|
+ #define CROWN_DEFAULT_WINDOW_HEIGHT 720
|
|
|
+#endif // CROWN_DEFAULT_WINDOW_HEIGHT
|
|
|
+
|
|
|
+#ifndef CE_MAX_WORLDS
|
|
|
+ #define CE_MAX_WORLDS 1024
|
|
|
+#endif // CE_MAX_WORLDS
|
|
|
+
|
|
|
+#ifndef CE_MAX_UNITS
|
|
|
+ #define CE_MAX_UNITS 65000 // Per world
|
|
|
+#endif // CE_MAX_UNITS
|
|
|
+
|
|
|
+#ifndef CE_MAX_CAMERAS
|
|
|
+ #define CE_MAX_CAMERAS 16 // Per world
|
|
|
+#endif // CE_MAX_CAMERAS
|
|
|
+
|
|
|
+#ifndef CE_MAX_ACTORS
|
|
|
+ #define CE_MAX_ACTORS 1024 // Per world
|
|
|
+#endif // CE_MAX_ACTORS
|
|
|
+
|
|
|
+#ifndef CE_MAX_CONTROLLERS
|
|
|
+ #define CE_MAX_CONTROLLERS 16 // Per world
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_TRIGGERS
|
|
|
+ #define CE_MAX_TRIGGERS 1024 // Per world
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_JOINTS
|
|
|
+ #define CE_MAX_JOINTS 512 // Per world
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_SOUND_INSTANCES
|
|
|
+ #define CE_MAX_SOUND_INSTANCES 64 // Per world
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_RAYCASTS
|
|
|
+ #define CE_MAX_RAYCASTS 8 // Per World
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_RAY_INTERSECTIONS
|
|
|
+ #define CE_MAX_RAY_INTERSECTIONS 16
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_CAMERA_COMPONENTS
|
|
|
+ #define CE_MAX_CAMERA_COMPONENTS 16 // Per unit
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_MESH_COMPONENTS
|
|
|
+ #define CE_MAX_MESH_COMPONENTS 16 // Per unit
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_SPRITE_COMPONENTS
|
|
|
+ #define CE_MAX_SPRITE_COMPONENTS 16 // Per unit
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_ACTOR_COMPONENTS
|
|
|
+ #define CE_MAX_ACTOR_COMPONENTS 16 // Per unit
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_MATERIAL_COMPONENTS
|
|
|
+ #define CE_MAX_MATERIAL_COMPONENTS 16 // Per unit
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_CONSOLE_CLIENTS
|
|
|
+ #define CE_MAX_CONSOLE_CLIENTS 32
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_GUI_RECTS
|
|
|
+ #define CE_MAX_GUI_RECTS 64 // Per Gui
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_GUI_TRIANGLES
|
|
|
+ #define CE_MAX_GUI_TRIANGLES 64 // Per Gui
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_GUI_IMAGES
|
|
|
+ #define CE_MAX_GUI_IMAGES 64 // Per Gui
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_GUI_TEXTS
|
|
|
+ #define CE_MAX_GUI_TEXTS 64 // Per Gui
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_DEBUG_LINES
|
|
|
+ #define CE_MAX_DEBUG_LINES 2 * 1024 // Per DebugLine
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_LUA_VECTOR2
|
|
|
+ #define CE_MAX_LUA_VECTOR2 4096
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_LUA_VECTOR3
|
|
|
+ #define CE_MAX_LUA_VECTOR3 4096
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_LUA_MATRIX4X4
|
|
|
+ #define CE_MAX_LUA_MATRIX4X4 4096
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CE_MAX_LUA_QUATERNION
|
|
|
+ #define CE_MAX_LUA_QUATERNION 4096
|
|
|
+#endif // CE_MAX
|
|
|
+
|
|
|
+#ifndef CROWN_SOUND_OPENAL
|
|
|
+ #define CROWN_SOUND_OPENAL (CROWN_PLATFORM_LINUX || CROWN_PLATFORM_WINDOWS)
|
|
|
+#endif // CROWN_SOUND_OPENAL
|
|
|
+
|
|
|
+#ifndef CROWN_SOUND_OPENSLES
|
|
|
+ #define CROWN_SOUND_OPENSLES (CROWN_PLATFORM_ANDROID)
|
|
|
+#endif // CROWN_SOUND_OPENSLES
|