Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

116 lignes
2.5 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2011 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__
  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. // Base types
  58. #include "lol/debug.h"
  59. #include "math/trig.h"
  60. #include "lol/math/half.h"
  61. #include "lol/math/real.h"
  62. #include "lol/math/vector.h"
  63. #include "numeric.h"
  64. #include "timer.h"
  65. #include "thread/thread.h"
  66. #include "array.h"
  67. // Static classes
  68. #include "log.h"
  69. #include "platform.h"
  70. #include "video.h"
  71. #include "audio.h"
  72. #include "scene.h"
  73. #include "input.h"
  74. #include "profiler.h"
  75. // Entities
  76. #include "entity.h"
  77. #include "worldentity.h"
  78. #include "emitter.h"
  79. #include "font.h"
  80. #include "gradient.h"
  81. #include "sample.h"
  82. #include "sprite.h"
  83. #include "text.h"
  84. #include "tileset.h"
  85. #include "world.h"
  86. // Other objects
  87. #include "hash.h"
  88. #include "dict.h"
  89. #include "map.h"
  90. #include "layer.h"
  91. #include "gpu/shader.h"
  92. #include "gpu/indexbuffer.h"
  93. #include "gpu/vertexbuffer.h"
  94. #include "image/image.h"
  95. #include "application/application.h"
  96. // Managers
  97. #include "ticker.h"
  98. #include "forge.h"
  99. #include "tiler.h"
  100. #include "sampler.h"
  101. #endif // __LOL_CORE_H__