summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2026-04-01 12:07:58 +0100
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2026-04-01 12:07:58 +0100
commit56207fbf4e8662b6cf93632193ba68d2576c2d4e (patch)
treedec327a00b301149e76f691728053c7ef5bb9119 /gfx
parentMove light vertex structs out (diff)
downloadilt-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.cpp5
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