diff options
| author | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2026-04-01 12:07:58 +0100 |
|---|---|---|
| committer | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2026-04-01 12:07:58 +0100 |
| commit | 56207fbf4e8662b6cf93632193ba68d2576c2d4e (patch) | |
| tree | dec327a00b301149e76f691728053c7ef5bb9119 /gfx | |
| parent | Move light vertex structs out (diff) | |
| download | ilt-56207fbf4e8662b6cf93632193ba68d2576c2d4e.tar.bz2 ilt-56207fbf4e8662b6cf93632193ba68d2576c2d4e.tar.xz ilt-56207fbf4e8662b6cf93632193ba68d2576c2d4e.zip | |
Helper to instantiate transient static values as required
Diffstat (limited to 'gfx')
| -rw-r--r-- | gfx/renderable.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gfx/renderable.cpp b/gfx/renderable.cpp index 4597597..90035c3 100644 --- a/gfx/renderable.cpp +++ b/gfx/renderable.cpp @@ -2,6 +2,7 @@ #include "gl_traits.h" #include "location.h" #include "maths.h" +#include "util.h" std::weak_ptr<Renderable::CommonLocationData> Renderable::commonLocationData; @@ -21,9 +22,7 @@ Renderable::CommonLocation ::operator=(Location const & location) Renderable::Renderable() { - if (!(locationData = commonLocationData.lock())) { - commonLocationData = locationData = std::make_shared<CommonLocationData>(); - } + createIfRequired(locationData, commonLocationData); } GLuint |
