Browse Source

base: strip core.h from its contents and put it in public/private headers.

undefined
Sam Hocevar 10 years ago
parent
commit
fe665f85b4
100 changed files with 434 additions and 339 deletions
  1. +1
    -1
      demos/tutorial/01_triangle.cpp
  2. +1
    -1
      demos/tutorial/02_cube.cpp
  3. +1
    -1
      demos/tutorial/03_noise.cpp
  4. +1
    -1
      demos/tutorial/04_texture.cpp
  5. +1
    -1
      demos/tutorial/05_easymesh.cpp
  6. +1
    -1
      demos/tutorial/06_sprite.cpp
  7. +1
    -1
      demos/tutorial/07_input.cpp
  8. +1
    -1
      demos/tutorial/08_fbo.cpp
  9. +1
    -1
      demos/tutorial/11_fractal.cpp
  10. +1
    -1
      demos/tutorial/12_voronoi.cpp
  11. +7
    -6
      src/Makefile.am
  12. +1
    -1
      src/application/application.cpp
  13. +1
    -1
      src/audio.cpp
  14. +1
    -1
      src/base/assert.cpp
  15. +1
    -1
      src/base/enum.cpp
  16. +1
    -1
      src/base/hash.cpp
  17. +1
    -1
      src/base/log.cpp
  18. +1
    -1
      src/base/string.cpp
  19. +1
    -1
      src/camera.cpp
  20. +0
    -211
      src/core.h
  21. +1
    -1
      src/debug/fps.cpp
  22. +1
    -1
      src/debug/lines.cpp
  23. +1
    -1
      src/debug/record.cpp
  24. +1
    -1
      src/debug/stats.cpp
  25. +1
    -1
      src/dict.cpp
  26. +1
    -1
      src/easymesh/csgbsp.cpp
  27. +1
    -1
      src/easymesh/easymesh-compiler.cpp
  28. +1
    -1
      src/easymesh/easymesh.cpp
  29. +1
    -1
      src/easymesh/easymeshbuild.cpp
  30. +1
    -1
      src/easymesh/easymeshrender.cpp
  31. +1
    -1
      src/eglapp.cpp
  32. +1
    -1
      src/emitter.cpp
  33. +1
    -1
      src/entity.cpp
  34. +1
    -1
      src/font.cpp
  35. +1
    -1
      src/forge.cpp
  36. +1
    -1
      src/generated/easymesh-parser.cpp
  37. +1
    -1
      src/generated/easymesh-scanner.cpp
  38. +1
    -1
      src/generated/lolfx-parser.cpp
  39. +1
    -1
      src/generated/lolfx-scanner.cpp
  40. +1
    -1
      src/gpu/framebuffer.cpp
  41. +1
    -1
      src/gpu/indexbuffer.cpp
  42. +1
    -1
      src/gpu/lolfx-compiler.cpp
  43. +1
    -1
      src/gpu/lolfx.cpp
  44. +1
    -1
      src/gpu/rendercontext.cpp
  45. +1
    -1
      src/gpu/renderer.cpp
  46. +1
    -1
      src/gpu/shader.cpp
  47. +1
    -1
      src/gpu/texture.cpp
  48. +1
    -1
      src/gpu/vertexbuffer.cpp
  49. +1
    -1
      src/gradient.cpp
  50. +1
    -1
      src/image/codec/android-image.cpp
  51. +1
    -1
      src/image/codec/dummy-image.cpp
  52. +1
    -1
      src/image/codec/gdiplus-image.cpp
  53. +1
    -1
      src/image/codec/imlib2-image.cpp
  54. +1
    -1
      src/image/codec/ios-image.cpp
  55. +1
    -1
      src/image/codec/oric-image.cpp
  56. +1
    -1
      src/image/codec/ps3-image.cpp
  57. +1
    -1
      src/image/codec/sdl-image.cpp
  58. +1
    -1
      src/image/codec/zed-image.cpp
  59. +1
    -1
      src/image/codec/zed-palette-image.cpp
  60. +1
    -1
      src/image/color/cie1931.cpp
  61. +1
    -1
      src/image/color/color.cpp
  62. +1
    -1
      src/image/combine.cpp
  63. +1
    -1
      src/image/crop.cpp
  64. +1
    -1
      src/image/dither/dbs.cpp
  65. +1
    -1
      src/image/dither/ediff.cpp
  66. +1
    -1
      src/image/dither/ordered.cpp
  67. +1
    -1
      src/image/dither/ostromoukhov.cpp
  68. +1
    -1
      src/image/dither/random.cpp
  69. +1
    -1
      src/image/filter/color.cpp
  70. +1
    -1
      src/image/filter/convolution.cpp
  71. +1
    -1
      src/image/filter/dilate.cpp
  72. +1
    -1
      src/image/filter/median.cpp
  73. +1
    -1
      src/image/filter/yuv.cpp
  74. +1
    -1
      src/image/image.cpp
  75. +1
    -1
      src/image/kernel.cpp
  76. +1
    -1
      src/image/noise.cpp
  77. +1
    -1
      src/image/pixel.cpp
  78. +1
    -1
      src/image/resample.cpp
  79. +1
    -1
      src/input/controller.cpp
  80. +1
    -1
      src/input/controller.h
  81. +1
    -1
      src/input/input.cpp
  82. +1
    -1
      src/input/input.h
  83. +1
    -1
      src/input/input_internal.h
  84. +1
    -1
      src/light.cpp
  85. +1
    -0
      src/lol/base/all.h
  86. +8
    -11
      src/lol/base/array.h
  87. +132
    -0
      src/lol/base/features.h
  88. +28
    -0
      src/lol/engine.h
  89. +64
    -0
      src/lol/extras.h
  90. +7
    -0
      src/lol/gpu/shader.h
  91. +35
    -0
      src/lol/main.h
  92. +17
    -9
      src/lol/math/vector.h
  93. +4
    -1
      src/lolcore.vcxproj
  94. +12
    -3
      src/lolcore.vcxproj.filters
  95. +1
    -1
      src/math/constants.cpp
  96. +1
    -1
      src/math/geometry.cpp
  97. +1
    -1
      src/math/half.cpp
  98. +1
    -1
      src/math/real.cpp
  99. +32
    -11
      src/math/trig.cpp
  100. +1
    -1
      src/math/vector.cpp

+ 1
- 1
demos/tutorial/01_triangle.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "loldebug.h"

using namespace std;


+ 1
- 1
demos/tutorial/02_cube.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "loldebug.h"

using namespace std;


+ 1
- 1
demos/tutorial/03_noise.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "loldebug.h"

using namespace std;


+ 1
- 1
demos/tutorial/04_texture.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "loldebug.h"

using namespace std;


+ 1
- 1
demos/tutorial/05_easymesh.cpp View File

@@ -13,7 +13,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

using namespace std;
using namespace lol;


+ 1
- 1
demos/tutorial/06_sprite.cpp View File

@@ -13,7 +13,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

using namespace std;
using namespace lol;


+ 1
- 1
demos/tutorial/07_input.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "loldebug.h"

using namespace std;


+ 1
- 1
demos/tutorial/08_fbo.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "loldebug.h"

using namespace std;


+ 1
- 1
demos/tutorial/11_fractal.cpp View File

@@ -15,7 +15,7 @@
#include <cstring>
#include <cstdio>

#include "core.h"
#include <lol/main.h>
#include "loldebug.h"

using namespace lol;


+ 1
- 1
demos/tutorial/12_voronoi.cpp View File

@@ -13,7 +13,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "loldebug.h"

using namespace std;


+ 7
- 6
src/Makefile.am View File

@@ -6,7 +6,7 @@ SUBDIRS = bullet lua data
noinst_LIBRARIES = liblolcore.a

liblolcore_a_SOURCES = \
core.h tiler.cpp tiler.h dict.cpp dict.h \
tiler.cpp tiler.h dict.cpp dict.h \
audio.cpp audio.h scene.cpp scene.h font.cpp font.h \
entity.cpp entity.h ticker.cpp ticker.h lolgl.h \
tileset.cpp tileset.h forge.cpp forge.h video.cpp video.h \
@@ -32,10 +32,13 @@ EXTRA_DIST += easymesh/easymesh-scanner.l easymesh/easymesh-parser.y \
gpu/lolfx-scanner.l gpu/lolfx-parser.y

liblolcore_headers = \
lol/main.h lol/engine.h lol/extras.h \
lol/unit.h \
\
lol/base/all.h \
lol/base/log.h lol/base/array.h lol/base/types.h lol/base/array.h \
lol/base/features.h lol/base/array.h lol/base/types.h lol/base/array.h \
lol/base/assert.h lol/base/string.h lol/base/hash.h lol/base/map.h \
lol/base/enum.h \
lol/base/enum.h lol/base/log.h \
\
lol/math/all.h \
lol/math/functions.h lol/math/vector.h lol/math/half.h lol/math/real.h \
@@ -57,9 +60,7 @@ liblolcore_headers = \
lol/gpu/renderer.h lol/gpu/rendercontext.h \
\
lol/debug/all.h \
lol/debug/lines.h \
\
lol/unit.h
lol/debug/lines.h

liblolcore_sources = \
generated/location.hh generated/position.hh generated/stack.hh \


+ 1
- 1
src/application/application.cpp View File

@@ -16,7 +16,7 @@
# include <emscripten.h>
#endif

#include "core.h"
#include <lol/main.h>

#include "lolgl.h"



+ 1
- 1
src/audio.cpp View File

@@ -25,7 +25,7 @@
# endif
#endif

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/base/assert.cpp View File

@@ -23,7 +23,7 @@
# include <emscripten.h>
#endif

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/base/enum.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/base/hash.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/base/log.cpp View File

@@ -26,7 +26,7 @@
# include <cstdarg>
#endif

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/base/string.cpp View File

@@ -21,7 +21,7 @@

#include <cstdarg>

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/camera.cpp View File

@@ -16,7 +16,7 @@
#include <cstring>
#include <cstdlib>

#include "core.h"
#include <lol/main.h>

#if defined _WIN32 || defined _XBOX
# define strcasecmp _stricmp


+ 0
- 211
src/core.h View File

@@ -1,211 +0,0 @@
//
// Lol Engine
//
// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
//

//
// The main header
// ---------------
//

#if !defined __LOL_CORE_H__
#define __LOL_CORE_H__

/*
* System and CPU features.
*/
#undef LOL_FEATURE_THREADS
#undef LOL_FEATURE_CHEAP_BRANCHES
#undef LOL_FEATURE_VERY_CHEAP_BRANCHES

#if !defined EMSCRIPTEN
# define LOL_FEATURE_THREADS 1
#endif

#if !defined __CELLOS_LV2__
# define LOL_FEATURE_CHEAP_BRANCHES 1
#endif


/*
* Check for C++11 features.
*/
#undef LOL_FEATURE_CXX11_CONSTEXPR
#undef LOL_FEATURE_CXX11_ISNAN

#if defined __GNUC__ /* GCC */
# if defined(__GXX_EXPERIMENTAL_CXX0X) || __cplusplus >= 201103L
# define LOL_FEATURE_CXX11_CONSTEXPR 1
# define LOL_FEATURE_CXX11_ISNAN 1
# endif

#elif defined _MSC_VER /* Visual Studio */
/* Even Visual Studio 2012 doesn't support constexpr. Idiots. */

#elif defined __has_feature /* Clang */
# if __has_feature(cxx_constexpr)
# define LOL_FEATURE_CXX11_CONSTEXPR 1
# endif
#endif

#if LOL_FEATURE_CXX11_CONSTEXPR
# define LOL_CONSTEXPR constexpr
#else
# define LOL_CONSTEXPR /* Nothing */
#endif


// Optimisation helpers
#if defined __GNUC__
# define __likely(x) __builtin_expect(!!(x), 1)
# define __unlikely(x) __builtin_expect(!!(x), 0)
# define INLINEATTR __attribute__((always_inline))
# if defined __CELLOS_LV2__ && !defined __SNC__
# define FP_USE(x) __asm__("" : "+f" (x))
# elif defined __x86_64__
# define FP_USE(x) __asm__("" : "+x" (x))
# elif defined __i386__ /* FIXME: this isn't good */
# define FP_USE(x) __asm__("" : "+m" (x))
# else
# define FP_USE(x) (void)(x)
# endif
#else
# define __likely(x) x
# define __unlikely(x) x
# define INLINEATTR
# define FP_USE(x) (void)(x)
#endif


/* Ensure we have nullptr */
#if defined nullptr
/* do nothing */
#elif defined __GNUC__
# define nullptr __null
#else
# include <cstddef>
# define nullptr NULL
#endif


/* Ensure we have ssize_t */
#if defined ssize_t
/* Do nothing, someone knows better than us it seems */
#elif HAVE_SYS_TYPES_H
# include <sys/types.h>
#elif _MSC_VER /* Visual Studio compiler */
# include <BaseTsd.h>
# define _MSC_STDINT_H_
typedef SSIZE_T ssize_t;
#endif


/* Ensure isnan() is present even on systems that don't define it, or
* when -ffast-math is being used. */
#include <cmath>
#if defined __FAST_MATH__
# undef isnan
#endif
#if !defined isnan && !defined LOL_FEATURE_CXX11_ISNAN
# define isnan isnan
# include <stdint.h>
static inline int isnan(float f)
{
union { float f; uint32_t x; } u = { f };
return (u.x << 1) > 0xff000000u;
}
#endif


/* XXX: workaround for a compilation bug in NaCl headers */
#if defined __native_client__
# define typeid(x) (*(type_info*)nullptr)
#endif


/* XXX: workaround for X11 headers that try to #define these */
#undef Always
#define Always Always
#undef None
#define None None


/* External declaration for LolFx files. */
#define LOLFX_RESOURCE_DECLARE(name) \
extern "C" char const *lolfx_resource_##name
#define LOLFX_RESOURCE_HELPER(name) #name ".lolfx"
#define LOLFX_RESOURCE_NAME(name) \
LOLFX_RESOURCE_HELPER(name), lolfx_resource_##name

/* If using NaCl or Android, override main() with our version */
#if defined __native_client__
# define main lol_nacl_main
#elif defined __ANDROID__
# define main lol_android_main
#endif

/* If using SDL on Windows or OS X, let it override main() */
#if defined USE_SDL && (defined _WIN32 || defined __APPLE__)
# include <SDL_main.h>
#endif

// Base types
#include <lol/base/all.h>
#include <lol/math/all.h>
#include <lol/algorithm/all.h>
#include <lol/sys/all.h>
#include <lol/image/all.h>
#include <lol/gpu/all.h>
#include <lol/debug/all.h>

#include "utils.h"
#include "numeric.h"

// Static classes
#include "platform.h"
#include "video.h"
#include "audio.h"
#include "scene.h"
#include "profiler.h"
#include "messageservice.h"

// Input
#include "input/input.h"
#include "input/controller.h"

// Entities
#include "entity.h"
#include "worldentity.h"

#include "camera.h"
#include "light.h"
#include "emitter.h"
#include "font.h"
#include "gradient.h"
#include "sample.h"
#include "sprite.h"
#include "text.h"
#include "tileset.h"
#include "world.h"

// Other objects
#include "dict.h"
#include "mesh/mesh.h"
#include "mesh/primitive.h"
#include "application/application.h"
#include "easymesh/csgbsp.h"
#include "easymesh/easymesh.h"

// Managers
#include "ticker.h"
#include "forge.h"
#include "tiler.h"
#include "sampler.h"

#endif // __LOL_CORE_H__


+ 1
- 1
src/debug/fps.cpp View File

@@ -14,7 +14,7 @@

#include <cstdio>

#include "core.h"
#include <lol/main.h>
#include "loldebug.h"

using namespace std;


+ 1
- 1
src/debug/lines.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/debug/record.cpp View File

@@ -18,7 +18,7 @@
# include <pipi.h>
#endif

#include "core.h"
#include <lol/main.h>
#include "loldebug.h"

using namespace std;


+ 1
- 1
src/debug/stats.cpp View File

@@ -14,7 +14,7 @@

#include <cstdio>

#include "core.h"
#include <lol/main.h>
#include "loldebug.h"

using namespace std;


+ 1
- 1
src/dict.cpp View File

@@ -15,7 +15,7 @@
#include <cstring>
#include <cstdlib>

#include "core.h"
#include <lol/main.h>

#if defined _WIN32 || defined _XBOX
# define strcasecmp _stricmp


+ 1
- 1
src/easymesh/csgbsp.cpp View File

@@ -18,7 +18,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include <lol/math/geometry.h>

namespace lol


+ 1
- 1
src/easymesh/easymesh-compiler.cpp View File

@@ -16,7 +16,7 @@

#include <string>

#include "core.h"
#include <lol/main.h>
#include "easymesh/easymesh-compiler.h"

namespace lol


+ 1
- 1
src/easymesh/easymesh.cpp View File

@@ -19,7 +19,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "easymesh/easymesh-compiler.h"

LOLFX_RESOURCE_DECLARE(shiny);


+ 1
- 1
src/easymesh/easymeshbuild.cpp View File

@@ -19,7 +19,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/easymesh/easymeshrender.cpp View File

@@ -19,7 +19,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/eglapp.cpp View File

@@ -32,7 +32,7 @@
# endif
#endif

#include "core.h"
#include <lol/main.h>
#include "lolgl.h"
#include "eglapp.h"
#if defined USE_SDL


+ 1
- 1
src/emitter.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/entity.cpp View File

@@ -14,7 +14,7 @@

#include <cstdlib>

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/font.cpp View File

@@ -16,7 +16,7 @@
#include <cstring>
#include <cstdio>

#include "core.h"
#include <lol/main.h>

using namespace std;



+ 1
- 1
src/forge.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/generated/easymesh-parser.cpp View File

@@ -54,7 +54,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "easymesh/easymesh.h"

#include <string>


+ 1
- 1
src/generated/easymesh-scanner.cpp View File

@@ -668,7 +668,7 @@ using std::malloc;
using std::realloc;
using std::free;

#include "core.h"
#include <lol/main.h>
#include "easymesh/easymesh-compiler.h"

typedef lol::EasyMeshParser::token token;


+ 1
- 1
src/generated/lolfx-parser.cpp View File

@@ -52,7 +52,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

#include <string>



+ 1
- 1
src/generated/lolfx-scanner.cpp View File

@@ -1672,7 +1672,7 @@ using std::realloc;
using std::free;
#include <iostream>

#include "core.h"
#include <lol/main.h>
#include "gpu/lolfx-compiler.h"

typedef lol::LolFxParser::token token;


+ 1
- 1
src/gpu/framebuffer.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "lolgl.h"

#if defined _WIN32 && defined USE_D3D9


+ 1
- 1
src/gpu/indexbuffer.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "lolgl.h"

#if defined _WIN32 && defined USE_D3D9


+ 1
- 1
src/gpu/lolfx-compiler.cpp View File

@@ -14,7 +14,7 @@

#include <string>

#include "core.h"
#include <lol/main.h>
#include "gpu/lolfx-compiler.h"

namespace lol


+ 1
- 1
src/gpu/lolfx.cpp View File

@@ -17,7 +17,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "gpu/lolfx-compiler.h"

namespace lol


+ 1
- 1
src/gpu/rendercontext.cpp View File

@@ -14,7 +14,7 @@

#include <cstdlib>

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/gpu/renderer.cpp View File

@@ -28,7 +28,7 @@
# undef far /* Fuck Microsoft again */
#endif

#include "core.h"
#include <lol/main.h>
#include "lolgl.h"

/* FIXME: find a way to pass g_hwnd from the windowing system */


+ 1
- 1
src/gpu/shader.cpp View File

@@ -31,7 +31,7 @@
# undef far /* Fuck Microsoft again */
#endif

#include "core.h"
#include <lol/main.h>
#include "lolgl.h"

using namespace std;


+ 1
- 1
src/gpu/texture.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "lolgl.h"

#if defined _WIN32 && defined USE_D3D9


+ 1
- 1
src/gpu/vertexbuffer.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "lolgl.h"

#if defined _WIN32 && defined USE_D3D9


+ 1
- 1
src/gradient.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

using namespace std;



+ 1
- 1
src/image/codec/android-image.cpp View File

@@ -21,7 +21,7 @@ extern "C" {
#include <android_native_app_glue.h>
}

#include "core.h"
#include <lol/main.h>
#include "../../image/image-private.h"

using namespace std;


+ 1
- 1
src/image/codec/dummy-image.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "../../image/image-private.h"

using namespace std;


+ 1
- 1
src/image/codec/gdiplus-image.cpp View File

@@ -21,7 +21,7 @@ using namespace std;
#include <windows.h>
#include <gdiplus.h>

#include "core.h"
#include <lol/main.h>
#include "../../image/image-private.h"

namespace lol


+ 1
- 1
src/image/codec/imlib2-image.cpp View File

@@ -16,7 +16,7 @@

#include <Imlib2.h>

#include "core.h"
#include <lol/main.h>
#include "../../image/image-private.h"

using namespace std;


+ 1
- 1
src/image/codec/ios-image.cpp View File

@@ -16,7 +16,7 @@

#import <UIKit/UIKit.h>

#include "core.h"
#include <lol/main.h>
#include "../../image/image-private.h"

using namespace std;


+ 1
- 1
src/image/codec/oric-image.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "../../image/image-private.h"

using namespace std;


+ 1
- 1
src/image/codec/ps3-image.cpp View File

@@ -18,7 +18,7 @@
#include <cell/sysmodule.h>
#include <cell/codec/pngdec.h>

#include "core.h"
#include <lol/main.h>
#include "../../image/image-private.h"

using namespace std;


+ 1
- 1
src/image/codec/sdl-image.cpp View File

@@ -25,7 +25,7 @@
# include <SDL_image.h>
#endif

#include "core.h"
#include <lol/main.h>
#include "../../image/image-private.h"

using namespace std;


+ 1
- 1
src/image/codec/zed-image.cpp View File

@@ -13,7 +13,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "../../image/image-private.h"

using namespace std;


+ 1
- 1
src/image/codec/zed-palette-image.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "../../image/image-private.h"

using namespace std;


+ 1
- 1
src/image/color/cie1931.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* This file contains code and data related to various CIE standards.


+ 1
- 1
src/image/color/color.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/image/combine.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* Image merge operations: merge, min/max, overlay, screen, multiply,


+ 1
- 1
src/image/crop.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "image-private.h"

/*


+ 1
- 1
src/image/dither/dbs.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* Direct Binary Search dithering


+ 1
- 1
src/image/dither/ediff.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* Generic error diffusion functions


+ 1
- 1
src/image/dither/ordered.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* Bayer ordered dithering functions


+ 1
- 1
src/image/dither/ostromoukhov.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* Ostromoukhov dithering functions


+ 1
- 1
src/image/dither/random.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* Random dithering


+ 1
- 1
src/image/filter/color.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* Colour manipulation functions


+ 1
- 1
src/image/filter/convolution.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* Generic convolution functions


+ 1
- 1
src/image/filter/dilate.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* Dilate and erode functions


+ 1
- 1
src/image/filter/median.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* Median filter functions


+ 1
- 1
src/image/filter/yuv.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* YUV conversion functions


+ 1
- 1
src/image/image.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "image-private.h"

#include <algorithm> /* for std::swap */


+ 1
- 1
src/image/kernel.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* Stock kernels


+ 1
- 1
src/image/noise.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* Noise rendering functions


+ 1
- 1
src/image/pixel.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>
#include "image-private.h"

namespace lol


+ 1
- 1
src/image/resample.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

/*
* Image resizing functions


+ 1
- 1
src/input/controller.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/input/controller.h View File

@@ -11,7 +11,7 @@
#if !defined __LOL_INPUT_CONTROLLER_H__
#define __LOL_INPUT_CONTROLLER_H__

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/input/input.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

#include "input/input_internal.h"



+ 1
- 1
src/input/input.h View File

@@ -11,7 +11,7 @@
#if !defined __LOL_INPUT_H__
#define __LOL_INPUT_H__

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/input/input_internal.h View File

@@ -11,7 +11,7 @@
#if !defined __LOL_INPUT_DEVICE_INTERNAL_H__
#define __LOL_INPUT_DEVICE_H__

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 1
src/light.cpp View File

@@ -15,7 +15,7 @@
#include <cstring>
#include <cstdlib>

#include "core.h"
#include <lol/main.h>

namespace lol
{


+ 1
- 0
src/lol/base/all.h View File

@@ -11,6 +11,7 @@
#if !defined __LOL_BASE_ALL_H__
#define __LOL_BASE_ALL_H__

#include <lol/base/features.h>
#include <lol/base/types.h>
#include <lol/base/log.h>
#include <lol/base/assert.h>


+ 8
- 11
src/lol/base/array.h View File

@@ -29,9 +29,6 @@
namespace lol
{

/* Set this to 1 when Visual Studio finally understands the feature */
#define INHERIT_CONSTRUCTORS 0

#define INDEX_NONE -1

/*
@@ -551,7 +548,7 @@ template<typename T1, typename T2 = void, typename T3 = void,
class array : public array_base<array_element<T1, T2, T3, T4, T5, T6, T7, T8>,
array<T1, T2, T3, T4, T5, T6, T7, T8>>
{
#if INHERIT_CONSTRUCTORS
#if LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS
using array_base<array_element<T1, T2, T3, T4, T5, T6, T7, T8>,
array<T1, T2, T3, T4, T5, T6, T7, T8>>::array_base;
#else
@@ -606,7 +603,7 @@ class array<T1, T2, T3, T4, T5, T6, T7, void>
: public array_base<array_element<T1, T2, T3, T4, T5, T6, T7, void>,
array<T1, T2, T3, T4, T5, T6, T7>>
{
#if INHERIT_CONSTRUCTORS
#if LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS
using array_base<array_element<T1, T2, T3, T4, T5, T6, T7, void>,
array<T1, T2, T3, T4, T5, T6, T7>>::array_base;
#else
@@ -659,7 +656,7 @@ class array<T1, T2, T3, T4, T5, T6, void, void>
: public array_base<array_element<T1, T2, T3, T4, T5, T6, void, void>,
array<T1, T2, T3, T4, T5, T6>>
{
#if INHERIT_CONSTRUCTORS
#if LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS
using array_base<array_element<T1, T2, T3, T4, T5, T6, void, void>,
array<T1, T2, T3, T4, T5, T6>>::array_base;
#else
@@ -709,7 +706,7 @@ class array<T1, T2, T3, T4, T5, void, void, void>
: public array_base<array_element<T1, T2, T3, T4, T5, void, void, void>,
array<T1, T2, T3, T4, T5>>
{
#if INHERIT_CONSTRUCTORS
#if LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS
using array_base<array_element<T1, T2, T3, T4, T5, void, void, void>,
array<T1, T2, T3, T4, T5>>::array_base;
#else
@@ -757,7 +754,7 @@ class array<T1, T2, T3, T4, void, void, void, void>
: public array_base<array_element<T1, T2, T3, T4, void, void, void, void>,
array<T1, T2, T3, T4>>
{
#if INHERIT_CONSTRUCTORS
#if LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS
using array_base<array_element<T1, T2, T3, T4, void, void, void, void>,
array<T1, T2, T3, T4>>::array_base;
#else
@@ -801,7 +798,7 @@ class array<T1, T2, T3, void, void, void, void, void>
: public array_base<array_element<T1, T2, T3, void, void, void, void, void>,
array<T1, T2, T3>>
{
#if INHERIT_CONSTRUCTORS
#if LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS
using array_base<array_element<T1, T2, T3, void, void, void, void, void>,
array<T1, T2, T3>>::array_base;
#else
@@ -843,7 +840,7 @@ class array<T1, T2, void, void, void, void, void, void>
: public array_base<array_element<T1, T2, void, void, void, void, void, void>,
array<T1, T2>>
{
#if INHERIT_CONSTRUCTORS
#if LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS
using array_base<array_element<T1, T2, void, void, void, void, void, void>,
array<T1, T2>>::array_base;
#else
@@ -883,7 +880,7 @@ class array<T, void, void, void, void, void, void, void>
: public array_base<T,
array<T>>
{
#if INHERIT_CONSTRUCTORS
#if LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS
using array_base<T,
array<T>>::array_base;
#else


+ 132
- 0
src/lol/base/features.h View File

@@ -0,0 +1,132 @@
//
// Lol Engine
//
// Copyright: (c) 2010-2014 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
//

//
// The build-time features
// -----------------------
//

#if !defined __LOL_BASE_FEATURES_H__
#define __LOL_BASE_FEATURES_H__

/*
* System and CPU features.
*/
#define LOL_FEATURE_THREADS 1
#define LOL_FEATURE_CHEAP_BRANCHES 1
#define LOL_FEATURE_VERY_CHEAP_BRANCHES 0

#if defined EMSCRIPTEN
# undef LOL_FEATURE_THREADS
# define LOL_FEATURE_THREADS 0
#endif

#if defined __CELLOS_LV2__
# undef LOL_FEATURE_CHEAP_BRANCHES
# define LOL_FEATURE_CHEAP_BRANCHES 0
#endif


/*
* Check for C++11 features.
*/

/* Set these to 1 when Visual Studio finally understands the features
* (planned for Visual Studion 14) */
#define LOL_FEATURE_CXX11_RELAXED_UNIONS 0
#define LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS 0
#define LOL_FEATURE_CXX11_CONSTEXPR 0
#define LOL_FEATURE_CXX11_ISNAN 0

#if defined __GNUC__ /* GCC */
# if defined(__GXX_EXPERIMENTAL_CXX0X) || __cplusplus >= 201103L
# undef LOL_FEATURE_CXX11_CONSTEXPR
# define LOL_FEATURE_CXX11_CONSTEXPR 1
# undef LOL_FEATURE_CXX11_ISNAN
# define LOL_FEATURE_CXX11_ISNAN 1
# endif
#elif defined __has_feature /* Clang */
# if __has_feature(cxx_constexpr)
# undef LOL_FEATURE_CXX11_CONSTEXPR
# define LOL_FEATURE_CXX11_CONSTEXPR 1
# endif
#endif

#if LOL_FEATURE_CXX11_CONSTEXPR
# define LOL_CONSTEXPR constexpr
#else
# define LOL_CONSTEXPR /* Nothing */
#endif


/*
* Ensure we have nullptr.
*/

#if defined nullptr
/* do nothing */
#elif defined __GNUC__
# define nullptr __null
#else
# include <cstddef>
# define nullptr NULL
#endif


/*
* Ensure we have ssize_t.
*/

#if defined ssize_t
/* Do nothing, someone knows better than us it seems */
#elif HAVE_SYS_TYPES_H
# include <sys/types.h>
#elif _MSC_VER /* Visual Studio compiler */
# include <BaseTsd.h>
# define _MSC_STDINT_H_
typedef SSIZE_T ssize_t;
#endif


/*
* Ensure isnan() is present even on systems that don't define it, or
* when -ffast-math is being used.
*/

#include <cmath>
#if defined __FAST_MATH__
# undef isnan
#endif
#if !defined isnan && !LOL_FEATURE_CXX11_ISNAN
# define isnan isnan
# include <stdint.h>
static inline int isnan(float f)
{
union { float f; uint32_t x; } u = { f };
return (u.x << 1) > 0xff000000u;
}
#endif


/* XXX: workaround for a compilation bug in NaCl headers */
#if defined __native_client__
# define typeid(x) (*(type_info*)nullptr)
#endif


/* XXX: workaround for X11 headers that try to #define these */
#undef Always
#define Always Always
#undef None
#define None None


#endif // __LOL_BASE_FEATURES_H__


+ 28
- 0
src/lol/engine.h View File

@@ -0,0 +1,28 @@
//
// Lol Engine
//
// Copyright: (c) 2010-2014 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
//

//
// The main header
// ---------------
//

#if !defined __LOL_ENGINE_H__
#define __LOL_ENGINE_H__

#include <lol/base/all.h>
#include <lol/math/all.h>
#include <lol/algorithm/all.h>
#include <lol/sys/all.h>
#include <lol/image/all.h>
#include <lol/gpu/all.h>
#include <lol/debug/all.h>

#endif // __LOL_ENGINE_H__


+ 64
- 0
src/lol/extras.h View File

@@ -0,0 +1,64 @@
//
// Lol Engine
//
// Copyright: (c) 2010-2014 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
//

//
// Extra includes that aren't proper part of the engine yet
// --------------------------------------------------------
//

#if !defined __LOL_EXTRAS_H__
#define __LOL_EXTRAS_H__

#include <lol/../utils.h>
#include <lol/../numeric.h>

// Static classes
#include <lol/../platform.h>
#include <lol/../video.h>
#include <lol/../audio.h>
#include <lol/../scene.h>
#include <lol/../profiler.h>
#include <lol/../messageservice.h>

// Input
#include <lol/../input/input.h>
#include <lol/../input/controller.h>

// Entities
#include <lol/../entity.h>
#include <lol/../worldentity.h>

#include <lol/../camera.h>
#include <lol/../light.h>
#include <lol/../emitter.h>
#include <lol/../font.h>
#include <lol/../gradient.h>
#include <lol/../sample.h>
#include <lol/../sprite.h>
#include <lol/../text.h>
#include <lol/../tileset.h>
#include <lol/../world.h>

// Other objects
#include <lol/../dict.h>
#include <lol/../mesh/mesh.h>
#include <lol/../mesh/primitive.h>
#include <lol/../application/application.h>
#include <lol/../easymesh/csgbsp.h>
#include <lol/../easymesh/easymesh.h>

// Managers
#include <lol/../ticker.h>
#include <lol/../forge.h>
#include <lol/../tiler.h>
#include <lol/../sampler.h>

#endif // __LOL_EXTRAS_H__


+ 7
- 0
src/lol/gpu/shader.h View File

@@ -18,6 +18,13 @@

#include <stdint.h>

/* External declaration for LolFx files. */
#define LOLFX_RESOURCE_DECLARE(name) \
extern "C" char const *lolfx_resource_##name
#define LOLFX_RESOURCE_HELPER(name) #name ".lolfx"
#define LOLFX_RESOURCE_NAME(name) \
LOLFX_RESOURCE_HELPER(name), lolfx_resource_##name

namespace lol
{



+ 35
- 0
src/lol/main.h View File

@@ -0,0 +1,35 @@
//
// Lol Engine
//
// Copyright: (c) 2010-2014 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
//

//
// The main header
// ---------------
//

#if !defined __LOL_MAIN_H__
#define __LOL_MAIN_H__

/* If using NaCl or Android, override main() with our version */
#if defined __native_client__
# define main lol_nacl_main
#elif defined __ANDROID__
# define main lol_android_main
#endif

/* If using SDL on Windows or OS X, let it override main() */
#if defined USE_SDL && (defined _WIN32 || defined __APPLE__)
# include <SDL_main.h>
#endif

#include <lol/engine.h>
#include <lol/extras.h>

#endif // __LOL_MAIN_H__


+ 17
- 9
src/lol/math/vector.h View File

@@ -25,6 +25,20 @@
namespace lol
{

#if !LOL_FEATURE_CXX11_RELAXED_UNIONS
# define _____ const
#else
# define _____ /* */
#endif

/* The generic "vec" type, which is a fixed-size vector */
template<typename T, int N>
struct vec
{
private:
T m_data[N];
};

#define LOL_VECTOR_TYPEDEFS(tname, suffix) \
template <typename T> struct tname; \
typedef tname<half> f16##suffix; \
@@ -88,7 +102,7 @@ template<typename T, int N> struct XVec2
{
inline XVec2<T, N>& operator =(Vec2<T> that);

#if 0
#if LOL_FEATURE_CXX11_RELAXED_UNIONS
inline XVec2<T, N>& operator =(XVec2<T, N> const &that)
{
return *this = (Vec2<T>)that;
@@ -111,7 +125,7 @@ template<typename T, int N> struct XVec3
{
inline XVec3<T, N>& operator =(Vec3<T> that);

#if 0
#if LOL_FEATURE_CXX11_RELAXED_UNIONS
inline XVec3<T, N>& operator =(XVec3<T, N> const &that)
{
return *this = (Vec3<T>)that;
@@ -134,7 +148,7 @@ template<typename T, int N> struct XVec4
{
inline XVec4<T, N>& operator =(Vec4<T> that);

#if 0
#if LOL_FEATURE_CXX11_RELAXED_UNIONS
inline XVec4<T, N>& operator =(XVec4<T, N> const &that)
{
return *this = (Vec4<T>)that;
@@ -197,7 +211,6 @@ template <typename T> struct BVec2
struct { T s, t; };

#if !_DOXYGEN_SKIP_ME
#define _____ const /* We’ll get rid of this with Visual Studio 14 */
XVec2<T,0x00> const xx, rr, ss;
XVec2<T,0x01> _____ xy, rg, st;
XVec2<T,0x10> _____ yx, gr, ts;
@@ -228,7 +241,6 @@ template <typename T> struct BVec2
XVec4<T,0x1101> const yyxy, ggrg, ttst;
XVec4<T,0x1110> const yyyx, gggr, ttts;
XVec4<T,0x1111> const yyyy, gggg, tttt;
#undef _____
#endif
};
};
@@ -360,7 +372,6 @@ template <typename T> struct BVec3
struct { T s, t, p; };

#if !_DOXYGEN_SKIP_ME
#define _____ const /* We’ll get rid of this with Visual Studio 14 */
XVec2<T,0x00> const xx, rr, ss;
XVec2<T,0x01> _____ xy, rg, st;
XVec2<T,0x02> _____ xz, rb, sp;
@@ -480,7 +491,6 @@ template <typename T> struct BVec3
XVec4<T,0x2220> const zzzx, bbbr, ppps;
XVec4<T,0x2221> const zzzy, bbbg, pppt;
XVec4<T,0x2222> const zzzz, bbbb, pppp;
#undef _____
#endif
};
};
@@ -561,7 +571,6 @@ template <typename T> struct BVec4
struct { T s, t, p, q; };

#if !_DOXYGEN_SKIP_ME
#define _____ const /* We’ll get rid of this with Visual Studio 14 */
XVec2<T,0x00> const xx, rr, ss;
XVec2<T,0x01> _____ xy, rg, st;
XVec2<T,0x02> _____ xz, rb, sp;
@@ -900,7 +909,6 @@ template <typename T> struct BVec4
XVec4<T,0x3331> const wwwy, aaag, qqqt;
XVec4<T,0x3332> const wwwz, aaab, qqqp;
XVec4<T,0x3333> const wwww, aaaa, qqqq;
#undef _____
#endif
};
};


+ 4
- 1
src/lolcore.vcxproj View File

@@ -257,7 +257,6 @@
<ClInclude Include="audio.h" />
<ClInclude Include="camera.h" />
<ClInclude Include="commandstack.h" />
<ClInclude Include="core.h" />
<ClInclude Include="debug\fps.h" />
<ClInclude Include="debug\record.h" />
<ClInclude Include="debug\stats.h" />
@@ -295,6 +294,7 @@
<ClInclude Include="lol\base\array.h" />
<ClInclude Include="lol\base\assert.h" />
<ClInclude Include="lol\base\enum.h" />
<ClInclude Include="lol\base\features.h" />
<ClInclude Include="lol\base\hash.h" />
<ClInclude Include="lol\base\log.h" />
<ClInclude Include="lol\base\map.h" />
@@ -302,6 +302,8 @@
<ClInclude Include="lol\base\types.h" />
<ClInclude Include="lol\debug\all.h" />
<ClInclude Include="lol\debug\lines.h" />
<ClInclude Include="lol\engine.h" />
<ClInclude Include="lol\extras.h" />
<ClInclude Include="lol\gpu\all.h" />
<ClInclude Include="lol\gpu\framebuffer.h" />
<ClInclude Include="lol\gpu\indexbuffer.h" />
@@ -315,6 +317,7 @@
<ClInclude Include="lol\image\color.h" />
<ClInclude Include="lol\image\image.h" />
<ClInclude Include="lol\image\pixel.h" />
<ClInclude Include="lol\main.h" />
<ClInclude Include="lol\math\all.h" />
<ClInclude Include="lol\math\array2d.h" />
<ClInclude Include="lol\math\array3d.h" />


+ 12
- 3
src/lolcore.vcxproj.filters View File

@@ -450,6 +450,15 @@
<ClInclude Include="lol\math\vector.h">
<Filter>lol\math</Filter>
</ClInclude>
<ClInclude Include="lol\engine.h">
<Filter>lol</Filter>
</ClInclude>
<ClInclude Include="lol\extras.h">
<Filter>lol</Filter>
</ClInclude>
<ClInclude Include="lol\main.h">
<Filter>lol</Filter>
</ClInclude>
<ClInclude Include="lol\unit.h">
<Filter>lol</Filter>
</ClInclude>
@@ -483,9 +492,6 @@
<ClInclude Include="camera.h">
<Filter>...</Filter>
</ClInclude>
<ClInclude Include="core.h">
<Filter>...</Filter>
</ClInclude>
<ClInclude Include="dict.h">
<Filter>...</Filter>
</ClInclude>
@@ -603,6 +609,9 @@
<ClInclude Include="lol\base\enum.h">
<Filter>lol\base</Filter>
</ClInclude>
<ClInclude Include="lol\base\features.h">
<Filter>lol\base</Filter>
</ClInclude>
<ClInclude Include="lol\base\hash.h">
<Filter>lol\base</Filter>
</ClInclude>


+ 1
- 1
src/math/constants.cpp View File

@@ -12,7 +12,7 @@
# include "config.h"
#endif

#include "core.h"
#include <lol/main.h>

namespace lol {



+ 1
- 1
src/math/geometry.cpp View File

@@ -18,7 +18,7 @@

#include <ostream> /* std::ostream */

#include "core.h"
#include <lol/main.h>

using namespace std;



+ 1
- 1
src/math/half.cpp View File

@@ -20,7 +20,7 @@
# endif
#endif

#include "core.h"
#include <lol/main.h>

using namespace std;



+ 1
- 1
src/math/real.cpp View File

@@ -17,7 +17,7 @@
#include <cstdio>
#include <cstdlib>

#include "core.h"
#include <lol/main.h>

using namespace std;



+ 32
- 11
src/math/trig.cpp View File

@@ -16,10 +16,31 @@
# include <fastmath.h>
#endif

#include "core.h"
#include <lol/main.h>

using namespace std;

// Optimisation helpers
#if defined __GNUC__
# define __likely(x) __builtin_expect(!!(x), 1)
# define __unlikely(x) __builtin_expect(!!(x), 0)
# define INLINEATTR __attribute__((always_inline))
# if defined __CELLOS_LV2__ && !defined __SNC__
# define FP_USE(x) __asm__("" : "+f" (x))
# elif defined __x86_64__
# define FP_USE(x) __asm__("" : "+x" (x))
# elif defined __i386__ /* FIXME: this isn't good */
# define FP_USE(x) __asm__("" : "+m" (x))
# else
# define FP_USE(x) (void)(x)
# endif
#else
# define __likely(x) x
# define __unlikely(x) x
# define INLINEATTR
# define FP_USE(x) (void)(x)
#endif

namespace lol
{

@@ -235,7 +256,7 @@ double lol_sin(double x)

/* If branches are cheap, skip the cycle count when |x| < π/4,
* and only do the Taylor series up to the required precision. */
#if defined LOL_FEATURE_CHEAP_BRANCHES
#if LOL_FEATURE_CHEAP_BRANCHES
if (absx < QUARTER)
{
/* Computing x^4 is one multiplication too many we do, but it helps
@@ -272,7 +293,7 @@ double lol_sin(double x)

/* If branches are very cheap, we have the option to do the Taylor
* series at a much lower degree by splitting. */
#if defined LOL_FEATURE_VERY_CHEAP_BRANCHES
#if LOL_FEATURE_VERY_CHEAP_BRANCHES
if (lol_fabs(absx) > QUARTER)
{
sign = (x * absx >= 0.0) ? sign : -sign;
@@ -295,7 +316,7 @@ double lol_sin(double x)
/* Compute a Tailor series for sin() and combine sign information. */
double x2 = absx * absx;
double x4 = x2 * x2;
#if defined LOL_FEATURE_VERY_CHEAP_BRANCHES
#if LOL_FEATURE_VERY_CHEAP_BRANCHES
double sub1 = (SC[3] * x4 + SC[1]) * x4 + ONE;
double sub2 = (SC[4] * x4 + SC[2]) * x4 + SC[0];
#else
@@ -311,7 +332,7 @@ double lol_cos(double x)
{
double absx = lol_fabs(x * INV_PI);

#if defined LOL_FEATURE_CHEAP_BRANCHES
#if LOL_FEATURE_CHEAP_BRANCHES
if (absx < QUARTER)
{
double x2 = absx * absx;
@@ -340,7 +361,7 @@ double lol_cos(double x)
#endif
absx -= num_cycles;

#if defined LOL_FEATURE_VERY_CHEAP_BRANCHES
#if LOL_FEATURE_VERY_CHEAP_BRANCHES
if (lol_fabs(absx) > QUARTER)
{
double x1 = HALF - lol_fabs(absx);
@@ -356,7 +377,7 @@ double lol_cos(double x)

double x2 = absx * absx;
double x4 = x2 * x2;
#if defined LOL_FEATURE_VERY_CHEAP_BRANCHES
#if LOL_FEATURE_VERY_CHEAP_BRANCHES
double sub1 = ((CC[5] * x4 + CC[3]) * x4 + CC[1]) * x4 + ONE;
double sub2 = (CC[4] * x4 + CC[2]) * x4 + CC[0];
#else
@@ -372,7 +393,7 @@ void lol_sincos(double x, double *sinx, double *cosx)
{
double absx = lol_fabs(x * INV_PI);

#if defined LOL_FEATURE_CHEAP_BRANCHES
#if LOL_FEATURE_CHEAP_BRANCHES
if (absx < QUARTER)
{
double x2 = absx * absx;
@@ -416,7 +437,7 @@ void lol_sincos(double x, double *sinx, double *cosx)
#endif
absx -= num_cycles;

#if defined LOL_FEATURE_VERY_CHEAP_BRANCHES
#if LOL_FEATURE_VERY_CHEAP_BRANCHES
if (lol_fabs(absx) > QUARTER)
{
cos_sign = sin_sign;
@@ -446,7 +467,7 @@ void lol_sincos(double x, double *sinx, double *cosx)

double x2 = absx * absx;
double x4 = x2 * x2;
#if defined LOL_FEATURE_VERY_CHEAP_BRANCHES
#if LOL_FEATURE_VERY_CHEAP_BRANCHES
double subs1 = ((SC[5] * x4 + SC[3]) * x4 + SC[1]) * x4 + ONE;
double subs2 = (SC[4] * x4 + SC[2]) * x4 + SC[0];
double subc1 = ((CC[5] * x4 + CC[3]) * x4 + CC[1]) * x4 + ONE;
@@ -476,7 +497,7 @@ void lol_sincos(float x, float *sinx, float *cosx)

double lol_tan(double x)
{
#if defined LOL_FEATURE_CHEAP_BRANCHES
#if LOL_FEATURE_CHEAP_BRANCHES
double absx = lol_fabs(x * INV_PI);

/* This value was determined empirically to ensure an error of no


+ 1
- 1
src/math/vector.cpp View File

@@ -17,7 +17,7 @@

#include <ostream> /* std::ostream */

#include "core.h"
#include <lol/main.h>

using namespace std;



Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save