1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-29 07:45:33 +00:00

Merge branch 'sensiblechain' into 'master'

Handle weird post-processing chains gracefully (#8295)

Closes #8295

See merge request OpenMW/openmw!4509
This commit is contained in:
psi29a 2025-01-12 17:58:41 +00:00
commit ec43849020
4 changed files with 19 additions and 4 deletions

View file

@ -226,6 +226,7 @@
Bug #8231: AGOP doesn't like NiCollisionSwitch
Bug #8237: Non-bipedal creatures should *not* use spellcast equip/unequip animations
Bug #8252: Plugin dependencies are not required to be loaded
Bug #8295: Post-processing chain is case-sensitive
Feature #1415: Infinite fall failsafe
Feature #2566: Handle NAM9 records for manual cell references
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking

View file

@ -762,14 +762,18 @@ namespace MWRender
if (Misc::StringUtils::ciEqual(technique->getName(), name))
return technique;
std::string realName = name;
auto fileIter = mTechniqueFileMap.find(name);
if (fileIter != mTechniqueFileMap.end())
realName = fileIter->first;
auto technique = std::make_shared<fx::Technique>(*mVFS, *mRendering.getResourceSystem()->getImageManager(),
name, renderWidth(), renderHeight(), mUBO, mNormalsSupported);
std::move(realName), renderWidth(), renderHeight(), mUBO, mNormalsSupported);
technique->compile();
if (technique->getStatus() != fx::Technique::Status::File_Not_exists)
technique->setLastModificationTime(
std::filesystem::last_write_time(mTechniqueFileMap[technique->getName()]));
technique->setLastModificationTime(std::filesystem::last_write_time(fileIter->second));
if (loadNextFrame)
{

View file

@ -18,6 +18,7 @@
#include <components/debug/debuglog.hpp>
#include <components/fx/stateupdater.hpp>
#include <components/fx/technique.hpp>
#include <components/misc/strings/algorithm.hpp>
#include "pingpongcanvas.hpp"
#include "transparentpass.hpp"
@ -229,7 +230,8 @@ namespace MWRender
TechniqueList mQueuedTemplates;
TechniqueList mInternalTechniques;
std::unordered_map<std::string, std::filesystem::path> mTechniqueFileMap;
std::unordered_map<std::string, std::filesystem::path, Misc::StringUtils::CiHash, Misc::StringUtils::CiEqual>
mTechniqueFileMap;
RenderingManager& mRendering;
osgViewer::Viewer* mViewer;

View file

@ -109,6 +109,14 @@ namespace fx
{
clear();
if (std::ranges::count(mFilePath.value(), '/') > 1)
{
Log(Debug::Error) << "Could not load technique, invalid location '" << mFilePath << "'";
mStatus = Status::File_Not_exists;
return false;
}
if (!mVFS.exists(mFilePath))
{
Log(Debug::Error) << "Could not load technique, file does not exist '" << mFilePath << "'";