Compare commits

..

8 Commits

Author SHA1 Message Date
Michele Caini
000b7d2651 updated single include file 2019-12-19 15:14:33 +01:00
Michele Caini
9ffa372ba2 workaround for an issue of MSVC (close #373) 2019-12-19 09:19:37 +01:00
Michele Caini
510cfcf1fc now working on v3.2.2 2019-12-19 09:18:41 +01:00
Michele Caini
e7f6d93a1e cleanup 2019-12-01 15:59:25 +01:00
Michele Caini
a17c449075 observer: minor changes 2019-12-01 15:58:05 +01:00
Michele Caini
c4da7a87f9 typo 2019-12-01 15:57:51 +01:00
Michele Caini
4a8b2f826d cleanup 2019-12-01 15:46:28 +01:00
Stefano Fiorentino
4901e4fb80 adding git_shallow to cmake deps helps reducing building time from scratch (#367)
very useful in CI/CD pipelines
2019-12-01 15:45:20 +01:00
11 changed files with 25 additions and 27 deletions

View File

@@ -32,6 +32,7 @@ NixAJ
Paolo-Oliverio
pgruenbacher
prowolf
stefanofiorentino
suVrik
szunhammer
The5-1

View File

@@ -16,7 +16,7 @@ endif()
# Project configuration
#
project(EnTT VERSION 3.2.1 LANGUAGES CXX)
project(EnTT VERSION 3.2.2 LANGUAGES CXX)
include(GNUInstallDirs)

View File

@@ -7,6 +7,7 @@ ExternalProject_Add(
cereal
GIT_REPOSITORY https://github.com/USCiLab/cereal.git
GIT_TAG v1.2.2
GIT_SHALLOW 1
DOWNLOAD_DIR ${CEREAL_DEPS_DIR}
TMP_DIR ${CEREAL_DEPS_DIR}/tmp
STAMP_DIR ${CEREAL_DEPS_DIR}/stamp

View File

@@ -7,6 +7,7 @@ ExternalProject_Add(
duktape
GIT_REPOSITORY https://github.com/svaarala/duktape-releases.git
GIT_TAG v2.2.0
GIT_SHALLOW 1
DOWNLOAD_DIR ${DUKTAPE_DEPS_DIR}
TMP_DIR ${DUKTAPE_DEPS_DIR}/tmp
STAMP_DIR ${DUKTAPE_DEPS_DIR}/stamp

View File

@@ -7,6 +7,7 @@ ExternalProject_Add(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG master
GIT_SHALLOW 1
DOWNLOAD_DIR ${GOOGLETEST_DEPS_DIR}
TMP_DIR ${GOOGLETEST_DEPS_DIR}/tmp
STAMP_DIR ${GOOGLETEST_DEPS_DIR}/stamp

View File

@@ -7765,10 +7765,10 @@ class basic_registry {
struct pool_handler: storage<Entity, Component> {
std::size_t super{};
pool_handler() ENTT_NOEXCEPT = default;
pool_handler(const storage<Entity, Component> &other)
: storage<Entity, Component>{other}
template<typename... Args>
pool_handler(Args &&... args)
: storage<Entity, Component>{std::forward<Args>(args)...},
super{}
{}
auto on_construct() ENTT_NOEXCEPT {
@@ -8041,7 +8041,7 @@ public:
* Identifiers aren't guaranteed to be stable between different runs.
*
* @tparam Component Type of component to query.
* @return Runtime the opaque identifier of the given type of component.
* @return The opaque identifier of the given type of component.
*/
template<typename Component>
static component type() ENTT_NOEXCEPT {
@@ -10134,9 +10134,7 @@ class basic_observer {
struct matcher_handler<matcher<type_list<Reject...>, type_list<Require...>, type_list<NoneOf...>, AllOf...>> {
template<std::size_t Index>
static void maybe_valid_if(basic_observer &obs, const Entity entt, const basic_registry<Entity> &reg) {
if(reg.template has<AllOf...>(entt) && !(reg.template has<NoneOf>(entt) || ...)
&& reg.template has<Require...>(entt) && !(reg.template has<Reject>(entt) || ...))
{
if(reg.template has<AllOf..., Require...>(entt) && !(reg.template has<NoneOf>(entt) || ...) && !(reg.template has<Reject>(entt) || ...)) {
auto *comp = obs.view.try_get(entt);
(comp ? *comp : obs.view.construct(entt)) |= (1 << Index);
}
@@ -11356,7 +11354,6 @@ struct as_void_t {};
#include <array>
#include <memory>
#include <cstring>
#include <cstddef>
#include <utility>
#include <type_traits>
@@ -13391,7 +13388,7 @@ bool setter([[maybe_unused]] meta_handle handle, [[maybe_unused]] meta_any index
bool accepted = false;
if constexpr(!Const) {
if constexpr(std::is_function_v<std::remove_pointer_t<decltype(Data)>> || std::is_member_function_pointer_v<decltype(Data)>) {
if constexpr(std::is_function_v<std::remove_reference_t<std::remove_pointer_t<decltype(Data)>>> || std::is_member_function_pointer_v<decltype(Data)>) {
using helper_type = meta_function_helper_t<decltype(Data)>;
using data_type = std::tuple_element_t<!std::is_member_function_pointer_v<decltype(Data)>, typename helper_type::args_type>;
static_assert(std::is_invocable_v<decltype(Data), Type &, data_type>);
@@ -13465,7 +13462,7 @@ meta_any getter([[maybe_unused]] meta_handle handle, [[maybe_unused]] meta_any i
}
};
if constexpr(std::is_function_v<std::remove_pointer_t<decltype(Data)>> || std::is_member_function_pointer_v<decltype(Data)>) {
if constexpr(std::is_function_v<std::remove_reference_t<std::remove_pointer_t<decltype(Data)>>> || std::is_member_function_pointer_v<decltype(Data)>) {
static_assert(std::is_invocable_v<decltype(Data), Type &>);
auto * const clazz = meta_any{handle}.try_cast<Type>();
return clazz ? dispatch(std::invoke(Data, *clazz)) : meta_any{};
@@ -13519,7 +13516,7 @@ meta_any invoke([[maybe_unused]] meta_handle handle, meta_any *args, std::index_
return instance;
}(args+Indexes, (args+Indexes)->try_cast<std::tuple_element_t<Indexes, typename helper_type::args_type>>())...);
if constexpr(std::is_function_v<std::remove_pointer_t<decltype(Candidate)>>) {
if constexpr(std::is_function_v<std::remove_reference_t<std::remove_pointer_t<decltype(Candidate)>>>) {
return (std::get<Indexes>(direct) && ...) ? dispatch(std::get<Indexes>(direct)...) : meta_any{};
} else {
auto * const clazz = meta_any{handle}.try_cast<Type>();

View File

@@ -2,10 +2,10 @@
#define ENTT_CONFIG_VERSION_H
#define ENTT_VERSION "3.2.1"
#define ENTT_VERSION "3.2.2"
#define ENTT_VERSION_MAJOR 3
#define ENTT_VERSION_MINOR 2
#define ENTT_VERSION_PATCH 1
#define ENTT_VERSION_PATCH 2
#endif // ENTT_CONFIG_VERSION_H

View File

@@ -211,9 +211,7 @@ class basic_observer {
struct matcher_handler<matcher<type_list<Reject...>, type_list<Require...>, type_list<NoneOf...>, AllOf...>> {
template<std::size_t Index>
static void maybe_valid_if(basic_observer &obs, const Entity entt, const basic_registry<Entity> &reg) {
if(reg.template has<AllOf...>(entt) && !(reg.template has<NoneOf>(entt) || ...)
&& reg.template has<Require...>(entt) && !(reg.template has<Reject>(entt) || ...))
{
if(reg.template has<AllOf..., Require...>(entt) && !(reg.template has<NoneOf>(entt) || ...) && !(reg.template has<Reject>(entt) || ...)) {
auto *comp = obs.view.try_get(entt);
(comp ? *comp : obs.view.construct(entt)) |= (1 << Index);
}

View File

@@ -50,10 +50,10 @@ class basic_registry {
struct pool_handler: storage<Entity, Component> {
std::size_t super{};
pool_handler() ENTT_NOEXCEPT = default;
pool_handler(const storage<Entity, Component> &other)
: storage<Entity, Component>{other}
template<typename... Args>
pool_handler(Args &&... args)
: storage<Entity, Component>{std::forward<Args>(args)...},
super{}
{}
auto on_construct() ENTT_NOEXCEPT {
@@ -326,7 +326,7 @@ public:
* Identifiers aren't guaranteed to be stable between different runs.
*
* @tparam Component Type of component to query.
* @return Runtime the opaque identifier of the given type of component.
* @return The opaque identifier of the given type of component.
*/
template<typename Component>
static component type() ENTT_NOEXCEPT {

View File

@@ -90,7 +90,7 @@ bool setter([[maybe_unused]] meta_handle handle, [[maybe_unused]] meta_any index
bool accepted = false;
if constexpr(!Const) {
if constexpr(std::is_function_v<std::remove_pointer_t<decltype(Data)>> || std::is_member_function_pointer_v<decltype(Data)>) {
if constexpr(std::is_function_v<std::remove_reference_t<std::remove_pointer_t<decltype(Data)>>> || std::is_member_function_pointer_v<decltype(Data)>) {
using helper_type = meta_function_helper_t<decltype(Data)>;
using data_type = std::tuple_element_t<!std::is_member_function_pointer_v<decltype(Data)>, typename helper_type::args_type>;
static_assert(std::is_invocable_v<decltype(Data), Type &, data_type>);
@@ -164,7 +164,7 @@ meta_any getter([[maybe_unused]] meta_handle handle, [[maybe_unused]] meta_any i
}
};
if constexpr(std::is_function_v<std::remove_pointer_t<decltype(Data)>> || std::is_member_function_pointer_v<decltype(Data)>) {
if constexpr(std::is_function_v<std::remove_reference_t<std::remove_pointer_t<decltype(Data)>>> || std::is_member_function_pointer_v<decltype(Data)>) {
static_assert(std::is_invocable_v<decltype(Data), Type &>);
auto * const clazz = meta_any{handle}.try_cast<Type>();
return clazz ? dispatch(std::invoke(Data, *clazz)) : meta_any{};
@@ -218,7 +218,7 @@ meta_any invoke([[maybe_unused]] meta_handle handle, meta_any *args, std::index_
return instance;
}(args+Indexes, (args+Indexes)->try_cast<std::tuple_element_t<Indexes, typename helper_type::args_type>>())...);
if constexpr(std::is_function_v<std::remove_pointer_t<decltype(Candidate)>>) {
if constexpr(std::is_function_v<std::remove_reference_t<std::remove_pointer_t<decltype(Candidate)>>>) {
return (std::get<Indexes>(direct) && ...) ? dispatch(std::get<Indexes>(direct)...) : meta_any{};
} else {
auto * const clazz = meta_any{handle}.try_cast<Type>();

View File

@@ -4,7 +4,6 @@
#include <array>
#include <memory>
#include <cstring>
#include <cstddef>
#include <utility>
#include <type_traits>