| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "loldebug.h" | #include "loldebug.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "loldebug.h" | #include "loldebug.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "loldebug.h" | #include "loldebug.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "loldebug.h" | #include "loldebug.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -13,7 +13,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| using namespace std; | using namespace std; | ||||
| using namespace lol; | using namespace lol; | ||||
| @@ -13,7 +13,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| using namespace std; | using namespace std; | ||||
| using namespace lol; | using namespace lol; | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "loldebug.h" | #include "loldebug.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "loldebug.h" | #include "loldebug.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -15,7 +15,7 @@ | |||||
| #include <cstring> | #include <cstring> | ||||
| #include <cstdio> | #include <cstdio> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "loldebug.h" | #include "loldebug.h" | ||||
| using namespace lol; | using namespace lol; | ||||
| @@ -13,7 +13,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "loldebug.h" | #include "loldebug.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -6,7 +6,7 @@ SUBDIRS = bullet lua data | |||||
| noinst_LIBRARIES = liblolcore.a | noinst_LIBRARIES = liblolcore.a | ||||
| liblolcore_a_SOURCES = \ | 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 \ | audio.cpp audio.h scene.cpp scene.h font.cpp font.h \ | ||||
| entity.cpp entity.h ticker.cpp ticker.h lolgl.h \ | entity.cpp entity.h ticker.cpp ticker.h lolgl.h \ | ||||
| tileset.cpp tileset.h forge.cpp forge.h video.cpp video.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 | gpu/lolfx-scanner.l gpu/lolfx-parser.y | ||||
| liblolcore_headers = \ | liblolcore_headers = \ | ||||
| lol/main.h lol/engine.h lol/extras.h \ | |||||
| lol/unit.h \ | |||||
| \ | |||||
| lol/base/all.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/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/all.h \ | ||||
| lol/math/functions.h lol/math/vector.h lol/math/half.h lol/math/real.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/gpu/renderer.h lol/gpu/rendercontext.h \ | ||||
| \ | \ | ||||
| lol/debug/all.h \ | lol/debug/all.h \ | ||||
| lol/debug/lines.h \ | |||||
| \ | |||||
| lol/unit.h | |||||
| lol/debug/lines.h | |||||
| liblolcore_sources = \ | liblolcore_sources = \ | ||||
| generated/location.hh generated/position.hh generated/stack.hh \ | generated/location.hh generated/position.hh generated/stack.hh \ | ||||
| @@ -16,7 +16,7 @@ | |||||
| # include <emscripten.h> | # include <emscripten.h> | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "lolgl.h" | #include "lolgl.h" | ||||
| @@ -25,7 +25,7 @@ | |||||
| # endif | # endif | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -23,7 +23,7 @@ | |||||
| # include <emscripten.h> | # include <emscripten.h> | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -26,7 +26,7 @@ | |||||
| # include <cstdarg> | # include <cstdarg> | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -21,7 +21,7 @@ | |||||
| #include <cstdarg> | #include <cstdarg> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -16,7 +16,7 @@ | |||||
| #include <cstring> | #include <cstring> | ||||
| #include <cstdlib> | #include <cstdlib> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #if defined _WIN32 || defined _XBOX | #if defined _WIN32 || defined _XBOX | ||||
| # define strcasecmp _stricmp | # define strcasecmp _stricmp | ||||
| @@ -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__ | |||||
| @@ -14,7 +14,7 @@ | |||||
| #include <cstdio> | #include <cstdio> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "loldebug.h" | #include "loldebug.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -18,7 +18,7 @@ | |||||
| # include <pipi.h> | # include <pipi.h> | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "loldebug.h" | #include "loldebug.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -14,7 +14,7 @@ | |||||
| #include <cstdio> | #include <cstdio> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "loldebug.h" | #include "loldebug.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -15,7 +15,7 @@ | |||||
| #include <cstring> | #include <cstring> | ||||
| #include <cstdlib> | #include <cstdlib> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #if defined _WIN32 || defined _XBOX | #if defined _WIN32 || defined _XBOX | ||||
| # define strcasecmp _stricmp | # define strcasecmp _stricmp | ||||
| @@ -18,7 +18,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include <lol/math/geometry.h> | #include <lol/math/geometry.h> | ||||
| namespace lol | namespace lol | ||||
| @@ -16,7 +16,7 @@ | |||||
| #include <string> | #include <string> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "easymesh/easymesh-compiler.h" | #include "easymesh/easymesh-compiler.h" | ||||
| namespace lol | namespace lol | ||||
| @@ -19,7 +19,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "easymesh/easymesh-compiler.h" | #include "easymesh/easymesh-compiler.h" | ||||
| LOLFX_RESOURCE_DECLARE(shiny); | LOLFX_RESOURCE_DECLARE(shiny); | ||||
| @@ -19,7 +19,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -19,7 +19,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -32,7 +32,7 @@ | |||||
| # endif | # endif | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "lolgl.h" | #include "lolgl.h" | ||||
| #include "eglapp.h" | #include "eglapp.h" | ||||
| #if defined USE_SDL | #if defined USE_SDL | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -14,7 +14,7 @@ | |||||
| #include <cstdlib> | #include <cstdlib> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -16,7 +16,7 @@ | |||||
| #include <cstring> | #include <cstring> | ||||
| #include <cstdio> | #include <cstdio> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| using namespace std; | using namespace std; | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -54,7 +54,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "easymesh/easymesh.h" | #include "easymesh/easymesh.h" | ||||
| #include <string> | #include <string> | ||||
| @@ -668,7 +668,7 @@ using std::malloc; | |||||
| using std::realloc; | using std::realloc; | ||||
| using std::free; | using std::free; | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "easymesh/easymesh-compiler.h" | #include "easymesh/easymesh-compiler.h" | ||||
| typedef lol::EasyMeshParser::token token; | typedef lol::EasyMeshParser::token token; | ||||
| @@ -52,7 +52,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include <string> | #include <string> | ||||
| @@ -1672,7 +1672,7 @@ using std::realloc; | |||||
| using std::free; | using std::free; | ||||
| #include <iostream> | #include <iostream> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "gpu/lolfx-compiler.h" | #include "gpu/lolfx-compiler.h" | ||||
| typedef lol::LolFxParser::token token; | typedef lol::LolFxParser::token token; | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "lolgl.h" | #include "lolgl.h" | ||||
| #if defined _WIN32 && defined USE_D3D9 | #if defined _WIN32 && defined USE_D3D9 | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "lolgl.h" | #include "lolgl.h" | ||||
| #if defined _WIN32 && defined USE_D3D9 | #if defined _WIN32 && defined USE_D3D9 | ||||
| @@ -14,7 +14,7 @@ | |||||
| #include <string> | #include <string> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "gpu/lolfx-compiler.h" | #include "gpu/lolfx-compiler.h" | ||||
| namespace lol | namespace lol | ||||
| @@ -17,7 +17,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "gpu/lolfx-compiler.h" | #include "gpu/lolfx-compiler.h" | ||||
| namespace lol | namespace lol | ||||
| @@ -14,7 +14,7 @@ | |||||
| #include <cstdlib> | #include <cstdlib> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -28,7 +28,7 @@ | |||||
| # undef far /* Fuck Microsoft again */ | # undef far /* Fuck Microsoft again */ | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "lolgl.h" | #include "lolgl.h" | ||||
| /* FIXME: find a way to pass g_hwnd from the windowing system */ | /* FIXME: find a way to pass g_hwnd from the windowing system */ | ||||
| @@ -31,7 +31,7 @@ | |||||
| # undef far /* Fuck Microsoft again */ | # undef far /* Fuck Microsoft again */ | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "lolgl.h" | #include "lolgl.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "lolgl.h" | #include "lolgl.h" | ||||
| #if defined _WIN32 && defined USE_D3D9 | #if defined _WIN32 && defined USE_D3D9 | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "lolgl.h" | #include "lolgl.h" | ||||
| #if defined _WIN32 && defined USE_D3D9 | #if defined _WIN32 && defined USE_D3D9 | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| using namespace std; | using namespace std; | ||||
| @@ -21,7 +21,7 @@ extern "C" { | |||||
| #include <android_native_app_glue.h> | #include <android_native_app_glue.h> | ||||
| } | } | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "../../image/image-private.h" | #include "../../image/image-private.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "../../image/image-private.h" | #include "../../image/image-private.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -21,7 +21,7 @@ using namespace std; | |||||
| #include <windows.h> | #include <windows.h> | ||||
| #include <gdiplus.h> | #include <gdiplus.h> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "../../image/image-private.h" | #include "../../image/image-private.h" | ||||
| namespace lol | namespace lol | ||||
| @@ -16,7 +16,7 @@ | |||||
| #include <Imlib2.h> | #include <Imlib2.h> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "../../image/image-private.h" | #include "../../image/image-private.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -16,7 +16,7 @@ | |||||
| #import <UIKit/UIKit.h> | #import <UIKit/UIKit.h> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "../../image/image-private.h" | #include "../../image/image-private.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "../../image/image-private.h" | #include "../../image/image-private.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -18,7 +18,7 @@ | |||||
| #include <cell/sysmodule.h> | #include <cell/sysmodule.h> | ||||
| #include <cell/codec/pngdec.h> | #include <cell/codec/pngdec.h> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "../../image/image-private.h" | #include "../../image/image-private.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -25,7 +25,7 @@ | |||||
| # include <SDL_image.h> | # include <SDL_image.h> | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "../../image/image-private.h" | #include "../../image/image-private.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -13,7 +13,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "../../image/image-private.h" | #include "../../image/image-private.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "../../image/image-private.h" | #include "../../image/image-private.h" | ||||
| using namespace std; | using namespace std; | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * This file contains code and data related to various CIE standards. | * This file contains code and data related to various CIE standards. | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * Image merge operations: merge, min/max, overlay, screen, multiply, | * Image merge operations: merge, min/max, overlay, screen, multiply, | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "image-private.h" | #include "image-private.h" | ||||
| /* | /* | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * Direct Binary Search dithering | * Direct Binary Search dithering | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * Generic error diffusion functions | * Generic error diffusion functions | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * Bayer ordered dithering functions | * Bayer ordered dithering functions | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * Ostromoukhov dithering functions | * Ostromoukhov dithering functions | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * Random dithering | * Random dithering | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * Colour manipulation functions | * Colour manipulation functions | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * Generic convolution functions | * Generic convolution functions | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * Dilate and erode functions | * Dilate and erode functions | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * Median filter functions | * Median filter functions | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * YUV conversion functions | * YUV conversion functions | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "image-private.h" | #include "image-private.h" | ||||
| #include <algorithm> /* for std::swap */ | #include <algorithm> /* for std::swap */ | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * Stock kernels | * Stock kernels | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * Noise rendering functions | * Noise rendering functions | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "image-private.h" | #include "image-private.h" | ||||
| namespace lol | namespace lol | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| /* | /* | ||||
| * Image resizing functions | * Image resizing functions | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -11,7 +11,7 @@ | |||||
| #if !defined __LOL_INPUT_CONTROLLER_H__ | #if !defined __LOL_INPUT_CONTROLLER_H__ | ||||
| #define __LOL_INPUT_CONTROLLER_H__ | #define __LOL_INPUT_CONTROLLER_H__ | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| #include "input/input_internal.h" | #include "input/input_internal.h" | ||||
| @@ -11,7 +11,7 @@ | |||||
| #if !defined __LOL_INPUT_H__ | #if !defined __LOL_INPUT_H__ | ||||
| #define __LOL_INPUT_H__ | #define __LOL_INPUT_H__ | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -11,7 +11,7 @@ | |||||
| #if !defined __LOL_INPUT_DEVICE_INTERNAL_H__ | #if !defined __LOL_INPUT_DEVICE_INTERNAL_H__ | ||||
| #define __LOL_INPUT_DEVICE_H__ | #define __LOL_INPUT_DEVICE_H__ | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -15,7 +15,7 @@ | |||||
| #include <cstring> | #include <cstring> | ||||
| #include <cstdlib> | #include <cstdlib> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| @@ -11,6 +11,7 @@ | |||||
| #if !defined __LOL_BASE_ALL_H__ | #if !defined __LOL_BASE_ALL_H__ | ||||
| #define __LOL_BASE_ALL_H__ | #define __LOL_BASE_ALL_H__ | ||||
| #include <lol/base/features.h> | |||||
| #include <lol/base/types.h> | #include <lol/base/types.h> | ||||
| #include <lol/base/log.h> | #include <lol/base/log.h> | ||||
| #include <lol/base/assert.h> | #include <lol/base/assert.h> | ||||
| @@ -29,9 +29,6 @@ | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| /* Set this to 1 when Visual Studio finally understands the feature */ | |||||
| #define INHERIT_CONSTRUCTORS 0 | |||||
| #define INDEX_NONE -1 | #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>, | class array : public array_base<array_element<T1, T2, T3, T4, T5, T6, T7, T8>, | ||||
| array<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>, | using array_base<array_element<T1, T2, T3, T4, T5, T6, T7, T8>, | ||||
| array<T1, T2, T3, T4, T5, T6, T7, T8>>::array_base; | array<T1, T2, T3, T4, T5, T6, T7, T8>>::array_base; | ||||
| #else | #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>, | : public array_base<array_element<T1, T2, T3, T4, T5, T6, T7, void>, | ||||
| array<T1, T2, T3, T4, T5, T6, T7>> | 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>, | using array_base<array_element<T1, T2, T3, T4, T5, T6, T7, void>, | ||||
| array<T1, T2, T3, T4, T5, T6, T7>>::array_base; | array<T1, T2, T3, T4, T5, T6, T7>>::array_base; | ||||
| #else | #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>, | : public array_base<array_element<T1, T2, T3, T4, T5, T6, void, void>, | ||||
| array<T1, T2, T3, T4, T5, T6>> | 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>, | using array_base<array_element<T1, T2, T3, T4, T5, T6, void, void>, | ||||
| array<T1, T2, T3, T4, T5, T6>>::array_base; | array<T1, T2, T3, T4, T5, T6>>::array_base; | ||||
| #else | #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>, | : public array_base<array_element<T1, T2, T3, T4, T5, void, void, void>, | ||||
| array<T1, T2, T3, T4, T5>> | 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>, | using array_base<array_element<T1, T2, T3, T4, T5, void, void, void>, | ||||
| array<T1, T2, T3, T4, T5>>::array_base; | array<T1, T2, T3, T4, T5>>::array_base; | ||||
| #else | #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>, | : public array_base<array_element<T1, T2, T3, T4, void, void, void, void>, | ||||
| array<T1, T2, T3, T4>> | 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>, | using array_base<array_element<T1, T2, T3, T4, void, void, void, void>, | ||||
| array<T1, T2, T3, T4>>::array_base; | array<T1, T2, T3, T4>>::array_base; | ||||
| #else | #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>, | : public array_base<array_element<T1, T2, T3, void, void, void, void, void>, | ||||
| array<T1, T2, T3>> | 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>, | using array_base<array_element<T1, T2, T3, void, void, void, void, void>, | ||||
| array<T1, T2, T3>>::array_base; | array<T1, T2, T3>>::array_base; | ||||
| #else | #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>, | : public array_base<array_element<T1, T2, void, void, void, void, void, void>, | ||||
| array<T1, T2>> | 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>, | using array_base<array_element<T1, T2, void, void, void, void, void, void>, | ||||
| array<T1, T2>>::array_base; | array<T1, T2>>::array_base; | ||||
| #else | #else | ||||
| @@ -883,7 +880,7 @@ class array<T, void, void, void, void, void, void, void> | |||||
| : public array_base<T, | : public array_base<T, | ||||
| array<T>> | array<T>> | ||||
| { | { | ||||
| #if INHERIT_CONSTRUCTORS | |||||
| #if LOL_FEATURE_CXX11_INHERIT_CONSTRUCTORS | |||||
| using array_base<T, | using array_base<T, | ||||
| array<T>>::array_base; | array<T>>::array_base; | ||||
| #else | #else | ||||
| @@ -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__ | |||||
| @@ -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__ | |||||
| @@ -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__ | |||||
| @@ -18,6 +18,13 @@ | |||||
| #include <stdint.h> | #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 | namespace lol | ||||
| { | { | ||||
| @@ -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__ | |||||
| @@ -25,6 +25,20 @@ | |||||
| namespace lol | 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) \ | #define LOL_VECTOR_TYPEDEFS(tname, suffix) \ | ||||
| template <typename T> struct tname; \ | template <typename T> struct tname; \ | ||||
| typedef tname<half> f16##suffix; \ | typedef tname<half> f16##suffix; \ | ||||
| @@ -88,7 +102,7 @@ template<typename T, int N> struct XVec2 | |||||
| { | { | ||||
| inline XVec2<T, N>& operator =(Vec2<T> that); | 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) | inline XVec2<T, N>& operator =(XVec2<T, N> const &that) | ||||
| { | { | ||||
| return *this = (Vec2<T>)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); | 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) | inline XVec3<T, N>& operator =(XVec3<T, N> const &that) | ||||
| { | { | ||||
| return *this = (Vec3<T>)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); | 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) | inline XVec4<T, N>& operator =(XVec4<T, N> const &that) | ||||
| { | { | ||||
| return *this = (Vec4<T>)that; | return *this = (Vec4<T>)that; | ||||
| @@ -197,7 +211,6 @@ template <typename T> struct BVec2 | |||||
| struct { T s, t; }; | struct { T s, t; }; | ||||
| #if !_DOXYGEN_SKIP_ME | #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,0x00> const xx, rr, ss; | ||||
| XVec2<T,0x01> _____ xy, rg, st; | XVec2<T,0x01> _____ xy, rg, st; | ||||
| XVec2<T,0x10> _____ yx, gr, ts; | XVec2<T,0x10> _____ yx, gr, ts; | ||||
| @@ -228,7 +241,6 @@ template <typename T> struct BVec2 | |||||
| XVec4<T,0x1101> const yyxy, ggrg, ttst; | XVec4<T,0x1101> const yyxy, ggrg, ttst; | ||||
| XVec4<T,0x1110> const yyyx, gggr, ttts; | XVec4<T,0x1110> const yyyx, gggr, ttts; | ||||
| XVec4<T,0x1111> const yyyy, gggg, tttt; | XVec4<T,0x1111> const yyyy, gggg, tttt; | ||||
| #undef _____ | |||||
| #endif | #endif | ||||
| }; | }; | ||||
| }; | }; | ||||
| @@ -360,7 +372,6 @@ template <typename T> struct BVec3 | |||||
| struct { T s, t, p; }; | struct { T s, t, p; }; | ||||
| #if !_DOXYGEN_SKIP_ME | #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,0x00> const xx, rr, ss; | ||||
| XVec2<T,0x01> _____ xy, rg, st; | XVec2<T,0x01> _____ xy, rg, st; | ||||
| XVec2<T,0x02> _____ xz, rb, sp; | XVec2<T,0x02> _____ xz, rb, sp; | ||||
| @@ -480,7 +491,6 @@ template <typename T> struct BVec3 | |||||
| XVec4<T,0x2220> const zzzx, bbbr, ppps; | XVec4<T,0x2220> const zzzx, bbbr, ppps; | ||||
| XVec4<T,0x2221> const zzzy, bbbg, pppt; | XVec4<T,0x2221> const zzzy, bbbg, pppt; | ||||
| XVec4<T,0x2222> const zzzz, bbbb, pppp; | XVec4<T,0x2222> const zzzz, bbbb, pppp; | ||||
| #undef _____ | |||||
| #endif | #endif | ||||
| }; | }; | ||||
| }; | }; | ||||
| @@ -561,7 +571,6 @@ template <typename T> struct BVec4 | |||||
| struct { T s, t, p, q; }; | struct { T s, t, p, q; }; | ||||
| #if !_DOXYGEN_SKIP_ME | #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,0x00> const xx, rr, ss; | ||||
| XVec2<T,0x01> _____ xy, rg, st; | XVec2<T,0x01> _____ xy, rg, st; | ||||
| XVec2<T,0x02> _____ xz, rb, sp; | XVec2<T,0x02> _____ xz, rb, sp; | ||||
| @@ -900,7 +909,6 @@ template <typename T> struct BVec4 | |||||
| XVec4<T,0x3331> const wwwy, aaag, qqqt; | XVec4<T,0x3331> const wwwy, aaag, qqqt; | ||||
| XVec4<T,0x3332> const wwwz, aaab, qqqp; | XVec4<T,0x3332> const wwwz, aaab, qqqp; | ||||
| XVec4<T,0x3333> const wwww, aaaa, qqqq; | XVec4<T,0x3333> const wwww, aaaa, qqqq; | ||||
| #undef _____ | |||||
| #endif | #endif | ||||
| }; | }; | ||||
| }; | }; | ||||
| @@ -257,7 +257,6 @@ | |||||
| <ClInclude Include="audio.h" /> | <ClInclude Include="audio.h" /> | ||||
| <ClInclude Include="camera.h" /> | <ClInclude Include="camera.h" /> | ||||
| <ClInclude Include="commandstack.h" /> | <ClInclude Include="commandstack.h" /> | ||||
| <ClInclude Include="core.h" /> | |||||
| <ClInclude Include="debug\fps.h" /> | <ClInclude Include="debug\fps.h" /> | ||||
| <ClInclude Include="debug\record.h" /> | <ClInclude Include="debug\record.h" /> | ||||
| <ClInclude Include="debug\stats.h" /> | <ClInclude Include="debug\stats.h" /> | ||||
| @@ -295,6 +294,7 @@ | |||||
| <ClInclude Include="lol\base\array.h" /> | <ClInclude Include="lol\base\array.h" /> | ||||
| <ClInclude Include="lol\base\assert.h" /> | <ClInclude Include="lol\base\assert.h" /> | ||||
| <ClInclude Include="lol\base\enum.h" /> | <ClInclude Include="lol\base\enum.h" /> | ||||
| <ClInclude Include="lol\base\features.h" /> | |||||
| <ClInclude Include="lol\base\hash.h" /> | <ClInclude Include="lol\base\hash.h" /> | ||||
| <ClInclude Include="lol\base\log.h" /> | <ClInclude Include="lol\base\log.h" /> | ||||
| <ClInclude Include="lol\base\map.h" /> | <ClInclude Include="lol\base\map.h" /> | ||||
| @@ -302,6 +302,8 @@ | |||||
| <ClInclude Include="lol\base\types.h" /> | <ClInclude Include="lol\base\types.h" /> | ||||
| <ClInclude Include="lol\debug\all.h" /> | <ClInclude Include="lol\debug\all.h" /> | ||||
| <ClInclude Include="lol\debug\lines.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\all.h" /> | ||||
| <ClInclude Include="lol\gpu\framebuffer.h" /> | <ClInclude Include="lol\gpu\framebuffer.h" /> | ||||
| <ClInclude Include="lol\gpu\indexbuffer.h" /> | <ClInclude Include="lol\gpu\indexbuffer.h" /> | ||||
| @@ -315,6 +317,7 @@ | |||||
| <ClInclude Include="lol\image\color.h" /> | <ClInclude Include="lol\image\color.h" /> | ||||
| <ClInclude Include="lol\image\image.h" /> | <ClInclude Include="lol\image\image.h" /> | ||||
| <ClInclude Include="lol\image\pixel.h" /> | <ClInclude Include="lol\image\pixel.h" /> | ||||
| <ClInclude Include="lol\main.h" /> | |||||
| <ClInclude Include="lol\math\all.h" /> | <ClInclude Include="lol\math\all.h" /> | ||||
| <ClInclude Include="lol\math\array2d.h" /> | <ClInclude Include="lol\math\array2d.h" /> | ||||
| <ClInclude Include="lol\math\array3d.h" /> | <ClInclude Include="lol\math\array3d.h" /> | ||||
| @@ -450,6 +450,15 @@ | |||||
| <ClInclude Include="lol\math\vector.h"> | <ClInclude Include="lol\math\vector.h"> | ||||
| <Filter>lol\math</Filter> | <Filter>lol\math</Filter> | ||||
| </ClInclude> | </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"> | <ClInclude Include="lol\unit.h"> | ||||
| <Filter>lol</Filter> | <Filter>lol</Filter> | ||||
| </ClInclude> | </ClInclude> | ||||
| @@ -483,9 +492,6 @@ | |||||
| <ClInclude Include="camera.h"> | <ClInclude Include="camera.h"> | ||||
| <Filter>...</Filter> | <Filter>...</Filter> | ||||
| </ClInclude> | </ClInclude> | ||||
| <ClInclude Include="core.h"> | |||||
| <Filter>...</Filter> | |||||
| </ClInclude> | |||||
| <ClInclude Include="dict.h"> | <ClInclude Include="dict.h"> | ||||
| <Filter>...</Filter> | <Filter>...</Filter> | ||||
| </ClInclude> | </ClInclude> | ||||
| @@ -603,6 +609,9 @@ | |||||
| <ClInclude Include="lol\base\enum.h"> | <ClInclude Include="lol\base\enum.h"> | ||||
| <Filter>lol\base</Filter> | <Filter>lol\base</Filter> | ||||
| </ClInclude> | </ClInclude> | ||||
| <ClInclude Include="lol\base\features.h"> | |||||
| <Filter>lol\base</Filter> | |||||
| </ClInclude> | |||||
| <ClInclude Include="lol\base\hash.h"> | <ClInclude Include="lol\base\hash.h"> | ||||
| <Filter>lol\base</Filter> | <Filter>lol\base</Filter> | ||||
| </ClInclude> | </ClInclude> | ||||
| @@ -12,7 +12,7 @@ | |||||
| # include "config.h" | # include "config.h" | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| namespace lol { | namespace lol { | ||||
| @@ -18,7 +18,7 @@ | |||||
| #include <ostream> /* std::ostream */ | #include <ostream> /* std::ostream */ | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| using namespace std; | using namespace std; | ||||
| @@ -20,7 +20,7 @@ | |||||
| # endif | # endif | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| using namespace std; | using namespace std; | ||||
| @@ -17,7 +17,7 @@ | |||||
| #include <cstdio> | #include <cstdio> | ||||
| #include <cstdlib> | #include <cstdlib> | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| using namespace std; | using namespace std; | ||||
| @@ -16,10 +16,31 @@ | |||||
| # include <fastmath.h> | # include <fastmath.h> | ||||
| #endif | #endif | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| using namespace std; | 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 | namespace lol | ||||
| { | { | ||||
| @@ -235,7 +256,7 @@ double lol_sin(double x) | |||||
| /* If branches are cheap, skip the cycle count when |x| < π/4, | /* If branches are cheap, skip the cycle count when |x| < π/4, | ||||
| * and only do the Taylor series up to the required precision. */ | * 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) | if (absx < QUARTER) | ||||
| { | { | ||||
| /* Computing x^4 is one multiplication too many we do, but it helps | /* 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 | /* If branches are very cheap, we have the option to do the Taylor | ||||
| * series at a much lower degree by splitting. */ | * 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) | if (lol_fabs(absx) > QUARTER) | ||||
| { | { | ||||
| sign = (x * absx >= 0.0) ? sign : -sign; | 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. */ | /* Compute a Tailor series for sin() and combine sign information. */ | ||||
| double x2 = absx * absx; | double x2 = absx * absx; | ||||
| double x4 = x2 * x2; | 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 sub1 = (SC[3] * x4 + SC[1]) * x4 + ONE; | ||||
| double sub2 = (SC[4] * x4 + SC[2]) * x4 + SC[0]; | double sub2 = (SC[4] * x4 + SC[2]) * x4 + SC[0]; | ||||
| #else | #else | ||||
| @@ -311,7 +332,7 @@ double lol_cos(double x) | |||||
| { | { | ||||
| double absx = lol_fabs(x * INV_PI); | double absx = lol_fabs(x * INV_PI); | ||||
| #if defined LOL_FEATURE_CHEAP_BRANCHES | |||||
| #if LOL_FEATURE_CHEAP_BRANCHES | |||||
| if (absx < QUARTER) | if (absx < QUARTER) | ||||
| { | { | ||||
| double x2 = absx * absx; | double x2 = absx * absx; | ||||
| @@ -340,7 +361,7 @@ double lol_cos(double x) | |||||
| #endif | #endif | ||||
| absx -= num_cycles; | absx -= num_cycles; | ||||
| #if defined LOL_FEATURE_VERY_CHEAP_BRANCHES | |||||
| #if LOL_FEATURE_VERY_CHEAP_BRANCHES | |||||
| if (lol_fabs(absx) > QUARTER) | if (lol_fabs(absx) > QUARTER) | ||||
| { | { | ||||
| double x1 = HALF - lol_fabs(absx); | double x1 = HALF - lol_fabs(absx); | ||||
| @@ -356,7 +377,7 @@ double lol_cos(double x) | |||||
| double x2 = absx * absx; | double x2 = absx * absx; | ||||
| double x4 = x2 * x2; | 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 sub1 = ((CC[5] * x4 + CC[3]) * x4 + CC[1]) * x4 + ONE; | ||||
| double sub2 = (CC[4] * x4 + CC[2]) * x4 + CC[0]; | double sub2 = (CC[4] * x4 + CC[2]) * x4 + CC[0]; | ||||
| #else | #else | ||||
| @@ -372,7 +393,7 @@ void lol_sincos(double x, double *sinx, double *cosx) | |||||
| { | { | ||||
| double absx = lol_fabs(x * INV_PI); | double absx = lol_fabs(x * INV_PI); | ||||
| #if defined LOL_FEATURE_CHEAP_BRANCHES | |||||
| #if LOL_FEATURE_CHEAP_BRANCHES | |||||
| if (absx < QUARTER) | if (absx < QUARTER) | ||||
| { | { | ||||
| double x2 = absx * absx; | double x2 = absx * absx; | ||||
| @@ -416,7 +437,7 @@ void lol_sincos(double x, double *sinx, double *cosx) | |||||
| #endif | #endif | ||||
| absx -= num_cycles; | absx -= num_cycles; | ||||
| #if defined LOL_FEATURE_VERY_CHEAP_BRANCHES | |||||
| #if LOL_FEATURE_VERY_CHEAP_BRANCHES | |||||
| if (lol_fabs(absx) > QUARTER) | if (lol_fabs(absx) > QUARTER) | ||||
| { | { | ||||
| cos_sign = sin_sign; | cos_sign = sin_sign; | ||||
| @@ -446,7 +467,7 @@ void lol_sincos(double x, double *sinx, double *cosx) | |||||
| double x2 = absx * absx; | double x2 = absx * absx; | ||||
| double x4 = x2 * x2; | 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 subs1 = ((SC[5] * x4 + SC[3]) * x4 + SC[1]) * x4 + ONE; | ||||
| double subs2 = (SC[4] * x4 + SC[2]) * x4 + SC[0]; | double subs2 = (SC[4] * x4 + SC[2]) * x4 + SC[0]; | ||||
| double subc1 = ((CC[5] * x4 + CC[3]) * x4 + CC[1]) * x4 + ONE; | 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) | double lol_tan(double x) | ||||
| { | { | ||||
| #if defined LOL_FEATURE_CHEAP_BRANCHES | |||||
| #if LOL_FEATURE_CHEAP_BRANCHES | |||||
| double absx = lol_fabs(x * INV_PI); | double absx = lol_fabs(x * INV_PI); | ||||
| /* This value was determined empirically to ensure an error of no | /* This value was determined empirically to ensure an error of no | ||||
| @@ -17,7 +17,7 @@ | |||||
| #include <ostream> /* std::ostream */ | #include <ostream> /* std::ostream */ | ||||
| #include "core.h" | |||||
| #include <lol/main.h> | |||||
| using namespace std; | using namespace std; | ||||