Commit 94e06586 authored by Florian Oetke's avatar Florian Oetke
Browse files

fixed particle config destruction order

parent ace0c9b9
Pipeline #2640 passed with stage
in 11 minutes and 44 seconds
......@@ -443,8 +443,8 @@ namespace mirrage::asset {
template <>
struct Loader<renderer::Particle_system_config> {
public:
static auto load(istream in) -> async::task<renderer::Particle_system_config>;
[[noreturn]] static void save(ostream, const renderer::Particle_system_config&)
auto load(istream in) -> async::task<renderer::Particle_system_config>;
[[noreturn]] void save(ostream, const renderer::Particle_system_config&)
{
MIRRAGE_FAIL("Save of Particle_system_config is not supported!");
}
......@@ -453,8 +453,8 @@ namespace mirrage::asset {
template <>
struct Loader<renderer::Particle_type_config> {
public:
static auto load(istream in) -> async::task<renderer::Particle_type_config>;
[[noreturn]] static void save(ostream, const renderer::Particle_type_config&)
auto load(istream in) -> async::task<renderer::Particle_type_config>;
[[noreturn]] void save(ostream, const renderer::Particle_type_config&)
{
MIRRAGE_FAIL("Save of Particle_type_config is not supported!");
}
......
......@@ -472,12 +472,16 @@ namespace mirrage::renderer {
assets.create_stateful_loader<Material>(device, assets, material_sampler, material_layout);
assets.create_stateful_loader<Model>(device, assets, draw_queue);
assets.create_stateful_loader<Particle_script>(device, storage_buffer, uniform_buffer);
assets.create_stateful_loader<Particle_system_config>();
assets.create_stateful_loader<Particle_type_config>();
}
~Asset_loaders()
{
assets.remove_stateful_loader<Particle_type_config>();
assets.remove_stateful_loader<Particle_system_config>();
assets.remove_stateful_loader<Particle_script>();
assets.remove_stateful_loader<Model>();
assets.remove_stateful_loader<Material>();
assets.remove_stateful_loader<Particle_script>();
}
};
......
......@@ -203,11 +203,10 @@ namespace mirrage::asset {
{
auto r = renderer::Particle_system_config();
sf2::deserialize_json(
in,
sf2::deserialize_json(in,
[&](auto& msg, uint32_t row, uint32_t column) {
LOG(plog::error) << "Error parsing JSON from " << in.aid().str() << " at " << row << ":"
<< column << ": " << msg;
LOG(plog::error) << "Error parsing JSON from " << in.aid().str() << " at "
<< row << ":" << column << ": " << msg;
},
r);
......@@ -232,11 +231,10 @@ namespace mirrage::asset {
{
auto r = renderer::Particle_type_config();
sf2::deserialize_json(
in,
sf2::deserialize_json(in,
[&](auto& msg, uint32_t row, uint32_t column) {
LOG(plog::error) << "Error parsing JSON from " << in.aid().str() << " at " << row << ":"
<< column << ": " << msg;
LOG(plog::error) << "Error parsing JSON from " << in.aid().str() << " at "
<< row << ":" << column << ": " << msg;
},
r);
......
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