From d4496d3b2c9b5dbe6e6406b78db2d215c109d767 Mon Sep 17 00:00:00 2001 From: James Hogan Date: Sat, 11 Sep 2021 16:32:18 +0100 Subject: [PATCH] Compositor: Add resetOrderOffset() To allow for custom compositors and passes created by C++ code alongside those created by Compositor::create(), add a resetOrderOffset() function which resets _order_offset back to zero. This will allow FlightGear to prevent repeated compositor reloads from increasing _order_offset indefinitely, which soon results in render orders beyond those set statically for the GUI and upcoming VR mirror compositors. --- simgear/scene/viewer/Compositor.hxx | 1 + 1 file changed, 1 insertion(+) diff --git a/simgear/scene/viewer/Compositor.hxx b/simgear/scene/viewer/Compositor.hxx index 94849ba9..2fcb9037 100644 --- a/simgear/scene/viewer/Compositor.hxx +++ b/simgear/scene/viewer/Compositor.hxx @@ -137,6 +137,7 @@ public: Pass * getPass(const std::string &name) const; int getOrderOffset() const { return _order_offset; } + static void resetOrderOffset() { _order_offset = 0; } protected: osg::View *_view; osg::GraphicsContext *_gc;