From ee3af051053f16d640d3a9054b109483212180fa Mon Sep 17 00:00:00 2001
From: Tazpn <tazpn@users.sourceforge.net>
Date: Sun, 20 Aug 2006 16:40:39 +0000
Subject: [PATCH] 1. Fix issues with writing out KF files related to footer 2.
 Add support for changing the priority on NiSequenceControllers 3. Update code
 due to CreateBlock changes and removal of CreateNiObject.

---
 NifCommon/niutils.h | 11 +++++++++++
 NifExport/pch.h     |  1 +
 2 files changed, 12 insertions(+)

diff --git a/NifCommon/niutils.h b/NifCommon/niutils.h
index 11aaec2..c4bc272 100644
--- a/NifCommon/niutils.h
+++ b/NifCommon/niutils.h
@@ -31,6 +31,7 @@ INFO: See Implementation for minimalist comments
 #include <color.h>
 
 // Niflib Headers
+#include <niflib.h>
 #include <obj\NiObject.h>
 #include <obj\NiAVObject.h>
 #include <obj\NiObjectNET.h>
@@ -343,4 +344,14 @@ extern TriObject* GetTriObject(Object *o);
 
 extern TSTR GetFileVersion(const char *fileName);
 
+inline Niflib::NiObjectRef CreateBlock(const char *name) {
+   return Niflib::CreateObject(name);
+}
+
+template<typename T>
+inline Niflib::Ref<T> CreateNiObject() {
+   return Niflib::StaticCast<T>(Niflib::CreateObject(T::TypeConst().GetTypeName()));
+}
+
+
 #endif // _NIUTILS_H_
\ No newline at end of file
diff --git a/NifExport/pch.h b/NifExport/pch.h
index 34cf26c..3427c16 100755
--- a/NifExport/pch.h
+++ b/NifExport/pch.h
@@ -45,4 +45,5 @@
 #include "Exporter.h"
 #include "NifExport.h"
 
+#include "niutils.h"
 #include <shlwapi.h>
-- 
GitLab