diff --git a/CHANGELOG.md b/CHANGELOG.md index 6042e37c08..b892d08202 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,6 +99,7 @@ Feature #6161: Refactor Sky to use shaders and GLES/GL3 friendly Feature #6162: Refactor GUI to use shaders and to be GLES and GL3+ friendly Feature #6199: Support FBO Rendering + Feature #6248: Embedded error marker mesh Feature #6249: Alpha testing support for Collada Feature #6251: OpenMW-CS: Set instance movement based on camera zoom Feature #6288: Preserve the "blocked" record flag for referenceable objects. diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index bf073a0e78..7d62824f4d 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -37,7 +37,7 @@ add_component_dir (settings ) add_component_dir (bsa - bsa_file compressedbsafile memorystream + bsa_file compressedbsafile ) add_component_dir (vfs @@ -93,7 +93,7 @@ add_component_dir (esmterrain add_component_dir (misc constants utf8stream stringops resourcehelpers rng messageformatparser weakcache thread - compression osguservalues + compression osguservalues errorMarker ) add_component_dir (debug diff --git a/components/bsa/memorystream.cpp b/components/bsa/memorystream.cpp deleted file mode 100644 index 34e98e6b68..0000000000 --- a/components/bsa/memorystream.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - OpenMW - The completely unofficial reimplementation of Morrowind - Copyright (C) 2008-2010 Nicolay Korslund - Email: < korslund@gmail.com > - WWW: http://openmw.sourceforge.net/ - - This file (memorystream.cpp) is part of the OpenMW package. - - OpenMW is distributed as free software: you can redistribute it - and/or modify it under the terms of the GNU General Public License - version 3, as published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - version 3 along with this program. If not, see - http://www.gnu.org/licenses/ . - - Compressed BSA upgrade added by Azdul 2019 - - */ -#include "memorystream.hpp" - - -namespace Bsa -{ -MemoryInputStreamBuf::MemoryInputStreamBuf(size_t bufferSize) : mBufferPtr(bufferSize) -{ - this->setg(mBufferPtr.data(), mBufferPtr.data(), mBufferPtr.data() + bufferSize); -} - -char* MemoryInputStreamBuf::getRawData() { - return mBufferPtr.data(); -} - -MemoryInputStream::MemoryInputStream(size_t bufferSize) : - MemoryInputStreamBuf(bufferSize), - std::istream(static_cast(this)) { - -} - -char* MemoryInputStream::getRawData() { - return MemoryInputStreamBuf::getRawData(); -} -} diff --git a/components/bsa/memorystream.hpp b/components/bsa/memorystream.hpp index d168e93d65..5aae448299 100644 --- a/components/bsa/memorystream.hpp +++ b/components/bsa/memorystream.hpp @@ -28,22 +28,10 @@ #include #include +#include namespace Bsa { -/** -Class used internally by MemoryInputStream. -*/ -class MemoryInputStreamBuf : public std::streambuf { - -public: - explicit MemoryInputStreamBuf(size_t bufferSize); - virtual char* getRawData(); -private: - //correct call to delete [] on C++ 11 - std::vector mBufferPtr; -}; - /** Class replaces Ogre memory streams without introducing any new external dependencies beyond standard library. @@ -52,10 +40,18 @@ private: Memory buffer is freed once the class instance is destroyed. */ -class MemoryInputStream : virtual MemoryInputStreamBuf, std::istream { +class MemoryInputStream : private std::vector, public virtual Files::MemBuf, public std::istream { public: - explicit MemoryInputStream(size_t bufferSize); - char* getRawData() override; + explicit MemoryInputStream(size_t bufferSize) + : std::vector(bufferSize) + , Files::MemBuf(this->data(), this->size()) + , std::istream(static_cast(this)) + {} + + char* getRawData() + { + return this->data(); + } }; } diff --git a/components/misc/errorMarker.cpp b/components/misc/errorMarker.cpp new file mode 100644 index 0000000000..fd2b0b53ac --- /dev/null +++ b/components/misc/errorMarker.cpp @@ -0,0 +1,1390 @@ +#include "errorMarker.hpp" + +namespace Misc +{ + const std::string errorMarker = "#Ascii Scene " +"#Version 162 " +"#Generator OpenSceneGraph 3.6.5 " +"" +"osg::Group {" +" UniqueID 1 " +" Children 5 {" +" osg::Geode {" +" UniqueID 2 " +" Name \"Error\" " +" Drawables 1 {" +" osg::Geometry {" +" UniqueID 3 " +" DataVariance STATIC " +" StateSet TRUE {" +" osg::StateSet {" +" UniqueID 4 " +" DataVariance STATIC " +" ModeList 1 {" +" GL_BLEND ON " +" }" +" AttributeList 1 {" +" osg::Material {" +" UniqueID 5 " +" Name \"Error\" " +" Ambient TRUE Front 1 1 1 0.5 Back 1 1 1 0.5 " +" Diffuse TRUE Front 0.8 0.704 0.32 0.5 Back 0.8 0.704 0.32 0.5 " +" Specular TRUE Front 0.5 0.5 0.5 0.5 Back 0.5 0.5 0.5 0.5 " +" Emission TRUE Front 1 0.88 0.4 0.5 Back 1 0.88 0.4 0.5 " +" Shininess TRUE Front 28.8 Back 28.8 " +" }" +" Value OFF " +" }" +" RenderingHint 2 " +" RenderBinMode USE_RENDERBIN_DETAILS " +" BinNumber 10 " +" BinName \"DepthSortedBin\" " +" }" +" }" +" PrimitiveSetList 1 {" +" osg::DrawElementsUShort {" +" UniqueID 6 " +" BufferObject TRUE {" +" osg::ElementBufferObject {" +" UniqueID 7 " +" Target 34963 " +" }" +" }" +" Mode TRIANGLES " +" vector 108 {" +" 0 1 2 3 " +" 0 2 2 4 " +" 3 5 3 4 " +" 4 6 5 6 " +" 7 8 8 9 " +" 10 6 8 10 " +" 5 6 11 11 " +" 6 10 12 5 " +" 11 13 12 11 " +" 11 14 13 10 " +" 15 11 11 15 " +" 16 15 17 16 " +" 18 16 17 17 " +" 19 18 20 21 " +" 22 23 20 22 " +" 22 24 23 25 " +" 23 24 24 26 " +" 25 26 27 28 " +" 28 29 30 26 " +" 28 30 25 26 " +" 31 31 26 30 " +" 32 25 31 33 " +" 32 31 31 34 " +" 33 30 35 31 " +" 31 35 36 35 " +" 37 36 38 36 " +" 37 37 39 38 " +" " +" }" +" }" +" }" +" VertexArray TRUE {" +" osg::Vec3Array {" +" UniqueID 8 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 9 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 40 {" +" -4.51996 -5.9634 -60.7026 " +" 2e-06 -5.96339 -61.6017 " +" 4.51996 -5.96339 -60.7026 " +" -8.3518 -5.9634 -58.1422 " +" 8.3518 -5.96339 -58.1422 " +" -58.1422 -5.96341 -8.3518 " +" 58.1422 -5.96339 -8.3518 " +" 60.7026 -5.96339 -4.51996 " +" 61.6017 -5.96339 0 " +" 60.7026 -5.96339 4.51996 " +" 58.1423 -5.96339 8.3518 " +" -58.1422 -5.96341 8.3518 " +" -60.7026 -5.96341 -4.51996 " +" -61.6017 -5.96341 0 " +" -60.7026 -5.96341 4.51996 " +" 8.3518 -5.9634 58.1422 " +" -8.3518 -5.96341 58.1422 " +" 4.51997 -5.96341 60.7026 " +" -4.51996 -5.96341 60.7026 " +" 2e-06 -5.96341 61.6017 " +" -60.7026 5.96339 -4.51996 " +" -61.6017 5.96339 0 " +" -60.7026 5.96339 4.51996 " +" -58.1423 5.96339 -8.3518 " +" -58.1422 5.96339 8.3518 " +" -8.3518 5.9634 -58.1422 " +" -8.3518 5.96339 58.1422 " +" -4.51996 5.96339 60.7026 " +" -2e-06 5.96339 61.6017 " +" 4.51996 5.9634 60.7026 " +" 8.3518 5.9634 58.1422 " +" 8.3518 5.96341 -58.1422 " +" -4.51997 5.96341 -60.7026 " +" -2e-06 5.96341 -61.6017 " +" 4.51996 5.96341 -60.7026 " +" 58.1422 5.96341 8.3518 " +" 58.1422 5.96341 -8.3518 " +" 60.7026 5.96341 4.51996 " +" 60.7026 5.96341 -4.51996 " +" 61.6017 5.96341 0 " +" }" +" }" +" }" +" NormalArray TRUE {" +" osg::Vec3Array {" +" UniqueID 10 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 9 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 40 {" +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" }" +" }" +" }" +" TexCoordArrayList 1 {" +" osg::Vec2Array {" +" UniqueID 11 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 9 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 40 {" +" 0.37739 0.519384 " +" 0.384197 0.509197 " +" 0.394384 0.50239 " +" 0.375 0.531401 " +" 0.406401 0.5 " +" 0.375 0.718599 " +" 0.593599 0.5 " +" 0.605616 0.50239 " +" 0.615803 0.509197 " +" 0.62261 0.519384 " +" 0.625 0.531401 " +" 0.406401 0.75 " +" 0.37739 0.730616 " +" 0.384197 0.740803 " +" 0.394384 0.74761 " +" 0.625 0.718599 " +" 0.593599 0.75 " +" 0.62261 0.730616 " +" 0.605616 0.74761 " +" 0.615803 0.740803 " +" 0.37739 0.019384 " +" 0.384197 0.009197 " +" 0.394384 0.00239 " +" 0.375 0.031401 " +" 0.406401 0 " +" 0.375 0.218599 " +" 0.593599 0 " +" 0.605616 0.00239 " +" 0.615803 0.009197 " +" 0.62261 0.019384 " +" 0.625 0.031401 " +" 0.406401 0.25 " +" 0.37739 0.230616 " +" 0.384197 0.240803 " +" 0.394384 0.24761 " +" 0.625 0.218599 " +" 0.593599 0.25 " +" 0.62261 0.230616 " +" 0.605616 0.24761 " +" 0.615803 0.240803 " +" }" +" }" +" }" +" }" +" }" +" }" +" osg::Geode {" +" UniqueID 12 " +" Name \"Error\" " +" Drawables 1 {" +" osg::Geometry {" +" UniqueID 13 " +" DataVariance STATIC " +" StateSet TRUE {" +" osg::StateSet {" +" UniqueID 4 " +" }" +" }" +" PrimitiveSetList 1 {" +" osg::DrawElementsUShort {" +" UniqueID 14 " +" BufferObject TRUE {" +" osg::ElementBufferObject {" +" UniqueID 15 " +" Target 34963 " +" }" +" }" +" Mode TRIANGLES " +" vector 120 {" +" 0 1 2 0 " +" 3 1 3 4 " +" 1 3 5 4 " +" 4 5 6 4 " +" 6 7 8 7 " +" 6 8 6 9 " +" 10 8 9 10 " +" 9 11 12 13 " +" 11 12 11 14 " +" 15 12 14 15 " +" 14 16 16 17 " +" 15 16 18 17 " +" 18 19 17 18 " +" 20 19 20 21 " +" 19 20 22 21 " +" 22 23 24 22 " +" 25 23 25 26 " +" 23 25 27 26 " +" 28 26 27 28 " +" 29 26 30 29 " +" 28 30 28 31 " +" 32 30 31 32 " +" 31 33 34 35 " +" 33 34 33 36 " +" 37 34 36 37 " +" 36 38 39 37 " +" 38 39 38 40 " +" 40 41 39 40 " +" 42 41 42 43 " +" 41 42 0 43 " +" " +" }" +" }" +" }" +" VertexArray TRUE {" +" osg::Vec3Array {" +" UniqueID 16 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 17 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 44 {" +" 61.6017 -5.96339 0 " +" 60.7026 5.96341 -4.51996 " +" 61.6017 5.96341 0 " +" 60.7026 -5.96339 -4.51996 " +" 58.1422 5.96341 -8.3518 " +" 58.1422 -5.96339 -8.3518 " +" 8.3518 -5.96339 -58.1422 " +" 8.3518 5.96341 -58.1422 " +" 4.51996 5.96341 -60.7026 " +" 4.51996 -5.96339 -60.7026 " +" -2e-06 5.96341 -61.6017 " +" 2e-06 -5.96339 -61.6017 " +" -4.51997 5.96341 -60.7026 " +" -2e-06 5.96341 -61.6017 " +" -4.51996 -5.9634 -60.7026 " +" -8.3518 5.9634 -58.1422 " +" -8.3518 -5.9634 -58.1422 " +" -58.1423 5.96339 -8.3518 " +" -58.1422 -5.96341 -8.3518 " +" -60.7026 5.96339 -4.51996 " +" -60.7026 -5.96341 -4.51996 " +" -61.6017 5.96339 0 " +" -61.6017 -5.96341 0 " +" -60.7026 5.96339 4.51996 " +" -61.6017 5.96339 0 " +" -60.7026 -5.96341 4.51996 " +" -58.1422 5.96339 8.3518 " +" -58.1422 -5.96341 8.3518 " +" -8.3518 -5.96341 58.1422 " +" -8.3518 5.96339 58.1422 " +" -4.51996 5.96339 60.7026 " +" -4.51996 -5.96341 60.7026 " +" -2e-06 5.96339 61.6017 " +" 2e-06 -5.96341 61.6017 " +" 4.51996 5.9634 60.7026 " +" -2e-06 5.96339 61.6017 " +" 4.51997 -5.96341 60.7026 " +" 8.3518 5.9634 58.1422 " +" 8.3518 -5.9634 58.1422 " +" 58.1422 5.96341 8.3518 " +" 58.1423 -5.96339 8.3518 " +" 60.7026 5.96341 4.51996 " +" 60.7026 -5.96339 4.51996 " +" 61.6017 5.96341 0 " +" }" +" }" +" }" +" NormalArray TRUE {" +" osg::Vec3Array {" +" UniqueID 18 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 17 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 44 {" +" 1 0 0 " +" 0.923877 0 -0.38269 " +" 0.980784 0 -0.195097 " +" 0.923877 0 -0.38269 " +" 0.773003 0 -0.634402 " +" 0.773003 0 -0.634402 " +" 0.634402 0 -0.773003 " +" 0.634402 0 -0.773003 " +" 0.38269 0 -0.923877 " +" 0.38269 0 -0.923877 " +" 0.195097 0 -0.980784 " +" 0 0 -1 " +" -0.38269 -0 -0.923877 " +" -0.195097 -0 -0.980784 " +" -0.38269 -0 -0.923877 " +" -0.634402 -0 -0.773003 " +" -0.634402 -0 -0.773003 " +" -0.773003 -0 -0.634402 " +" -0.773003 -0 -0.634402 " +" -0.923877 -0 -0.38269 " +" -0.923877 -0 -0.38269 " +" -0.980784 -0 -0.195097 " +" -1 0 0 " +" -0.923877 0 0.38269 " +" -0.980784 0 0.195097 " +" -0.923877 0 0.38269 " +" -0.773003 0 0.634402 " +" -0.773003 0 0.634402 " +" -0.634402 0 0.773003 " +" -0.634402 0 0.773003 " +" -0.38269 0 0.923877 " +" -0.38269 0 0.923877 " +" -0.195097 0 0.980784 " +" 0 0 1 " +" 0.38269 0 0.923877 " +" 0.195097 0 0.980784 " +" 0.38269 0 0.923877 " +" 0.634402 0 0.773003 " +" 0.634402 0 0.773003 " +" 0.773003 0 0.634402 " +" 0.773003 0 0.634402 " +" 0.923877 0 0.38269 " +" 0.923877 0 0.38269 " +" 0.980784 0 0.195097 " +" }" +" }" +" }" +" TexCoordArrayList 1 {" +" osg::Vec2Array {" +" UniqueID 19 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 17 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 44 {" +" 0.625 0.5 " +" 0.605616 0.25 " +" 0.625 0.25 " +" 0.605616 0.5 " +" 0.593599 0.25 " +" 0.593599 0.5 " +" 0.406401 0.5 " +" 0.406401 0.25 " +" 0.394384 0.25 " +" 0.394384 0.5 " +" 0.375 0.25 " +" 0.375 0.5 " +" 0.125 0.519384 " +" 0.125 0.5 " +" 0.375 0.519384 " +" 0.125 0.531401 " +" 0.375 0.531401 " +" 0.125 0.718599 " +" 0.375 0.718599 " +" 0.125 0.730616 " +" 0.375 0.730616 " +" 0.125 0.75 " +" 0.375 0.75 " +" 0.394384 1 " +" 0.375 1 " +" 0.394384 0.75 " +" 0.406401 1 " +" 0.406401 0.75 " +" 0.593599 0.75 " +" 0.593599 1 " +" 0.605616 1 " +" 0.605616 0.75 " +" 0.625 1 " +" 0.625 0.75 " +" 0.875 0.730616 " +" 0.875 0.75 " +" 0.625 0.730616 " +" 0.875 0.718599 " +" 0.625 0.718599 " +" 0.875 0.531401 " +" 0.625 0.531401 " +" 0.875 0.519384 " +" 0.625 0.519384 " +" 0.875 0.5 " +" }" +" }" +" }" +" }" +" }" +" }" +" osg::Geode {" +" UniqueID 20 " +" Name \"Error\" " +" Drawables 1 {" +" osg::Geometry {" +" UniqueID 21 " +" DataVariance STATIC " +" StateSet TRUE {" +" osg::StateSet {" +" UniqueID 22 " +" DataVariance STATIC " +" AttributeList 1 {" +" osg::Material {" +" UniqueID 23 " +" Name \"ErrorLabel\" " +" Ambient TRUE Front 1 1 1 1 Back 1 1 1 1 " +" Diffuse TRUE Front 0.176208 0.176208 0.176208 1 Back 0.176208 0.176208 0.176208 1 " +" Specular TRUE Front 0.5 0.5 0.5 1 Back 0.5 0.5 0.5 1 " +" Emission TRUE Front 0.22026 0.22026 0.22026 1 Back 0.22026 0.22026 0.22026 1 " +" Shininess TRUE Front 28.8 Back 28.8 " +" }" +" Value OFF " +" }" +" }" +" }" +" PrimitiveSetList 1 {" +" osg::DrawElementsUShort {" +" UniqueID 24 " +" BufferObject TRUE {" +" osg::ElementBufferObject {" +" UniqueID 25 " +" Target 34963 " +" }" +" }" +" Mode TRIANGLES " +" vector 216 {" +" 0 1 2 3 " +" 0 2 2 4 " +" 3 4 5 3 " +" 5 6 7 5 " +" 8 3 8 5 " +" 7 7 9 8 " +" 10 3 8 8 " +" 11 10 12 13 " +" 10 14 12 10 " +" 15 14 10 10 " +" 11 15 16 15 " +" 11 11 17 16 " +" 18 16 17 17 " +" 19 18 20 21 " +" 22 23 20 22 " +" 22 24 23 25 " +" 23 24 24 26 " +" 25 26 27 28 " +" 28 29 30 26 " +" 28 30 25 26 " +" 31 31 26 30 " +" 32 25 31 33 " +" 32 31 31 34 " +" 33 30 35 31 " +" 31 35 36 35 " +" 37 36 38 36 " +" 37 37 39 38 " +" 40 41 42 43 " +" 40 42 42 44 " +" 43 45 43 44 " +" 44 46 45 47 " +" 45 46 48 47 " +" 46 46 49 48 " +" 44 50 46 51 " +" 46 50 50 52 " +" 53 54 50 53 " +" 53 55 54 50 " +" 54 51 54 56 " +" 51 56 57 51 " +" 58 51 57 57 " +" 59 58 60 61 " +" 62 63 60 62 " +" 62 64 63 65 " +" 63 64 64 66 " +" 65 66 67 68 " +" 69 70 65 71 " +" 69 65 72 71 " +" 65 66 68 73 " +" 65 66 73 68 " +" 74 73 73 72 " +" 65 73 75 72 " +" 72 75 76 75 " +" 77 76 78 76 " +" 77 77 79 78 " +" " +" }" +" }" +" }" +" VertexArray TRUE {" +" osg::Vec3Array {" +" UniqueID 26 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 27 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 80 {" +" -7.12646 -9.95049 -13.7349 " +" -6.35115 -9.95049 -14.8952 " +" -5.1908 -9.95049 -15.6705 " +" -7.39872 -9.95049 -12.3661 " +" -3.82208 -9.95049 -15.9428 " +" 3.82208 -9.95049 -15.9428 " +" 5.1908 -9.95049 -15.6705 " +" 6.35115 -9.95049 -14.8952 " +" 7.39872 -9.95049 -12.3661 " +" 7.12646 -9.95049 -13.7349 " +" -7.39872 -9.95049 33.4208 " +" 7.39872 -9.95049 33.4208 " +" -6.35115 -9.95049 35.9499 " +" -7.12647 -9.95049 34.7895 " +" -5.1908 -9.95049 36.7252 " +" -3.82208 -9.95049 36.9975 " +" 3.82208 -9.95049 36.9975 " +" 7.12646 -9.95049 34.7895 " +" 5.1908 -9.95049 36.7252 " +" 6.35115 -9.95049 35.9499 " +" -7.12646 -9.95042 -36.7346 " +" -6.35115 -9.95042 -37.8949 " +" -5.1908 -9.95042 -38.6702 " +" -7.39872 -9.95042 -35.3659 " +" -3.82208 -9.95042 -38.9425 " +" -7.39872 -9.95042 -27.7217 " +" 3.82208 -9.95042 -38.9425 " +" 5.1908 -9.95042 -38.6702 " +" 6.35115 -9.95042 -37.8949 " +" 7.12646 -9.95042 -36.7346 " +" 7.39872 -9.95042 -35.3659 " +" -3.82208 -9.95042 -24.1451 " +" -7.12647 -9.95042 -26.353 " +" -6.35115 -9.95042 -25.1926 " +" -5.1908 -9.95042 -24.4173 " +" 7.39872 -9.95042 -27.7217 " +" 3.82208 -9.95042 -24.1451 " +" 7.12646 -9.95042 -26.353 " +" 5.1908 -9.95042 -24.4173 " +" 6.35115 -9.95042 -25.1926 " +" -5.1908 9.95055 -15.6705 " +" -6.35115 9.95055 -14.8952 " +" -7.12646 9.95055 -13.7349 " +" -3.82208 9.95055 -15.9428 " +" -7.39872 9.95055 -12.3661 " +" 3.82208 9.95055 -15.9428 " +" 7.39872 9.95055 -12.3661 " +" 5.1908 9.95055 -15.6705 " +" 6.35115 9.95055 -14.8952 " +" 7.12646 9.95055 -13.7349 " +" -7.39872 9.95055 33.4208 " +" 7.39872 9.95055 33.4208 " +" -7.12646 9.95055 34.7895 " +" -6.35115 9.95056 35.9499 " +" -3.82208 9.95056 36.9975 " +" -5.1908 9.95056 36.7252 " +" 3.82208 9.95055 36.9975 " +" 5.19081 9.95055 36.7252 " +" 7.12646 9.95056 34.7895 " +" 6.35115 9.95055 35.9499 " +" -5.1908 9.95062 -38.6702 " +" -6.35115 9.95062 -37.8949 " +" -7.12646 9.95062 -36.7346 " +" -3.82208 9.95062 -38.9425 " +" -7.39872 9.95062 -35.3659 " +" 3.82208 9.95062 -38.9425 " +" -7.39872 9.95063 -27.7217 " +" -7.12646 9.95063 -26.353 " +" -6.35115 9.95063 -25.1926 " +" 6.35115 9.95062 -37.8949 " +" 5.1908 9.95062 -38.6702 " +" 7.12647 9.95062 -36.7346 " +" 7.39872 9.95062 -35.3659 " +" -3.82208 9.95063 -24.1451 " +" -5.1908 9.95063 -24.4173 " +" 3.82208 9.95063 -24.1451 " +" 7.39872 9.95062 -27.7217 " +" 5.1908 9.95063 -24.4173 " +" 7.12646 9.95063 -26.353 " +" 6.35115 9.95063 -25.1926 " +" }" +" }" +" }" +" NormalArray TRUE {" +" osg::Vec3Array {" +" UniqueID 28 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 27 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 80 {" +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" }" +" }" +" }" +" TexCoordArrayList 1 {" +" osg::Vec2Array {" +" UniqueID 29 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 27 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 80 {" +" 0.006133 0.041706 " +" 0.023598 0.006596 " +" 0.149209 0.001714 " +" 0 0.06756 " +" 0.241707 0 " +" 0.758294 0 " +" 0.850791 0.001714 " +" 0.976402 0.006596 " +" 1 0.06756 " +" 0.993867 0.041706 " +" 0 0.93244 " +" 1 0.93244 " +" 0.023598 0.993404 " +" 0.006133 0.958294 " +" 0.149209 0.998286 " +" 0.241706 1 " +" 0.758294 1 " +" 0.993867 0.958294 " +" 0.850791 0.998286 " +" 0.976402 0.993404 " +" 0.006133 0.149209 " +" 0.023598 0.023598 " +" 0.149209 0.006133 " +" 0 0.241707 " +" 0.241707 0 " +" 0 0.758294 " +" 0.758294 0 " +" 0.850791 0.006133 " +" 0.976402 0.023598 " +" 0.993867 0.149209 " +" 1 0.241707 " +" 0.241706 1 " +" 0.006133 0.850791 " +" 0.023598 0.976402 " +" 0.149209 0.993867 " +" 1 0.758293 " +" 0.758294 1 " +" 0.993867 0.850791 " +" 0.850791 0.993867 " +" 0.976402 0.976402 " +" 0.149209 0.001714 " +" 0.023598 0.006596 " +" 0.006133 0.041706 " +" 0.241706 0 " +" 0 0.06756 " +" 0.758294 0 " +" 1 0.06756 " +" 0.850791 0.001714 " +" 0.976402 0.006596 " +" 0.993867 0.041706 " +" 0 0.93244 " +" 1 0.93244 " +" 0.006133 0.958294 " +" 0.023598 0.993404 " +" 0.241707 1 " +" 0.149209 0.998286 " +" 0.758294 1 " +" 0.850791 0.998286 " +" 0.993867 0.958294 " +" 0.976402 0.993404 " +" 0.149209 0.006133 " +" 0.023598 0.023598 " +" 0.006133 0.149209 " +" 0.241706 0 " +" 0 0.241707 " +" 0.758294 0 " +" 0 0.758294 " +" 0.006133 0.850791 " +" 0.023598 0.976402 " +" 0.976402 0.023598 " +" 0.850791 0.006133 " +" 0.993867 0.149209 " +" 1 0.241706 " +" 0.241707 1 " +" 0.149209 0.993867 " +" 0.758294 1 " +" 1 0.758294 " +" 0.850791 0.993867 " +" 0.993867 0.850791 " +" 0.976402 0.976402 " +" }" +" }" +" }" +" }" +" }" +" }" +" osg::Geode {" +" UniqueID 30 " +" Name \"Error\" " +" Drawables 1 {" +" osg::Geometry {" +" UniqueID 31 " +" DataVariance STATIC " +" StateSet TRUE {" +" osg::StateSet {" +" UniqueID 22 " +" }" +" }" +" PrimitiveSetList 1 {" +" osg::DrawElementsUShort {" +" UniqueID 32 " +" BufferObject TRUE {" +" osg::ElementBufferObject {" +" UniqueID 33 " +" Target 34963 " +" }" +" }" +" Mode TRIANGLES " +" vector 240 {" +" 0 1 2 0 " +" 3 1 0 2 " +" 4 0 5 3 " +" 4 2 6 5 " +" 7 3 4 6 " +" 8 5 9 7 " +" 6 10 8 9 " +" 11 7 6 12 " +" 10 9 13 11 " +" 12 14 10 13 " +" 15 11 12 16 " +" 14 13 17 15 " +" 16 18 14 19 " +" 15 17 16 20 " +" 18 19 21 15 " +" 18 20 22 23 " +" 21 19 18 22 " +" 24 23 19 25 " +" 26 24 22 27 " +" 23 25 26 22 " +" 28 27 25 29 " +" 30 26 28 31 " +" 27 29 30 32 " +" 26 31 29 33 " +" 34 32 30 35 " +" 31 33 34 30 " +" 36 35 33 37 " +" 38 34 36 39 " +" 35 37 38 39 " +" 34 39 38 35 " +" 40 41 42 43 " +" 41 40 40 42 " +" 44 43 40 45 " +" 46 44 42 47 " +" 43 45 46 48 " +" 44 47 45 49 " +" 50 48 46 51 " +" 47 49 50 46 " +" 52 51 49 53 " +" 54 50 52 55 " +" 51 53 54 52 " +" 56 55 53 57 " +" 58 54 56 57 " +" 59 55 58 56 " +" 60 57 61 59 " +" 58 60 62 61 " +" 63 59 58 62 " +" 64 61 65 63 " +" 62 66 64 65 " +" 67 63 62 68 " +" 66 65 69 67 " +" 66 68 70 69 " +" 71 67 66 70 " +" 72 69 73 71 " +" 70 74 72 71 " +" 73 75 70 76 " +" 74 71 75 77 " +" 76 78 74 75 " +" 79 77 76 79 " +" 78 75 78 79 " +" " +" }" +" }" +" }" +" VertexArray TRUE {" +" osg::Vec3Array {" +" UniqueID 34 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 35 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 80 {" +" -7.39872 9.95055 -12.3661 " +" -7.39872 -9.95049 -12.3661 " +" -7.39872 -9.95049 33.4208 " +" -7.12646 -9.95049 -13.7349 " +" -7.39872 9.95055 33.4208 " +" -7.12646 9.95055 -13.7349 " +" -7.12647 -9.95049 34.7895 " +" -6.35115 -9.95049 -14.8952 " +" -7.12646 9.95055 34.7895 " +" -6.35115 9.95055 -14.8952 " +" -6.35115 9.95056 35.9499 " +" -5.1908 -9.95049 -15.6705 " +" -6.35115 -9.95049 35.9499 " +" -5.1908 9.95055 -15.6705 " +" -5.1908 9.95056 36.7252 " +" -3.82208 -9.95049 -15.9428 " +" -5.1908 -9.95049 36.7252 " +" -3.82208 9.95055 -15.9428 " +" -3.82208 9.95056 36.9975 " +" 3.82208 9.95055 -15.9428 " +" -3.82208 -9.95049 36.9975 " +" 3.82208 -9.95049 -15.9428 " +" 3.82208 -9.95049 36.9975 " +" 5.1908 -9.95049 -15.6705 " +" 3.82208 9.95055 36.9975 " +" 5.1908 9.95055 -15.6705 " +" 5.19081 9.95055 36.7252 " +" 6.35115 -9.95049 -14.8952 " +" 5.1908 -9.95049 36.7252 " +" 6.35115 9.95055 -14.8952 " +" 6.35115 -9.95049 35.9499 " +" 7.12646 -9.95049 -13.7349 " +" 6.35115 9.95055 35.9499 " +" 7.12646 9.95055 -13.7349 " +" 7.12646 9.95056 34.7895 " +" 7.39872 -9.95049 -12.3661 " +" 7.12646 -9.95049 34.7895 " +" 7.39872 9.95055 -12.3661 " +" 7.39872 -9.95049 33.4208 " +" 7.39872 9.95055 33.4208 " +" -3.82208 9.95063 -24.1451 " +" -3.82208 -9.95042 -24.1451 " +" 3.82208 -9.95042 -24.1451 " +" -5.1908 -9.95042 -24.4173 " +" 3.82208 9.95063 -24.1451 " +" -5.1908 9.95063 -24.4173 " +" 5.1908 -9.95042 -24.4173 " +" -6.35115 -9.95042 -25.1926 " +" 5.1908 9.95063 -24.4173 " +" -6.35115 9.95063 -25.1926 " +" 6.35115 9.95063 -25.1926 " +" -7.12647 -9.95042 -26.353 " +" 6.35115 -9.95042 -25.1926 " +" -7.12646 9.95063 -26.353 " +" 7.12646 9.95063 -26.353 " +" -7.39872 -9.95042 -27.7217 " +" 7.12646 -9.95042 -26.353 " +" -7.39872 9.95063 -27.7217 " +" 7.39872 9.95062 -27.7217 " +" -7.39872 -9.95042 -35.3659 " +" 7.39872 -9.95042 -27.7217 " +" -7.39872 9.95062 -35.3659 " +" 7.39872 -9.95042 -35.3659 " +" -7.12646 -9.95042 -36.7346 " +" 7.39872 9.95062 -35.3659 " +" -7.12646 9.95062 -36.7346 " +" 7.12647 9.95062 -36.7346 " +" -6.35115 -9.95042 -37.8949 " +" 7.12646 -9.95042 -36.7346 " +" -6.35115 9.95062 -37.8949 " +" 6.35115 -9.95042 -37.8949 " +" -5.1908 -9.95042 -38.6702 " +" 6.35115 9.95062 -37.8949 " +" -5.1908 9.95062 -38.6702 " +" 5.1908 9.95062 -38.6702 " +" -3.82208 9.95062 -38.9425 " +" 5.1908 -9.95042 -38.6702 " +" -3.82208 -9.95042 -38.9425 " +" 3.82208 9.95062 -38.9425 " +" 3.82208 -9.95042 -38.9425 " +" }" +" }" +" }" +" NormalArray TRUE {" +" osg::Vec3Array {" +" UniqueID 36 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 35 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 80 {" +" -0.995187 -0 -0.0979987 " +" -0.995187 -0 -0.0979987 " +" -0.995187 0 0.0979987 " +" -0.923877 -0 -0.38269 " +" -0.995187 0 0.0979987 " +" -0.923877 -0 -0.38269 " +" -0.923877 0 0.38269 " +" -0.707107 -0 -0.707107 " +" -0.923877 0 0.38269 " +" -0.707107 -0 -0.707107 " +" -0.707107 0 0.707107 " +" -0.38269 -0 -0.923877 " +" -0.707107 0 0.707107 " +" -0.38269 -0 -0.923877 " +" -0.38269 0 0.923877 " +" -0.0979987 -0 -0.995187 " +" -0.38269 0 0.923877 " +" -0.0979987 -0 -0.995187 " +" -0.0979987 0 0.995187 " +" 0.0979987 0 -0.995187 " +" -0.0979987 0 0.995187 " +" 0.0979987 0 -0.995187 " +" 0.0979987 0 0.995187 " +" 0.38269 0 -0.923877 " +" 0.0979987 0 0.995187 " +" 0.38269 0 -0.923877 " +" 0.38269 0 0.923877 " +" 0.707107 0 -0.707107 " +" 0.38269 0 0.923877 " +" 0.707107 0 -0.707107 " +" 0.707107 0 0.707107 " +" 0.923877 0 -0.38269 " +" 0.707107 0 0.707107 " +" 0.923877 0 -0.38269 " +" 0.923877 0 0.38269 " +" 0.995187 0 -0.0979987 " +" 0.923877 0 0.38269 " +" 0.995187 0 -0.0979987 " +" 0.995187 0 0.0979987 " +" 0.995187 0 0.0979987 " +" -0.0979987 0 0.995187 " +" -0.0979987 0 0.995187 " +" 0.0979987 0 0.995187 " +" -0.38269 0 0.923877 " +" 0.0979987 0 0.995187 " +" -0.38269 0 0.923877 " +" 0.38269 0 0.923877 " +" -0.707107 0 0.707107 " +" 0.38269 0 0.923877 " +" -0.707107 0 0.707107 " +" 0.707107 0 0.707107 " +" -0.923877 0 0.38269 " +" 0.707107 0 0.707107 " +" -0.923877 0 0.38269 " +" 0.923877 0 0.38269 " +" -0.995187 0 0.0979987 " +" 0.923877 0 0.38269 " +" -0.995187 0 0.0979987 " +" 0.995187 0 0.0979987 " +" -0.995187 -0 -0.0979987 " +" 0.995187 0 0.0979987 " +" -0.995187 -0 -0.0979987 " +" 0.995187 0 -0.0979987 " +" -0.923877 -0 -0.38269 " +" 0.995187 0 -0.0979987 " +" -0.923877 -0 -0.38269 " +" 0.923877 0 -0.38269 " +" -0.707107 -0 -0.707107 " +" 0.923877 0 -0.38269 " +" -0.707107 -0 -0.707107 " +" 0.707107 0 -0.707107 " +" -0.38269 -0 -0.923877 " +" 0.707107 0 -0.707107 " +" -0.38269 -0 -0.923877 " +" 0.38269 0 -0.923877 " +" -0.0979987 -0 -0.995187 " +" 0.38269 0 -0.923877 " +" -0.0979987 -0 -0.995187 " +" 0.0979987 0 -0.995187 " +" 0.0979987 0 -0.995187 " +" }" +" }" +" }" +" TexCoordArrayList 1 {" +" osg::Vec2Array {" +" UniqueID 37 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 35 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 80 {" +" 0 0.06756 " +" 0 0.06756 " +" 0 0.93244 " +" 0.006133 0.041706 " +" 0 0.93244 " +" 0.006133 0.041706 " +" 0.006133 0.958294 " +" 0.023598 0.006596 " +" 0.006133 0.958294 " +" 0.023598 0.006596 " +" 0.023598 0.993404 " +" 0.149209 0.001714 " +" 0.023598 0.993404 " +" 0.149209 0.001714 " +" 0.149209 0.998286 " +" 0.241706 0 " +" 0.149209 0.998286 " +" 0.241707 0 " +" 0.241706 1 " +" 0.758294 0 " +" 0.241707 1 " +" 0.758294 0 " +" 0.758294 1 " +" 0.850791 0.001714 " +" 0.758294 1 " +" 0.850791 0.001714 " +" 0.850791 0.998286 " +" 0.976402 0.006596 " +" 0.850791 0.998286 " +" 0.976402 0.006596 " +" 0.976402 0.993404 " +" 0.993867 0.041706 " +" 0.976402 0.993404 " +" 0.993867 0.041706 " +" 0.993867 0.958294 " +" 1 0.06756 " +" 0.993867 0.958294 " +" 1 0.06756 " +" 1 0.93244 " +" 1 0.93244 " +" 0.241706 1 " +" 0.241707 1 " +" 0.758294 1 " +" 0.149209 0.993867 " +" 0.758294 1 " +" 0.149209 0.993867 " +" 0.850791 0.993867 " +" 0.023598 0.976402 " +" 0.850791 0.993867 " +" 0.023598 0.976402 " +" 0.976402 0.976402 " +" 0.006133 0.850791 " +" 0.976402 0.976402 " +" 0.006133 0.850791 " +" 0.993867 0.850791 " +" 0 0.758293 " +" 0.993867 0.850791 " +" 0 0.758294 " +" 1 0.758294 " +" 0 0.241707 " +" 1 0.758294 " +" 0 0.241706 " +" 1 0.241707 " +" 0.006133 0.149209 " +" 1 0.241707 " +" 0.006133 0.149209 " +" 0.993867 0.149209 " +" 0.023598 0.023598 " +" 0.993867 0.149209 " +" 0.023598 0.023598 " +" 0.976402 0.023598 " +" 0.149209 0.006133 " +" 0.976402 0.023598 " +" 0.149209 0.006133 " +" 0.850791 0.006133 " +" 0.241707 0 " +" 0.850791 0.006133 " +" 0.241706 0 " +" 0.758294 0 " +" 0.758294 0 " +" }" +" }" +" }" +" }" +" }" +" }" +" osg::Geode {" +" UniqueID 38 " +" Name \"Cube\" " +" Drawables 1 {" +" osg::Geometry {" +" UniqueID 39 " +" DataVariance STATIC " +" StateSet TRUE {" +" osg::StateSet {" +" UniqueID 40 " +" DataVariance STATIC " +" AttributeList 1 {" +" osg::Material {" +" UniqueID 41 " +" Name \"Material\" " +" Ambient TRUE Front 1 1 1 1 Back 1 1 1 1 " +" Diffuse TRUE Front 0.8 0.8 0.8 1 Back 0.8 0.8 0.8 1 " +" Specular TRUE Front 0.5 0.5 0.5 1 Back 0.5 0.5 0.5 1 " +" Emission TRUE Front 0 0 0 1 Back 0 0 0 1 " +" Shininess TRUE Front 41.344 Back 41.344 " +" }" +" Value OFF " +" }" +" }" +" }" +" PrimitiveSetList 1 {" +" osg::DrawElementsUShort {" +" UniqueID 42 " +" BufferObject TRUE {" +" osg::ElementBufferObject {" +" UniqueID 43 " +" Target 34963 " +" }" +" }" +" Mode TRIANGLES " +" vector 36 {" +" 0 1 2 0 " +" 2 3 4 5 " +" 6 4 6 7 " +" 8 9 10 8 " +" 10 11 12 13 " +" 14 12 14 15 " +" 16 17 18 16 " +" 18 19 20 21 " +" 22 20 22 23 " +" " +" }" +" }" +" }" +" VertexArray TRUE {" +" osg::Vec3Array {" +" UniqueID 44 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 45 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 24 {" +" 1 1 1 " +" -1 1 1 " +" -1 -1 1 " +" 1 -1 1 " +" 1 -1 -1 " +" 1 -1 1 " +" -1 -1 1 " +" -1 -1 -1 " +" -1 -1 -1 " +" -1 -1 1 " +" -1 1 1 " +" -1 1 -1 " +" -1 1 -1 " +" 1 1 -1 " +" 1 -1 -1 " +" -1 -1 -1 " +" 1 1 -1 " +" 1 1 1 " +" 1 -1 1 " +" 1 -1 -1 " +" -1 1 -1 " +" -1 1 1 " +" 1 1 1 " +" 1 1 -1 " +" }" +" }" +" }" +" NormalArray TRUE {" +" osg::Vec3Array {" +" UniqueID 46 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 45 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 24 {" +" 0 0 1 " +" 0 0 1 " +" 0 0 1 " +" 0 0 1 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" 0 -1 0 " +" -1 0 0 " +" -1 0 0 " +" -1 0 0 " +" -1 0 0 " +" 0 0 -1 " +" 0 0 -1 " +" 0 0 -1 " +" 0 0 -1 " +" 1 0 0 " +" 1 0 0 " +" 1 0 0 " +" 1 0 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" 0 1 0 " +" }" +" }" +" }" +" TexCoordArrayList 1 {" +" osg::Vec2Array {" +" UniqueID 47 " +" BufferObject TRUE {" +" osg::VertexBufferObject {" +" UniqueID 45 " +" }" +" }" +" Binding BIND_PER_VERTEX " +" vector 24 {" +" 0.625 0.5 " +" 0.875 0.5 " +" 0.875 0.75 " +" 0.625 0.75 " +" 0.375 0.75 " +" 0.625 0.75 " +" 0.625 1 " +" 0.375 1 " +" 0.375 0 " +" 0.625 0 " +" 0.625 0.25 " +" 0.375 0.25 " +" 0.125 0.5 " +" 0.375 0.5 " +" 0.375 0.75 " +" 0.125 0.75 " +" 0.375 0.5 " +" 0.625 0.5 " +" 0.625 0.75 " +" 0.375 0.75 " +" 0.375 0.25 " +" 0.625 0.25 " +" 0.625 0.5 " +" 0.375 0.5 " +" }" +" }" +" }" +" }" +" }" +" }" +" }" +"}"; + +} diff --git a/components/misc/errorMarker.hpp b/components/misc/errorMarker.hpp new file mode 100644 index 0000000000..05e1fa9557 --- /dev/null +++ b/components/misc/errorMarker.hpp @@ -0,0 +1,11 @@ +#ifndef OPENMW_COMPONENTS_MISC_ERRORMARKER_H +#define OPENMW_COMPONENTS_MISC_ERRORMARKER_H + +#include + +namespace Misc +{ + extern const std::string errorMarker; +} + +#endif diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index 23581a09b8..f39a5919b6 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -36,6 +37,7 @@ #include #include +#include #include "imagemanager.hpp" #include "niffilemanager.hpp" @@ -483,13 +485,11 @@ namespace Resource Resource::ImageManager* mImageManager; }; - osg::ref_ptr load (const std::string& normalizedFilename, const VFS::Manager* vfs, Resource::ImageManager* imageManager, Resource::NifFileManager* nifFileManager) + namespace { - auto ext = Misc::getFileExtension(normalizedFilename); - if (ext == "nif") - return NifOsg::Loader::load(nifFileManager->get(normalizedFilename), imageManager); - else + osg::ref_ptr loadNonNif(const std::string& normalizedFilename, std::istream& model, Resource::ImageManager* imageManager) { + auto ext = Misc::getFileExtension(normalizedFilename); osgDB::ReaderWriter* reader = osgDB::Registry::instance()->getReaderWriterForExtension(std::string(ext)); if (!reader) { @@ -505,10 +505,9 @@ namespace Resource options->setReadFileCallback(new ImageReadCallback(imageManager)); if (ext == "dae") options->setOptionString("daeUseSequencedTextureUnits"); - Files::IStreamPtr stream = vfs->get(normalizedFilename); - const std::uint64_t fileHash = Files::getHash(normalizedFilename, *stream); + const std::uint64_t fileHash = Files::getHash(normalizedFilename, model); - osgDB::ReaderWriter::ReadResult result = reader->readNode(*stream, options); + osgDB::ReaderWriter::ReadResult result = reader->readNode(model, options); if (!result.success()) { std::stringstream errormsg; @@ -519,7 +518,9 @@ namespace Resource // Recognize and hide collision node unsigned int hiddenNodeMask = 0; SceneUtil::FindByNameVisitor nameFinder("Collision"); - result.getNode()->accept(nameFinder); + + auto node = result.getNode(); + node->accept(nameFinder); if (nameFinder.mFoundNode) nameFinder.mFoundNode->setNodeMask(hiddenNodeMask); @@ -527,16 +528,14 @@ namespace Resource { // Collada alpha testing Resource::ColladaAlphaTrickVisitor colladaAlphaTrickVisitor; - result.getNode()->accept(colladaAlphaTrickVisitor); + node->accept(colladaAlphaTrickVisitor); - result.getNode()->getOrCreateStateSet()->addUniform(new osg::Uniform("emissiveMult", 1.f)); - result.getNode()->getOrCreateStateSet()->addUniform(new osg::Uniform("specStrength", 1.f)); - result.getNode()->getOrCreateStateSet()->addUniform(new osg::Uniform("envMapColor", osg::Vec4f(1,1,1,1))); - result.getNode()->getOrCreateStateSet()->addUniform(new osg::Uniform("useFalloff", false)); + node->getOrCreateStateSet()->addUniform(new osg::Uniform("emissiveMult", 1.f)); + node->getOrCreateStateSet()->addUniform(new osg::Uniform("specStrength", 1.f)); + node->getOrCreateStateSet()->addUniform(new osg::Uniform("envMapColor", osg::Vec4f(1,1,1,1))); + node->getOrCreateStateSet()->addUniform(new osg::Uniform("useFalloff", false)); } - auto node = result.getNode(); - node->setUserValue(Misc::OsgUserValues::sFileHash, std::string(reinterpret_cast(&fileHash), sizeof(fileHash))); @@ -544,6 +543,15 @@ namespace Resource } } + osg::ref_ptr load (const std::string& normalizedFilename, const VFS::Manager* vfs, Resource::ImageManager* imageManager, Resource::NifFileManager* nifFileManager) + { + auto ext = Misc::getFileExtension(normalizedFilename); + if (ext == "nif") + return NifOsg::Loader::load(nifFileManager->get(normalizedFilename), imageManager); + else + return loadNonNif(normalizedFilename, *vfs->get(normalizedFilename), imageManager); + } + class CanOptimizeCallback : public SceneUtil::Optimizer::IsOperationPermissibleForObjectCallback { public: @@ -659,23 +667,23 @@ namespace Resource { loaded = load(normalized, mVFS, mImageManager, mNifFileManager); } - catch (std::exception& e) + catch (const std::exception& e) { - static const char * const sMeshTypes[] = { "nif", "osg", "osgt", "osgb", "osgx", "osg2", "dae" }; + static osg::ref_ptr errorMarkerNode = [&] { + static const char* const sMeshTypes[] = { "nif", "osg", "osgt", "osgb", "osgx", "osg2", "dae" }; - for (unsigned int i=0; iexists(normalized)) + for (unsigned int i=0; iexists(normalized)) + return load(normalized, mVFS, mImageManager, mNifFileManager); } - } + Files::IMemStream file(Misc::errorMarker.data(), Misc::errorMarker.size()); + return loadNonNif("error_marker.osgt", file, mImageManager); + }(); - if (!loaded) - throw; + Log(Debug::Error) << "Failed to load '" << name << "': " << e.what() << ", using marker_error instead"; + loaded = static_cast(errorMarkerNode->clone(osg::CopyOp::DEEP_COPY_ALL)); } // set filtering settings