From bbfc573b15876bf05eb5c64ccd4a729e8d5d12aa Mon Sep 17 00:00:00 2001 From: psi29a Date: Wed, 17 Aug 2022 21:19:14 +0000 Subject: [PATCH] Merge branch 'windows_save' into 'master' [Postprocessing] Mitigate clashes with live reload and external saves on windows See merge request OpenMW/openmw!2237 (cherry picked from commit 92f3b4ba82e96d53e36212d3e824de4d13551552) 0f9a7594 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 4eb410ad29..cdbb8d5618 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 @@ -376,6 +378,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();