Clang compilation fixes
This commit is contained in:
parent
ef5b8479ea
commit
9edf94be0c
9 changed files with 27 additions and 17 deletions
|
|
@ -17,7 +17,8 @@
|
|||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace psemek::gfx
|
||||
{
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ namespace psemek::gfx
|
|||
throw std::runtime_error("Number of transforms in a pose must be equal to the number of bones");
|
||||
auto pose_ptr = s.read_ptr<bone_transform<float>>(pose_count);
|
||||
|
||||
std::string_view name(name_ptr, name_ptr + name_length);
|
||||
std::string_view name(name_ptr, name_length);
|
||||
|
||||
result.poses[name] = {pose_ptr, pose_ptr + pose_count};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
#include <exception>
|
||||
|
||||
namespace psemek::ml
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ namespace psemek::ui
|
|||
|
||||
void update(float dt) override;
|
||||
|
||||
void set_enabled(bool value);
|
||||
void set_hidden(bool value);
|
||||
void set_enabled(bool value) override;
|
||||
void set_hidden(bool value) override;
|
||||
|
||||
using on_click_callback = std::function<void()>;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include <psemek/ui/font.hpp>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace psemek::ui
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ namespace psemek::ui
|
|||
virtual bool horizontal_scroll() const { return horizontal_; }
|
||||
virtual bool vertical_scroll() const { return vertical_; }
|
||||
|
||||
virtual bool on_event(mouse_move const & e);
|
||||
virtual bool on_event(mouse_click const & e);
|
||||
virtual bool on_event(mouse_wheel const & e);
|
||||
virtual bool on_event(mouse_move const & e) override;
|
||||
virtual bool on_event(mouse_click const & e) override;
|
||||
virtual bool on_event(mouse_wheel const & e) override;
|
||||
|
||||
struct shape const & shape() const override { return shape_; }
|
||||
void reshape(geom::box<float, 2> const & bbox) override;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ namespace psemek::util
|
|||
: value{((1 << static_cast<underlying_type>(flags)) | ...)}
|
||||
{}
|
||||
|
||||
flag_set & operator = (flag_set const &) = default;
|
||||
|
||||
bool is_set(Flag const & flag) const
|
||||
{
|
||||
return value & (1 << static_cast<underlying_type>(flag));
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include <psemek/util/unused.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <array>
|
||||
|
||||
using namespace psemek::util;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,19 @@
|
|||
#include <chrono>
|
||||
#include <vector>
|
||||
#include <optional>
|
||||
#include <iostream>
|
||||
|
||||
// Have to put it before including to_string.hpp due to how unqualified lookup works,
|
||||
// see e.g. https://alexanderlobov.net/posts/2019-07-08-function-lookup-in-templates
|
||||
template <typename T>
|
||||
std::ostream & operator << (std::ostream & s, std::optional<T> const & o)
|
||||
{
|
||||
if (o)
|
||||
s << *o;
|
||||
else
|
||||
s << "(empty)";
|
||||
return s;
|
||||
}
|
||||
|
||||
#include <psemek/util/to_string.hpp>
|
||||
|
||||
|
|
@ -77,16 +90,6 @@ namespace psemek::test
|
|||
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::ostream & operator << (std::ostream & s, std::optional<T> const & o)
|
||||
{
|
||||
if (o)
|
||||
s << *o;
|
||||
else
|
||||
s << "(empty)";
|
||||
return s;
|
||||
}
|
||||
|
||||
#define test_case(name) \
|
||||
void name ## _test_case (::psemek::test::context &); \
|
||||
static const auto name ## _test_case_registrator = []{ ::psemek::test::add_test_case(#name, &(name ## _test_case)); return 0; }(); \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue