Commit 98c24cd2 authored by Florian Oetke's avatar Florian Oetke
Browse files

fixed/tried to work around MSVC compiler errors

parent f7d6e831
Subproject commit 512d1ebb531bda0fddace53a74a2503289c0a0ec
Subproject commit aa0e9f5b67c0a66ffd3064e933be3c8980c6a331
......@@ -163,8 +163,8 @@ namespace mirrage::ecs {
class Component : public Tiny_component<T, Index_policy, Storage_policy>,
public detail::Owned_component_base {
public:
using component_base_t = Component;
static constexpr auto sort_key = &Component::_owner;
using component_base_t = Component;
static constexpr auto sort_key() { return &Component::_owner; }
static constexpr auto sort_key_index = 0;
Component() = default;
......
......@@ -215,7 +215,7 @@ namespace mirrage::ecs {
template <class T>
struct Pool_storage_policy_sort<T, util::void_t<decltype(T::sort_key), decltype(T::sort_key_index)>> {
static constexpr bool sorted = true;
static constexpr auto sort_key = T::sort_key;
static constexpr auto sort_key = T::sort_key();
static constexpr auto sort_key_constructor_idx = T::sort_key_index;
};
......@@ -267,7 +267,7 @@ namespace mirrage::ecs {
auto empty() const -> bool { return _pool.empty(); }
template <class Key,
class = std::enable_if_t<std::is_same_v<Key, decltype(std::declval<T>().*T::sort_key)>>>
class = std::enable_if_t<std::is_same_v<Key, decltype(std::declval<T>().*T::sort_key())>>>
auto find(const Key& key)
{
return _pool.find(key);
......@@ -601,7 +601,7 @@ namespace mirrage::ecs {
{
if constexpr(pool_based) {
auto& component = *_iterator;
_last_value = value_type{(component.*T::sort_key).id(), &component};
_last_value = value_type{(component.*T::sort_key()).id(), &component};
} else {
auto&& [entity, idx] = *_iterator;
_last_value = value_type{entity, &_container->_storage.get(idx)};
......
......@@ -11,8 +11,8 @@
#include <mirrage/utils/console_command.hpp>
#include <mirrage/utils/messagebus.hpp>
#include <unordered_set>
#include <iostream>
#include <unordered_set>
namespace mirrage::gui {
......@@ -95,7 +95,7 @@ namespace mirrage::gui {
return false;
}
static std::ostream& print_names(std::ostream& stream)
static plog::util::nostringstream& print_names(plog::util::nostringstream& stream)
{
auto first = true;
for(auto dm : instances()) {
......
......@@ -26,11 +26,11 @@ namespace mirrage::gui {
void Debug_console_appender::write(const plog::Record& record)
{
auto msg =
auto msg =
#ifdef _WIN32
plog::util::toNarrow(plog::TxtFormatter::format(record), 0);
plog::util::toNarrow(plog::TxtFormatter::format(record), 0);
#else
plog::TxtFormatter::format(record);
plog::TxtFormatter::format(record);
#endif
auto prev_pos = std::string::size_type(0);
auto pos = std::string::size_type(0);
......@@ -53,7 +53,7 @@ namespace mirrage::gui {
_commands.add("help | Prints all available commands", [&]() {
LOG(plog::info) << "Available commands:\n"
<< [](std::ostream& stream) -> std::ostream& {
<< +[](plog::util::nostringstream& stream) -> plog::util::nostringstream& {
auto max_width = 0;
for(auto& c : util::Console_command_container::list_all_commands()) {
auto sep = c.second.api().find("|");
......
......@@ -101,6 +101,27 @@ namespace mirrage::renderer {
: Component(owner, em)
{
}
Simple_animation_controller_comp(Simple_animation_controller_comp&& rhs) noexcept
: Component(static_cast<Component&&>(rhs))
, _animations(std::move(rhs._animations))
, _current_animation(std::move(rhs._current_animation))
, _prev_animation(std::move(rhs._prev_animation))
, _next_animation(std::move(rhs._next_animation))
, _fade_time(std::move(rhs._fade_time))
, _fade_time_left(std::move(rhs._fade_time_left))
{
}
auto operator=(Simple_animation_controller_comp&& rhs) noexcept -> Simple_animation_controller_comp&
{
Component::operator=(static_cast<Component&&>(rhs));
_animations = std::move(rhs._animations);
_current_animation = std::move(rhs._current_animation);
_prev_animation = std::move(rhs._prev_animation);
_next_animation = std::move(rhs._next_animation);
_fade_time = std::move(rhs._fade_time);
_fade_time_left = std::move(rhs._fade_time_left);
return *this;
}
void play(util::Str_id animation, bool preserve_state = true);
void play(util::Str_id animation, float speed, bool reversed, bool paused, bool looped);
......
......@@ -13,8 +13,8 @@ using mirrage::ecs::components::Transform_comp;
namespace mirrage::renderer {
namespace {
constexpr auto shader_buffer_size = 64 * 3 * 4 * int(sizeof(float));
constexpr auto initial_animation_capacity = 16 * shader_buffer_size;
constexpr auto shader_buffer_size = static_cast<vk::DeviceSize>(64 * 3 * 4 * int(sizeof(float)));
constexpr auto initial_animation_capacity = static_cast<vk::DeviceSize>(16 * shader_buffer_size);
auto animation_substance(util::Str_id substance_id, Skinning_type st)
{
......@@ -47,7 +47,8 @@ namespace mirrage::renderer {
return r.create_descriptor_set(*r.gbuffer().animation_data_layout, 1);
});
auto anim_desc_buffer_writes = util::build_vector(buffers, [&](auto i) {
return vk::DescriptorBufferInfo{_animation_uniforms.buffer(i), 0, shader_buffer_size};
return vk::DescriptorBufferInfo{
_animation_uniforms.buffer(i), static_cast<vk::DeviceSize>(0), shader_buffer_size};
});
auto anim_desc_writes = util::build_vector(buffers, [&](auto i) {
return vk::WriteDescriptorSet{*_animation_desc_sets.at(i),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment