From 1ffc1c9c363258536341bc52b81f20f0d89356d9 Mon Sep 17 00:00:00 2001 From: Amorilia <amorilia@users.sourceforge.net> Date: Wed, 21 Sep 2011 20:38:33 +0100 Subject: [PATCH] Added ReadNifTree for link stack stuff. --- include/niflib.h | 5 +++++ src/niflib.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/include/niflib.h b/include/niflib.h index a14357d9..939f01be 100644 --- a/include/niflib.h +++ b/include/niflib.h @@ -140,6 +140,11 @@ NIFLIB_API vector< Ref<NiObject> > ReadNifList( string const & file_name, NifInf */ NIFLIB_API vector< Ref<NiObject> > ReadNifList( istream & in, NifInfo * info = NULL ); +/*! + * Like ReadNifList but returns root. + */ +NIFLIB_API Ref<NiObject> ReadNifTree( istream & in, list<Ref<NiObject> > & missing_link_stack, NifInfo * info ); + /*! * Reads the given file by file name and returns a reference to the root object. * \param file_name The name of the file to load, or the complete path if it is not in the working directory. diff --git a/src/niflib.cpp b/src/niflib.cpp index 6280ca03..5bed1efb 100644 --- a/src/niflib.cpp +++ b/src/niflib.cpp @@ -60,6 +60,11 @@ static void SplitNifTree( NiObject * root_object, NiObjectRef& xnif_root, list<N //--Function Bodies--// +NiObjectRef ReadNifTree( istream & in, list<NiObjectRef> & missing_link_stack, NifInfo * info ) { + vector<NiObjectRef> objects = ReadNifList( in, missing_link_stack, info ); + return FindRoot( objects ); +} + NiObjectRef ReadNifTree( string const & file_name, NifInfo * info ) { //Read object list vector<NiObjectRef> objects = ReadNifList( file_name, info ); -- GitLab