Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

142 Zeilen
3.2 KiB

  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. // The main header
  12. // ---------------
  13. //
  14. #if !defined __LOL_CORE_H__
  15. #define __LOL_CORE_H__
  16. // CPU features
  17. #undef LOL_FEATURE_CHEAP_BRANCHES
  18. #undef LOL_FEATURE_VERY_CHEAP_BRANCHES
  19. #if !defined __CELLOS_LV2__
  20. # define LOL_FEATURE_CHEAP_BRANCHES
  21. #endif
  22. // Optimisation helpers
  23. #if defined __GNUC__
  24. # define __likely(x) __builtin_expect(!!(x), 1)
  25. # define __unlikely(x) __builtin_expect(!!(x), 0)
  26. # define INLINEATTR __attribute__((always_inline))
  27. # if defined __CELLOS_LV2__ && !defined __SNC__
  28. # define FP_USE(x) __asm__("" : "+f" (x))
  29. # elif defined __x86_64__
  30. # define FP_USE(x) __asm__("" : "+x" (x))
  31. # elif defined __i386__ /* FIXME: this isn't good */
  32. # define FP_USE(x) __asm__("" : "+m" (x))
  33. # else
  34. # define FP_USE(x) (void)(x)
  35. # endif
  36. #else
  37. # define __likely(x) x
  38. # define __unlikely(x) x
  39. # define INLINEATTR
  40. # define FP_USE(x) (void)(x)
  41. #endif
  42. /* Ensure isnan() is present even on systems that don't define it, or
  43. * when -ffast-math is being used. */
  44. #include <cmath>
  45. #if defined __FAST_MATH__
  46. # undef isnan
  47. #endif
  48. #if !defined isnan
  49. # define isnan isnan
  50. # include <stdint.h>
  51. static inline int isnan(float f)
  52. {
  53. union { float f; uint32_t x; } u = { f };
  54. return (u.x << 1) > 0xff000000u;
  55. }
  56. #endif
  57. /* If using NaCl or Android, override main() with our version */
  58. #if defined __native_client__
  59. # define main lol_nacl_main
  60. #elif defined __ANDROID__
  61. # define main lol_android_main
  62. #endif
  63. /* If using SDL on Windows or OS X, let it override main() */
  64. #if defined USE_SDL && (defined _WIN32 || defined __APPLE__)
  65. # include <SDL_main.h>
  66. #endif
  67. // Base types
  68. #include <lol/debug.h>
  69. #include <lol/core/types.h>
  70. #include <lol/core/array.h>
  71. #include <lol/core/string.h>
  72. #include <lol/core/hash.h>
  73. #include <lol/core/map.h>
  74. #include <lol/math/math.h>
  75. #include <lol/math/half.h>
  76. #include <lol/math/real.h>
  77. #include <lol/math/vector.h>
  78. #include "numeric.h"
  79. #include "timer.h"
  80. #include "thread/thread.h"
  81. // Static classes
  82. #include "log.h"
  83. #include "platform.h"
  84. #include "video.h"
  85. #include "audio.h"
  86. #include "scene.h"
  87. #include "input/input.h"
  88. #include "input/keyboard.h"
  89. #include "input/stick.h"
  90. #include "profiler.h"
  91. // Entities
  92. #include "entity.h"
  93. #include "worldentity.h"
  94. #include "camera.h"
  95. #include "emitter.h"
  96. #include "font.h"
  97. #include "gradient.h"
  98. #include "sample.h"
  99. #include "sprite.h"
  100. #include "text.h"
  101. #include "tileset.h"
  102. #include "world.h"
  103. // Other objects
  104. #include "dict.h"
  105. #include "map.h"
  106. #include "layer.h"
  107. #include "gpu/lolfx.h"
  108. #include "gpu/shader.h"
  109. #include "gpu/texture.h"
  110. #include "gpu/indexbuffer.h"
  111. #include "gpu/vertexbuffer.h"
  112. #include "gpu/framebuffer.h"
  113. #include "mesh/mesh.h"
  114. #include "image/image.h"
  115. #include "application/application.h"
  116. #include "easymesh/easymesh.h"
  117. // Managers
  118. #include "ticker.h"
  119. #include "forge.h"
  120. #include "tiler.h"
  121. #include "sampler.h"
  122. #endif // __LOL_CORE_H__