|
|
|
@ -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);
|
|
|
|
|