diff --git a/include/niflib.h b/include/niflib.h index 7071538589777552a83bcf658e99c60ceec529a6..1b8edc6f62fb032e9baab09e18072dc790c0fe76 100644 --- a/include/niflib.h +++ b/include/niflib.h @@ -107,6 +107,14 @@ enum ExportOptions { */ NIFLIB_API unsigned int GetNifVersion( string const & file_name ); +/*! + * Returns the nif info without reading the entire file which includes the nif version, + * the nif user version1 and the nif user version2 + * \param The full path to the nif file which includes the file name and the location of the nif file + * \return The nif info structure which contains the nif header info + */ +NIFLIB_API NifInfo ReadHeaderInfo( string const & file_name ); + /*! * Return the missing link stack with objects replaced from nif trees at specified root. */ diff --git a/include/obj/BSShaderTextureSet.h b/include/obj/BSShaderTextureSet.h index 6b12d4991f1985854d1054a8f595cc21b139a9f3..3156127a8fc0d763bff8c80798e5434968e7742d 100644 --- a/include/obj/BSShaderTextureSet.h +++ b/include/obj/BSShaderTextureSet.h @@ -57,20 +57,20 @@ public: // Textures // \return The current value. - vector<string > GetTextures() const; + NIFLIB_API vector<string > getTextures() const; // Textures // \param[in] value The new value. - void SetTextures( const vector<string >& value ); + NIFLIB_API void setTextures( const vector<string >& value ); // Textures // \return The current value. - string GetTexture( size_t i ) const; + NIFLIB_API string getTexture( size_t i ) const; // Textures // \param[in] i Index of texture to set // \param[in] value The new value. - void SetTexture( size_t i, const string& value); + NIFLIB_API void setTexture( size_t i, const string& value); //--END CUSTOM CODE--// protected: diff --git a/include/obj/NiGeometry.h b/include/obj/NiGeometry.h index 8a2f23c6fe94d11e9240fe3f4fa3d6a3f96b1130..02edf9cb97c44f99c40796ee7ffde06dbe81064c 100644 --- a/include/obj/NiGeometry.h +++ b/include/obj/NiGeometry.h @@ -166,6 +166,18 @@ public: // \return The current value. NIFLIB_API bool HasShader() const; + /* + * Returns the array of the only 2 properties that are specific to Bethesda + * \return Returns the array of the 2 properties + */ + NIFLIB_API array<2,Ref<NiProperty > > getBsProperties(); + + /* + * Sets the array of the only 2 properties that are specific to Bethesda + * \param[in] The new array of properties + */ + NIFLIB_API void setBsProperties( array<2, Ref<NiProperty>> value); + //--END CUSTOM CODE--// protected: /*! Data index (NiTriShapeData/NiTriStripData). */ diff --git a/src/niflib.cpp b/src/niflib.cpp index 673227db0ec88532c457df951831e0b37e7c1923..fb579069b010e1bf5ee85e73883250c63f1cc788 100644 --- a/src/niflib.cpp +++ b/src/niflib.cpp @@ -114,6 +114,21 @@ unsigned int GetNifVersion( string const & file_name ) { return info.version; } + +NifInfo ReadHeaderInfo( string const & file_name ) { + //--Open File--// + ifstream in( file_name.c_str(), ifstream::binary ); + + //--Read Header Info--// + + Header nif_header; + NifInfo info; + info = nif_header.Read(in); + + return info; +} + + vector<NiObjectRef> ReadNifList( string const & file_name, NifInfo * info ) { //--Open File--// diff --git a/src/obj/BSShaderTextureSet.cpp b/src/obj/BSShaderTextureSet.cpp index 895452f7e7717da558b04fead17072018db3897d..66144f6ae4feb8288c642ba2f625824c11686ca5 100644 --- a/src/obj/BSShaderTextureSet.cpp +++ b/src/obj/BSShaderTextureSet.cpp @@ -129,21 +129,21 @@ std::list<NiObject *> BSShaderTextureSet::GetPtrs() const { //--BEGIN MISC CUSTOM CODE--// -vector<string > BSShaderTextureSet::GetTextures() const { +vector<string > BSShaderTextureSet::getTextures() const { return textures; } -void BSShaderTextureSet::SetTextures( const vector<string >& value ) { +void BSShaderTextureSet::setTextures( const vector<string >& value ) { textures = value; } -string BSShaderTextureSet::GetTexture(size_t i) const { +string BSShaderTextureSet::getTexture(size_t i) const { if (i >= textures.size()) throw runtime_error("Invalid Texture Index specified"); return textures[i]; } -void BSShaderTextureSet::SetTexture( size_t i, const string& value) { +void BSShaderTextureSet::setTexture( size_t i, const string& value) { if (i >= textures.size()) textures.resize(i+1); textures[i] = value; diff --git a/src/obj/NiGeometry.cpp b/src/obj/NiGeometry.cpp index e9c29623b6a7a89061791ebbd31ef9108c2d737f..00cc9c543105466f043233771d7ce51569f6dd8e 100644 --- a/src/obj/NiGeometry.cpp +++ b/src/obj/NiGeometry.cpp @@ -633,5 +633,14 @@ bool NiGeometry::HasShader() const { return hasShader; } +array<2,Ref<NiProperty > > Niflib::NiGeometry::getBsProperties() { + return this->bsProperties; +} + +void Niflib::NiGeometry::setBsProperties( array<2, Ref<NiProperty>> value ) { + this->bsProperties = value; +} //--END CUSTOM CODE--// + +