From 9fd25e8b10b1291525a18c8b3e34256ca6151dd6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 22 Mar 2025 11:50:31 +0000 Subject: Add ManyPtr which tracks specified subclasses This removes the need to repeated dynamic_cast the pointer. Provides interface which enforces the fastest option for the required types. --- gfx/gl/shadowMapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gfx/gl') diff --git a/gfx/gl/shadowMapper.cpp b/gfx/gl/shadowMapper.cpp index 6525f76..3cb73f7 100644 --- a/gfx/gl/shadowMapper.cpp +++ b/gfx/gl/shadowMapper.cpp @@ -88,7 +88,7 @@ ShadowMapper::update(const SceneProvider & scene, const LightDirection & dir, co shadowStenciller.setLightDirection(dir); for (const auto & [id, asset] : gameState->assets) { - if (const auto r = std::dynamic_pointer_cast(asset)) { + if (const auto r = asset.getAs()) { r->updateStencil(shadowStenciller); } } -- cgit v1.2.3