diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index 3c4ce6868..83fcb3e37 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -9,6 +9,8 @@ #include #include +#include + #include "model/doc/document.hpp" #include "model/world/data.hpp" @@ -24,7 +26,7 @@ CS::Editor::Editor () CSMSettings::UserSettings::instance().loadSettings ("opencs.ini"); mSettings.setModel (CSMSettings::UserSettings::instance()); - //NifOgre::Loader::setShowMarkers(true); + NifOsg::Loader::setShowMarkers(true); mVFS.reset(new VFS::Manager(mFsStrict)); diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index c05bad5ae..a37a13261 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -345,6 +345,13 @@ namespace namespace NifOsg { + bool Loader::sShowMarkers = false; + + void Loader::setShowMarkers(bool show) + { + sShowMarkers = show; + } + void Loader::loadKf(Nif::NIFFilePtr nif, osg::Node *rootNode, int sourceIndex, TextKeyMap& textKeys) { if(nif->numRoots() < 1) @@ -511,7 +518,7 @@ namespace NifOsg // String markers may contain important information // affecting the entire subtree of this obj // TODO: implement show markers flag - if(sd->string == "MRK" /*&& !sShowMarkers*/) + if(sd->string == "MRK" && !sShowMarkers) { // Marker objects. These meshes are only visible in the editor. skipMeshes = true; diff --git a/components/nifosg/nifloader.hpp b/components/nifosg/nifloader.hpp index 9fc262c70..8f9efe6b3 100644 --- a/components/nifosg/nifloader.hpp +++ b/components/nifosg/nifloader.hpp @@ -7,11 +7,14 @@ #include -#include - namespace osg { class Geometry; + class Group; + class Node; + class MatrixTransform; + class StateSet; + class Geode; } namespace osgAnimation { @@ -50,6 +53,11 @@ namespace NifOsg /// which animation source a keyframe controller came from. void loadKf(Nif::NIFFilePtr kf, osg::Node* rootNode, int sourceIndex, TextKeyMap &textKeys); + /// Set whether or not nodes marked as "MRK" should be shown. + /// These should be hidden ingame, but visible in the editior. + /// Default: false. + static void setShowMarkers(bool show); + const VFS::Manager* resourceManager; private: @@ -92,6 +100,8 @@ namespace NifOsg Nif::NIFFilePtr mNif; osg::Group* mRootNode; + + static bool sShowMarkers; }; }