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

Incorporated defines into the h and cpp files I'd already made for NiNode,...

Incorporated defines into the h and cpp files I'd already made for NiNode, NiObjectNET, and NiAVObject.
parent 44e36c4c
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,28 @@ ...@@ -2,6 +2,28 @@
All rights reserved. Please see niflib.h for licence. */ All rights reserved. Please see niflib.h for licence. */
#include "NiAVObject.h" #include "NiAVObject.h"
#include "NiProperty.h"
#include "NiCollisionData.h"
//Definition of TYPE constant //Definition of TYPE constant
const Type NiAVObject::TYPE("NiAVObject", &NiObjectNET::TYPE ); const Type NiAVObject::TYPE("NiAVObject", &NI_A_V_OBJECT_PARENT::TYPE );
\ No newline at end of file
NiAVObject::NiAVObject() NI_A_V_OBJECT_CONSTRUCT {}
NiAVObject::~NiAVObject() {}
void NiAVObject::Read( istream& in, list<uint> link_stack, unsigned int version ) {
NI_A_V_OBJECT_READ
}
void NiAVObject::Write( ostream& out, map<NiObjectRef,uint> link_map, unsigned int version ) const {
NI_A_V_OBJECT_WRITE
}
string NiAVObject::asString( bool verbose ) const {
NI_A_V_OBJECT_STRING
}
void NiAVObject::FixLinks( const vector<NiObjectRef> & objects, list<uint> link_stack, unsigned int version ) {
NI_A_V_OBJECT_FIXLINKS
}
\ No newline at end of file
...@@ -5,28 +5,26 @@ All rights reserved. Please see niflib.h for licence. */ ...@@ -5,28 +5,26 @@ All rights reserved. Please see niflib.h for licence. */
#define _NIAVOBJECT_H_ #define _NIAVOBJECT_H_
#include "xml_extract.h" #include "xml_extract.h"
#include "NiObjectNET.h" #include NI_A_V_OBJECT_INCLUDE
/* /*
* NiAVObject - An audio/video object? Part of the scene graph and has a position in 3D. * NiAVObject - An audio/video object? Part of the scene graph and has a position in 3D.
*/ */
class NiAVObject; class NiAVObject;
typedef Ref<NiAVObject> NiAVObjectRef; typedef Ref<NiAVObject> NiAVObjectRef;
class NiAVObject : public NiObjectNET { class NiAVObject : public NI_A_V_OBJECT_PARENT {
public: public:
NiAVObject() {} NiAVObject();
~NiAVObject() {} ~NiAVObject();
//Run-Time Type Information //Run-Time Type Information
static const Type TYPE; static const Type TYPE;
virtual void Read( istream& in, list<uint> link_stack, unsigned int version );
virtual void Write( ostream& out, map<NiObjectRef,uint> link_map, unsigned int version ) const;
virtual string asString( bool verbose = false ) const;
virtual void FixLinks( const vector<NiObjectRef> & objects, list<uint> link_stack, unsigned int version );
short flags;
Vector3 localTranslate;
Matrix33 localRotate;
float localScale;
Vector3 localVelocity;
//TODO: list of NiProperty pointers. Need functions to add/remove. //TODO: list of NiProperty pointers. Need functions to add/remove.
//TODO: Bounding Box. What to do with newer files that have a link? Wrap this in a function and translate? //TODO: Bounding Box. What to do with newer files that have a link? Wrap this in a function and translate?
...@@ -69,11 +67,12 @@ public: ...@@ -69,11 +67,12 @@ public:
} }
NiAVObjectRef GetParent() { return parent; } NiAVObjectRef GetParent() { return parent; }
protected: private:
NI_A_V_OBJECT_MEMBERS
NiAVObject * parent; NiAVObject * parent;
void ResetSkinnedFlag(); void ResetSkinnedFlag();
Matrix44 bindPosition; Matrix44 bindPosition;
}; };
#endif #endif
\ No newline at end of file
...@@ -2,6 +2,27 @@ ...@@ -2,6 +2,27 @@
All rights reserved. Please see niflib.h for licence. */ All rights reserved. Please see niflib.h for licence. */
#include "NiNode.h" #include "NiNode.h"
#include "NiDynamicEffect.h"
//Definition of TYPE constant //Definition of TYPE constant
const Type NiNode::TYPE("NiNode", &NiAVObject::TYPE ); const Type NiNode::TYPE("NiNode", &NI_NODE_PARENT::TYPE );
\ No newline at end of file
NiNode::NiNode() NI_NODE_CONSTRUCT {}
NiNode::~NiNode() {}
void NiNode::Read( istream& in, list<uint> link_stack, unsigned int version ) {
NI_NODE_READ
}
void NiNode::Write( ostream& out, map<NiObjectRef,uint> link_map, unsigned int version ) const {
NI_NODE_WRITE
}
string NiNode::asString( bool verbose ) const {
NI_NODE_STRING
}
void NiNode::FixLinks( const vector<NiObjectRef> & objects, list<uint> link_stack, unsigned int version ) {
NI_NODE_FIXLINKS
}
...@@ -4,24 +4,30 @@ All rights reserved. Please see niflib.h for licence. */ ...@@ -4,24 +4,30 @@ All rights reserved. Please see niflib.h for licence. */
#ifndef _NINODE_H_ #ifndef _NINODE_H_
#define _NINODE_H_ #define _NINODE_H_
#include "NiAVObject.h" #include "xml_extract.h"
#include NI_NODE_INCLUDE
/* /*
* NiNode - A basic scene graph node. Can have children. * NiNode - A basic scene graph node. Can have children.
*/ */
class NiNode; class NiNode;
typedef Ref<NiNode> NiNodeRef; typedef Ref<NiNode> NiNodeRef;
class NiNode : public NiAVObject { class NiNode : public NI_NODE_PARENT {
public: public:
NiNode() {} NiNode();
~NiNode() {} ~NiNode();
//Run-Time Type Information //Run-Time Type Information
static const Type TYPE; static const Type TYPE;
virtual void Read( istream& in, list<uint> link_stack, unsigned int version );
virtual void Write( ostream& out, map<NiObjectRef,uint> link_map, unsigned int version ) const;
virtual string asString( bool verbose = false ) const;
virtual void FixLinks( const vector<NiObjectRef> & objects, list<uint> link_stack, unsigned int version );
//TODO: Add functions to get and set children and store a list of NiObjectNET references //TODO: Add functions to get and set children and store a list of NiObjectNET references
private:
NI_NODE_MEMBERS
}; };
#endif #endif
\ No newline at end of file
...@@ -2,6 +2,28 @@ ...@@ -2,6 +2,28 @@
All rights reserved. Please see niflib.h for licence. */ All rights reserved. Please see niflib.h for licence. */
#include "NiObjectNET.h" #include "NiObjectNET.h"
#include "NiExtraData.h"
#include "NiTimeController.h"
//Definition of TYPE constant //Definition of TYPE constant
const Type NiObjectNET::TYPE("NiObjectNET", &NiObject::TYPE ); const Type NiObjectNET::TYPE("NiObjectNET", &NI_OBJECT_N_E_T_PARENT::TYPE );
\ No newline at end of file
NiObjectNET::NiObjectNET() NI_OBJECT_N_E_T_CONSTRUCT {}
NiObjectNET::~NiObjectNET() {}
void NiObjectNET::Read( istream& in, list<uint> link_stack, unsigned int version ) {
NI_OBJECT_N_E_T_READ
}
void NiObjectNET::Write( ostream& out, map<NiObjectRef,uint> link_map, unsigned int version ) const {
NI_OBJECT_N_E_T_WRITE
}
string NiObjectNET::asString( bool verbose ) const {
NI_OBJECT_N_E_T_STRING
}
void NiObjectNET::FixLinks( const vector<NiObjectRef> & objects, list<uint> link_stack, unsigned int version ) {
NI_OBJECT_N_E_T_FIXLINKS
}
...@@ -4,32 +4,29 @@ All rights reserved. Please see niflib.h for licence. */ ...@@ -4,32 +4,29 @@ All rights reserved. Please see niflib.h for licence. */
#ifndef _NIOBJECTNET_H_ #ifndef _NIOBJECTNET_H_
#define _NIOBJECTNET_H_ #define _NIOBJECTNET_H_
#include "NiObject.h" #include "xml_extract.h"
#include NI_OBJECT_N_E_T_INCLUDE
/* /*
* NiObjectNET - An object that has a name. Can have extra data and controllers attatched. * NiObjectNET - An object that has a name. Can have extra data and controllers attatched.
*/ */
class NiObjectNET; class NiObjectNET;
typedef Ref<NiObjectNET> NiObjectNETRef; typedef Ref<NiObjectNET> NiObjectNETRef;
class NiObjectNET : public NiObject /*NI_OBJECT_N_E_T_PARENTS*/ { class NiObjectNET : public NI_OBJECT_N_E_T_PARENT {
public: public:
NiObjectNET() /*NI_OBJECT_N_E_T_CONSTRUCT*/ {} NiObjectNET();
~NiObjectNET() {} ~NiObjectNET();
//Run-Time Type Information //Run-Time Type Information
static const Type TYPE; static const Type TYPE;
string name; virtual void Read( istream& in, list<uint> link_stack, unsigned int version );
virtual void Read( istream& in, list<uint> link_stack, unsigned int version ) { /*NI_OBJECT_N_E_T_READ*/ } 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 { /*NI_OBJECT_N_E_T_WRITE*/ } virtual string asString( bool verbose = false ) const;
virtual string asString( bool verbose = false ) const { /*NI_OBJECT_N_E_T_STRING*/ } 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 ) { /*NI_OBJECT_N_E_T_FIXLINKS*/ }
private:
/*NI_OBJECT_N_E_T_MEMBERS*/
//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:
NI_OBJECT_N_E_T_MEMBERS
}; };
#endif
#endif
\ No newline at end of file
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