diff --git a/CHANGELOG.md b/CHANGELOG.md index e470c086e..310e37d16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ Bug #4828: Potion looping effects VFX are not shown for NPCs Bug #4837: CTD when a mesh with NiLODNode root node with particles is loaded Bug #4841: Russian localization ignores implicit keywords + Bug #4844: Data race in savegame loading / GlobalMap render Bug #4847: Idle animation reset oddities Bug #4851: No shadows since switch to OSG Bug #4860: Actors outside of processing range visible for one frame after spawning @@ -88,6 +89,7 @@ Bug #5001: Possible data race in the Animation::setAlpha() Bug #5004: Werewolves shield their eyes during storm Bug #5018: Spell tooltips don't support purely negative magnitudes + Bug #5025: Data race in the ICO::setMaximumNumOfObjectsToCompilePerFrame() Bug #5028: Offered price caps are not trading-specific Bug #5038: Enchanting success chance calculations are blatantly wrong Feature #1774: Handle AvoidNode diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 1c95ccc93..c67aaffa4 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -257,10 +257,10 @@ OMW::Engine::~Engine() mWorkQueue = nullptr; - mResourceSystem.reset(); - mViewer = nullptr; + mResourceSystem.reset(); + delete mEncoder; mEncoder = nullptr; diff --git a/apps/openmw/mwgui/loadingscreen.cpp b/apps/openmw/mwgui/loadingscreen.cpp index a9480f261..54382ab4d 100644 --- a/apps/openmw/mwgui/loadingscreen.cpp +++ b/apps/openmw/mwgui/loadingscreen.cpp @@ -165,11 +165,6 @@ namespace MWGui if (mMainWidget->getVisible()) return; - if (mViewer->getIncrementalCompileOperation()) - { - mViewer->getIncrementalCompileOperation()->setMaximumNumOfObjectsToCompilePerFrame(100); - } - // Assign dummy bounding sphere callback to avoid the bounding sphere of the entire scene being recomputed after each frame of loading // We are already using node masks to avoid the scene from being updated/rendered, but node masks don't work for computeBound() mViewer->getSceneData()->setComputeBoundingSphereCallback(new DontComputeBoundCallback); diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 964aaa9de..0d9cbd9b0 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -268,6 +268,7 @@ namespace MWRender { mViewer->setIncrementalCompileOperation(new osgUtil::IncrementalCompileOperation); mViewer->getIncrementalCompileOperation()->setTargetFrameRate(Settings::Manager::getFloat("target framerate", "Cells")); + mViewer->getIncrementalCompileOperation()->setMaximumNumOfObjectsToCompilePerFrame(100); } mResourceSystem->getSceneManager()->setIncrementalCompileOperation(mViewer->getIncrementalCompileOperation()); diff --git a/apps/openmw/mwworld/store.cpp b/apps/openmw/mwworld/store.cpp index 2a0c39466..444650217 100644 --- a/apps/openmw/mwworld/store.cpp +++ b/apps/openmw/mwworld/store.cpp @@ -500,7 +500,12 @@ namespace MWWorld } void Store::setUp() { + // The land is static for given game session, there is no need to refresh it every load. + if (mBuilt) + return; + std::sort(mStatic.begin(), mStatic.end(), Compare()); + mBuilt = true; } diff --git a/apps/openmw/mwworld/store.hpp b/apps/openmw/mwworld/store.hpp index 2ed81af48..c6ef401ed 100644 --- a/apps/openmw/mwworld/store.hpp +++ b/apps/openmw/mwworld/store.hpp @@ -247,6 +247,8 @@ namespace MWWorld RecordId load(ESM::ESMReader &esm); void setUp(); + private: + bool mBuilt = false; }; template <> diff --git a/components/esmterrain/storage.cpp b/components/esmterrain/storage.cpp index 1e23569b5..ec2699aa7 100644 --- a/components/esmterrain/storage.cpp +++ b/components/esmterrain/storage.cpp @@ -353,11 +353,11 @@ namespace ESMTerrain std::string Storage::getTextureName(UniqueTextureId id) { // Goes under used terrain blend transitions - static const std::string baseTexture = "textures\\tx_black_01.dds"; + static constexpr char baseTexture[] = "textures\\tx_black_01.dds"; if (id.first == -1) return baseTexture; - static const std::string defaultTexture = "textures\\_land_default.dds"; + static constexpr char defaultTexture[] = "textures\\_land_default.dds"; if (id.first == 0) return defaultTexture; // Not sure if the default texture really is hardcoded? diff --git a/extern/osg-ffmpeg-videoplayer/videostate.hpp b/extern/osg-ffmpeg-videoplayer/videostate.hpp index 6abaa64cd..54519f428 100644 --- a/extern/osg-ffmpeg-videoplayer/videostate.hpp +++ b/extern/osg-ffmpeg-videoplayer/videostate.hpp @@ -80,8 +80,8 @@ struct PacketQueue { AVPacketList *first_pkt, *last_pkt; std::atomic flushing; - int nb_packets; - int size; + std::atomic nb_packets; + std::atomic size; OpenThreads::Mutex mutex; OpenThreads::Condition cond;