From 0f9a7594bb3c3d3cb3d65dcc14ca0fa7f9140645 Mon Sep 17 00:00:00 2001 From: "glassmancody.info" Date: Wed, 3 Aug 2022 15:48:58 -0700 Subject: [PATCH] wait a brief moment before reading a file marked as modified --- apps/openmw/mwrender/postprocessor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp index 4902dc8ef8..6f79ff32da 100644 --- a/apps/openmw/mwrender/postprocessor.cpp +++ b/apps/openmw/mwrender/postprocessor.cpp @@ -1,6 +1,8 @@ #include "postprocessor.hpp" #include +#include +#include #include #include @@ -385,6 +387,10 @@ namespace MWRender if (!isDirty) continue; + // TODO: Temporary workaround to avoid conflicts with external programs saving the file, especially problematic on Windows. + // If we move to a file watcher using native APIs this should be removed. + std::this_thread::sleep_for(std::chrono::milliseconds(5)); + if (technique->compile()) Log(Debug::Info) << "Reloaded technique : " << mTechniqueFileMap[technique->getName()].string();