diff --git a/src/lol/algorithm/sort.h b/src/lol/algorithm/sort.h index fac73654..8a7bee5a 100644 --- a/src/lol/algorithm/sort.h +++ b/src/lol/algorithm/sort.h @@ -33,10 +33,12 @@ void array_base<T, ARRAY>::Shuffle() template<typename T, typename ARRAY> void array_base<T, ARRAY>::Sort(int sort) { +#if SORT_WORKS // yeah cause it's shite. int s = 0; // Classic bubble if (s++ == sort) { +#endif //SORT_WORKS int d = 1; for (ptrdiff_t i = 0; i < Count() - 1; i = lol::max(i + d, (ptrdiff_t)0)) { @@ -48,12 +50,14 @@ void array_base<T, ARRAY>::Sort(int sort) d = -1; } } +#if SORT_WORKS } // Quick sort with swap else if (s++ == sort) { SortQuickSwap(0, Count()); } +#endif //SORT_WORKS } template<typename T, typename ARRAY> diff --git a/src/lol/base/array.h b/src/lol/base/array.h index fe98e905..95a29722 100644 --- a/src/lol/base/array.h +++ b/src/lol/base/array.h @@ -383,7 +383,7 @@ public: } void Shuffle(); - void Sort(int sort); + void Sort(int sort = 0); void SortQuickSwap(ptrdiff_t start, ptrdiff_t stop); /* TODO: remove these legacy functions one day */ diff --git a/src/lol/math/geometry.h b/src/lol/math/geometry.h index 5ae5a337..cf734f2f 100644 --- a/src/lol/math/geometry.h +++ b/src/lol/math/geometry.h @@ -26,6 +26,7 @@ namespace lol { +//AxisBase -------------------------------------------------------------------- struct AxisBase { enum Type @@ -38,6 +39,20 @@ protected: }; typedef SafeEnum<AxisBase> Axis; +//DirectionBase --------------------------------------------------------------- +struct DirectionBase +{ + enum Type + { + Up = 0, Down, Left, Right, MAX, + }; +protected: + static inline char const *GetDescription() { return "Up,Down,Left,Right,MAX"; } + static inline char const **GetCustomString() { return nullptr; } +}; +typedef SafeEnum<DirectionBase> Direction; + +//LOL_BOX_TYPEDEFS ------------------------------------------------------------ #define LOL_BOX_TYPEDEFS(tname, suffix) \ template <typename T> struct tname; \ typedef tname<float> suffix; \ diff --git a/src/mesh/mesh.h b/src/mesh/mesh.h index c8c09fd8..1ba628bd 100644 --- a/src/mesh/mesh.h +++ b/src/mesh/mesh.h @@ -18,13 +18,33 @@ #include <lol/gpu/vertexbuffer.h> #include <lol/gpu/indexbuffer.h> +//Assimp supports http://assimp.sourceforge.net/main_features_formats.html +#if USE_ASSIMP +//Cause build has a problem with function choice. +#if _WIN32 || _WIN64 +#define sin lol::sin +#define asin lol::asin +#define cos lol::cos +#define acos lol::acos +#endif //_WIN32 || _WIN64 +#include <assimp/Importer.hpp> // C++ importer interface +#include <assimp/scene.h> // Output data structure +#include <assimp/postprocess.h> // Post processing flags +#if _WIN32 || _WIN64 +#undef sin +#undef asin +#undef cos +#undef acos +#endif //_WIN32 || _WIN64 +#endif //USE_ASSIMP + namespace lol { /* * A mesh contains a list of submeshes. This is a convenient way to - * handle different materials or mesh types (static, skeletal, morph - * targets, etc.) within the same container object. + * handle different materials or mesh types (static, skeletal, morph targets, etc.) + * within the same container object. */ class Mesh