Skip to content

Commit

Permalink
BugFix: AgentStateVis::setColour() did not support StaticColor
Browse files Browse the repository at this point in the history
Spotted by Jack A
  • Loading branch information
Robadob committed Apr 7, 2022
1 parent eddbfc9 commit 445b520
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/flamegpu/visualiser/AgentStateVis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ void AgentStateVis::setModelScale(float maxLen) {
void AgentStateVis::setColor(const ColorFunction& cf) {
// Remove old, we only ever want 1 color value
config.tex_buffers.erase(TexBufferConfig::Color);
config.tex_buffers.emplace(TexBufferConfig::Color, CustomTexBufferConfig{ cf.getAgentVariableName(), cf.getSamplerName() });
if (!cf.getAgentVariableName().empty() && !cf.getSamplerName().empty())
config.tex_buffers.emplace(TexBufferConfig::Color, CustomTexBufferConfig{ cf.getAgentVariableName(), cf.getSamplerName() });
config.color_shader_src = cf.getSrc();
}
void AgentStateVis::clearColor() {
Expand Down

0 comments on commit 445b520

Please sign in to comment.