Use the embedded marker error if we fail to load the error marker model from the vfs

update_gitlab_rules
Cédric Mocquillon 1 year ago
parent a0cddfda2b
commit 97c42768e6

@ -42,6 +42,7 @@
Bug #7122: Teleportation to underwater should cancel active water walking effect
Bug #7163: Myar Aranath: Wheat breaks the GUI
Bug #7172: Current music playlist continues playing indefinitely if next playlist is empty
Bug #7229: Error marker loading failure is not handled
Bug #7243: Get Skyrim.esm loading
Feature #5492: Let rain and snow collide with statics
Feature #6447: Add LOD support to Object Paging

@ -852,12 +852,24 @@ namespace Resource
{
static osg::ref_ptr<osg::Node> errorMarkerNode = [&] {
static const char* const sMeshTypes[] = { "nif", "osg", "osgt", "osgb", "osgx", "osg2", "dae" };
for (unsigned int i = 0; i < sizeof(sMeshTypes) / sizeof(sMeshTypes[0]); ++i)
static bool useEmbedded = false;
if (!useEmbedded)
{
normalized = "meshes/marker_error." + std::string(sMeshTypes[i]);
if (mVFS->exists(normalized))
return load(normalized, mVFS, mImageManager, mNifFileManager);
try
{
for (unsigned int i = 0; i < sizeof(sMeshTypes) / sizeof(sMeshTypes[0]); ++i)
{
normalized = "meshes/marker_error." + std::string(sMeshTypes[i]);
if (mVFS->exists(normalized))
return load(normalized, mVFS, mImageManager, mNifFileManager);
}
}
catch (const std::exception& e)
{
useEmbedded = true;
Log(Debug::Warning) << "Failed to load error marker:" << e.what()
<< ", using embedded marker_error instead";
}
}
Files::IMemStream file(ErrorMarker::sValue.data(), ErrorMarker::sValue.size());
return loadNonNif("error_marker.osgt", file, mImageManager);

Loading…
Cancel
Save