Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

108 righe
2.3 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. #if defined __FAST_MATH__
  45. # undef isnan
  46. #endif
  47. #if !defined isnan
  48. # define isnan isnan
  49. # include <stdint.h>
  50. static inline int isnan(float f)
  51. {
  52. union { float f; uint32_t x; } u = { f };
  53. return (u.x << 1) > 0xff000000u;
  54. }
  55. #endif
  56. // Base types
  57. #include "trig.h"
  58. #include "half.h"
  59. #include "matrix.h"
  60. #include "numeric.h"
  61. #include "timer.h"
  62. // Static classes
  63. #include "log.h"
  64. #include "platform.h"
  65. #include "video.h"
  66. #include "audio.h"
  67. #include "scene.h"
  68. #include "input.h"
  69. #include "profiler.h"
  70. // Entities
  71. #include "entity.h"
  72. #include "worldentity.h"
  73. #include "emitter.h"
  74. #include "font.h"
  75. #include "gradient.h"
  76. #include "sample.h"
  77. #include "sprite.h"
  78. #include "text.h"
  79. #include "tileset.h"
  80. #include "world.h"
  81. // Other objects
  82. #include "hash.h"
  83. #include "dict.h"
  84. #include "map.h"
  85. #include "layer.h"
  86. #include "shader/shader.h"
  87. #include "image/image.h"
  88. // Managers
  89. #include "ticker.h"
  90. #include "forge.h"
  91. #include "tiler.h"
  92. #include "sampler.h"
  93. #endif // __LOL_CORE_H__