summaryrefslogtreecommitdiff
path: root/StormLib/test/TLogHelper.cpp
diff options
context:
space:
mode:
authorDavid Racine <bass_dr@hotmail.com>2026-08-20 13:56:41 -0400
committerGitHub <noreply@github.com>2026-08-20 17:56:41 +0000
commit22426a8127e71f3eb2729c66c9f642944bc44b01 (patch)
tree24d19f0053568cc087ea9be4ebc8b1c80d78b798 /StormLib/test/TLogHelper.cpp
parent17c57c64c5e2307e961a1884b0f3071555113049 (diff)
Resolve the Fast3dGui cast once per scope instead of per call (#7095)
Reaching the Fast3d GUI is spelled out in full at every call site: std::dynamic_pointer_cast<Fast::Fast3dGui>( Ship::Context::GetRawInstance()->GetWindow()->GetGui())->GetTextureByName(name) Each one locks the Context weak_ptr, copies a shared_ptr for the window and one for the GUI, then runs a dynamic_cast, only to drop all three again. InputViewer::DrawElement does that 43 times per frame, and the item tracker and save editor repeat it once per icon drawn. Binding it to a local once per scope leaves the behaviour identical and reads better. The local goes in the innermost block that covers the call sites, so it stays behind the guards that were already there: DrawElement still resolves nothing when the input viewer is off. RenderButton keeps its inline casts. Its two call sites are in exclusive branches, so a local would add a cast on the path that takes neither.
Diffstat (limited to 'StormLib/test/TLogHelper.cpp')
0 files changed, 0 insertions, 0 deletions