1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-25 20:39:43 +00:00

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 92f3b4ba82)

0f9a7594 wait a brief moment before reading a file marked as modified
This commit is contained in:
psi29a 2022-08-17 21:19:14 +00:00
parent 341161ba03
commit bbfc573b15

View file

@ -1,6 +1,8 @@
#include "postprocessor.hpp" #include "postprocessor.hpp"
#include <algorithm> #include <algorithm>
#include <chrono>
#include <thread>
#include <SDL_opengl_glext.h> #include <SDL_opengl_glext.h>
#include <osg/Texture1D> #include <osg/Texture1D>
@ -376,6 +378,10 @@ namespace MWRender
if (!isDirty) if (!isDirty)
continue; 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()) if (technique->compile())
Log(Debug::Info) << "Reloaded technique : " << mTechniqueFileMap[technique->getName()].string(); Log(Debug::Info) << "Reloaded technique : " << mTechniqueFileMap[technique->getName()].string();