diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-13 14:41:10 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-13 14:41:10 +0000 |
commit | 5dc52d15b89bb4c13a1aef63b0f313a713c53ad1 (patch) | |
tree | 1dd053e25d79d6e0b70921c5c0243388584c4c5a /game | |
parent | Push more RailLinks logic down into NetworkOf (diff) | |
download | ilt-5dc52d15b89bb4c13a1aef63b0f313a713c53ad1.tar.bz2 ilt-5dc52d15b89bb4c13a1aef63b0f313a713c53ad1.tar.xz ilt-5dc52d15b89bb4c13a1aef63b0f313a713c53ad1.zip |
Only attempt to render renderable networks
Diffstat (limited to 'game')
-rw-r--r-- | game/network/network.impl.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/game/network/network.impl.h b/game/network/network.impl.h index 699cb94..d2e9ff0 100644 --- a/game/network/network.impl.h +++ b/game/network/network.impl.h @@ -6,9 +6,11 @@ template<typename T> void NetworkOf<T>::render(const Shader & shader) const { - shader.setModel(Location {}, Shader::Program::StaticPos); - texture->Bind(); - links.apply(&T::render, shader); + if constexpr (std::is_base_of_v<Renderable, T>) { + shader.setModel(Location {}, Shader::Program::StaticPos); + texture->Bind(); + links.apply(&Renderable::render, shader); + } } template<typename T> |