source: trunk/src/core.h @ 2106

Last change on this file since 2106 was 2106, checked in by sam, 7 years ago

build: rename Map to LevelMap so that we can use Map for the hashmap.

  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://sam.zoy.org/projects/COPYING.WTFPL for more details.
9//
10
11//
12// The main header
13// ---------------
14//
15
16#if !defined __LOL_CORE_H__
17#define __LOL_CORE_H__
18
19// CPU features
20#undef LOL_FEATURE_CHEAP_BRANCHES
21#undef LOL_FEATURE_VERY_CHEAP_BRANCHES
22
23#if !defined __CELLOS_LV2__
24#   define LOL_FEATURE_CHEAP_BRANCHES
25#endif
26
27// Optimisation helpers
28#if defined __GNUC__
29#   define __likely(x)   __builtin_expect(!!(x), 1)
30#   define __unlikely(x) __builtin_expect(!!(x), 0)
31#   define INLINEATTR __attribute__((always_inline))
32#   if defined __CELLOS_LV2__ && !defined __SNC__
33#      define FP_USE(x) __asm__("" : "+f" (x))
34#   elif defined __x86_64__
35#      define FP_USE(x) __asm__("" : "+x" (x))
36#   elif defined __i386__ /* FIXME: this isn't good */
37#      define FP_USE(x) __asm__("" : "+m" (x))
38#   else
39#      define FP_USE(x) (void)(x)
40#   endif
41#else
42#   define __likely(x)   x
43#   define __unlikely(x) x
44#   define INLINEATTR
45#   define FP_USE(x) (void)(x)
46#endif
47
48/* Ensure isnan() is present even on systems that don't define it, or
49 * when -ffast-math is being used. */
50#include <cmath>
51#if defined __FAST_MATH__
52#   undef isnan
53#endif
54#if !defined isnan
55#   define isnan isnan
56#   include <stdint.h>
57static inline int isnan(float f)
58{
59    union { float f; uint32_t x; } u = { f };
60    return (u.x << 1) > 0xff000000u;
61}
62#endif
63
64/* If using NaCl or Android, override main() with our version */
65#if defined __native_client__
66#   define main lol_nacl_main
67#elif defined __ANDROID__
68#   define main lol_android_main
69#endif
70
71/* If using SDL on Windows or OS X, let it override main() */
72#if defined USE_SDL && (defined _WIN32 || defined __APPLE__)
73#   include <SDL_main.h>
74#endif
75
76// Base types
77#include <lol/debug.h>
78
79#include <lol/core/types.h>
80#include <lol/core/array.h>
81#include <lol/core/string.h>
82#include <lol/core/hash.h>
83#include <lol/core/map.h>
84
85#include <lol/math/math.h>
86#include <lol/math/half.h>
87#include <lol/math/real.h>
88#include <lol/math/vector.h>
89
90#include "numeric.h"
91#include "timer.h"
92#include "thread/thread.h"
93
94// Static classes
95#include "log.h"
96#include "platform.h"
97#include "video.h"
98#include "audio.h"
99#include "scene.h"
100#include "input/input.h"
101#include "input/keyboard.h"
102#include "input/stick.h"
103#include "profiler.h"
104
105// Entities
106#include "entity.h"
107#include "worldentity.h"
108
109#include "camera.h"
110#include "emitter.h"
111#include "font.h"
112#include "gradient.h"
113#include "sample.h"
114#include "sprite.h"
115#include "text.h"
116#include "tileset.h"
117#include "world.h"
118
119// Other objects
120#include "dict.h"
121#include "map.h"
122#include "layer.h"
123#include "gpu/lolfx.h"
124#include "gpu/shader.h"
125#include "gpu/texture.h"
126#include "gpu/indexbuffer.h"
127#include "gpu/vertexbuffer.h"
128#include "gpu/framebuffer.h"
129#include "mesh/mesh.h"
130#include "image/image.h"
131#include "application/application.h"
132#include "easymesh/easymesh.h"
133
134// Managers
135#include "ticker.h"
136#include "forge.h"
137#include "tiler.h"
138#include "sampler.h"
139
140#endif // __LOL_CORE_H__
141
Note: See TracBrowser for help on using the repository browser.