Skip to content
Snippets Groups Projects
Commit 4fe94f6a authored by Shon Ferguson's avatar Shon Ferguson
Browse files

Fixed a few errors in niflib.cpp by adding a GetName function to NiObjectNET.

parent f8d80e68
No related branches found
No related tags found
No related merge requests found
...@@ -729,7 +729,7 @@ void MapParentNodeNames( map<string,NiAVObjectRef> & name_map, NiAVObjectRef par ...@@ -729,7 +729,7 @@ void MapParentNodeNames( map<string,NiAVObjectRef> & name_map, NiAVObjectRef par
//} //}
//Add the par node to the map, and then call this function for each of its children //Add the par node to the map, and then call this function for each of its children
name_map[par->name] = par; name_map[par->GetName()] = par;
//TODO: Implement functions to get and set children //TODO: Implement functions to get and set children
list<NiAVObjectRef> links;// = par->GetAttr("Children")->asLinkList();; list<NiAVObjectRef> links;// = par->GetAttr("Children")->asLinkList();;
...@@ -761,7 +761,7 @@ void ReassignTreeCrossRefs( map<string,NiAVObjectRef> & name_map, NiAVObjectRef ...@@ -761,7 +761,7 @@ void ReassignTreeCrossRefs( map<string,NiAVObjectRef> & name_map, NiAVObjectRef
//existing nodes by changing their data or attatched properties //existing nodes by changing their data or attatched properties
void MergeSceneGraph( map<string,NiAVObjectRef> & name_map, const NiAVObjectRef & root, NiAVObjectRef par ) { void MergeSceneGraph( map<string,NiAVObjectRef> & name_map, const NiAVObjectRef & root, NiAVObjectRef par ) {
//Check if this block's name exists in the block map //Check if this block's name exists in the block map
string name = par->name; string name = par->GetName();
if ( name_map.find(name) != name_map.end() ) { if ( name_map.find(name) != name_map.end() ) {
//This block already exists in the original file, so continue on to its children //This block already exists in the original file, so continue on to its children
...@@ -809,7 +809,7 @@ void MergeSceneGraph( map<string,NiAVObjectRef> & name_map, const NiAVObjectRef ...@@ -809,7 +809,7 @@ void MergeSceneGraph( map<string,NiAVObjectRef> & name_map, const NiAVObjectRef
//par_par->GetAttr("Children")->RemoveLinks( par ); //par_par->GetAttr("Children")->RemoveLinks( par );
//Get the block to attatch to //Get the block to attatch to
NiObjectRef attatch = DynamicCast<NiObject>(name_map[par_par->name]); NiObjectRef attatch = DynamicCast<NiObject>(name_map[par_par->GetName()]);
//TODO: Implement children //TODO: Implement children
////Add this block as new child ////Add this block as new child
......
...@@ -27,3 +27,12 @@ string NiObjectNET::asString( bool verbose ) const { ...@@ -27,3 +27,12 @@ string NiObjectNET::asString( bool verbose ) const {
void NiObjectNET::FixLinks( const vector<NiObjectRef> & objects, list<uint> link_stack, unsigned int version ) { void NiObjectNET::FixLinks( const vector<NiObjectRef> & objects, list<uint> link_stack, unsigned int version ) {
NI_OBJECT_N_E_T_FIXLINKS NI_OBJECT_N_E_T_FIXLINKS
} }
string NiObjectNET::GetName() {
return name;
}
void NiObjectNET::SetName( string & new_name ) {
name = new_name;
}
...@@ -24,6 +24,9 @@ public: ...@@ -24,6 +24,9 @@ public:
virtual void Write( ostream& out, map<NiObjectRef,uint> link_map, unsigned int version ) const; virtual void Write( ostream& out, map<NiObjectRef,uint> link_map, unsigned int version ) const;
virtual string asString( bool verbose = false ) const; virtual string asString( bool verbose = false ) const;
virtual void FixLinks( const vector<NiObjectRef> & objects, list<uint> link_stack, unsigned int version ); virtual void FixLinks( const vector<NiObjectRef> & objects, list<uint> link_stack, unsigned int version );
string GetName();
void SetName( string & new_name );
//TODO: pointer to extra data type... find out what that is. AExtraData right now. Need functions to add/remove. //TODO: pointer to extra data type... find out what that is. AExtraData right now. Need functions to add/remove.
//TODO: pointer to first NiTimeController type. Need functions to add/remove. //TODO: pointer to first NiTimeController type. Need functions to add/remove.
private: private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment