1
0
Fork 0

CameraGroup: Reset compositor order offset on reload

Use the newly added simgear::Compositor::resetOrderOffset() to reset the
order offset counter with each compositor reload. This prevents the
counter increasing indefinitely, which soon results in render orders
beyond those set statically for the GUI and upcoming VR mirror.
This commit is contained in:
James Hogan 2021-09-11 16:53:28 +01:00
parent 07dfb6496c
commit 04c6821b8c
No known key found for this signature in database
GPG key ID: 35CEE4862B1023F2

View file

@ -970,6 +970,9 @@ void reloadCompositors(CameraGroup *cgroup)
{
cgroup->_viewer->getViewerBase()->stopThreading();
// Prevent the camera render orders increasing indefinitely with each reload
Compositor::resetOrderOffset();
for (auto &info : cgroup->_cameras) {
// Ignore the GUI camera
if (info->flags & CameraInfo::GUI)