From 4c7646cbb48266bacef3bdf61683ac91ae9616f7 Mon Sep 17 00:00:00 2001 From: Shon Ferguson <shonferg@users.sourceforge.net> Date: Wed, 28 Mar 2007 21:20:26 +0000 Subject: [PATCH] Fixed Matrix44 so IDENTITY is private, and made other necessary changes due to this. Made Header and Footer functions NIFLIB_HIDDEN. Fixed comment on NIF version 3.1 A manual change by Amorilia to the generated Header.cpp and Footer.cpp files was overwritten. This needs to be fixed in the Python script. --- include/gen/Footer.h | 6 +++--- include/gen/Header.h | 8 ++++---- include/nif_math.h | 1 + include/nif_versions.h | 2 +- src/gen/Header.cpp | 2 +- src/nif_math.cpp | 6 +++--- src/obj/NiGeometry.cpp | 4 ++-- src/obj/NiNode.cpp | 4 ++-- 8 files changed, 17 insertions(+), 16 deletions(-) diff --git a/include/gen/Footer.h b/include/gen/Footer.h index 6ef939a5..cec6ed2f 100644 --- a/include/gen/Footer.h +++ b/include/gen/Footer.h @@ -37,9 +37,9 @@ struct Footer { * Bip Head node). */ vector<Ref<NiObject > > roots; - void Read( istream& in, list<unsigned int> & link_stack, unsigned int version, unsigned int user_version ); - void Write( ostream& out, const map<NiObjectRef,unsigned int> & link_map, unsigned int version, unsigned int user_version ) const; - string asString( bool verbose = false ) const; + NIFLIB_HIDDEN void Read( istream& in, list<unsigned int> & link_stack, unsigned int version, unsigned int user_version ); + NIFLIB_HIDDEN void Write( ostream& out, const map<NiObjectRef,unsigned int> & link_map, unsigned int version, unsigned int user_version ) const; + NIFLIB_HIDDEN string asString( bool verbose = false ) const; }; } diff --git a/include/gen/Header.h b/include/gen/Header.h index 8b7c1db6..ad54673f 100644 --- a/include/gen/Header.h +++ b/include/gen/Header.h @@ -31,7 +31,7 @@ struct Header { /*! * Unknown. */ - vector<LineString > copyright; + array<3,LineString > copyright; /*! * The NIF version, in hexadecimal notation: 0x04000002, 0x0401000C, * 0x04020002, 0x04020100, 0x04020200, 0x0A000100, 0x0A010000, @@ -88,9 +88,9 @@ struct Header { * Unknown. */ unsigned int unknownInt2; - void Read( istream& in ); - void Write( ostream& out ) const; - string asString( bool verbose = false ) const; + NIFLIB_HIDDEN void Read( istream& in ); + NIFLIB_HIDDEN void Write( ostream& out ) const; + NIFLIB_HIDDEN string asString( bool verbose = false ) const; }; } diff --git a/include/nif_math.h b/include/nif_math.h index 085d6a58..1378c001 100644 --- a/include/nif_math.h +++ b/include/nif_math.h @@ -816,6 +816,7 @@ struct Matrix44 { return rows[n]; } + private: /*! The 4x4 identity matrix constant */ static const Matrix44 IDENTITY; }; diff --git a/include/nif_versions.h b/include/nif_versions.h index 4aa85c23..86e5f227 100644 --- a/include/nif_versions.h +++ b/include/nif_versions.h @@ -8,7 +8,7 @@ All rights reserved. Please see niflib.h for licence. */ namespace Niflib { -const unsigned VER_3_1 = 0x03010000; /*!< NIF Version 3.3.0.13 */ +const unsigned VER_3_1 = 0x03010000; /*!< NIF Version 3.1 */ const unsigned VER_3_3_0_13 = 0x0303000D; /*!< NIF Version 3.3.0.13 */ const unsigned VER_4_0_0_0 = 0x04000000; /*!< NIF Version 4.0.0.0 */ const unsigned VER_4_0_0_2 = 0x04000002; /*!< NIF Version 4.0.0.2 */ diff --git a/src/gen/Header.cpp b/src/gen/Header.cpp index df85dcb4..a861387d 100644 --- a/src/gen/Header.cpp +++ b/src/gen/Header.cpp @@ -5,7 +5,7 @@ All rights reserved. Please see niflib.h for licence. */ using namespace Niflib; //Constructor -Header::Header() : version((unsigned int)0x04000002), endianType((byte)1), userVersion((unsigned int)0), numBlocks((unsigned int)0), userVersion2((unsigned int)0), numBlockTypes((unsigned short)0), unknownInt2((unsigned int)0), copyright(3) {}; +Header::Header() : version((unsigned int)0x04000002), endianType((byte)1), userVersion((unsigned int)0), numBlocks((unsigned int)0), userVersion2((unsigned int)0), numBlockTypes((unsigned short)0), unknownInt2((unsigned int)0) {}; //Copy Constructor Header::Header( const Header & src ) { diff --git a/src/nif_math.cpp b/src/nif_math.cpp index 73d24e41..b1d5cc8d 100644 --- a/src/nif_math.cpp +++ b/src/nif_math.cpp @@ -162,7 +162,7 @@ Vector3 Vector3::CrossProduct( const Vector3 & rh) const { */ Matrix22::Matrix22() { - *this = Matrix22::IDENTITY; + *this = Matrix22::Identity(); } /* @@ -170,7 +170,7 @@ Matrix22::Matrix22() { */ Matrix33::Matrix33() { - *this = Matrix33::IDENTITY; + *this = Matrix33::Identity(); } Quaternion Matrix33::AsQuaternion() { @@ -241,7 +241,7 @@ Matrix33 Matrix33::operator*( const Matrix33 & m ) const */ Matrix44::Matrix44() { - *this = Matrix44::IDENTITY; + *this = Matrix44::Identity(); } Matrix44::Matrix44( const Matrix33 & r ) { diff --git a/src/obj/NiGeometry.cpp b/src/obj/NiGeometry.cpp index bffd82bb..4ada3fd3 100644 --- a/src/obj/NiGeometry.cpp +++ b/src/obj/NiGeometry.cpp @@ -210,7 +210,7 @@ void NiGeometry::ApplySkinOffset() { this->ApplyTransforms(); //Set the skin overall transform to the identity - skinInstance->GetSkinData()->SetOverallTransform( Matrix44::IDENTITY ); + skinInstance->GetSkinData()->SetOverallTransform( Matrix44::Identity() ); //Reset skin offsets skinInstance->GetSkinData()->ResetOffsets( this ); @@ -352,7 +352,7 @@ void NiGeometry::ApplyTransforms() { geom_data->Transform( this->GetLocalTransform() ); //Now that the transforms have been applied, clear them to the identity - this->SetLocalTransform( Matrix44::IDENTITY ); + this->SetLocalTransform( Matrix44::Identity() ); } // Calculate bounding sphere using minimum-volume axis-align bounding box. Its fast but not a very good fit. diff --git a/src/obj/NiNode.cpp b/src/obj/NiNode.cpp index aa6e7b92..b1a79f50 100644 --- a/src/obj/NiNode.cpp +++ b/src/obj/NiNode.cpp @@ -221,7 +221,7 @@ void NiNode::PropagateTransform() { } //Nowthat the transforms have been propogated, clear them out - this->SetLocalTransform( Matrix44::IDENTITY ); + this->SetLocalTransform( Matrix44::Identity() ); } bool NiNode::IsSplitMeshProxy() const { @@ -245,7 +245,7 @@ bool NiNode::IsSplitMeshProxy() const { if ( children[i]->IsDerivedType( NiTriBasedGeom::TypeConst() ) == false ) { return false; } - if ( children[i]->GetLocalTransform() != Matrix44::IDENTITY ) { + if ( children[i]->GetLocalTransform() != Matrix44::Identity() ) { return false; } if ( children[i]->GetVisibility() == false ) { -- GitLab