Commit dbeedbdd authored by Florian Oetke's avatar Florian Oetke
Browse files

refactored utils and removed dead code [fixes #29]

parent 5daec22f
......@@ -32,7 +32,7 @@ endif()
# add_definitions(-DHPC_HISTOGRAM_DEBUG_VIEW)
add_definitions(-DGSL_TERMINATE_ON_CONTRACT_VIOLATION)
add_definitions(-DHPC_HISTOGRAM_DEBUG_VIEW)
#add_definitions(-DHPC_HISTOGRAM_DEBUG_VIEW)
if(MIRRAGE_BUILD_DEMO)
add_subdirectory(demo)
......
......@@ -5,7 +5,7 @@
#include <mirrage/ecs/components/transform_comp.hpp>
#include <mirrage/ecs/ecs.hpp>
#include <mirrage/renderer/light_comp.hpp>
#include <mirrage/utils/math.hpp>
#include <mirrage/utils/min_max.hpp>
#include <mirrage/utils/sf2_glm.hpp>
#include <gsl/gsl>
......
......@@ -5,7 +5,7 @@
#include "material_parser.hpp"
#include <mirrage/renderer/model.hpp>
#include <mirrage/utils/math.hpp>
#include <mirrage/utils/min_max.hpp>
#include <mirrage/utils/str_id.hpp>
#include <mirrage/utils/template_utils.hpp>
......
......@@ -11,11 +11,11 @@
#include <mirrage/asset/error.hpp>
#include <mirrage/asset/stream.hpp>
#include <mirrage/utils/container_utils.hpp>
#include <mirrage/utils/log.hpp>
#include <mirrage/utils/maybe.hpp>
#include <mirrage/utils/reflection.hpp>
#include <mirrage/utils/string_utils.hpp>
#include <mirrage/utils/template_utils.hpp>
#include <async++.h>
#include <tsl/robin_map.h>
......@@ -132,7 +132,7 @@ namespace mirrage::asset {
} // namespace detail
class Asset_manager : util::no_copy_move {
class Asset_manager {
public:
Asset_manager(const std::string& exe_name, const std::string& org_name, const std::string& app_name);
~Asset_manager();
......
......@@ -40,7 +40,7 @@ namespace mirrage::ecs {
* The main functionality is thread-safe but the other methods require a lock to prevent
* concurrent read access during their execution
*/
class Entity_manager : util::no_copy_move {
class Entity_manager {
public:
Entity_manager(asset::Asset_manager&, util::any_ptr userdata);
......
......@@ -5,8 +5,8 @@
#include <mirrage/asset/asset_manager.hpp>
#include <mirrage/utils/maybe.hpp>
#include <mirrage/utils/registration.hpp>
#include <mirrage/utils/str_id.hpp>
#include <mirrage/utils/template_utils.hpp>
#include <mirrage/utils/units.hpp>
#include <vulkan/vulkan.hpp>
......
......@@ -11,8 +11,8 @@
#include <mirrage/asset/asset_manager.hpp>
#include <mirrage/utils/purgatory.hpp>
#include <mirrage/utils/registration.hpp>
#include <mirrage/utils/ring_buffer.hpp>
#include <mirrage/utils/template_utils.hpp>
#include <vulkan/vulkan.hpp>
......
......@@ -9,7 +9,7 @@
#include <mirrage/graphic/settings.hpp>
#include <mirrage/utils/template_utils.hpp>
#include <mirrage/utils/registration.hpp>
#include <mirrage/utils/units.hpp>
#include <vulkan/vulkan.hpp>
......
#include <mirrage/graphic/device_memory.hpp>
#include <mirrage/utils/template_utils.hpp>
#include <mirrage/utils/container_utils.hpp>
#include <mirrage/utils/ranges.hpp>
#include <gsl/gsl>
......
......@@ -2,6 +2,8 @@
#include <mirrage/graphic/device.hpp>
#include <mirrage/utils/ranges.hpp>
#include <gsl/gsl>
......
......@@ -5,6 +5,8 @@
#include <mirrage/graphic/context.hpp>
#include <mirrage/graphic/device.hpp>
#include <mirrage/utils/ranges.hpp>
#include <memory>
......
......@@ -2,6 +2,8 @@
#include <mirrage/graphic/device.hpp>
#include <mirrage/utils/ranges.hpp>
namespace mirrage::graphic {
......
......@@ -3,6 +3,8 @@
#include <mirrage/graphic/device.hpp>
#include <mirrage/graphic/texture.hpp>
#include <mirrage/utils/ranges.hpp>
namespace mirrage::graphic {
......
......@@ -3,7 +3,7 @@
#include <mirrage/input/input_mapping.hpp>
#include <mirrage/asset/asset_manager.hpp>
#include <mirrage/utils/template_utils.hpp>
#include <mirrage/utils/ranges.hpp>
#include <glm/glm.hpp>
#include <sf2/sf2.hpp>
......
......@@ -2,7 +2,7 @@
#include <mirrage/net/error.hpp>
#include <mirrage/utils/template_utils.hpp>
#include <mirrage/utils/container_utils.hpp>
#include <enet/enet.h>
......
......@@ -4,6 +4,7 @@
#include <mirrage/ecs/component.hpp>
#include <mirrage/utils/small_vector.hpp>
#include <mirrage/utils/units.hpp>
#include <vector>
......
......@@ -9,7 +9,7 @@
#include <mirrage/graphic/device.hpp>
#include <mirrage/graphic/profiler.hpp>
#include <mirrage/utils/math.hpp>
#include <mirrage/utils/min_max.hpp>
#include <glm/gtx/quaternion.hpp>
#include <glm/vec3.hpp>
......@@ -156,16 +156,6 @@ namespace mirrage::renderer {
void recreate();
template <class T>
auto find_pass() -> util::tracking_ptr<T>
{
auto pass = std::find_if(
_passes.begin(), _passes.end(), [](auto& p) { return dynamic_cast<T*>(&*p) != nullptr; });
return pass != _passes.end() ? util::tracking_ptr<T>(pass->create_ptr())
: util::tracking_ptr<T>{};
}
void update(util::Time dt);
void draw();
......@@ -229,7 +219,7 @@ namespace mirrage::renderer {
graphic::Image_descriptor_set_layout _noise_descriptor_set_layout;
graphic::DescriptorSet _noise_descriptor_set;
std::vector<util::trackable<Render_pass>> _passes;
std::vector<std::unique_ptr<Render_pass>> _passes;
Camera_comp::Pool* _cameras;
util::maybe<Camera_state> _active_camera;
......
......@@ -2,8 +2,8 @@
#include <mirrage/ecs/entity_handle.hpp>
#include <mirrage/utils/maybe.hpp>
#include <mirrage/utils/ranges.hpp>
#include <mirrage/utils/str_id.hpp>
#include <mirrage/utils/template_utils.hpp>
#include <mirrage/utils/units.hpp>
#include <glm/gtx/quaternion.hpp>
......
#include <mirrage/renderer/animation.hpp>
#include <mirrage/utils/ranges.hpp>
#include <glm/glm.hpp>
#include <glm/gtx/dual_quaternion.hpp>
#include <glm/gtx/matrix_decompose.hpp>
......
......@@ -59,8 +59,7 @@ namespace mirrage::renderer {
, _noise_descriptor_set_layout(device(), *_noise_sampler, 1, vk::ShaderStageFlagBits::eFragment)
, _passes(util::map(passes,
[&, write_first_pp_buffer = true](auto& factory) mutable {
return util::trackable<Render_pass>(
factory->create_pass(*this, ecs, engine, write_first_pp_buffer));
return factory->create_pass(*this, ecs, engine, write_first_pp_buffer);
}))
, _cameras(&ecs.list<Camera_comp>())
{
......
Supports Markdown
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