From 5ced9f1f1f8aa9baa0e1fc1701ea0c198bf8eb87 Mon Sep 17 00:00:00 2001
From: Shon Ferguson <shonferg@users.sourceforge.net>
Date: Thu, 25 May 2006 23:14:15 +0000
Subject: [PATCH] Added AParticleModifier as a test of the defines and the
 template generation script.

---
 niflib.vcproj     |  9 +++++++++
 obj/NiObject.h    |  1 +
 obj/NiObjectNET.h |  1 -
 xml_extract.h     | 12 ++++++------
 4 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/niflib.vcproj b/niflib.vcproj
index 0443027e..3d4b70dd 100644
--- a/niflib.vcproj
+++ b/niflib.vcproj
@@ -134,6 +134,9 @@
 			Name="Source Files"
 			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\obj\AParticleModifier.cpp">
+			</File>
 			<File
 				RelativePath=".\NIF_IO.cpp">
 			</File>
@@ -170,6 +173,9 @@
 			Name="Header Files"
 			Filter="h;hpp;hxx;hm;inl;inc;xsd"
 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+			<File
+				RelativePath=".\obj\AParticleModifier.h">
+			</File>
 			<File
 				RelativePath=".\NIF_IO.h">
 			</File>
@@ -179,6 +185,9 @@
 			<File
 				RelativePath=".\niflib.h">
 			</File>
+			<File
+				RelativePath=".\xml_extract.h">
+			</File>
 			<Filter
 				Name="obj"
 				Filter="">
diff --git a/obj/NiObject.h b/obj/NiObject.h
index f3da692e..678b47ea 100644
--- a/obj/NiObject.h
+++ b/obj/NiObject.h
@@ -44,6 +44,7 @@ POSSIBILITY OF SUCH DAMAGE. */
 #include <vector>
 #include "NIF_IO.h"
 #include "Ref.h"
+#include "xml_extract.h"
 
 using namespace std;
 
diff --git a/obj/NiObjectNET.h b/obj/NiObjectNET.h
index 75f95a2b..43bf9f91 100644
--- a/obj/NiObjectNET.h
+++ b/obj/NiObjectNET.h
@@ -4,7 +4,6 @@ All rights reserved.  Please see niflib.h for licence. */
 #ifndef _NIOBJECTNET_H_
 #define _NIOBJECTNET_H_
 
-#include "xml_extract.h"
 #include "NiObject.h"
 
 /*
diff --git a/xml_extract.h b/xml_extract.h
index 3ff0db78..8f73b46d 100644
--- a/xml_extract.h
+++ b/xml_extract.h
@@ -46,7 +46,7 @@
 #define _XML_EXTRACT_H_
 
 #include "NIF_IO.h"
-#include "obj\NiObject.h"
+#include "obj\Ref.h"
 #include <iostream>
 #include <fstream>
 #include <vector>
@@ -1275,7 +1275,7 @@ NiObject::FixLinks( objects, link_stack, version ); \
 Ref<AParticleModifier > nextModifier; \
 AParticleModifier * previousModifier; \
 
-#define A_PARTICLE_MODIFIER_PARENTS NiObject \
+#define A_PARTICLE_MODIFIER_PARENTS NiObject
 
 #define A_PARTICLE_MODIFIER_CONSTRUCT \
 
@@ -1289,8 +1289,8 @@ link_stack.push_back( block_num ); \
 
 #define A_PARTICLE_MODIFIER_WRITE \
 NiObject::Write( out, link_map, version ); \
-NifStream( link_map[nextModifier], out, version ); \
-NifStream( link_map[previousModifier], out, version ); \
+NifStream( link_map[StaticCast<NiObject>(nextModifier)], out, version ); \
+NifStream( link_map[StaticCast<NiObject>(previousModifier)], out, version ); \
 
 #define A_PARTICLE_MODIFIER_STRING \
 stringstream out; \
@@ -1301,9 +1301,9 @@ return out.str(); \
 
 #define A_PARTICLE_MODIFIER_FIXLINKS \
 NiObject::FixLinks( objects, link_stack, version ); \
-nextModifier = blocks[link_stack.front()]; \
+nextModifier = DynamicCast<AParticleModifier>(objects[link_stack.front()]); \
 link_stack.pop_front(); \
-previousModifier = blocks[link_stack.front()]; \
+previousModifier = DynamicCast<AParticleModifier>(objects[link_stack.front()]); \
 link_stack.pop_front(); \
 
 #define A_P_SYS_MODIFIER_MEMBERS \
-- 
GitLab