diff --git a/CMakeLists.txt b/CMakeLists.txt index a0cf56ab4..cbe142fcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,6 +221,9 @@ if (${OGRE_VERSION} VERSION_LESS "1.9") message(FATAL_ERROR "OpenMW requires Ogre 1.9 or later, please install the latest stable version from http://ogre3d.org") endif() +find_package(OpenSceneGraph 3.2.0 REQUIRED osgDB) +include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}) + find_package(MyGUI REQUIRED) if (${MYGUI_VERSION} VERSION_LESS "3.2.1") message(FATAL_ERROR "OpenMW requires MyGUI 3.2.1 or later, please install the latest version from http://mygui.info") diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index f6b1c8cba..ecaeb115b 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -31,24 +31,24 @@ add_component_dir (nifoverrides ) add_component_dir (bsa - bsa_archive bsa_file resources + bsa_file ) add_component_dir (nif controlled effect niftypes record controller extra node record_ptr data niffile property nifkey data node base nifstream ) -add_component_dir (nifcache - nifcache - ) +#add_component_dir (nifcache +# nifcache +# ) -add_component_dir (nifogre - ogrenifloader skeleton material mesh particles controller - ) +#add_component_dir (nifogre +# ogrenifloader skeleton material mesh particles controller +# ) -add_component_dir (nifbullet - bulletnifloader - ) +#add_component_dir (nifbullet +# bulletnifloader +# ) add_component_dir (to_utf8 to_utf8 @@ -160,7 +160,7 @@ include_directories(${BULLET_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) add_library(components STATIC ${COMPONENT_FILES} ${MOC_SRCS} ${ESM_UI_HDR}) -target_link_libraries(components ${Boost_LIBRARIES} ${OGRE_LIBRARIES}) +target_link_libraries(components ${Boost_LIBRARIES} ${OGRE_LIBRARIES} ${OPENSCENEGRAPH_LIBRARIES}) if (GIT_CHECKOUT) add_dependencies (components git-version) diff --git a/components/nif/controlled.hpp b/components/nif/controlled.hpp index 815aa7d3f..51890f069 100644 --- a/components/nif/controlled.hpp +++ b/components/nif/controlled.hpp @@ -129,8 +129,8 @@ public: * 1 - Point (fixed origin) */ int mType; - Ogre::Vector3 mPosition; - Ogre::Vector3 mDirection; + osg::Vec3f mPosition; + osg::Vec3f mDirection; void read(NIFStream *nif) { diff --git a/components/nif/controller.hpp b/components/nif/controller.hpp index 9ae527e5a..718748c31 100644 --- a/components/nif/controller.hpp +++ b/components/nif/controller.hpp @@ -33,7 +33,7 @@ class NiParticleSystemController : public Controller { public: struct Particle { - Ogre::Vector3 velocity; + osg::Vec3f velocity; float lifetime; float lifespan; float timestamp; @@ -64,7 +64,7 @@ public: }; int emitFlags; - Ogre::Vector3 offsetRandom; + osg::Vec3f offsetRandom; NodePtr emitter; diff --git a/components/nif/data.hpp b/components/nif/data.hpp index d9de12fb5..db5a5643d 100644 --- a/components/nif/data.hpp +++ b/components/nif/data.hpp @@ -33,10 +33,10 @@ namespace Nif class ShapeData : public Record { public: - std::vector vertices, normals; - std::vector colors; - std::vector< std::vector > uvlist; - Ogre::Vector3 center; + std::vector vertices, normals; + std::vector colors; + std::vector< std::vector > uvlist; + osg::Vec3f center; float radius; void read(NIFStream *nif) @@ -131,7 +131,7 @@ public: class NiRotatingParticlesData : public NiAutoNormalParticlesData { public: - std::vector rotations; + std::vector rotations; void read(NIFStream *nif) { @@ -272,9 +272,9 @@ class NiSkinData : public Record public: struct BoneTrafo { - Ogre::Matrix3 rotation; // Rotation offset from bone? - Ogre::Vector3 trans; // Translation - float scale; // Probably scale (always 1) + Matrix3 rotation; // Rotation offset from bone? + osg::Vec3f trans; // Translation + float scale; // Scale }; struct VertWeight @@ -286,7 +286,7 @@ public: struct BoneInfo { BoneTrafo trafo; - Ogre::Vector4 unknown; + osg::Vec4f unknown; std::vector weights; }; @@ -327,7 +327,7 @@ struct NiMorphData : public Record { struct MorphData { FloatKeyMap mData; - std::vector mVertices; + std::vector mVertices; }; std::vector mMorphs; diff --git a/components/nif/effect.hpp b/components/nif/effect.hpp index cc1b0f41c..679557e25 100644 --- a/components/nif/effect.hpp +++ b/components/nif/effect.hpp @@ -38,9 +38,9 @@ struct NiLight : Effect struct SLight { float dimmer; - Ogre::Vector3 ambient; - Ogre::Vector3 diffuse; - Ogre::Vector3 specular; + osg::Vec3f ambient; + osg::Vec3f diffuse; + osg::Vec3f specular; void read(NIFStream *nif) { diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index 4f3ee95cb..f7d864198 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -2,16 +2,16 @@ #include "effect.hpp" #include - -#include +#include namespace Nif { /// Open a NIF stream. The name is used for error messages. -NIFFile::NIFFile(const std::string &name) +NIFFile::NIFFile(Files::IStreamPtr stream, const std::string &name) : ver(0) , filename(name) + , mStream(stream) { parse(); } @@ -121,63 +121,68 @@ std::string NIFFile::printVersion(unsigned int version) version_out.full = version; - return Ogre::StringConverter::toString(version_out.quad[3]) - +"." + Ogre::StringConverter::toString(version_out.quad[2]) - +"." + Ogre::StringConverter::toString(version_out.quad[1]) - +"." + Ogre::StringConverter::toString(version_out.quad[0]); + std::stringstream stream; + stream << version_out.quad[3] << "." + << version_out.quad[2] << "." + << version_out.quad[1] << "." + << version_out.quad[0]; + return stream.str(); } void NIFFile::parse() { - NIFStream nif (this, Ogre::ResourceGroupManager::getSingleton().openResource(filename)); - - // Check the header string - std::string head = nif.getVersionString(); - if(head.compare(0, 22, "NetImmerse File Format") != 0) - fail("Invalid NIF header: " + head); - - // Get BCD version - ver = nif.getUInt(); - if(ver != VER_MW) - fail("Unsupported NIF version: " + printVersion(ver)); - // Number of records - size_t recNum = nif.getInt(); - records.resize(recNum); - - /* The format for 10.0.1.0 seems to be a bit different. After the + NIFStream nif (this, mStream); + + // Check the header string + std::string head = nif.getVersionString(); + if(head.compare(0, 22, "NetImmerse File Format") != 0) + fail("Invalid NIF header: " + head); + + // Get BCD version + ver = nif.getUInt(); + if(ver != VER_MW) + fail("Unsupported NIF version: " + printVersion(ver)); + // Number of records + size_t recNum = nif.getInt(); + records.resize(recNum); + + /* The format for 10.0.1.0 seems to be a bit different. After the header, it contains the number of records, r (int), just like 4.0.0.2, but following that it contains a short x, followed by x strings. Then again by r shorts, one for each record, giving which of the above strings to use to identify the record. After this follows two ints (zero?) and then the record data. However we do not support or plan to support other versions yet. - */ + */ - for(size_t i = 0;i < recNum;i++) + for(size_t i = 0;i < recNum;i++) { - Record *r = NULL; - - std::string rec = nif.getString(); - if(rec.empty()) - fail("Record number " + Ogre::StringConverter::toString(i) + " out of " + Ogre::StringConverter::toString(recNum) + " is blank."); + Record *r = NULL; + std::string rec = nif.getString(); + if(rec.empty()) + { + std::stringstream error; + error << "Record number " << i << " out of " << recNum << " is blank."; + fail(error.str()); + } - std::map::const_iterator entry = factories.find(rec); - - if (entry != factories.end()) - { - r = entry->second.mCreate (); - r->recType = entry->second.mType; - } - else - fail("Unknown record type " + rec); + std::map::const_iterator entry = factories.find(rec); - assert(r != NULL); - assert(r->recType != RC_MISSING); - r->recName = rec; - r->recIndex = i; - records[i] = r; - r->read(&nif); + if (entry != factories.end()) + { + r = entry->second.mCreate (); + r->recType = entry->second.mType; + } + else + fail("Unknown record type " + rec); + + assert(r != NULL); + assert(r->recType != RC_MISSING); + r->recName = rec; + r->recIndex = i; + records[i] = r; + r->read(&nif); } size_t rootNum = nif.getUInt(); diff --git a/components/nif/niffile.hpp b/components/nif/niffile.hpp index ceb9984fb..9f08f3f1d 100644 --- a/components/nif/niffile.hpp +++ b/components/nif/niffile.hpp @@ -7,6 +7,8 @@ #include #include +#include + #include "record.hpp" namespace Nif @@ -42,6 +44,8 @@ class NIFFile ///\overload void operator = (NIFFile const &); + Files::IStreamPtr mStream; + public: /// Used if file parsing fails void fail(const std::string &msg) @@ -57,8 +61,8 @@ public: << "File: " << filename < - #include "nifstream.hpp" +#include +#include + namespace Nif { template struct KeyT { T mValue; + + // FIXME: Implement Quadratic and TBC interpolation + /* T mForwardValue; // Only for Quadratic interpolation, and never for QuaternionKeyList T mBackwardValue; // Only for Quadratic interpolation, and never for QuaternionKeyList float mTension; // Only for TBC interpolation float mBias; // Only for TBC interpolation float mContinuity; // Only for TBC interpolation + */ }; -typedef KeyT FloatKey; -typedef KeyT Vector3Key; -typedef KeyT Vector4Key; -typedef KeyT QuaternionKey; template struct KeyMapT { @@ -92,7 +93,12 @@ struct KeyMapT { { //Don't try to read XYZ keys into the wrong part if ( count != 1 ) - nif->file->fail("XYZ_ROTATION_KEY count should always be '1' . Retrieved Value: "+Ogre::StringConverter::toString(count)); + { + std::stringstream error; + error << "XYZ_ROTATION_KEY count should always be '1' . Retrieved Value: " + << count; + nif->file->fail(error.str()); + } } else if (0 == mInterpolationType) { @@ -100,7 +106,11 @@ struct KeyMapT { nif->file->fail("Interpolation type 0 doesn't work with keys"); } else - nif->file->fail("Unhandled interpolation type: "+Ogre::StringConverter::toString(mInterpolationType)); + { + std::stringstream error; + error << "Unhandled interpolation type: " << mInterpolationType; + nif->file->fail(error.str()); + } } private: @@ -109,31 +119,26 @@ private: key.mValue = (nif.*getValue)(); } - static void readQuadratic(NIFStream &nif, KeyT &key) - { - readValue(nif, key); - } - template static void readQuadratic(NIFStream &nif, KeyT &key) { readValue(nif, key); - key.mForwardValue = (nif.*getValue)(); - key.mBackwardValue = (nif.*getValue)(); + /*key.mForwardValue = */(nif.*getValue)(); + /*key.mBackwardValue = */(nif.*getValue)(); } static void readTBC(NIFStream &nif, KeyT &key) { readValue(nif, key); - key.mTension = nif.getFloat(); - key.mBias = nif.getFloat(); - key.mContinuity = nif.getFloat(); + /*key.mTension = */nif.getFloat(); + /*key.mBias = */nif.getFloat(); + /*key.mContinuity = */nif.getFloat(); } }; typedef KeyMapT FloatKeyMap; -typedef KeyMapT Vector3KeyMap; -typedef KeyMapT Vector4KeyMap; -typedef KeyMapT QuaternionKeyMap; +typedef KeyMapT Vector3KeyMap; +typedef KeyMapT Vector4KeyMap; +typedef KeyMapT QuaternionKeyMap; } // Namespace #endif //#ifndef OPENMW_COMPONENTS_NIF_NIFKEY_HPP diff --git a/components/nif/nifstream.cpp b/components/nif/nifstream.cpp index e5699db7b..628541933 100644 --- a/components/nif/nifstream.cpp +++ b/components/nif/nifstream.cpp @@ -9,19 +9,19 @@ namespace Nif uint8_t NIFStream::read_byte() { uint8_t byte; - if(inp->read(&byte, 1) != 1) return 0; + inp->read((char*)&byte, 1); return byte; } uint16_t NIFStream::read_le16() { uint8_t buffer[2]; - if(inp->read(buffer, 2) != 2) return 0; + inp->read((char*)buffer, 2); return buffer[0] | (buffer[1]<<8); } uint32_t NIFStream::read_le32() { uint8_t buffer[4]; - if(inp->read(buffer, 4) != 4) return 0; + inp->read((char*)buffer, 4); return buffer[0] | (buffer[1]<<8) | (buffer[2]<<16) | (buffer[3]<<24); } float NIFStream::read_le32f() @@ -34,43 +34,45 @@ float NIFStream::read_le32f() } //Public functions -Ogre::Vector2 NIFStream::getVector2() +osg::Vec2f NIFStream::getVector2() { - float a[2]; + osg::Vec2f vec; for(size_t i = 0;i < 2;i++) - a[i] = getFloat(); - return Ogre::Vector2(a); + vec._v[i] = getFloat(); + return vec; } -Ogre::Vector3 NIFStream::getVector3() +osg::Vec3f NIFStream::getVector3() { - float a[3]; + osg::Vec3f vec; for(size_t i = 0;i < 3;i++) - a[i] = getFloat(); - return Ogre::Vector3(a); + vec._v[i] = getFloat(); + return vec; } -Ogre::Vector4 NIFStream::getVector4() +osg::Vec4f NIFStream::getVector4() { - float a[4]; + osg::Vec4f vec; for(size_t i = 0;i < 4;i++) - a[i] = getFloat(); - return Ogre::Vector4(a); + vec._v[i] = getFloat(); + return vec; } -Ogre::Matrix3 NIFStream::getMatrix3() +Matrix3 NIFStream::getMatrix3() { - Ogre::Real a[3][3]; + Matrix3 mat; for(size_t i = 0;i < 3;i++) { for(size_t j = 0;j < 3;j++) - a[i][j] = Ogre::Real(getFloat()); + mat.mValues[i][j] = getFloat(); } - return Ogre::Matrix3(a); + return mat; } -Ogre::Quaternion NIFStream::getQuaternion() +osg::Quat NIFStream::getQuaternion() { - float a[4]; - for(size_t i = 0;i < 4;i++) - a[i] = getFloat(); - return Ogre::Quaternion(a); + osg::Quat quat; + quat.w() = getFloat(); + quat.x() = getFloat(); + quat.y() = getFloat(); + quat.z() = getFloat(); + return quat; } Transformation NIFStream::getTrafo() { @@ -83,16 +85,9 @@ Transformation NIFStream::getTrafo() std::string NIFStream::getString(size_t length) { - //Make sure we're not reading in too large of a string - unsigned int fileSize = inp->size(); - if(fileSize != 0 && fileSize < length) - file->fail("Attempted to read a string with " + Ogre::StringConverter::toString(length) + " characters , but file is only "+Ogre::StringConverter::toString(fileSize)+ " bytes!"); - std::vector str (length+1, 0); - if(inp->read(&str[0], length) != length) - throw std::runtime_error (": String length in NIF file "+ file->getFilename() +" does not match! Expected length: " - + Ogre::StringConverter::toString(length)); + inp->read(&str[0], length); return &str[0]; } @@ -103,7 +98,9 @@ std::string NIFStream::getString() } std::string NIFStream::getVersionString() { - return inp->getLine(); + std::string result; + std::getline(*inp, result); + return result; } void NIFStream::getShorts(std::vector &vec, size_t size) @@ -118,25 +115,25 @@ void NIFStream::getFloats(std::vector &vec, size_t size) for(size_t i = 0;i < vec.size();i++) vec[i] = getFloat(); } -void NIFStream::getVector2s(std::vector &vec, size_t size) +void NIFStream::getVector2s(std::vector &vec, size_t size) { vec.resize(size); for(size_t i = 0;i < vec.size();i++) vec[i] = getVector2(); } -void NIFStream::getVector3s(std::vector &vec, size_t size) +void NIFStream::getVector3s(std::vector &vec, size_t size) { vec.resize(size); for(size_t i = 0;i < vec.size();i++) vec[i] = getVector3(); } -void NIFStream::getVector4s(std::vector &vec, size_t size) +void NIFStream::getVector4s(std::vector &vec, size_t size) { vec.resize(size); for(size_t i = 0;i < vec.size();i++) vec[i] = getVector4(); } -void NIFStream::getQuaternions(std::vector &quat, size_t size) +void NIFStream::getQuaternions(std::vector &quat, size_t size) { quat.resize(size); for(size_t i = 0;i < quat.size();i++) diff --git a/components/nif/nifstream.hpp b/components/nif/nifstream.hpp index 6c5e83eeb..b732c83af 100644 --- a/components/nif/nifstream.hpp +++ b/components/nif/nifstream.hpp @@ -5,14 +5,13 @@ #include #include +#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include +#include +#include #include "niftypes.hpp" @@ -24,7 +23,7 @@ class NIFFile; class NIFStream { /// Input stream - Ogre::DataStreamPtr inp; + Files::IStreamPtr inp; uint8_t read_byte(); uint16_t read_le16(); @@ -35,9 +34,9 @@ public: NIFFile * const file; - NIFStream (NIFFile * file, Ogre::DataStreamPtr inp): file (file), inp (inp) {} + NIFStream (NIFFile * file, Files::IStreamPtr inp): file (file), inp (inp) {} - void skip(size_t size) { inp->skip(size); } + void skip(size_t size) { inp->ignore(size); } char getChar() { return read_byte(); } short getShort() { return read_le16(); } @@ -46,11 +45,11 @@ public: unsigned int getUInt() { return read_le32(); } float getFloat() { return read_le32f(); } - Ogre::Vector2 getVector2(); - Ogre::Vector3 getVector3(); - Ogre::Vector4 getVector4(); - Ogre::Matrix3 getMatrix3(); - Ogre::Quaternion getQuaternion(); + osg::Vec2f getVector2(); + osg::Vec3f getVector3(); + osg::Vec4f getVector4(); + Matrix3 getMatrix3(); + osg::Quat getQuaternion(); Transformation getTrafo(); ///Read in a string of the given length @@ -62,10 +61,10 @@ public: void getShorts(std::vector &vec, size_t size); void getFloats(std::vector &vec, size_t size); - void getVector2s(std::vector &vec, size_t size); - void getVector3s(std::vector &vec, size_t size); - void getVector4s(std::vector &vec, size_t size); - void getQuaternions(std::vector &quat, size_t size); + void getVector2s(std::vector &vec, size_t size); + void getVector3s(std::vector &vec, size_t size); + void getVector4s(std::vector &vec, size_t size); + void getQuaternions(std::vector &quat, size_t size); }; } diff --git a/components/nif/niftypes.hpp b/components/nif/niftypes.hpp index 786c48b65..864795afb 100644 --- a/components/nif/niftypes.hpp +++ b/components/nif/niftypes.hpp @@ -24,24 +24,35 @@ #ifndef OPENMW_COMPONENTS_NIF_NIFTYPES_HPP #define OPENMW_COMPONENTS_NIF_NIFTYPES_HPP -#include -#include +#include // Common types used in NIF files namespace Nif { +struct Matrix3 +{ + float mValues[3][3]; + + Matrix3() + { + for (int i=0;i<3;++i) + for (int j=0;j<3;++j) + mValues[i][j] = 0; + } +}; + struct Transformation { - Ogre::Vector3 pos; - Ogre::Matrix3 rotation; + osg::Vec3f pos; + Matrix3 rotation; float scale; static const Transformation& getIdentity() { static const Transformation identity = { - Ogre::Vector3::ZERO, Ogre::Matrix3::IDENTITY, 1.0f + osg::Vec3f(), Matrix3(), 1.0f }; return identity; } diff --git a/components/nif/node.cpp b/components/nif/node.cpp index fb68da548..b0c5d990e 100644 --- a/components/nif/node.cpp +++ b/components/nif/node.cpp @@ -1,60 +1,2 @@ #include "node.hpp" -namespace Nif -{ - -void Node::getProperties(const Nif::NiTexturingProperty *&texprop, - const Nif::NiMaterialProperty *&matprop, - const Nif::NiAlphaProperty *&alphaprop, - const Nif::NiVertexColorProperty *&vertprop, - const Nif::NiZBufferProperty *&zprop, - const Nif::NiSpecularProperty *&specprop, - const Nif::NiWireframeProperty *&wireprop, - const Nif::NiStencilProperty *&stencilprop) const -{ - if(parent) - parent->getProperties(texprop, matprop, alphaprop, vertprop, zprop, specprop, wireprop, stencilprop); - - for(size_t i = 0;i < props.length();i++) - { - // Entries may be empty - if(props[i].empty()) - continue; - - const Nif::Property *pr = props[i].getPtr(); - if(pr->recType == Nif::RC_NiTexturingProperty) - texprop = static_cast(pr); - else if(pr->recType == Nif::RC_NiMaterialProperty) - matprop = static_cast(pr); - else if(pr->recType == Nif::RC_NiAlphaProperty) - alphaprop = static_cast(pr); - else if(pr->recType == Nif::RC_NiVertexColorProperty) - vertprop = static_cast(pr); - else if(pr->recType == Nif::RC_NiZBufferProperty) - zprop = static_cast(pr); - else if(pr->recType == Nif::RC_NiSpecularProperty) - specprop = static_cast(pr); - else if(pr->recType == Nif::RC_NiWireframeProperty) - wireprop = static_cast(pr); - else if (pr->recType == Nif::RC_NiStencilProperty) - stencilprop = static_cast(pr); - else - std::cerr<< "Unhandled property type: "<recName <getWorldTransform() * getLocalTransform(); - return getLocalTransform(); -} - -} diff --git a/components/nif/node.hpp b/components/nif/node.hpp index a26480d59..123b70cad 100644 --- a/components/nif/node.hpp +++ b/components/nif/node.hpp @@ -1,8 +1,6 @@ #ifndef OPENMW_COMPONENTS_NIF_NODE_HPP #define OPENMW_COMPONENTS_NIF_NODE_HPP -#include - #include "controlled.hpp" #include "extra.hpp" #include "data.hpp" @@ -26,14 +24,14 @@ public: // Node flags. Interpretation depends somewhat on the type of node. int flags; Transformation trafo; - Ogre::Vector3 velocity; // Unused? Might be a run-time game state + osg::Vec3f velocity; // Unused? Might be a run-time game state PropertyList props; // Bounding box info bool hasBounds; - Ogre::Vector3 boundPos; - Ogre::Matrix3 boundRot; - Ogre::Vector3 boundXYZ; // Box size + osg::Vec3f boundPos; + Matrix3 boundRot; + osg::Vec3f boundXYZ; // Box size void read(NIFStream *nif) { @@ -91,18 +89,6 @@ public: boneTrafo = &bi.trafo; boneIndex = ind; } - - void getProperties(const Nif::NiTexturingProperty *&texprop, - const Nif::NiMaterialProperty *&matprop, - const Nif::NiAlphaProperty *&alphaprop, - const Nif::NiVertexColorProperty *&vertprop, - const Nif::NiZBufferProperty *&zprop, - const Nif::NiSpecularProperty *&specprop, - const Nif::NiWireframeProperty *&wireprop, - const Nif::NiStencilProperty *&stencilprop) const; - - Ogre::Matrix4 getLocalTransform() const; - Ogre::Matrix4 getWorldTransform() const; }; struct NiNode : Node diff --git a/components/nif/property.hpp b/components/nif/property.hpp index 77f61d068..52ee7f6e1 100644 --- a/components/nif/property.hpp +++ b/components/nif/property.hpp @@ -159,7 +159,7 @@ class NiFogProperty : public Property { public: float mFogDepth; - Ogre::Vector3 mColour; + osg::Vec3f mColour; void read(NIFStream *nif) @@ -194,7 +194,7 @@ struct StructPropT : Property struct S_MaterialProperty { // The vector components are R,G,B - Ogre::Vector3 ambient, diffuse, specular, emissive; + osg::Vec3f ambient, diffuse, specular, emissive; float glossiness, alpha; void read(NIFStream *nif) @@ -265,14 +265,6 @@ struct S_AlphaProperty Taken from: http://niftools.sourceforge.net/doc/nif/NiAlphaProperty.html - - Right now we only use standard alpha blending (see the Ogre code - that sets it up) and it appears that this is the only blending - used in the original game. Bloodmoon (along with several mods) do - however use other settings, such as discarding pixel values with - alpha < 1.0. This is faster because we don't have to mess with the - depth stuff like we did for blending. And OGRE has settings for - this too. */ // Tested against when certain flags are set (see above.)