Skip to content

Commit

Permalink
🧼 [Particles] Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesFouchy committed Dec 29, 2023
1 parent 0d79244 commit dfa719a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Nodes/MaybeGenerateModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
namespace Lab {

/// Called for each node.
/// Returns a string iff a new module has been generated and gen_desired_function() should read the result of the module fom a texture (the name of the texture is the name returned by the function).
/// Returns a string iff a new module has been generated and gen_desired_function() should stop traversing the graph and instead read the image resulting from the new module from a texture
/// (the name of the texture is the name returned by the function).
using MaybeGenerateModule = std::function<std::optional<std::string>(Cool::NodeId const&, NodeDefinition const&)>;

} // namespace Lab
5 changes: 2 additions & 3 deletions src/Nodes/Node.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include <Cool/Dependencies/Input.h>
#include <Cool/Nodes/Pin.h>
#include <cereal/details/helpers.hpp>
#include <cereal/types/optional.hpp>
#include <optional>
#include <string_view>
Expand Down Expand Up @@ -57,7 +56,7 @@ class Node {

auto is_particle_initializer() const -> bool;
auto particles_count() -> std::optional<size_t>& { return _particles_count; }
auto particles_count() const -> std::optional<size_t> const& { return _particles_count; }
auto particles_count() const -> std::optional<size_t> { return _particles_count; }
void set_particles_count(std::optional<size_t> particles_count) { _particles_count = particles_count; }

private:
Expand All @@ -70,7 +69,7 @@ class Node {
size_t _number_of_main_input_pins{};
size_t _number_of_function_inputs{};

std::optional<size_t> _particles_count{}; // HACK Only used in the case of a particle initializer node
std::optional<size_t> _particles_count{}; // HACK Only used in the case of a Particle Initializer node

private:
friend class cereal::access;
Expand Down

0 comments on commit dfa719a

Please sign in to comment.