From 7c3de7d43cd659e7922e44dc9d44f1a9ef7b067e Mon Sep 17 00:00:00 2001 From: Amorilia <amorilia@users.sourceforge.net> Date: Mon, 7 Apr 2008 20:29:56 +0000 Subject: [PATCH] niflib: vector bool solution + syncing --- include/obj/NiBillboardNode.h | 13 +++++++++++++ src/obj/NiLinesData.cpp | 11 +++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/include/obj/NiBillboardNode.h b/include/obj/NiBillboardNode.h index 43677946..93107abc 100644 --- a/include/obj/NiBillboardNode.h +++ b/include/obj/NiBillboardNode.h @@ -22,6 +22,19 @@ typedef Ref<NiBillboardNode> NiBillboardNodeRef; /*! * These nodes will always be rotated to face the camera creating a billboard * effect for any attached objects. + * + * In pre-10.1.0.0 the Flags field is used for BillboardMode. + * Here is what alphax says about these Flags after checking SceneImmerse: + * + * 0x0000 - 0x0010 is ALWAYS_FACE_CAMERA (somewhat misleadingly named, but + * that is what the format calls it), + * 0x0020 is ROTATE_ABOUT_UP, + * 0x0040 is RIGID_FACE_CAMERA (always face the viewport), and + * 0x0060 is ALWAYS_FACE_CENTER. + * That is where "left shift the corresponding value from v10 NIFs 5 bits" + * falls down - I do not know if v4 NIFs support the others, or if they actually + * mean anything, but these seem the most useful. The rotation of the node does + * seem to affect the axis of constraint. */ class NiBillboardNode : public NiNode { public: diff --git a/src/obj/NiLinesData.cpp b/src/obj/NiLinesData.cpp index 740f879f..bf94f2a0 100644 --- a/src/obj/NiLinesData.cpp +++ b/src/obj/NiLinesData.cpp @@ -48,7 +48,11 @@ void NiLinesData::Read( istream& in, list<unsigned int> & link_stack, const NifI NiGeometryData::Read( in, link_stack, info ); lines.resize(numVertices); for (unsigned int i1 = 0; i1 < lines.size(); i1++) { - NifStream( lines[i1], in, info ); + { + bool tmp; + NifStream( tmp, in, info ); + lines[i1] = tmp; + }; }; //--BEGIN POST-READ CUSTOM CODE--// @@ -63,7 +67,10 @@ void NiLinesData::Write( ostream& out, const map<NiObjectRef,unsigned int> & lin NiGeometryData::Write( out, link_map, info ); for (unsigned int i1 = 0; i1 < lines.size(); i1++) { - NifStream( lines[i1], out, info ); + { + bool tmp = lines[i1]; + NifStream( tmp, out, info ); + }; }; //--BEGIN POST-WRITE CUSTOM CODE--// -- GitLab