Skip to content

Commit

Permalink
update to newest sfml
Browse files Browse the repository at this point in the history
  • Loading branch information
vittorioromeo committed May 7, 2024
1 parent c168e23 commit 2963f69
Show file tree
Hide file tree
Showing 6 changed files with 289 additions and 283 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ set(SFML_ENABLE_PCH true)
CPMAddPackage(
NAME SFML
GITHUB_REPOSITORY vittorioromeo/SFML
GIT_TAG b97c9c7f0b552ff7e1e6f0fa51abe82b949e241d
GIT_TAG 06b4c6ceaabaa3e15e88ca70cf61ae7bba69ad39
)

set_target_properties(sfml-system PROPERTIES UNITY_BUILD OFF)
Expand Down Expand Up @@ -187,7 +187,7 @@ if(NOT SSVOH_ANDROID)
CPMAddPackage(
NAME imgui-sfml
GITHUB_REPOSITORY SFML/imgui-sfml
GIT_TAG ac98a9f34ed26fd92544941903d4bd0a2964cad4
GIT_TAG 7758bfd06326af08dc919198c13f9f0e64e70b1a
)

set_target_properties(ImGui-SFML PROPERTIES UNITY_BUILD ON)
Expand Down
2 changes: 1 addition & 1 deletion include/SSVOpenHexagon/SSVUtilsJson/JsonCpp/jsoncpp.inl
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ inline bool Reader::decodeUnicodeCodePoint(
"surrogate "
"pair.",
token, current);
unsigned int surrogatePair;
unsigned int surrogatePair{};
if(*(current++) == '\\' && *(current++) == 'u')
{
if(decodeUnicodeEscapeSequence(token, current, end, surrogatePair))
Expand Down
2 changes: 1 addition & 1 deletion include/SSVOpenHexagon/Utils/FastVertexVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ struct FastVertexVector : public sf::Drawable
}

void draw(sf::RenderTarget& mRenderTarget,
const sf::RenderStates& mRenderStates) const override
sf::RenderStates mRenderStates) const override
{
if(_data == nullptr) [[unlikely]]
{
Expand Down
36 changes: 27 additions & 9 deletions include/SSVOpenHexagon/Utils/TinyVariant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
#define TINYVARIANT_USE_STD_INDEX_SEQUENCE
#endif

#ifdef TINYVARIANT_SUPPORTS_HAS_BUILTIN
#if __has_builtin(__type_pack_element)
#define TINYVARIANT_USE_TYPE_PACK_ELEMENT
#endif
#endif

#ifdef TINYVARIANT_USE_STD_INDEX_SEQUENCE
#include <utility>
#endif
Expand Down Expand Up @@ -102,7 +108,7 @@ template <typename T>
inline constexpr bool is_same_type<T, T> = true;

template <typename T>
[[nodiscard, gnu::always_inline]] constexpr T variadic_max(
[[nodiscard, gnu::always_inline]] consteval T variadic_max(
std::initializer_list<T> il) noexcept
{
T result = 0;
Expand All @@ -119,7 +125,7 @@ template <typename T>
}

template <sz_t N>
[[nodiscard, gnu::always_inline]] constexpr auto
[[nodiscard, gnu::always_inline]] consteval auto
smallest_int_type_for() noexcept
{
if constexpr(N <= UINT8_MAX)
Expand Down Expand Up @@ -151,7 +157,7 @@ enum : sz_t
};

template <typename T, typename... Ts>
[[nodiscard, gnu::always_inline]] constexpr sz_t index_of() noexcept
[[nodiscard, gnu::always_inline]] consteval sz_t index_of() noexcept
{
constexpr bool matches[]{is_same_type<T, Ts>...};

Expand All @@ -172,14 +178,22 @@ struct type_wrapper
using type = T;
};


#ifdef TINYVARIANT_USE_TYPE_PACK_ELEMENT

template <sz_t N, typename... Ts>
using type_at = __type_pack_element<N, Ts...>;

#else

template <sz_t N, typename T0 = void, typename T1 = void, typename T2 = void,
typename T3 = void, typename T4 = void, typename T5 = void,
typename T6 = void, typename T7 = void, typename T8 = void,
typename T9 = void, typename... Ts>
[[nodiscard, gnu::always_inline]] constexpr auto type_at_impl() noexcept
[[nodiscard, gnu::always_inline]] consteval auto type_at_impl() noexcept
{
// clang-format off
if constexpr(N == 0) { return type_wrapper<T0>{}; }
if constexpr(N == 0) { return type_wrapper<T0>{}; }
else if constexpr(N == 1) { return type_wrapper<T1>{}; }
else if constexpr(N == 2) { return type_wrapper<T2>{}; }
else if constexpr(N == 3) { return type_wrapper<T3>{}; }
Expand All @@ -196,6 +210,8 @@ template <sz_t N, typename T0 = void, typename T1 = void, typename T2 = void,
template <sz_t N, typename... Ts>
using type_at = typename decltype(type_at_impl<N, Ts...>())::type;

#endif

template <typename>
struct tinyvariant_inplace_type_t
{};
Expand Down Expand Up @@ -653,15 +669,15 @@ class [[nodiscard]] tinyvariant
template <typename... Fs>
[[nodiscard, gnu::always_inline]] auto recursive_match(
Fs&&... fs) & -> decltype(recursive_visit(impl::overload_set{
static_cast<Fs&&>(fs)...}))
static_cast<Fs&&>(fs)...}))
{
return recursive_visit(impl::overload_set{static_cast<Fs&&>(fs)...});
}

template <typename... Fs>
[[nodiscard, gnu::always_inline]] auto recursive_match(
Fs&&... fs) const& -> decltype(recursive_visit(impl::overload_set{
static_cast<Fs&&>(fs)...}))
static_cast<Fs&&>(fs)...}))
{
return recursive_visit(impl::overload_set{static_cast<Fs&&>(fs)...});
}
Expand Down Expand Up @@ -714,25 +730,27 @@ class [[nodiscard]] tinyvariant
template <typename... Fs>
[[nodiscard, gnu::always_inline]] auto linear_match(
Fs&&... fs) & -> decltype(linear_visit(impl::overload_set{
static_cast<Fs&&>(fs)...}))
static_cast<Fs&&>(fs)...}))
{
return linear_visit(impl::overload_set{static_cast<Fs&&>(fs)...});
}

template <typename... Fs>
[[nodiscard, gnu::always_inline]] auto linear_match(
Fs&&... fs) const& -> decltype(linear_visit(impl::overload_set{
static_cast<Fs&&>(fs)...}))
static_cast<Fs&&>(fs)...}))
{
return linear_visit(impl::overload_set{static_cast<Fs&&>(fs)...});
}
};

#undef TINYVARIANT_DO_WITH_CURRENT_INDEX
#undef TINYVARIANT_DO_WITH_CURRENT_INDEX_OBJ
#undef TINYVARIANT_STATIC_ASSERT_INDEX_VALIDITY

#undef TINYVARIANT_USE_STD_INDEX_SEQUENCE
#undef TINYVARIANT_USE_INTEGER_PACK
#undef TINYVARIANT_USE_MAKE_INTEGER_SEQ
#undef TINYVARIANT_USE_TYPE_PACK_ELEMENT

} // namespace vittorioromeo
2 changes: 1 addition & 1 deletion src/SSVOpenHexagon/Core/HGUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ void HexagonGame::postUpdate_ImguiLuaConsole()
ilcShowConsoleNext = false;

ImGui::SFML::ProcessEvent(
window->getRenderWindow(), sf::Event{sf::Event::GainedFocus});
window->getRenderWindow(), sf::Event::FocusGained{});
}

if(!ilcShowConsole)
Expand Down
Loading

0 comments on commit 2963f69

Please sign in to comment.