is Hidden marker now takes a const RefId& instead of a string_view

iwyu_full
fteppe 2 years ago committed by florent.teppe
parent 0d68735e23
commit 2f2e401559

@ -14,7 +14,7 @@ namespace MWLua
bool isMarker(const MWWorld::Ptr& ptr)
{
return Misc::ResourceHelpers::isHiddenMarker(ptr.getCellRef().getRefId().getRefIdString());
return Misc::ResourceHelpers::isHiddenMarker(ptr.getCellRef().getRefId());
}
std::string ptrToString(const MWWorld::Ptr& ptr)

@ -68,7 +68,7 @@ namespace MWLua
const ESM::RefId& id = ref->mRef.getRefId();
if (id == ESM::RefId::stringRefId("player"))
return ESM::REC_INTERNAL_PLAYER;
if (Misc::ResourceHelpers::isHiddenMarker(id.getRefIdString()))
if (Misc::ResourceHelpers::isHiddenMarker(id))
return ESM::REC_INTERNAL_MARKER;
return ref->getType();
}

@ -599,7 +599,7 @@ namespace MWRender
continue;
}
if (Misc::ResourceHelpers::isHiddenMarker(ref.mRefID.getRefIdString()))
if (Misc::ResourceHelpers::isHiddenMarker(ref.mRefID))
continue;
int type = store.findStatic(ref.mRefID);

@ -92,7 +92,7 @@ namespace
std::string getModel(const MWWorld::Ptr& ptr, const VFS::Manager* vfs)
{
if (Misc::ResourceHelpers::isHiddenMarker(ptr.getCellRef().getRefId().getRefIdString()))
if (Misc::ResourceHelpers::isHiddenMarker(ptr.getCellRef().getRefId()))
return {};
bool useAnim = ptr.getClass().useAnim();
std::string model = ptr.getClass().getModel(ptr);

@ -82,7 +82,7 @@ namespace EsmLoader
T record;
bool deleted = false;
record.load(reader, deleted);
if (Misc::ResourceHelpers::isHiddenMarker(record.mId.getRefIdString()))
if (Misc::ResourceHelpers::isHiddenMarker(record.mId))
return;
records.emplace_back(deleted, std::move(record));
}

@ -5,6 +5,7 @@
#include <string_view>
#include <components/esm/common.hpp>
#include <components/esm/refid.hpp>
#include <components/misc/pathhelpers.hpp>
#include <components/misc/strings/algorithm.hpp>
@ -157,10 +158,10 @@ std::string Misc::ResourceHelpers::correctSoundPath(std::string_view resPath, co
return vfs->normalizeFilename(resPath);
}
bool Misc::ResourceHelpers::isHiddenMarker(std::string_view id)
bool Misc::ResourceHelpers::isHiddenMarker(const ESM::RefId& id)
{
return Misc::StringUtils::ciEqual(id, "prisonmarker") || Misc::StringUtils::ciEqual(id, "divinemarker")
|| Misc::StringUtils::ciEqual(id, "templemarker") || Misc::StringUtils::ciEqual(id, "northmarker");
return id == ESM::RefId::stringRefId("prisonmarker") ||id == ESM::RefId::stringRefId("divinemarker")
|| id == ESM::RefId::stringRefId("templemarker") || id == ESM::RefId::stringRefId("northmarker");
}
namespace

@ -9,6 +9,11 @@ namespace VFS
class Manager;
}
namespace ESM
{
struct RefId;
}
namespace Misc
{
// Workarounds for messy resource handling in vanilla morrowind
@ -30,7 +35,7 @@ namespace Misc
std::string correctSoundPath(std::string_view resPath, const VFS::Manager* vfs);
/// marker objects that have a hardcoded function in the game logic, should be hidden from the player
bool isHiddenMarker(std::string_view id);
bool isHiddenMarker(const ESM::RefId& id);
std::string getLODMeshName(int esmVersion, std::string resPath, const VFS::Manager* vfs, unsigned char lod = 0);
}
}

Loading…
Cancel
Save