mirror of
https://github.com/OpenMW/openmw.git
synced 2025-05-04 22:41:24 +00:00
Use the embedded marker error if we fail to load the error marker model from the vfs
This commit is contained in:
parent
a0cddfda2b
commit
97c42768e6
2 changed files with 18 additions and 5 deletions
|
@ -42,6 +42,7 @@
|
||||||
Bug #7122: Teleportation to underwater should cancel active water walking effect
|
Bug #7122: Teleportation to underwater should cancel active water walking effect
|
||||||
Bug #7163: Myar Aranath: Wheat breaks the GUI
|
Bug #7163: Myar Aranath: Wheat breaks the GUI
|
||||||
Bug #7172: Current music playlist continues playing indefinitely if next playlist is empty
|
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
|
Bug #7243: Get Skyrim.esm loading
|
||||||
Feature #5492: Let rain and snow collide with statics
|
Feature #5492: Let rain and snow collide with statics
|
||||||
Feature #6447: Add LOD support to Object Paging
|
Feature #6447: Add LOD support to Object Paging
|
||||||
|
|
|
@ -852,12 +852,24 @@ namespace Resource
|
||||||
{
|
{
|
||||||
static osg::ref_ptr<osg::Node> errorMarkerNode = [&] {
|
static osg::ref_ptr<osg::Node> errorMarkerNode = [&] {
|
||||||
static const char* const sMeshTypes[] = { "nif", "osg", "osgt", "osgb", "osgx", "osg2", "dae" };
|
static const char* const sMeshTypes[] = { "nif", "osg", "osgt", "osgb", "osgx", "osg2", "dae" };
|
||||||
|
static bool useEmbedded = false;
|
||||||
for (unsigned int i = 0; i < sizeof(sMeshTypes) / sizeof(sMeshTypes[0]); ++i)
|
if (!useEmbedded)
|
||||||
{
|
{
|
||||||
normalized = "meshes/marker_error." + std::string(sMeshTypes[i]);
|
try
|
||||||
if (mVFS->exists(normalized))
|
{
|
||||||
return load(normalized, mVFS, mImageManager, mNifFileManager);
|
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());
|
Files::IMemStream file(ErrorMarker::sValue.data(), ErrorMarker::sValue.size());
|
||||||
return loadNonNif("error_marker.osgt", file, mImageManager);
|
return loadNonNif("error_marker.osgt", file, mImageManager);
|
||||||
|
|
Loading…
Reference in a new issue