1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 15:29:55 +00:00

Use normalize path in Animation::addAnimSource to change extension

This commit is contained in:
elsid 2024-10-06 16:24:15 +02:00
parent 7e7cf51ade
commit a6e075499b
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625

View file

@ -28,16 +28,17 @@
#include <components/esm3/loadnpc.hpp> #include <components/esm3/loadnpc.hpp>
#include <components/esm3/loadrace.hpp> #include <components/esm3/loadrace.hpp>
#include <components/esm4/loadligh.hpp> #include <components/esm4/loadligh.hpp>
#include <components/misc/constants.hpp> #include <components/misc/constants.hpp>
#include <components/misc/pathhelpers.hpp> #include <components/misc/pathhelpers.hpp>
#include <components/misc/resourcehelpers.hpp> #include <components/misc/resourcehelpers.hpp>
#include <components/sceneutil/lightcommon.hpp>
#include <components/sceneutil/keyframe.hpp>
#include <components/vfs/manager.hpp> #include <components/vfs/manager.hpp>
#include <components/vfs/pathutil.hpp>
#include <components/vfs/recursivedirectoryiterator.hpp> #include <components/vfs/recursivedirectoryiterator.hpp>
#include <components/sceneutil/keyframe.hpp>
#include <components/sceneutil/lightcommon.hpp>
#include <components/sceneutil/lightmanager.hpp> #include <components/sceneutil/lightmanager.hpp>
#include <components/sceneutil/lightutil.hpp> #include <components/sceneutil/lightutil.hpp>
#include <components/sceneutil/positionattitudetransform.hpp> #include <components/sceneutil/positionattitudetransform.hpp>
@ -677,10 +678,10 @@ namespace MWRender
void Animation::addAnimSource(std::string_view model, const std::string& baseModel) void Animation::addAnimSource(std::string_view model, const std::string& baseModel)
{ {
std::string kfname = Misc::StringUtils::lowerCase(model); VFS::Path::Normalized kfname(model);
if (kfname.ends_with(".nif")) if (Misc::getFileExtension(kfname) == "nif")
kfname.replace(kfname.size() - 4, 4, ".kf"); kfname.changeExtension("kf");
addSingleAnimSource(kfname, baseModel); addSingleAnimSource(kfname, baseModel);