diff --git a/CMakeLists.txt b/CMakeLists.txt index b5e80ea319778243691dad818c7e4aeb4467796d..1c5ddd4ea5a71a454afa5aa4cae2f2bd9c35e8a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,23 +7,27 @@ include_directories("include") add_library(niflib SHARED src/RefObject.cpp src/kfm.cpp +NvTriStrip/NvTriStrip.cpp +NvTriStrip/NvTriStripObjects.cpp +NvTriStrip/VertexCache.cpp src/ComplexShape.cpp -src/MatTexCollection.cpp -src/ObjectRegistry.cpp -src/nif_math.cpp src/gen/AdditionalDataBlock.cpp src/gen/AdditionalDataInfo.cpp src/gen/ArkTexture.cpp src/gen/AVObject.cpp -src/gen/bhkCMSDContainer.cpp +src/gen/bhkCMSDBigTris.cpp +src/gen/bhkCMSDChunk.cpp src/gen/bhkCMSDData.cpp -src/gen/bhkCMSD_Shape.cpp -src/gen/bhkCMSD_Something.cpp +src/gen/bhkCMSDMaterial.cpp +src/gen/bhkCMSDBigTris.cpp +src/gen/bhkCMSDTransform.cpp src/gen/BodyPartList.cpp +src/gen/BoneLOD.cpp src/gen/BoundingBox.cpp src/gen/BoundingVolume.cpp src/gen/BoxBV.cpp src/gen/BSPackedAdditionalDataBlock.cpp +src/gen/BSSegment.cpp src/gen/BSSegmentedTriangle.cpp src/gen/BSTreadTransfInfo.cpp src/gen/BSTreadTransform.cpp @@ -57,6 +61,7 @@ src/gen/MipMap.cpp src/gen/Morph.cpp src/gen/MorphWeight.cpp src/gen/MotorDescriptor.cpp +src/gen/MTransform.cpp src/gen/MultiTextureElement.cpp src/gen/NodeGroup.cpp src/gen/OblivionColFilter.cpp @@ -66,6 +71,7 @@ src/gen/Particle.cpp src/gen/ParticleDesc.cpp src/gen/physXMaterialRef.cpp src/gen/Polygon.cpp +src/gen/QTransform.cpp src/gen/QuaternionXYZW.cpp src/gen/RagdollDescriptor.cpp src/gen/Region.cpp @@ -74,6 +80,7 @@ src/gen/SemanticData.cpp src/gen/ShaderTexDesc.cpp src/gen/SkinData.cpp src/gen/SkinPartition.cpp +src/gen/SkinPartitionUnknownItem1.cpp src/gen/SkinShape.cpp src/gen/SkinShapeGroup.cpp src/gen/SkinTransform.cpp @@ -85,12 +92,13 @@ src/gen/TexDesc.cpp src/gen/TexSource.cpp src/gen/UnionBV.cpp src/gen/UnknownMatrix1.cpp -src/pch.cpp -src/nifqhull.cpp src/Inertia.cpp -src/Type.cpp -src/niflib.cpp +src/kfm.cpp +src/MatTexCollection.cpp src/NIF_IO.cpp +src/niflib.cpp +src/nif_math.cpp +src/nifqhull.cpp src/obj/AbstractAdditionalGeometryData.cpp src/obj/ATextureRenderData.cpp src/obj/AvoidNode.cpp @@ -211,6 +219,7 @@ src/obj/BSWindModifier.cpp src/obj/BSXFlags.cpp src/obj/CStreamableAssetData.cpp src/obj/DistantLODShaderProperty.cpp +src/ObjectRegistry.cpp src/obj/FxButton.cpp src/obj/FxRadioButton.cpp src/obj/FxWidget.cpp @@ -531,12 +540,12 @@ src/obj/TallGrassShaderProperty.cpp src/obj/TileShaderProperty.cpp src/obj/VolumetricFogShaderProperty.cpp src/obj/WaterShaderProperty.cpp -NvTriStrip/VertexCache.cpp -NvTriStrip/NvTriStripObjects.cpp -NvTriStrip/NvTriStrip.cpp -TriStripper/tri_stripper.cpp +src/pch.cpp +src/RefObject.cpp +src/Type.cpp TriStripper/connectivity_graph.cpp TriStripper/policy.cpp +TriStripper/tri_stripper.cpp ) set_target_properties(niflib diff --git a/docsys b/docsys index 085f573af2a34ebf29716f273cfafbe492c22660..35298236a9fb81c6355127198e36dd6cb2e5391e 160000 --- a/docsys +++ b/docsys @@ -1 +1 @@ -Subproject commit 085f573af2a34ebf29716f273cfafbe492c22660 +Subproject commit 35298236a9fb81c6355127198e36dd6cb2e5391e diff --git a/include/gen/BSSegment.h b/include/gen/BSSegment.h new file mode 100644 index 0000000000000000000000000000000000000000..78dfb0314904f1ce2e2165853a57c666df94231d --- /dev/null +++ b/include/gen/BSSegment.h @@ -0,0 +1,38 @@ +/* Copyright (c) 2006, NIF File Format Library and Tools +All rights reserved. Please see niflib.h for license. */ + +//---THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT---// + +//To change this file, alter the niftools/docsys/gen_niflib.py Python script. + +#ifndef _BSSEGMENT_H_ +#define _BSSEGMENT_H_ + +#include "../NIF_IO.h" + +namespace Niflib { + + +/*! Bethesda-specific node. */ +struct BSSegment { + /*! Default Constructor */ + NIFLIB_API BSSegment(); + /*! Default Destructor */ + NIFLIB_API ~BSSegment(); + /*! Copy Constructor */ + NIFLIB_API BSSegment( const BSSegment & src ); + /*! Copy Operator */ + NIFLIB_API BSSegment & operator=( const BSSegment & src ); + /*! Index multiplied by 1536 (0x0600) */ + int internalIndex; + /*! Geometry present in the segment */ + BSSegmentFlags flags; + /*! Unknown */ + byte unknownByte1; + //--BEGIN MISC CUSTOM CODE--// + + //--END CUSTOM CODE--// +}; + +} +#endif diff --git a/include/gen/BoneLOD.h b/include/gen/BoneLOD.h new file mode 100644 index 0000000000000000000000000000000000000000..74da09390363088fd732ac55828f7f88e4d06a7c --- /dev/null +++ b/include/gen/BoneLOD.h @@ -0,0 +1,36 @@ +/* Copyright (c) 2006, NIF File Format Library and Tools +All rights reserved. Please see niflib.h for license. */ + +//---THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT---// + +//To change this file, alter the niftools/docsys/gen_niflib.py Python script. + +#ifndef _BONELOD_H_ +#define _BONELOD_H_ + +#include "../NIF_IO.h" + +namespace Niflib { + + +/*! Stores Bone Level of Detail info in a BSBoneLODExtraData */ +struct BoneLOD { + /*! Default Constructor */ + NIFLIB_API BoneLOD(); + /*! Default Destructor */ + NIFLIB_API ~BoneLOD(); + /*! Copy Constructor */ + NIFLIB_API BoneLOD( const BoneLOD & src ); + /*! Copy Operator */ + NIFLIB_API BoneLOD & operator=( const BoneLOD & src ); + /*! Distance to cull? */ + unsigned int distance; + /*! The bones name */ + IndexString boneName; + //--BEGIN MISC CUSTOM CODE--// + + //--END CUSTOM CODE--// +}; + +} +#endif diff --git a/include/gen/FurniturePosition.h b/include/gen/FurniturePosition.h index 20e4a27bd4eef07a819d7e556074716430457db1..eecbc04c65993412bf6eeffea4906fba2d9930a5 100644 --- a/include/gen/FurniturePosition.h +++ b/include/gen/FurniturePosition.h @@ -37,10 +37,12 @@ struct FurniturePosition { * Ref 1. */ byte positionRef2; + /*! Similar to Orientation, in float form. */ + float heading; /*! Unknown */ - unsigned short unknownShort1; - /*! Unknown */ - unsigned short unknownShort2; + AnimationType animationType; + /*! Unknown/unused in nif? */ + FurnitureEntryPoints entryProperties; //--BEGIN MISC CUSTOM CODE--// //--END CUSTOM CODE--// }; diff --git a/include/gen/bhkCMSD_Shape.h b/include/gen/MTransform.h similarity index 57% rename from include/gen/bhkCMSD_Shape.h rename to include/gen/MTransform.h index 5f60a1aaefa75b0dd3019f403c3c98737cc8838a..785d4e24564ecae8439b9ed58c020c0db80db461 100644 --- a/include/gen/bhkCMSD_Shape.h +++ b/include/gen/MTransform.h @@ -5,8 +5,8 @@ All rights reserved. Please see niflib.h for license. */ //To change this file, alter the niftools/docsys/gen_niflib.py Python script. -#ifndef _BHKCMSD_SHAPE_H_ -#define _BHKCMSD_SHAPE_H_ +#ifndef _MTRANSFORM_H_ +#define _MTRANSFORM_H_ #include "../NIF_IO.h" @@ -14,19 +14,21 @@ namespace Niflib { /*! */ -struct bhkCMSD_Shape { +struct MTransform { /*! Default Constructor */ - NIFLIB_API bhkCMSD_Shape(); + NIFLIB_API MTransform(); /*! Default Destructor */ - NIFLIB_API ~bhkCMSD_Shape(); + NIFLIB_API ~MTransform(); /*! Copy Constructor */ - NIFLIB_API bhkCMSD_Shape( const bhkCMSD_Shape & src ); + NIFLIB_API MTransform( const MTransform & src ); /*! Copy Operator */ - NIFLIB_API bhkCMSD_Shape & operator=( const bhkCMSD_Shape & src ); - /*! Unknown */ - mutable unsigned int numShape; - /*! Unknown */ - vector<unsigned short > shape; + NIFLIB_API MTransform & operator=( const MTransform & src ); + /*! Translation. */ + Vector3 translation; + /*! Rotation. */ + Matrix33 rotation; + /*! Scale. */ + float scale; //--BEGIN MISC CUSTOM CODE--// //--END CUSTOM CODE--// diff --git a/include/gen/QTransform.h b/include/gen/QTransform.h new file mode 100644 index 0000000000000000000000000000000000000000..3c667351f1f778649998b3bbe9f9d1233d7d3849 --- /dev/null +++ b/include/gen/QTransform.h @@ -0,0 +1,38 @@ +/* Copyright (c) 2006, NIF File Format Library and Tools +All rights reserved. Please see niflib.h for license. */ + +//---THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT---// + +//To change this file, alter the niftools/docsys/gen_niflib.py Python script. + +#ifndef _QTRANSFORM_H_ +#define _QTRANSFORM_H_ + +#include "../NIF_IO.h" + +namespace Niflib { + + +/*! */ +struct QTransform { + /*! Default Constructor */ + NIFLIB_API QTransform(); + /*! Default Destructor */ + NIFLIB_API ~QTransform(); + /*! Copy Constructor */ + NIFLIB_API QTransform( const QTransform & src ); + /*! Copy Operator */ + NIFLIB_API QTransform & operator=( const QTransform & src ); + /*! Translation. */ + Vector3 translation; + /*! Rotation. */ + Quaternion rotation; + /*! Scale. */ + float scale; + //--BEGIN MISC CUSTOM CODE--// + + //--END CUSTOM CODE--// +}; + +} +#endif diff --git a/include/gen/SkinPartition.h b/include/gen/SkinPartition.h index 71969762981106bc6641e9f50a3d309ef3ae7d76..aa75225da2cb22f5eba9008ac07a1e4c5da64192 100644 --- a/include/gen/SkinPartition.h +++ b/include/gen/SkinPartition.h @@ -10,6 +10,8 @@ All rights reserved. Please see niflib.h for license. */ #include "../NIF_IO.h" +// Include structures +#include "SkinPartitionUnknownItem1.h" namespace Niflib { @@ -67,6 +69,20 @@ struct SkinPartition { vector< vector<byte > > boneIndices; /*! Unknown */ unsigned short unknownShort; + /*! Unknown. */ + unsigned short unknown83C3; + /*! Unknown. */ + unsigned short unknown00001; + /*! Unknown. */ + mutable unsigned short numVertices2; + /*! Unknown. */ + unsigned short unknown00002; + /*! Unknown. */ + unsigned short unknown00003; + /*! Unknown. */ + unsigned short unknown00004; + /*! Unknown. */ + vector<SkinPartitionUnknownItem1 > unknownArr1; //--BEGIN MISC CUSTOM CODE--// /*! Calculate proper value of numTriangles field. */ unsigned short numTrianglesCalc() const; diff --git a/include/gen/SkinPartitionUnknownItem1.h b/include/gen/SkinPartitionUnknownItem1.h new file mode 100644 index 0000000000000000000000000000000000000000..60a6345c585b387db0167718e086edf149c29763 --- /dev/null +++ b/include/gen/SkinPartitionUnknownItem1.h @@ -0,0 +1,44 @@ +/* Copyright (c) 2006, NIF File Format Library and Tools +All rights reserved. Please see niflib.h for license. */ + +//---THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT---// + +//To change this file, alter the niftools/docsys/gen_niflib.py Python script. + +#ifndef _SKINPARTITIONUNKNOWNITEM1_H_ +#define _SKINPARTITIONUNKNOWNITEM1_H_ + +#include "../NIF_IO.h" + +namespace Niflib { + + +/*! */ +struct SkinPartitionUnknownItem1 { + /*! Default Constructor */ + NIFLIB_API SkinPartitionUnknownItem1(); + /*! Default Destructor */ + NIFLIB_API ~SkinPartitionUnknownItem1(); + /*! Copy Constructor */ + NIFLIB_API SkinPartitionUnknownItem1( const SkinPartitionUnknownItem1 & src ); + /*! Copy Operator */ + NIFLIB_API SkinPartitionUnknownItem1 & operator=( const SkinPartitionUnknownItem1 & src ); + /*! Unknown. */ + unsigned int unknownFlags; + /*! Unknown. */ + float f1; + /*! Unknown. */ + float f2; + /*! Unknown. */ + float f3; + /*! Unknown. */ + float f4; + /*! Unknown. */ + float f5; + //--BEGIN MISC CUSTOM CODE--// + + //--END CUSTOM CODE--// +}; + +} +#endif diff --git a/include/gen/bhkCMSDBigTris.h b/include/gen/bhkCMSDBigTris.h index b931652c09d76caba89af5025a06880fbb94ea9b..244c5191ca70e8b32ee65e8fbbd3722f66b67a49 100644 --- a/include/gen/bhkCMSDBigTris.h +++ b/include/gen/bhkCMSDBigTris.h @@ -13,7 +13,7 @@ All rights reserved. Please see niflib.h for license. */ namespace Niflib { -/*! */ +/*! Triangle indices used in pair with "Big Verts" in a bhkCompressedMeshShapeData. */ struct bhkCMSDBigTris { /*! Default Constructor */ NIFLIB_API bhkCMSDBigTris(); @@ -23,17 +23,17 @@ struct bhkCMSDBigTris { NIFLIB_API bhkCMSDBigTris( const bhkCMSDBigTris & src ); /*! Copy Operator */ NIFLIB_API bhkCMSDBigTris & operator=( const bhkCMSDBigTris & src ); - /*! Index of triangle vertiex 1 */ - mutable unsigned short triangle1; - /*! Index of triangle vertiex 2 */ - mutable unsigned short triangle2; - /*! Index of triangle vertiex 3 */ - mutable unsigned short triangle3; - /*! Unknown */ - mutable unsigned int unknownInt1; - /*! Unknown */ - mutable unsigned short unknownShort1; - //--BEGIN MISC CUSTOM CODE--// + /*! Unknown. */ + unsigned short triangle1; + /*! Unknown. */ + unsigned short triangle2; + /*! Unknown. */ + unsigned short triangle3; + /*! Always 0? */ + unsigned int unknownInt1; + /*! Unknown. */ + unsigned short unknownShort1; + //--BEGIN MISC CUSTOM CODE--// //--END CUSTOM CODE--// }; diff --git a/include/gen/bhkCMSDChunk.h b/include/gen/bhkCMSDChunk.h index 6cc381514f58f9f719ae9020e66f238bace1a91b..356f47e975fe1231ee7337774a5ff2ae77935710 100644 --- a/include/gen/bhkCMSDChunk.h +++ b/include/gen/bhkCMSDChunk.h @@ -13,7 +13,7 @@ All rights reserved. Please see niflib.h for license. */ namespace Niflib { -/*! */ +/*! Defines subshape chunks in bhkCompressedMeshShapeData */ struct bhkCMSDChunk { /*! Default Constructor */ NIFLIB_API bhkCMSDChunk(); @@ -23,31 +23,31 @@ struct bhkCMSDChunk { NIFLIB_API bhkCMSDChunk( const bhkCMSDChunk & src ); /*! Copy Operator */ NIFLIB_API bhkCMSDChunk & operator=( const bhkCMSDChunk & src ); - /*! Translation */ + /*! Local translation */ Vector4 translation; - /*! Index in parents material list */ - mutable unsigned int materialIndex; - /*! Unknown */ - mutable unsigned short unknownShort1; - /*! Index of parents transformation list */ - mutable unsigned short transformIndex; - /*! Number of vertices */ + /*! Index of material in bhkCompressedMeshShapeData::Chunk Materials */ + unsigned int materialIndex; + /*! Always 65535? */ + unsigned short unknownShort1; + /*! Index of transformation in bhkCompressedMeshShapeData::Chunk Transforms */ + unsigned short transformIndex; + /*! Number of compressed vertices */ mutable unsigned int numVertices; - /*! Vertices */ + /*! Compressed vertices */ vector<unsigned short > vertices; - /*! Number of indices */ + /*! Unknown. */ mutable unsigned int numIndices; - /*! indices */ + /*! Unknown. */ vector<unsigned short > indices; - /*! Number of strips */ + /*! Number of compressed strips */ mutable unsigned int numStrips; - /*! Strips */ + /*! Compressed strips */ vector<unsigned short > strips; - /*! Number of indices2 (welding) */ + /*! Number of */ mutable unsigned int numIndices2; - /*! Indices2 8welding) */ + /*! Compressed */ vector<unsigned short > indices2; - //--BEGIN MISC CUSTOM CODE--// + //--BEGIN MISC CUSTOM CODE--// //--END CUSTOM CODE--// }; diff --git a/include/gen/bhkCMSDContainer.h b/include/gen/bhkCMSDContainer.h deleted file mode 100644 index 82e127cf041b63d82a27001a11fa9b3e2c1f9e63..0000000000000000000000000000000000000000 --- a/include/gen/bhkCMSDContainer.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (c) 2006, NIF File Format Library and Tools -All rights reserved. Please see niflib.h for license. */ - -//---THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT---// - -//To change this file, alter the niftools/docsys/gen_niflib.py Python script. - -#ifndef _BHKCMSDCONTAINER_H_ -#define _BHKCMSDCONTAINER_H_ - -#include "../NIF_IO.h" - -// Include structures -#include "bhkCMSD_Shape.h" -namespace Niflib { - - -/*! */ -struct bhkCMSDContainer { - /*! Default Constructor */ - NIFLIB_API bhkCMSDContainer(); - /*! Default Destructor */ - NIFLIB_API ~bhkCMSDContainer(); - /*! Copy Constructor */ - NIFLIB_API bhkCMSDContainer( const bhkCMSDContainer & src ); - /*! Copy Operator */ - NIFLIB_API bhkCMSDContainer & operator=( const bhkCMSDContainer & src ); - /*! Unknown */ - Vector4 unknownFloats; - /*! Unknown */ - unsigned int unknownInt; - /*! Unknown */ - unsigned short unknownShort1; - /*! Unknown */ - unsigned short unknownShort2; - /*! Unknown */ - array<4,bhkCMSD_Shape > shape; - //--BEGIN MISC CUSTOM CODE--// - - //--END CUSTOM CODE--// -}; - -} -#endif diff --git a/include/gen/bhkCMSD_Something.h b/include/gen/bhkCMSDMaterial.h similarity index 57% rename from include/gen/bhkCMSD_Something.h rename to include/gen/bhkCMSDMaterial.h index 300bddd0c5ac0029af3d9c21d209c9cfcb632197..9337299ea1c921ad77e604f6436ca8218cafc1a9 100644 --- a/include/gen/bhkCMSD_Something.h +++ b/include/gen/bhkCMSDMaterial.h @@ -5,26 +5,26 @@ All rights reserved. Please see niflib.h for license. */ //To change this file, alter the niftools/docsys/gen_niflib.py Python script. -#ifndef _BHKCMSD_SOMETHING_H_ -#define _BHKCMSD_SOMETHING_H_ +#ifndef _BHKCMSDMATERIAL_H_ +#define _BHKCMSDMATERIAL_H_ #include "../NIF_IO.h" namespace Niflib { -/*! Unknown, used in bhkCompressedMeshShapeData */ -struct bhkCMSD_Something { +/*! per-chunk material, used in bhkCompressedMeshShapeData */ +struct bhkCMSDMaterial { /*! Default Constructor */ - NIFLIB_API bhkCMSD_Something(); + NIFLIB_API bhkCMSDMaterial(); /*! Default Destructor */ - NIFLIB_API ~bhkCMSD_Something(); + NIFLIB_API ~bhkCMSDMaterial(); /*! Copy Constructor */ - NIFLIB_API bhkCMSD_Something( const bhkCMSD_Something & src ); + NIFLIB_API bhkCMSDMaterial( const bhkCMSDMaterial & src ); /*! Copy Operator */ - NIFLIB_API bhkCMSD_Something & operator=( const bhkCMSD_Something & src ); - /*! Unknown */ - unsigned int largeInt; + NIFLIB_API bhkCMSDMaterial & operator=( const bhkCMSDMaterial & src ); + /*! The shape's material. */ + HavokMaterial material; /*! Always 1? */ unsigned int unknownInteger; //--BEGIN MISC CUSTOM CODE--// diff --git a/include/gen/bhkCMSDTransform.h b/include/gen/bhkCMSDTransform.h index dbdb8871f7411151603525b41f46f6bd4f0400d3..16e11550ef099d9d193db085f6773bb1ba2cf5bb 100644 --- a/include/gen/bhkCMSDTransform.h +++ b/include/gen/bhkCMSDTransform.h @@ -9,12 +9,13 @@ All rights reserved. Please see niflib.h for license. */ #define _BHKCMSDTRANSFORM_H_ #include "../NIF_IO.h" -#include "QuaternionXYZW.h" +// Include structures +#include "QuaternionXYZW.h" namespace Niflib { -/*! */ +/*! A set of transformation data: translation and rotation */ struct bhkCMSDTransform { /*! Default Constructor */ NIFLIB_API bhkCMSDTransform(); @@ -24,10 +25,10 @@ struct bhkCMSDTransform { NIFLIB_API bhkCMSDTransform( const bhkCMSDTransform & src ); /*! Copy Operator */ NIFLIB_API bhkCMSDTransform & operator=( const bhkCMSDTransform & src ); - /*! Translation */ - Vector4 translation; - /*! Rotation */ - QuaternionXYZW rotation; + /*! A vector that moves the chunk by the specified amount. W is not used. */ + Vector4 translation; + /*! Rotation. Reference point for rotation is bhkRigidBody translation. */ + QuaternionXYZW rotation; //--BEGIN MISC CUSTOM CODE--// //--END CUSTOM CODE--// diff --git a/include/gen/enums.h b/include/gen/enums.h index 20302b298b5847ef5f277935f4f95f55ae588e13..3c46bf0036fd3618b518c9789e45ef9771fa811e 100644 --- a/include/gen/enums.h +++ b/include/gen/enums.h @@ -93,6 +93,30 @@ enum HavokMaterial { HAV_MAT_SNOW_STAIRS = 29, /*!< Snow Stairs */ HAV_MAT_ELEVATOR = 30, /*!< Elevator */ HAV_MAT_RUBBER = 31, /*!< Rubber */ + SKY_HAV_MAT_LIGHT_WOOD = 365420259, /*!< Light Wood */ + SKY_HAV_MAT_BROKEN_STONE = 131151687, /*!< Broken Stone */ + SKY_HAV_MAT_SNOW = 398949039, /*!< Snow */ + SKY_HAV_MAT_GRAVEL = 428587608, /*!< Gravel */ + SKY_HAV_MAT_MATERIAL_CHAIN_METAL = 438912228, /*!< MaterialChainMetal */ + SKY_HAV_MAT_WOOD = 500811281, /*!< Wood */ + SKY_HAV_MAT_BARREL = 732141076, /*!< Barrel */ + SKY_HAV_MAT_MATERIAL_BASKET = 790784366, /*!< Material Basket */ + SKY_HAV_MAT_ICE = 873356572, /*!< Ice */ + SKY_HAV_MAT_STAIRSSTONE = 899511101, /*!< Stairs Stone */ + SKY_HAV_MAT_MATERIAL_BLADE_1HAND = 1060167844, /*!< Material Blade 1 Hand */ + SKY_HAV_MAT_MATERIALBOOK = 1264672850, /*!< Material Book */ + SKY_HAV_MAT_SOLID_METAL = 1288358971, /*!< Solid Metal */ + SKY_HAV_MAT_MATERIAL_AXE_1HAND = 1305674443, /*!< Material Axe 1Hand */ + SKY_HAV_MAT_STAIRS_WOOD = 1461712277, /*!< Stairs Wood */ + SKY_HAV_MAT_MUD = 1486385281, /*!< Mud */ + SKY_HAV_MAT_STAIRSSNOW = 1560365355, /*!< Stairs Snow */ + SKY_HAV_MAT_UNKNOWN = 1591009235, /*!< Unknown material in Creation Kit v1.5.24.0. Found in trap objects. */ + SKY_HAV_MAT_MATERIAL_BOWS_STAVES = 1607128641, /*!< Material Bows Staves */ + SKY_HAV_MAT_GRASS = 1848600814, /*!< Grass */ + SKY_HAV_MAT_MATERIAL_BOULDER_LARGE = 1885326971, /*!< MaterialBoulderLarge */ + SKY_HAV_MAT_MATERIALSTONEASSTAIRS = 1886078335, /*!< Material Stone As Stairs */ + SKY_HAV_MAT_MATERIAL_BLADE_2HAND = 2022742644, /*!< Material Blade 2Hand */ + SKY_HAV_MAT_MATERIAL_BOTTLE_SMALL = 2025794648, /*!< MaterialBottleSmall */ }; ostream & operator<<( ostream & out, HavokMaterial const & val ); @@ -116,6 +140,18 @@ enum VelocityType { ostream & operator<<( ostream & out, VelocityType const & val ); +/*! + * Animation type used on this position. This specifies the function of this + * position. + */ +enum AnimationType { + SIT = 1, /*!< Actor use sit animation. */ + SLEEP = 2, /*!< Actor use sleep animation. */ + LEAN = 4, /*!< Used for lean animations? */ +}; + +ostream & operator<<( ostream & out, AnimationType const & val ); + /*! Determines how a data stream is used? */ enum DataStreamUsage { USAGE_VERTEX_INDEX = 0, /*!< USAGE_VERTEX_INDEX */ @@ -213,6 +249,12 @@ enum SyncPoint { ostream & operator<<( ostream & out, SyncPoint const & val ); +/*! + * Biped bodypart data used for visibility control of triangles. Options are + * Fallout 3, except where marked for Skyrim (uses SBP prefix) + * Skyrim BP names are listed only for vanilla names, different creatures + * have different defnitions for naming. + */ enum BSDismemberBodyPartType { BP_TORSO = 0, /*!< Torso */ BP_HEAD = 1, /*!< Head */ @@ -228,6 +270,27 @@ enum BSDismemberBodyPartType { BP_RIGHTLEG2 = 11, /*!< Right Leg 2 */ BP_RIGHTLEG3 = 12, /*!< Right Leg 3 */ BP_BRAIN = 13, /*!< Brain */ + SBP_30_HEAD = 30, /*!< Skyrim, Head(Human), Body(Atronachs,Beasts), Mask(Dragonpriest) */ + SBP_31_HAIR = 31, /*!< Skyrim, Hair(human), Far(Dragon), Mask2(Dragonpriest),SkinnedFX(Spriggan) */ + SBP_32_BODY = 32, /*!< Skyrim, Main body, extras(Spriggan) */ + SBP_33_HANDS = 33, /*!< Skyrim, Hands L/R, BodyToo(Dragonpriest), Legs(Draugr), Arms(Giant) */ + SBP_34_FOREARMS = 34, /*!< Skyrim, Forearms L/R, Beard(Draugr) */ + SBP_35_AMULET = 35, /*!< Skyrim, Amulet */ + SBP_36_RING = 36, /*!< Skyrim, Ring */ + SBP_37_FEET = 37, /*!< Skyrim, Feet L/R */ + SBP_38_CALVES = 38, /*!< Skyrim, Calves L/R */ + SBP_39_SHIELD = 39, /*!< Skyrim, Shield */ + SBP_40_TAIL = 40, /*!< Skyrim, Tail(Argonian/Khajiit), Skeleton01(Dragon), FX01(AtronachStorm),FXMist (Dragonpriest), Spit(Chaurus,Spider),SmokeFins(IceWraith) */ + SBP_41_LONGHAIR = 41, /*!< Skyrim, Long Hair(Human), Skeleton02(Dragon),FXParticles(Dragonpriest) */ + SBP_42_CIRCLET = 42, /*!< Skyrim, Circlet(Human, MouthFireEffect(Dragon) */ + SBP_43_EARS = 43, /*!< Skyrim, Ears */ + SBP_44_BLOODHEAD = 44, /*!< Skyrim, Bloodied dragon head */ + SBP_45_BLOODWINGL = 45, /*!< Skyrim, Left Bloodied dragon wing, Saddle(Horse) */ + SBP_46_BLOODWINGR = 46, /*!< Skyrim, Right Bloodied dragon wing */ + SBP_47_BLOODTAIL = 47, /*!< Skyrim, Bloodied dragon tail */ + SBP_50_DECAPITATEDHEAD = 50, /*!< Skyrim, Decapitated Head */ + SBP_51_DECAPITATE = 51, /*!< Skyrim, Decapitate, neck gore */ + SBP_61_FX01 = 61, /*!< Skyrim, FX01(Humanoid) */ BP_SECTIONCAP_HEAD = 101, /*!< Section Cap | Head */ BP_SECTIONCAP_HEAD2 = 102, /*!< Section Cap | Head 2 */ BP_SECTIONCAP_LEFTARM = 103, /*!< Section Cap | Left Arm */ @@ -241,6 +304,12 @@ enum BSDismemberBodyPartType { BP_SECTIONCAP_RIGHTLEG2 = 111, /*!< Section Cap | Right Leg 2 */ BP_SECTIONCAP_RIGHTLEG3 = 112, /*!< Section Cap | Right Leg 3 */ BP_SECTIONCAP_BRAIN = 113, /*!< Section Cap | Brain */ + SBP_130_HEAD = 130, /*!< Skyrim, Head slot, use on full-face helmets */ + SBP_131_HAIR = 131, /*!< Skyrim, Hair slot 1, use on hoods */ + SBP_141_LONGHAIR = 141, /*!< Skyrim, Hair slot 2, use for longer hair */ + SBP_142_CIRCLET = 142, /*!< Skyrim, Circlet slot 1, use for circlets */ + SBP_143_EARS = 143, /*!< Skyrim, Ear slot */ + SBP_150_DECAPITATEDHEAD = 150, /*!< Skyrim, neck gore on head side */ BP_TORSOCAP_HEAD = 201, /*!< Torso Cap | Head */ BP_TORSOCAP_HEAD2 = 202, /*!< Torso Cap | Head 2 */ BP_TORSOCAP_LEFTARM = 203, /*!< Torso Cap | Left Arm */ @@ -254,6 +323,7 @@ enum BSDismemberBodyPartType { BP_TORSOCAP_RIGHTLEG2 = 211, /*!< Torso Cap | Right Leg 2 */ BP_TORSOCAP_RIGHTLEG3 = 212, /*!< Torso Cap | Right Leg 3 */ BP_TORSOCAP_BRAIN = 213, /*!< Torso Cap | Brain */ + SBP_230_HEAD = 230, /*!< Skyrim, Head slot, use for neck on character head */ BP_TORSOSECTION_HEAD = 1000, /*!< Torso Section | Head */ BP_TORSOSECTION_HEAD2 = 2000, /*!< Torso Section | Head 2 */ BP_TORSOSECTION_LEFTARM = 3000, /*!< Torso Section | Left Arm */ @@ -283,6 +353,18 @@ enum ChannelType { ostream & operator<<( ostream & out, ChannelType const & val ); +/*! Skyrim, sets what sky function this object fulfills in BSSkyShaderProperty. */ +enum SkyObjectType { + BSSM_SKY_TEXTURE = 0, /*!< BSSM_Sky_Texture */ + BSSM_SKY_SUNGLARE = 1, /*!< BSSM_Sky_Sunglare */ + BSSM_SKY = 2, /*!< BSSM_Sky */ + BSSM_SKY_CLOUDS = 3, /*!< BSSM_Sky_Clouds */ + BSSM_SKY_STARS = 5, /*!< BSSM_Sky_Stars */ + BSSM_SKY_MOON_STARS_MASK = 7, /*!< BSSM_Sky_Moon_Stars_Mask */ +}; + +ostream & operator<<( ostream & out, SkyObjectType const & val ); + /*! * Sets mesh color in Oblivion Construction Set. Anything higher than 57 is also * null. @@ -591,6 +673,13 @@ enum ImageType { ostream & operator<<( ostream & out, ImageType const & val ); +/*! An unsigned 32-bit integer, describing what's inside the segment. */ +enum BSSegmentFlags { + BSSEG_WATER = 9, /*!< Contains water. */ +}; + +ostream & operator<<( ostream & out, BSSegmentFlags const & val ); + /*! An unsigned 32-bit integer, describing the color depth of a texture. */ enum PixelLayout { PIX_LAY_PALETTISED = 0, /*!< Texture is in 8-bit paletized format. */ @@ -761,6 +850,32 @@ enum FieldType { ostream & operator<<( ostream & out, FieldType const & val ); +/*! Values for configuring the shader type in a BSLightingShaderProperty */ +enum BSLightingShaderPropertyShaderType { + DEFAULT = 0, /*!< Default */ + ENVIRONMENT_MAP = 1, /*!< Enables EnvMap Mask(TS6), EnvMap Scale */ + GLOW_SHADER = 2, /*!< Enables Glow(TS3) */ + HEIGHTMAP = 3, /*!< Enables Height(TS4) */ + FACE_TINT = 4, /*!< Enables SubSurface(TS3), Detail(TS4), Tint(TS7) */ + SKIN_TINT = 5, /*!< Enables Skin Tint Color */ + HAIR_TINT = 6, /*!< Enables Hair Tint Color */ + PARALLAX_OCC_MATERIAL = 7, /*!< Enables Height(TS4), Max Passes, Scale. Unused? */ + WORLD_MULTITEXTURE = 8, /*!< World Multitexture */ + WORLDMAP1 = 9, /*!< WorldMap1 */ + UNKNOWN_10 = 10, /*!< Unknown 10 */ + MULTILAYER_PARALLAX = 11, /*!< Enables EnvMap Mask(TS6), Layer(TS7), Parallax Layer Thickness, Parallax Refraction Scale, Parallax Inner Layer U Scale, Parallax Inner Layer V Scale, EnvMap Scale */ + UNKNOWN_12 = 12, /*!< Unknown 12 */ + WORLDMAP2 = 13, /*!< WorldMap2 */ + SPARKLE_SNOW = 14, /*!< Enables SparkleParams */ + WORLDMAP3 = 15, /*!< WorldMap3 */ + EYE_ENVMAP = 16, /*!< Enables EnvMap Mask(TS6), Eye EnvMap Scale */ + UNKNOWN_17 = 17, /*!< Unknown 17 */ + WORLDMAP4 = 18, /*!< WorldMap4 */ + WORLD_LOD_MULTITEXTURE = 19, /*!< World LOD Multitexture */ +}; + +ostream & operator<<( ostream & out, BSLightingShaderPropertyShaderType const & val ); + /*! Determines decay function. Used by NiPSysBombModifier. */ enum DecayType { DECAY_NONE = 0, /*!< No decay. */ @@ -781,6 +896,58 @@ enum EmitFrom { ostream & operator<<( ostream & out, EmitFrom const & val ); +/*! Skyrim water shader property flags */ +enum SkyrimWaterShaderFlags { + SWSF1_UNKNOWN0 = 1, /*!< Unknown */ + SWSF1_BYPASS_REFRACTION_MAP = 2, /*!< Bypasses refraction map when set to 1 */ + SWSF1_WATER_TOGGLE = 4, /*!< Main water Layer on/off */ + SWSF1_UNKNOWN3 = 8, /*!< Unknown */ + SWSF1_UNKNOWN4 = 16, /*!< Unknown */ + SWSF1_UNKNOWN5 = 32, /*!< Unknown */ + SWSF1_HIGHLIGHT_LAYER_TOGGLE = 64, /*!< Reflection layer 2 on/off. (is this scene reflection?) */ + SWSF1_ENABLED = 128, /*!< Water layer on/off */ +}; + +ostream & operator<<( ostream & out, SkyrimWaterShaderFlags const & val ); + +/*! Skyrim Shader Property Flags 1 */ +enum SkyrimShaderPropertyFlags1 { + SLSF1_SPECULAR = 1, /*!< Enables Specularity */ + SLSF1_SKINNED = 2, /*!< Required For Skinned Meshes. */ + SLSF1_TEMP_REFRACTION = 4, /*!< Unknown */ + SLSF1_VERTEX_ALPHA = 8, /*!< Enables using alpha component of vertex colors. */ + SLSF1_GREYSCALE_TO_PALETTECOLOR = 16, /*!< in EffectShaderProperty */ + SLSF1_GREYSCALE_TO_PALETTEALPHA = 32, /*!< in EffectShaderProperty */ + SLSF1_USE_FALLOFF = 64, /*!< Use Falloff value in EffectShaderProperty */ + SLSF1_ENVIRONMENT_MAPPING = 128, /*!< Environment mapping (uses Envmap Scale). */ + SLSF1_RECIEVE_SHADOWS = 256, /*!< Object can recieve shadows. */ + SLSF1_CAST_SHADOWS = 512, /*!< Can cast shadows */ + SLSF1_FACEGEN_DETAIL_MAP = 1024, /*!< Use a face detail map in the 4th texture slot. */ + SLSF1_PARALLAX = 2048, /*!< Unused? */ + SLSF1_MODEL_SPACE_NORMALS = 4096, /*!< Use Model space normals and an external Specular Map. */ + SLSF1_NON_PROJECTIVE_SHADOWS = 8192, /*!< Unknown. */ + SLSF1_LANDSCAPE = 16384, /*!< Unknown. */ + SLSF1_REFRACTION = 32768, /*!< Use normal map for refraction effect. */ + SLSF1_FIRE_REFRACTION = 65536, /*!< SLSF1_Fire_Refraction */ + SLSF1_EYE_ENVIRONMENT_MAPPING = 131072, /*!< Eye Environment Mapping (Must use the Eye shader and the model must be skinned) */ + SLSF1_HAIR_SOFT_LIGHTING = 262144, /*!< Keeps from going too bright under lights (hair shader only) */ + SLSF1_SCREENDOOR_ALPHA_FADE = 524288, /*!< SLSF1_Screendoor_Alpha_Fade */ + SLSF1_LOCALMAP_HIDE_SECRET = 1048576, /*!< Object and anything it is positioned above will not render on local map view. */ + SLSF1_FACEGEN_RGB_TINT = 2097152, /*!< Use tintmask for Face. */ + SLSF1_OWN_EMIT = 4194304, /*!< Provides its own emittance color. (will not absorb light/ambient color?) */ + SLSF1_PROJECTED_UV = 8388608, /*!< Used for decalling? */ + SLSF1_MULTIPLE_TEXTURES = 16777216, /*!< SLSF1_Multiple_Textures */ + SLSF1_REMAPPABLE_TEXTURES = 33554432, /*!< SLSF1_Remappable_Textures */ + SLSF1_DECAL = 67108864, /*!< SLSF1_Decal */ + SLSF1_DYNAMIC_DECAL = 134217728, /*!< SLSF1_Dynamic_Decal */ + SLSF1_PARALLAX_OCCLUSION = 268435456, /*!< SLSF1_Parallax_Occlusion */ + SLSF1_EXTERNAL_EMITTANCE = 536870912, /*!< SLSF1_External_Emittance */ + SLSF1_SOFT_EFFECT = 1073741824, /*!< SLSF1_Soft_Effect */ + SLSF1_ZBUFFER_TEST = 2147483648, /*!< ZBuffer Test (1=on) */ +}; + +ostream & operator<<( ostream & out, SkyrimShaderPropertyFlags1 const & val ); + /*! Shader Property Flags */ enum BSShaderFlags { SF_SPECULAR = 1, /*!< Enables Specularity */ @@ -819,6 +986,20 @@ enum BSShaderFlags { ostream & operator<<( ostream & out, BSShaderFlags const & val ); +/*! + * Furniture entry points. It specifies the direction(s) from where the actor is + * able to enter (and leave) the position. + */ +enum FurnitureEntryPoints { + FRONT = 1, /*!< front entry point */ + BEHIND = 2, /*!< behind entry point */ + RIGHT = 4, /*!< right entry point */ + LEFT = 8, /*!< left entry point */ + UP = 16, /*!< up entry point - unknown function. Used on some beds in Skyrim, probably for blocking of sleeping position. */ +}; + +ostream & operator<<( ostream & out, FurnitureEntryPoints const & val ); + /*! Editor flags for the Body Partitions. */ enum BSPartFlag { PF_EDITOR_VISIBLE = 1, /*!< Visible in Editor */ @@ -827,82 +1008,6 @@ enum BSPartFlag { ostream & operator<<( ostream & out, BSPartFlag const & val ); -/*! Skyrim Shader Property Flags 2 */ -enum SkyrimLightingShaderFlags2 { - SLSF2_ZBUFFER_WRITE = 1, /*!< Enables writing to the Z-Buffer */ - SLSF2_1 = 2, /*!< SLSF2_1 */ - SLSF2_2 = 4, /*!< SLSF2_2 */ - SLSF2_3 = 8, /*!< SLSF2_3 */ - SLSF2_DOUBLE_SIDED = 16, /*!< Double-sided rendering */ - SLSF2_VERTEX_COLOR = 32, /*!< Has Vertex Colors (Maybe, could be Vertex Alpha?) */ - SLSF2_GLOW_MAP = 64, /*!< Use Glow Map */ - SLSF2_7 = 128, /*!< SLSF2_7 */ - SLSF2_8 = 256, /*!< SLSF2_8 */ - SLSF2_9 = 512, /*!< SLSF2_9 */ - SLSF2_10 = 1024, /*!< SLSF2_10 */ - SLSF2_11 = 2048, /*!< SLSF2_11 */ - SLSF2_12 = 4096, /*!< SLSF2_12 */ - SLSF2_13 = 8192, /*!< SLSF2_13 */ - SLSF2_14 = 16384, /*!< SLSF2_14 */ - SLSF2_15 = 32768, /*!< SLSF2_15 */ - SLSF2_16 = 65536, /*!< Wireframe (Seems to only work on particles) */ - SLSF2_17 = 131072, /*!< SLSF2_17 */ - SLSF2_18 = 262144, /*!< SLSF2_18 */ - SLSF2_19 = 524288, /*!< SLSF2_19 */ - SLSF2_20 = 1048576, /*!< SLSF2_20 */ - SLSF2_21 = 2097152, /*!< SLSF2_21 */ - SLSF2_22 = 4194304, /*!< SLSF2_22 */ - SLSF2_23 = 8388608, /*!< SLSF2_23 */ - SLSF2_MULTI_LAYER = 16777216, /*!< Use Multilayer (inner-layer) Map */ - SLSF2_SOFT_LIGHT = 33554432, /*!< Use Soft Lighting Map */ - SLSF2_RIM_LIGHT = 67108864, /*!< Use Rim Lighting Map */ - SLSF2_BACK_LIGHT = 134217728, /*!< Use Back Lighting Map */ - SLSF2_28 = 268435456, /*!< SLSF2_28 */ - SLSF2_VERTEX_ANIMATION = 536870912, /*!< Enables Vertex Animation */ - SLSF2_30 = 1073741824, /*!< SLSF2_30 */ - SLSF2_31 = 2147483648, /*!< SLSF2_31 */ -}; - -ostream & operator<<( ostream & out, SkyrimLightingShaderFlags2 const & val ); - -/*! Skyrim Shader Property Flags 1 */ -enum SkyrimLightingShaderFlags1 { - SLSF1_SPECULAR = 1, /*!< Enables Specularity */ - SLSF1_SKINNED = 2, /*!< Required For Skinned Meshes */ - SLSF1_2 = 4, /*!< SLSF1_2 */ - SLSF1_3 = 8, /*!< SLSF1_3 */ - SLSF1_4 = 16, /*!< SLSF1_4 */ - SLSF1_5 = 32, /*!< SLSF1_5 */ - SLSF1_6 = 64, /*!< SLSF1_6 */ - SLSF1_ENVIRONMENT_MAPPING = 128, /*!< Environment mapping (uses Envmap Scale) */ - SLSF1_8 = 256, /*!< SLSF1_8 */ - SLSF1_CAST_SHADOWS = 512, /*!< Can cast shadows */ - SLSF1_10 = 1024, /*!< SLSF1_10 */ - SLSF1_11 = 2048, /*!< SLSF1_11 */ - SLSF1_SPECULAR_MAP = 4096, /*!< Use Specular Map */ - SLSF1_13 = 8192, /*!< SLSF1_13 */ - SLSF1_14 = 16384, /*!< SLSF1_14 */ - SLSF1_15 = 32768, /*!< SLSF1_15 */ - SLSF1_16 = 65536, /*!< SLSF1_16 */ - SLSF1_EYE_ENVIRONMENT_MAPPING = 131072, /*!< Eye Environment Mapping (Must use the Eye shader and the model must be skinned) */ - SLSF1_18 = 262144, /*!< SLSF1_18 */ - SLSF1_19 = 524288, /*!< SLSF1_19 */ - SLSF1_20 = 1048576, /*!< SLSF1_20 */ - SLSF1_21 = 2097152, /*!< SLSF1_21 */ - SLSF1_22 = 4194304, /*!< SLSF1_22 */ - SLSF1_23 = 8388608, /*!< SLSF1_23 */ - SLSF1_24 = 16777216, /*!< SLSF1_24 */ - SLSF1_25 = 33554432, /*!< SLSF1_25 */ - SLSF1_26 = 67108864, /*!< SLSF1_26 */ - SLSF1_27 = 134217728, /*!< SLSF1_27 */ - SLSF1_28 = 268435456, /*!< SLSF1_28 */ - SLSF1_29 = 536870912, /*!< SLSF1_29 */ - SLSF1_30 = 1073741824, /*!< SLSF1_30 */ - SLSF1_ZBUFFER_TEST = 2147483648, /*!< ZBuffer Test (1=on) */ -}; - -ostream & operator<<( ostream & out, SkyrimLightingShaderFlags1 const & val ); - /*! Determines how the data stream is accessed? */ enum DataStreamAccess { CPU_READ = 1, /*!< CPU Read */ @@ -917,32 +1022,42 @@ enum DataStreamAccess { ostream & operator<<( ostream & out, DataStreamAccess const & val ); /*! Skyrim Shader Property Flags 2 */ -enum SkyrimEffectShaderFlags2 { - SESF2_TEXTURE_TRANSFORM_U = 1, /*!< Has Texture Transform (U?) */ - SESF2_TEXTURE_TRANSFORM_V = 2, /*!< Has Texture Transform (V?) */ - SESF2_2 = 4, /*!< SESF2_2 */ - SESF2_3 = 8, /*!< SESF2_3 */ - SESF2_4 = 16, /*!< SESF2_4 */ - SESF2_5 = 32, /*!< SESF2_5 */ - SESF2_6 = 64, /*!< SESF2_6 */ - SESF2_7 = 128, /*!< SESF2_7 */ +enum SkyrimShaderPropertyFlags2 { + SLSF2_ZBUFFER_WRITE = 1, /*!< Enables writing to the Z-Buffer */ + SLSF2_LOD_LANDSCAPE = 2, /*!< SLSF2_LOD_Landscape */ + SLSF2_LOD_OBJECTS = 4, /*!< SLSF2_LOD_Objects */ + SLSF2_NO_FADE = 8, /*!< SLSF2_No_Fade */ + SLSF2_DOUBLE_SIDED = 16, /*!< Double-sided rendering. */ + SLSF2_VERTEX_COLORS = 32, /*!< Has Vertex Colors. */ + SLSF2_GLOW_MAP = 64, /*!< Use Glow Map in the third texture slot. */ + SLSF2_ASSUME_SHADOWMASK = 128, /*!< SLSF2_Assume_Shadowmask */ + SLSF2_PACKED_TANGENT = 256, /*!< SLSF2_Packed_Tangent */ + SLSF2_MULTI_INDEX_SNOW = 512, /*!< SLSF2_Multi_Index_Snow */ + SLSF2_VERTEX_LIGHTING = 1024, /*!< SLSF2_Vertex_Lighting */ + SLSF2_UNIFORM_SCALE = 2048, /*!< SLSF2_Uniform_Scale */ + SLSF2_FIT_SLOPE = 4096, /*!< SLSF2_Fit_Slope */ + SLSF2_BILLBOARD = 8192, /*!< SLSF2_Billboard */ + SLSF2_NO_LOD_LAND_BLEND = 16384, /*!< SLSF2_No_LOD_Land_Blend */ + SLSF2_ENVMAP_LIGHT_FADE = 32768, /*!< SLSF2_EnvMap_Light_Fade */ + SLSF2_WIREFRAME = 65536, /*!< Wireframe (Seems to only work on particles) */ + SLSF2_WEAPON_BLOOD = 131072, /*!< Used for blood decals on weapons. */ + SLSF2_HIDE_ON_LOCAL_MAP = 262144, /*!< Similar to hide secret, but only for self? */ + SLSF2_PREMULT_ALPHA = 524288, /*!< Has Premultiplied Alpha */ + SLSF2_CLOUD_LOD = 1048576, /*!< SLSF2_Cloud_LOD */ + SLSF2_ANISOTROPIC_LIGHTING = 2097152, /*!< Hair only? */ + SLSF2_NO_TRANSPARENCY_MULTISAMPLING = 4194304, /*!< SLSF2_No_Transparency_Multisampling */ + SLSF2_UNUSED01 = 8388608, /*!< Unused? */ + SLSF2_MULTI_LAYER_PARALLAX = 16777216, /*!< Use Multilayer (inner-layer) Map */ + SLSF2_SOFT_LIGHTING = 33554432, /*!< Use Soft Lighting Map */ + SLSF2_RIM_LIGHTING = 67108864, /*!< Use Rim Lighting Map */ + SLSF2_BACK_LIGHTING = 134217728, /*!< Use Back Lighting Map */ + SLSF2_UNUSED02 = 268435456, /*!< Unused? */ + SLSF2_TREE_ANIM = 536870912, /*!< Enables Vertex Animation, Flutter Animation */ + SLSF2_EFFECT_LIGHTING = 1073741824, /*!< SLSF2_Effect_Lighting */ + SLSF2_HD_LOD_OBJECTS = 2147483648, /*!< SLSF2_HD_LOD_Objects */ }; -ostream & operator<<( ostream & out, SkyrimEffectShaderFlags2 const & val ); - -/*! Skyrim Shader Property Flags 1 */ -enum SkyrimEffectShaderFlags1 { - SESF1_0 = 1, /*!< SESF1_0 */ - SESF1_1 = 2, /*!< SESF1_1 */ - SESF1_2 = 4, /*!< SESF1_2 */ - SESF1_3 = 8, /*!< SESF1_3 */ - SESF1_DOUBLE_SIDED = 16, /*!< Draw textures double-sided */ - SESF1_5 = 32, /*!< SESF1_5 */ - SESF1_6 = 64, /*!< SESF1_6 */ - SESF1_7 = 128, /*!< SESF1_7 */ -}; - -ostream & operator<<( ostream & out, SkyrimEffectShaderFlags1 const & val ); +ostream & operator<<( ostream & out, SkyrimShaderPropertyFlags2 const & val ); } #endif diff --git a/include/gen/enums_intl.h b/include/gen/enums_intl.h index 72a7f6a12c87e2fac17f7cca58d98327d94ae120..2ac375b0f3d0867ddf9e59e0e7001bba2c15c19f 100644 --- a/include/gen/enums_intl.h +++ b/include/gen/enums_intl.h @@ -52,6 +52,12 @@ void NifStream( VelocityType & val, istream& in, const NifInfo & info = NifInfo( void NifStream( VelocityType const & val, ostream& out, const NifInfo & info = NifInfo() ); +//---AnimationType---// + +void NifStream( AnimationType & val, istream& in, const NifInfo & info = NifInfo() ); +void NifStream( AnimationType const & val, ostream& out, const NifInfo & info = NifInfo() ); + + //---DataStreamUsage---// void NifStream( DataStreamUsage & val, istream& in, const NifInfo & info = NifInfo() ); @@ -99,6 +105,9 @@ void NifStream( StencilAction const & val, ostream& out, const NifInfo & info = void NifStream( SyncPoint & val, istream& in, const NifInfo & info = NifInfo() ); void NifStream( SyncPoint const & val, ostream& out, const NifInfo & info = NifInfo() ); + +//---BSDismemberBodyPartType---// + void NifStream( BSDismemberBodyPartType & val, istream& in, const NifInfo & info = NifInfo() ); void NifStream( BSDismemberBodyPartType const & val, ostream& out, const NifInfo & info = NifInfo() ); @@ -106,6 +115,12 @@ void NifStream( ChannelType & val, istream& in, const NifInfo & info = NifInfo() void NifStream( ChannelType const & val, ostream& out, const NifInfo & info = NifInfo() ); +//---SkyObjectType---// + +void NifStream( SkyObjectType & val, istream& in, const NifInfo & info = NifInfo() ); +void NifStream( SkyObjectType const & val, ostream& out, const NifInfo & info = NifInfo() ); + + //---OblivionLayer---// void NifStream( OblivionLayer & val, istream& in, const NifInfo & info = NifInfo() ); @@ -220,6 +235,12 @@ void NifStream( ImageType & val, istream& in, const NifInfo & info = NifInfo() ) void NifStream( ImageType const & val, ostream& out, const NifInfo & info = NifInfo() ); +//---BSSegmentFlags---// + +void NifStream( BSSegmentFlags & val, istream& in, const NifInfo & info = NifInfo() ); +void NifStream( BSSegmentFlags const & val, ostream& out, const NifInfo & info = NifInfo() ); + + //---PixelLayout---// void NifStream( PixelLayout & val, istream& in, const NifInfo & info = NifInfo() ); @@ -277,6 +298,12 @@ void NifStream( FieldType & val, istream& in, const NifInfo & info = NifInfo() ) void NifStream( FieldType const & val, ostream& out, const NifInfo & info = NifInfo() ); +//---BSLightingShaderPropertyShaderType---// + +void NifStream( BSLightingShaderPropertyShaderType & val, istream& in, const NifInfo & info = NifInfo() ); +void NifStream( BSLightingShaderPropertyShaderType const & val, ostream& out, const NifInfo & info = NifInfo() ); + + //---DecayType---// void NifStream( DecayType & val, istream& in, const NifInfo & info = NifInfo() ); @@ -289,46 +316,46 @@ void NifStream( EmitFrom & val, istream& in, const NifInfo & info = NifInfo() ); void NifStream( EmitFrom const & val, ostream& out, const NifInfo & info = NifInfo() ); -//---BSShaderFlags---// +//---SkyrimWaterShaderFlags---// -void NifStream( BSShaderFlags & val, istream& in, const NifInfo & info = NifInfo() ); -void NifStream( BSShaderFlags const & val, ostream& out, const NifInfo & info = NifInfo() ); +void NifStream( SkyrimWaterShaderFlags & val, istream& in, const NifInfo & info = NifInfo() ); +void NifStream( SkyrimWaterShaderFlags const & val, ostream& out, const NifInfo & info = NifInfo() ); -//---BSPartFlag---// +//---SkyrimShaderPropertyFlags1---// -void NifStream( BSPartFlag & val, istream& in, const NifInfo & info = NifInfo() ); -void NifStream( BSPartFlag const & val, ostream& out, const NifInfo & info = NifInfo() ); +void NifStream( SkyrimShaderPropertyFlags1 & val, istream& in, const NifInfo & info = NifInfo() ); +void NifStream( SkyrimShaderPropertyFlags1 const & val, ostream& out, const NifInfo & info = NifInfo() ); -//---SkyrimLightingShaderFlags2---// +//---BSShaderFlags---// -void NifStream( SkyrimLightingShaderFlags2 & val, istream& in, const NifInfo & info = NifInfo() ); -void NifStream( SkyrimLightingShaderFlags2 const & val, ostream& out, const NifInfo & info = NifInfo() ); +void NifStream( BSShaderFlags & val, istream& in, const NifInfo & info = NifInfo() ); +void NifStream( BSShaderFlags const & val, ostream& out, const NifInfo & info = NifInfo() ); -//---SkyrimLightingShaderFlags1---// +//---FurnitureEntryPoints---// -void NifStream( SkyrimLightingShaderFlags1 & val, istream& in, const NifInfo & info = NifInfo() ); -void NifStream( SkyrimLightingShaderFlags1 const & val, ostream& out, const NifInfo & info = NifInfo() ); +void NifStream( FurnitureEntryPoints & val, istream& in, const NifInfo & info = NifInfo() ); +void NifStream( FurnitureEntryPoints const & val, ostream& out, const NifInfo & info = NifInfo() ); -//---DataStreamAccess---// +//---BSPartFlag---// -void NifStream( DataStreamAccess & val, istream& in, const NifInfo & info = NifInfo() ); -void NifStream( DataStreamAccess const & val, ostream& out, const NifInfo & info = NifInfo() ); +void NifStream( BSPartFlag & val, istream& in, const NifInfo & info = NifInfo() ); +void NifStream( BSPartFlag const & val, ostream& out, const NifInfo & info = NifInfo() ); -//---SkyrimEffectShaderFlags2---// +//---DataStreamAccess---// -void NifStream( SkyrimEffectShaderFlags2 & val, istream& in, const NifInfo & info = NifInfo() ); -void NifStream( SkyrimEffectShaderFlags2 const & val, ostream& out, const NifInfo & info = NifInfo() ); +void NifStream( DataStreamAccess & val, istream& in, const NifInfo & info = NifInfo() ); +void NifStream( DataStreamAccess const & val, ostream& out, const NifInfo & info = NifInfo() ); -//---SkyrimEffectShaderFlags1---// +//---SkyrimShaderPropertyFlags2---// -void NifStream( SkyrimEffectShaderFlags1 & val, istream& in, const NifInfo & info = NifInfo() ); -void NifStream( SkyrimEffectShaderFlags1 const & val, ostream& out, const NifInfo & info = NifInfo() ); +void NifStream( SkyrimShaderPropertyFlags2 & val, istream& in, const NifInfo & info = NifInfo() ); +void NifStream( SkyrimShaderPropertyFlags2 const & val, ostream& out, const NifInfo & info = NifInfo() ); } #endif diff --git a/include/obj/BSBehaviorGraphExtraData.h b/include/obj/BSBehaviorGraphExtraData.h index 35146335fea6eeb9f9dbadf9e7f3e1b35108a3fa..918756a9d0a12c6c781fe2927d4491f465d7ccec 100644 --- a/include/obj/BSBehaviorGraphExtraData.h +++ b/include/obj/BSBehaviorGraphExtraData.h @@ -20,10 +20,7 @@ namespace Niflib { class BSBehaviorGraphExtraData; typedef Ref<BSBehaviorGraphExtraData> BSBehaviorGraphExtraDataRef; -/*! - * Links a nif with a Havok Behavior .hkx animation file - * Unknown. Links to a hkx file. - */ +/*! Links a nif with a Havok Behavior .hkx animation file */ class BSBehaviorGraphExtraData : public NiExtraData { public: /*! Constructor */ @@ -62,8 +59,8 @@ public: protected: /*! Name of the hkx file. */ IndexString behaviourGraphFile; - /*! Unknown, has to do with blending on an actor. */ - byte unknownByte1; + /*! Unknown, has to do with blending appended bones onto an actor. */ + byte controlsBaseSkeleton; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSBoneLODExtraData.h b/include/obj/BSBoneLODExtraData.h index 37a6323f282499d2b44f232ee825997b87bac154..b08286b3480ef5e9aaa8daea955649fedef816aa 100644 --- a/include/obj/BSBoneLODExtraData.h +++ b/include/obj/BSBoneLODExtraData.h @@ -15,12 +15,15 @@ All rights reserved. Please see niflib.h for license. */ //--END CUSTOM CODE--// #include "NiExtraData.h" + +// Include structures +#include "../gen/BoneLOD.h" namespace Niflib { class BSBoneLODExtraData; typedef Ref<BSBoneLODExtraData> BSBoneLODExtraDataRef; -/*! Unkown */ +/*! Unknown */ class BSBoneLODExtraData : public NiExtraData { public: /*! Constructor */ @@ -57,12 +60,10 @@ public: //--END CUSTOM CODE--// protected: - /*! */ - mutable unsigned int unknownInt1; - /*! */ - vector<unsigned int > unknownIntA1; - /*! */ - vector<unsigned int > unknownIntA2; + /*! Number of bone entries */ + mutable unsigned int bonelodCount; + /*! Bone Entry */ + vector<BoneLOD > bonelodInfo; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSEffectShaderProperty.h b/include/obj/BSEffectShaderProperty.h index af94136d18eaac56c7bac51c28e9f66f0ad4a6b0..5ce08ba6ea8e52ed467790bd1e18aa1f3aad6f22 100644 --- a/include/obj/BSEffectShaderProperty.h +++ b/include/obj/BSEffectShaderProperty.h @@ -20,7 +20,7 @@ namespace Niflib { class BSEffectShaderProperty; typedef Ref<BSEffectShaderProperty> BSEffectShaderPropertyRef; -/*! */ +/*! Skyrim non-PP shader model, used primarily for transparency effects. */ class BSEffectShaderProperty : public NiProperty { public: /*! Constructor */ @@ -57,42 +57,34 @@ public: //--END CUSTOM CODE--// protected: - /*! 8/16? (nope, also 122,atronachflame) */ - byte unknownByte1; - /*! */ - unsigned short unknownShort1; - /*! always 80? */ - byte unknownByte2; - /*! Shader options, will use SkyrimEffectShaderFlags1 */ - unsigned int effectShaderFlags1; + /*! Unknown. */ + SkyrimShaderPropertyFlags1 shaderFlags1; + /*! Unknown. */ + SkyrimShaderPropertyFlags2 shaderFlags2; /*! Offset UVs */ - TexCoord textureTranslation1; - /*! Offset UVs */ - TexCoord textureTranslation2; + TexCoord uvOffset; + /*! Offset UV Scale to repeat tiling textures */ + TexCoord uvScale; /*! points to an external texture. */ string sourceTexture; - /*! hader options, will use SkyrimEffectShaderFlags12 */ - unsigned short effectShaderFlags2; - /*! Unknown */ - unsigned short unknownShort2; - /*! Unknown */ - float unknownFloat1; - /*! Unknown */ - float unknownFloat2; - /*! Unknown */ - float unknownFloat3; - /*! Unknown */ - float unknownFloat4; - /*! Color */ - Color3 diffuseColor; - /*! The material's transparency */ - float alpha; - /*! Adds a glow effect */ - float emissive; - /*! Unknown */ - float unknownFloat5; + /*! How to handle texture borders. */ + unsigned int textureClampMode; + /*! Unknown. */ + float falloffStartAngle; + /*! Unknown. */ + float falloffStopAngle; + /*! Texture will fade in within this proximity. */ + float falloffStartOpacity; + /*! Unknown. */ + float falloffStopOpacity; + /*! Emissive color */ + Color4 emissiveColor; + /*! Multipled Emissive Colors */ + float emissiveMultiple; + /*! Unknown. */ + float softFalloffDepth; /*! points to an external texture. */ - string gradientTexture; + string greyscaleTexture; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSEffectShaderPropertyFloatController.h b/include/obj/BSEffectShaderPropertyFloatController.h index fd4a1a51472f9ce6731a97182ffb1bc0409ae7ff..ca541719de28ace557159565adf2b83c7e0b5184 100644 --- a/include/obj/BSEffectShaderPropertyFloatController.h +++ b/include/obj/BSEffectShaderPropertyFloatController.h @@ -20,7 +20,20 @@ namespace Niflib { class BSEffectShaderPropertyFloatController; typedef Ref<BSEffectShaderPropertyFloatController> BSEffectShaderPropertyFloatControllerRef; -/*! */ +/*! + * This controller is used to animate variables in + * BSEffectShaderPropertyFloatController, target is a number in order they appear: + * 0: Visibility? + * 1: + * 2: + * 3: + * 4: Emissive or Saturation? + * 5: Alpha Transparency + * 6: U Offset + * 7: U Scale + * 8: V Offset + * 9: V Scale + */ class BSEffectShaderPropertyFloatController : public NiFloatInterpController { public: /*! Constructor */ @@ -57,8 +70,8 @@ public: //--END CUSTOM CODE--// protected: - /*! Unknown. Does not appear to be a link. */ - unsigned int unknownInt2; + /*! Unknown */ + unsigned int targetVariable; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSInvMarker.h b/include/obj/BSInvMarker.h index b82f06d5766cc8c1e4e85d54ac51fb8b3bba8373..a0d091a0fc94548cf42ed5a9b9ef6d52a0661fdc 100644 --- a/include/obj/BSInvMarker.h +++ b/include/obj/BSInvMarker.h @@ -27,6 +27,8 @@ typedef Ref<BSInvMarker> BSInvMarkerRef; * If not present, then Skyrim will still show the nif in inventory, * using the default values. * Name should be 'INV' (without the quotes). + * For rotations, a short of "4712" appears as "4.712" but "959" appears as + * "0.959" meshes\weapons\daedric\daedricbowskinned.nif */ class BSInvMarker : public NiExtraData { public: @@ -64,12 +66,14 @@ public: //--END CUSTOM CODE--// protected: - /*! Up-down rotation, in radians * 1000. */ - unsigned int rotation1; - /*! Left-right rotation, in radians * 1000. */ - unsigned int rotation2; - /*! Zoom factor. 16000 is really far away, 16600 is really close by. */ - unsigned short zoom; + /*! Unknown. */ + unsigned short rotationX; + /*! Unknown. */ + unsigned short rotationY; + /*! Unknown. */ + unsigned short rotationZ; + /*! Zoom factor. */ + float zoom; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSLODTriShape.h b/include/obj/BSLODTriShape.h index f97f0d0ffd06260ed070cdceb4387c76fb39690c..f7d75650f2f2784cc9e583b8572748c9010a9966 100644 --- a/include/obj/BSLODTriShape.h +++ b/include/obj/BSLODTriShape.h @@ -20,7 +20,7 @@ namespace Niflib { class BSLODTriShape; typedef Ref<BSLODTriShape> BSLODTriShapeRef; -/*! Unkown */ +/*! A variation on NiTriShape, for visibility control over vertex groups. */ class BSLODTriShape : public NiTriBasedGeom { public: /*! Constructor */ @@ -58,11 +58,11 @@ public: //--END CUSTOM CODE--// protected: /*! Unknown */ - unsigned int unknownInt1; + unsigned int level0Size; /*! Unknown */ - unsigned int unknownInt2; + unsigned int level1Size; /*! Unknown */ - unsigned int unknownInt3; + unsigned int level2Size; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSLagBoneController.h b/include/obj/BSLagBoneController.h index 0d7bdc55cfd8530b483d984ee1c0d51f98ac4145..9d8aef3ce49e14c6c8921021c29f6366980820dd 100644 --- a/include/obj/BSLagBoneController.h +++ b/include/obj/BSLagBoneController.h @@ -58,11 +58,11 @@ public: //--END CUSTOM CODE--// protected: /*! How long it takes to rotate about an actor back to rest position. */ - float rotationLag; - /*! Unknown */ - float unknownFloat3; + float linearVelocity; + /*! How the bone lags rotation */ + float linearRotation; /*! How far bone will tail an actor. */ - float length; + float maximumDistance; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSLeafAnimNode.h b/include/obj/BSLeafAnimNode.h index 14d2e85271b50ad0c3e24e78723fdd38b8ad2ae0..3a0dcc039c6fb933dc881224c372f0f206fa7136 100644 --- a/include/obj/BSLeafAnimNode.h +++ b/include/obj/BSLeafAnimNode.h @@ -20,7 +20,7 @@ namespace Niflib { class BSLeafAnimNode; typedef Ref<BSLeafAnimNode> BSLeafAnimNodeRef; -/*! Unkown, related to trees. */ +/*! Unknown, related to trees. */ class BSLeafAnimNode : public NiNode { public: /*! Constructor */ diff --git a/include/obj/BSLightingShaderProperty.h b/include/obj/BSLightingShaderProperty.h index 2fe84d8bb81f54197b5af0abb13b6beb073fa2e1..c22b9072b55f412ef2849cf8c9eaef56bac47a9c 100644 --- a/include/obj/BSLightingShaderProperty.h +++ b/include/obj/BSLightingShaderProperty.h @@ -25,18 +25,12 @@ class BSShaderTextureSet; class BSLightingShaderProperty; typedef Ref<BSLightingShaderProperty> BSLightingShaderPropertyRef; -/*! - * Bethesda-specific node, used in Skyrim to configure material/shader/texture - * properties. - */ +/*! Skyrim PP shader for assigning material/shader/texture. */ class BSLightingShaderProperty : public NiProperty { public: /*! Constructor */ NIFLIB_API BSLightingShaderProperty(); - /*! Copy constructor */ - NIFLIB_API BSLightingShaderProperty(const BSLightingShaderProperty& src); - /*! Destructor */ NIFLIB_API virtual ~BSLightingShaderProperty(); @@ -70,49 +64,49 @@ public: * Shader flags used by Skyrim * \return The value of the shader flags */ - NIFLIB_API unsigned int getShaderFlags1(); + NIFLIB_API SkyrimShaderPropertyFlags1 getShaderFlags1(); /*! * Sets the value of the shader flags used by Skyrim * \param[in] The new value of the shader flags */ - NIFLIB_API void setShaderFlags1(unsigned int value); + NIFLIB_API void setShaderFlags1(SkyrimShaderPropertyFlags1 value); /*! * Gets the second set of shader flags used by Skyrim * \return The value of the second set of flags */ - NIFLIB_API unsigned int getShaderFlags2(); + NIFLIB_API SkyrimShaderPropertyFlags2 getShaderFlags2(); /*! * Sets the value of the second set of skyrim shader flags * \param[in] the value of the second set of flags */ - NIFLIB_API void setShaderFlags2(unsigned int value); + NIFLIB_API void setShaderFlags2(SkyrimShaderPropertyFlags2 value); /*! * Used to reposition the texture coordinates of the uv's * \return The texture translation the the uv's */ - NIFLIB_API TexCoord getTextureTranslation1(); + NIFLIB_API TexCoord getUVOffset(); /*! * Sets the value of the texture offset of the uv's * \param[in] The new value of the uv offsets */ - NIFLIB_API void setTextureTranslation1(TexCoord value); + NIFLIB_API void setUVOffset(TexCoord value); /*! * Used to get the offset of the texture coordinates or uv's * \return The second texture offsets for the uv */ - NIFLIB_API TexCoord getTextureRepeat(); + NIFLIB_API TexCoord getUVScale(); /*! * Used to set the second texture offsets * \param[in] The second texture offsets */ - NIFLIB_API void setTextureRepeat(TexCoord value); + NIFLIB_API void setUVScale(TexCoord value); /*! * Returns the current texture set used @@ -142,25 +136,25 @@ public: * Get the emissive saturation * \return The emissive saturation */ - NIFLIB_API float getEmissiveSaturation(); + NIFLIB_API float getEmissiveMultiple(); /*! * Sets the emissive saturation of the material * \param[in] The new emissive saturation value */ - NIFLIB_API void setEmissiveSaturation(float value); + NIFLIB_API void setEmissiveMultiple(float value); /*! * Gets unknown unsigned int7 * \return The current value */ - NIFLIB_API unsigned int getUnkownInt7(); + NIFLIB_API TexClampMode getTextureClampMode(); /*! * Sets the unknown int7 of this material * \param[in] The new value */ - NIFLIB_API void setUnknownInt7(unsigned int value); + NIFLIB_API void setTextureClampMode(TexClampMode value); /*! * Get the transparency or "alpha" of this material @@ -176,12 +170,14 @@ public: /*! * Get the unknown float2 of the material + * WARNING: API not stable * \return The unknown float2 value */ NIFLIB_API float getUnknownFloat2(); /*! * Sets the unknown float2 of the material + * WARNING: API not stable * \param[in] The new unknown float2 value */ NIFLIB_API void setUnknownFloat2(float value); @@ -250,61 +246,25 @@ public: * Gets the environment map strength of the material * \return The environment map strength */ - NIFLIB_API float getEnvironmentMapStrength(); + NIFLIB_API float getEnvironmentMapScale(); /*! * Sets the environment map strength of the material * \param[in] The new environment map strength value */ - NIFLIB_API void setEnvironmentMapStrength(float value); - - /*! - * Sets unknown float set3 of the material related to hair - * \return The unknown float set3 value - */ - NIFLIB_API array<2, float> getUnknownFloatSet3(); - - /*! - * Sets the unknown float set3 of the material - * \param[in] The new unknown float set3 value - */ - NIFLIB_API void setUnknownFloatSet3(array<2, float> value); - - /*! - * Gets the unknown float9 of the material - * \return The unknown float9 value - */ - NIFLIB_API float getUnknownFloat9(); - - /*! - * Sets the unknown float9 of the material - * \param[in] The new unknown float9 value - */ - NIFLIB_API void setUnknownFloat9(float value); - - /*! - * Gets the unknown color2 of the material - * \return The unknown color2 value - */ - NIFLIB_API Color4 getUnknownColor2(); - - /*! - * Sets the unknown color2 of the material - * \param[in] The new unknown color2 value - */ - NIFLIB_API void setUnknownColor2(Color4 value); + NIFLIB_API void setEnvironmentMapScale(float value); /*! * Gets the unknown float set5 of the material * \return The unknown float set5 value */ - NIFLIB_API Vector4 getUnknownFloatSet5(); + NIFLIB_API Vector4 getSparkleParameters(); /*! * Sets the unknown float set5 of the material * \param[in] The new unknown float set5 value */ - NIFLIB_API void setUnknownFloatSet5(Vector4 value); + NIFLIB_API void setSparkleParameters(Vector4 value); /*! * Get the eye cubemap scale @@ -344,55 +304,61 @@ public: //--END CUSTOM CODE--// protected: - /*! Skyrim Shader Flag field 1 (will use SkyrimLightingShaderFlags1) */ - unsigned int shaderFlags1; - /*! Skyrim Shader Flag field 2 (will use SkyrimLightingShaderFlags2) */ - unsigned int shaderFlags2; - /*! Offset UVs */ - TexCoord textureTranslation1; + /*! Skyrim Shader Flags for setting render/shader options. */ + SkyrimShaderPropertyFlags1 shaderFlags1; + /*! Skyrim Shader Flags for setting render/shader options. */ + SkyrimShaderPropertyFlags2 shaderFlags2; /*! Offset UVs */ - TexCoord textureRepeat; - /*! Texture Set */ + TexCoord uvOffset; + /*! Offset UV Scale to repeat tiling textures, see above. */ + TexCoord uvScale; + /*! Texture Set, can have override in an esm/esp */ Ref<BSShaderTextureSet > textureSet; /*! Glow color and alpha */ Color3 emissiveColor; - /*! Unknown */ - float emissiveSaturation; - /*! Unknown, always 3? */ - unsigned int unknownInt7; - /*! The material transparency (1=non-transparent). */ + /*! Multiplied emissive colors */ + float emissiveMultiple; + /*! How to handle texture borders. */ + TexClampMode textureClampMode; + /*! The materials opacity (1=non-transparent). */ float alpha; /*! Unknown */ float unknownFloat2; - /*! The material's glossiness. (0-999) */ + /*! The material's specular power, or glossiness (0-999). */ float glossiness; /*! Adds a colored highlight. */ Color3 specularColor; /*! Brightness of specular highlight. (0=not visible) (0-999) */ float specularStrength; - /*! Unknown, related to backlight/rim/softlight effect */ + /*! Controls strength for envmap/backlight/rim/softlight lighting effect? */ float lightingEffect1; - /*! Unknown, related to backlight/rim/softlight effect */ + /*! Controls strength for envmap/backlight/rim/softlight lighting effect? */ float lightingEffect2; + /*! Scales the environment/cube map. (0-??) */ + float environmentMapScale; + /*! Tints the base texture. Overridden by game settings. */ + Color3 skinTintColor; + /*! Tints the base texture. Overridden by game settings. */ + Color3 hairTintColor; + /*! Max Passes */ + float maxPasses; + /*! Scale */ + float scale; + /*! How far from the surface the inner layer appears to be. */ + float parallaxInnerLayerThickness; + /*! Depth of inner parallax layer effect. */ + float parallaxRefractionScale; + /*! Scales the inner parallax layer texture. */ + TexCoord parallaxInnerLayerTextureScale; /*! How strong the environment/cube map is. (0-??) */ - float environmentMapStrength; - /*! Unknown, related to skin */ - Vector3 unknownFloatSet1; - /*! Unknown, related to hair */ - Color3 unknownColor1; - /*! Unknown */ - array<2,float > unknownFloatSet3; - /*! Unknown, related to ice or parallax */ - float unknownFloat9; - /*! Unknown, related to ice parallax */ - Color4 unknownColor2; - /*! Unknown, also related to ice? */ - Vector4 unknownFloatSet5; - /*! Eye(Skyrim) */ + float parallaxEnvmapStrength; + /*! Unknown/unused? CK lists "snow material" when used. */ + Vector4 sparkleParameters; + /*! Eye cubemap scale */ float eyeCubemapScale; - /*! Eye(Skyrim)Left Unknown */ + /*! Offset to set center for left eye cubemap */ Vector3 leftEyeReflectionCenter; - /*! Eye(Skyrim)Right Unknown */ + /*! Offset to set center for right eye cubemap */ Vector3 rightEyeReflectionCenter; public: /*! NIFLIB_HIDDEN function. For internal use only. */ diff --git a/include/obj/BSLightingShaderPropertyColorController.h b/include/obj/BSLightingShaderPropertyColorController.h index 62395f6e23392e594292c03f6fde89a3dacb71fa..b34f7def0b1aedf182d3115ac6fd2126c1a5ddf3 100644 --- a/include/obj/BSLightingShaderPropertyColorController.h +++ b/include/obj/BSLightingShaderPropertyColorController.h @@ -57,8 +57,8 @@ public: //--END CUSTOM CODE--// protected: - /*! Unknown */ - unsigned int unknownInt2; + /*! Which variable in the shader to animate. */ + unsigned int targetVariable; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSLightingShaderPropertyFloatController.h b/include/obj/BSLightingShaderPropertyFloatController.h index 504d53de431712a180d6b6194d0a897fce5ac44d..d23fec95285569954dd7c25894893be3ccc8d6bf 100644 --- a/include/obj/BSLightingShaderPropertyFloatController.h +++ b/include/obj/BSLightingShaderPropertyFloatController.h @@ -24,10 +24,10 @@ typedef Ref<BSLightingShaderPropertyFloatController> BSLightingShaderPropertyFlo * This controller is used to animate variables in * BSLightingShaderPropertyFloatController, target is a number in order they * appear: - * 5: Texture Translation U - * 6: Texture Translation V - * 7: Texture Repeat U - * 8: Texture Repeat V + * 5: U Offset + * 6: V Offset + * 7: U Scale + * 8: V Scale */ class BSLightingShaderPropertyFloatController : public NiFloatInterpController { public: @@ -65,7 +65,7 @@ public: //--END CUSTOM CODE--// protected: - /*! Unknown */ + /*! Which variable in the shader to animate. */ unsigned int targetVariable; public: /*! NIFLIB_HIDDEN function. For internal use only. */ diff --git a/include/obj/BSMultiBoundAABB.h b/include/obj/BSMultiBoundAABB.h index 9c5657a8375db2ba2aa3daa5e96ca9ae2d164906..dca32e8f6c8d56fc3b6b557e77d2ea87304e9fda 100644 --- a/include/obj/BSMultiBoundAABB.h +++ b/include/obj/BSMultiBoundAABB.h @@ -57,8 +57,10 @@ public: //--END CUSTOM CODE--// protected: - /*! Unknown */ - array<6,float > unknownFloats1; + /*! Position of the AABB's center */ + Vector3 position; + /*! Extent of the AABB in all directions */ + Vector3 extent; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSPSysSubTexModifier.h b/include/obj/BSPSysSubTexModifier.h index f1dfc118af149caa1c2a61d3adb3ded45bead55c..9f745a7e902e07f8198b76095475173d54b37b4f 100644 --- a/include/obj/BSPSysSubTexModifier.h +++ b/include/obj/BSPSysSubTexModifier.h @@ -20,7 +20,10 @@ namespace Niflib { class BSPSysSubTexModifier; typedef Ref<BSPSysSubTexModifier> BSPSysSubTexModifierRef; -/*! */ +/*! + * Similar to a Flip Controller, this handles particle texture animation on a + * single texture atlas + */ class BSPSysSubTexModifier : public NiPSysModifier { public: /*! Constructor */ @@ -57,20 +60,20 @@ public: //--END CUSTOM CODE--// protected: + /*! Starting frame/position on atlas */ + unsigned int startFrame; + /*! Random chance to start on a different frame? */ + float startFrameFudge; + /*! Ending frame/position on atlas */ + float endFrame; + /*! Frame to start looping */ + float loopStartFrame; + /*! Unknown. */ + float loopStartFrameFudge; /*! Unknown */ - unsigned int unknownInt1; - /*! These seem to relate to the texture slots in a TextureSet */ - float unknownFloat1; + float frameCount; /*! Unknown */ - float unknownFloat2; - /*! Unknown */ - float unknownFloat3; - /*! Unknown */ - float unknownFloat4; - /*! Unknown */ - float unknownFloat5; - /*! Unknown */ - float unknownFloat6; + float frameCountFudge; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSProceduralLightningController.h b/include/obj/BSProceduralLightningController.h index 938818f90d7b72f0d1c9ca60f00ae3006149361c..273eea839a1f07469d124d8f5a07383b018fda59 100644 --- a/include/obj/BSProceduralLightningController.h +++ b/include/obj/BSProceduralLightningController.h @@ -15,12 +15,21 @@ All rights reserved. Please see niflib.h for license. */ //--END CUSTOM CODE--// #include "NiFloatInterpController.h" + +// Include structures +#include "../Ref.h" namespace Niflib { +// Forward define of referenced NIF objects +class NiInterpolator; class BSProceduralLightningController; typedef Ref<BSProceduralLightningController> BSProceduralLightningControllerRef; -/*! */ +/*! + * Skyrim, Paired with dummy TriShapes, this controller generates lightning shapes + * for special effects. + * First interpolator controls Generation. + */ class BSProceduralLightningController : public NiFloatInterpController { public: /*! Constructor */ @@ -57,36 +66,36 @@ public: //--END CUSTOM CODE--// protected: + /*! References interpolator for Mutation of strips */ + Ref<NiInterpolator > interpolator2_Mutation; /*! Unknown */ - unsigned int unknownInt2; - /*! Unknown */ - unsigned int target___1; + Ref<NiInterpolator > interpolator3; /*! Unknown */ - unsigned int target___2; + Ref<NiInterpolator > interpolator4; /*! Unknown */ - unsigned int target___3; + Ref<NiInterpolator > interpolator5; /*! Unknown */ - unsigned int target___4; + Ref<NiInterpolator > interpolator6; /*! Unknown */ - unsigned int target___5; + Ref<NiInterpolator > interpolator7; /*! Unknown */ - unsigned int target___6; - /*! Unknown */ - unsigned int target___7; + Ref<NiInterpolator > interpolator8; + /*! References interpolator for Amplitutde control. 0=straight, 50=wide */ + Ref<NiInterpolator > interpolator9_ArcOffset; /*! Unknown */ unsigned short unknownShort1; /*! Unknown */ unsigned short unknownShort2; /*! Unknown */ unsigned short unknownShort3; - /*! Unknown */ - float float1; + /*! How far lightning will stretch to. */ + float distanceWeight; /*! Unknown */ float float2; - /*! Unknown */ - float float3; - /*! Unknown */ - float float4; + /*! How wide the bolt will be */ + float stripWidth; + /*! Influences forking behavior */ + float fork; /*! Unknown */ float float5; /*! Unknown */ @@ -95,8 +104,8 @@ protected: byte byte2; /*! Unknown */ byte byte3; - /*! Unknown */ - unsigned int target___8; + /*! Unknown, unsure if this is actually another interpolator link. */ + Ref<NiInterpolator > interpolator10_; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSSegmentedTriShape.h b/include/obj/BSSegmentedTriShape.h index 942c15ea81efa37dcd38750c2d8b607b2ccf01cb..c171ad36483fb854014e85d61217710a139f18cf 100644 --- a/include/obj/BSSegmentedTriShape.h +++ b/include/obj/BSSegmentedTriShape.h @@ -17,7 +17,7 @@ All rights reserved. Please see niflib.h for license. */ #include "NiTriShape.h" // Include structures -#include "../gen/BSSegmentedTriangle.h" +#include "../gen/BSSegment.h" namespace Niflib { class BSSegmentedTriShape; @@ -60,10 +60,10 @@ public: //--END CUSTOM CODE--// protected: - /*! Unknown */ - mutable int numSegTriangles; - /*! Unknown */ - vector<BSSegmentedTriangle > segTriangles; + /*! Number of segments in the square grid */ + mutable int numSegments; + /*! Configuration of each segment */ + vector<BSSegment > segment; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSShaderPPLightingProperty.h b/include/obj/BSShaderPPLightingProperty.h index 7ff0663dff0e9bc5f433c349c0dd804a56b323e3..3108b882119493d06292d8bbc7b0203a86052796 100644 --- a/include/obj/BSShaderPPLightingProperty.h +++ b/include/obj/BSShaderPPLightingProperty.h @@ -80,6 +80,8 @@ protected: float unknownFloat4; /*! Unknown */ float unknownFloat5; + /*! Glow color and alpha */ + Color4 emissiveColor; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSSkyShaderProperty.h b/include/obj/BSSkyShaderProperty.h index bb1e7e6e4789eda60278985a7b1edc64dc65dc7e..26f7230e058a049fa814ef2aadf2203978ba85a4 100644 --- a/include/obj/BSSkyShaderProperty.h +++ b/include/obj/BSSkyShaderProperty.h @@ -20,7 +20,7 @@ namespace Niflib { class BSSkyShaderProperty; typedef Ref<BSSkyShaderProperty> BSSkyShaderPropertyRef; -/*! */ +/*! Skyrim Sky shader block. */ class BSSkyShaderProperty : public NiProperty { public: /*! Constructor */ @@ -57,18 +57,21 @@ public: //--END CUSTOM CODE--// protected: - /*! Unknown */ - float unknownFloat1; - /*! Unknown */ - unsigned int unknownInt1; - /*! Unknown */ - unsigned int unknownInt2; - /*! Unknown */ - Vector3 unknownFloats; - /*! Unknown */ - string texture; - /*! Unknown */ - unsigned int unknownInt3; + /*! Unknown. */ + SkyrimShaderPropertyFlags1 shaderFlags1; + /*! Unknown. */ + SkyrimShaderPropertyFlags2 shaderFlags2; + /*! + * Offset UVs. Seems to be unused, but it fits with the other Skyrim shader + * properties. + */ + TexCoord uvOffset; + /*! Offset UV Scale to repeat tiling textures, see above. */ + TexCoord uvScale; + /*! points to an external texture. */ + string sourceTexture; + /*! Sky Object Type */ + SkyObjectType skyObjectType; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSStripPSysData.h b/include/obj/BSStripPSysData.h index 302c0dd91acbeee3e2c187d7336e65e9fb4ce79b..a9ba04204886bcbef1d6ec8ab705c36ec8fe82c2 100644 --- a/include/obj/BSStripPSysData.h +++ b/include/obj/BSStripPSysData.h @@ -58,13 +58,13 @@ public: //--END CUSTOM CODE--// protected: /*! Unknown */ - short unknownShort3; + short unknownShort5; /*! Unknown */ - byte unknownByte1; + byte unknownByte6; /*! Unknown */ - int unknownInt2; + int unknownInt7; /*! Unknown */ - int unknownInt3; + float unknownFloat8; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSTreeNode.h b/include/obj/BSTreeNode.h index 1bcc14f87e155eb490d98d5295cee5607d79c476..57ef20bcbd1ce812c6be0169121a46e475d18ace 100644 --- a/include/obj/BSTreeNode.h +++ b/include/obj/BSTreeNode.h @@ -14,20 +14,19 @@ All rights reserved. Please see niflib.h for license. */ //--END CUSTOM CODE--// -#include "NiAVObject.h" +#include "NiNode.h" // Include structures #include "../Ref.h" namespace Niflib { // Forward define of referenced NIF objects -class NiAVObject; class NiNode; class BSTreeNode; typedef Ref<BSTreeNode> BSTreeNodeRef; /*! Node for handling Trees, Switches branch configurations for variation? */ -class BSTreeNode : public NiAVObject { +class BSTreeNode : public NiNode { public: /*! Constructor */ NIFLIB_API BSTreeNode(); @@ -63,12 +62,6 @@ public: //--END CUSTOM CODE--// protected: - /*! The number of child objects. */ - mutable unsigned int numChildren; - /*! List of child node object indices. */ - vector<Ref<NiAVObject > > children; - /*! Unknown */ - unsigned int unknownInt1; /*! Unknown */ mutable unsigned int numBones1; /*! Unknown */ diff --git a/include/obj/BSWaterShaderProperty.h b/include/obj/BSWaterShaderProperty.h index 2bc558d69a3a78bb49a0d600f02e2dca58fe7eda..83b189051fdcad4ae759704b22041d0a9b82073b 100644 --- a/include/obj/BSWaterShaderProperty.h +++ b/include/obj/BSWaterShaderProperty.h @@ -20,7 +20,10 @@ namespace Niflib { class BSWaterShaderProperty; typedef Ref<BSWaterShaderProperty> BSWaterShaderPropertyRef; -/*! Water Shader Property, different from "WaterShaderProperty" */ +/*! + * Skyrim water shader property, different from "WaterShaderProperty" seen in + * Fallout. + */ class BSWaterShaderProperty : public NiProperty { public: /*! Constructor */ @@ -57,24 +60,26 @@ public: //--END CUSTOM CODE--// protected: - /*! Unknown, flag? */ - unsigned short unknownShort1; - /*! Unknown, flag? */ - unsigned short unknownShort2; - /*! Unknown */ - unsigned int unknownInt1; - /*! Unknown */ - unsigned int unknownInt2; - /*! Unknown */ - unsigned int unknownInt3; - /*! Unknown */ - float unknownFloat1; - /*! Unknown */ - float unknownFloat2; + /*! Unknown. */ + SkyrimShaderPropertyFlags1 shaderFlags1; + /*! Unknown. */ + SkyrimShaderPropertyFlags2 shaderFlags2; + /*! + * Offset UVs. Seems to be unused, but it fits with the other Skyrim shader + * properties. + */ + TexCoord uvOffset; + /*! Offset UV Scale to repeat tiling textures, see above. */ + TexCoord uvScale; + /*! Defines attributes for the water shader (will use SkyrimWaterShaderFlags) */ + SkyrimWaterShaderFlags waterShaderFlags; + /*! + * A bitflag, only the first/second bit controls water flow positive or negative + * along UVs. + */ + byte waterDirection; /*! Unknown, flag? */ unsigned short unknownShort3; - /*! Unknown, flag? */ - unsigned short unknownShort4; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/BSXFlags.h b/include/obj/BSXFlags.h index f3aa927b0231901d802a5d533bc661ae353a707c..f534b871f145c533c7840dd8d3d25d1f676ad52e 100644 --- a/include/obj/BSXFlags.h +++ b/include/obj/BSXFlags.h @@ -21,14 +21,16 @@ typedef Ref<BSXFlags> BSXFlagsRef; /*! * Controls animation and collision. Integer holds flags: - * Bit 0 : enable havok - * Bit 1 : enable collision - * Bit 2 : is skeleton nif? - * Bit 3 : enable animation - * Bit 4 : FlameNodes present + * Bit 0 : enable havok, bAnimated(Skyrim) + * Bit 1 : enable collision, bHavok(Skyrim) + * Bit 2 : is skeleton nif?, bRagdoll(Skyrim) + * Bit 3 : enable animation, bComplex(Skyrim) + * Bit 4 : FlameNodes present, bAddon(Skyrim) * Bit 5 : EditorMarkers present - * Bit 6 : ? (Skyrim) - * Bit 7 : ? (Skyrim) + * Bit 6 : bDynamic(Skyrim) + * Bit 7 : bArticulated(Skyrim) + * Bit 8 : bIKTarget(Skyrim) + * Bit 9 : Unknown(Skyrim) */ class BSXFlags : public NiIntegerExtraData { public: diff --git a/include/obj/NiAVObject.h b/include/obj/NiAVObject.h index 8a842cfadca61044a551d30f51468c0c2e7e6cb8..77f56e6034558ca640c20debfcb0a8ad23b38005 100644 --- a/include/obj/NiAVObject.h +++ b/include/obj/NiAVObject.h @@ -35,9 +35,6 @@ public: /*! Constructor */ NIFLIB_API NiAVObject(); - /*! Copy constructor */ - NIFLIB_API NiAVObject(const NiAVObject& src); - /*! Destructor */ NIFLIB_API virtual ~NiAVObject(); diff --git a/include/obj/NiGeometry.h b/include/obj/NiGeometry.h index 5632e62508ed92f8dac06558b8b54256365ba603..a806c82299fd2252b376a96ab4ff9e93a7d54660 100644 --- a/include/obj/NiGeometry.h +++ b/include/obj/NiGeometry.h @@ -180,13 +180,13 @@ public: * Returns the array of the only 2 properties that are specific to Bethesda * \return Returns the array of the 2 properties */ - NIFLIB_API array<2,Ref<NiProperty > > getBsProperties(); + NIFLIB_API array<2,Ref<NiProperty > > getBSProperties(); /* * Sets the array of the only 2 properties that are specific to Bethesda * \param[in] The new array of properties */ - NIFLIB_API void setBsProperties( array<2, Ref<NiProperty>> value); + NIFLIB_API void setBSProperties( array<2, Ref<NiProperty> > value); //--END CUSTOM CODE--// protected: diff --git a/include/obj/NiNode.h b/include/obj/NiNode.h index d2cf779034b97b7a6e81704f93d310908a7764f4..0c7414b233d263df557f13bc30b311aaee2eef12 100644 --- a/include/obj/NiNode.h +++ b/include/obj/NiNode.h @@ -34,9 +34,6 @@ public: /*! Constructor */ NIFLIB_API NiNode(); - /*! Copy constructor */ - NIFLIB_API NiNode(const NiNode& src); - /*! Destructor */ NIFLIB_API virtual ~NiNode(); diff --git a/include/obj/NiObject.h b/include/obj/NiObject.h index 9a9ef1934301fcc55dc180da748f1d2f572060c5..7553cad1e1e44a652cb07ab4d29d64beb4ed7d42 100644 --- a/include/obj/NiObject.h +++ b/include/obj/NiObject.h @@ -38,9 +38,6 @@ public: /*! Constructor */ NIFLIB_API NiObject(); - /*! Copy constructor */ - NIFLIB_API NiObject(const NiObject& src); - /*! Destructor */ NIFLIB_API virtual ~NiObject(); diff --git a/include/obj/NiObjectNET.h b/include/obj/NiObjectNET.h index 07c19ea4547cc1524c21235722633be3ddb2b146..e2e5b819ceea5fdefb709a3896ff54064d3bbff0 100644 --- a/include/obj/NiObjectNET.h +++ b/include/obj/NiObjectNET.h @@ -31,9 +31,6 @@ public: /*! Constructor */ NIFLIB_API NiObjectNET(); - /*! Copy constructor */ - NIFLIB_API NiObjectNET(const NiObjectNET& src); - /*! Destructor */ NIFLIB_API virtual ~NiObjectNET(); @@ -137,21 +134,18 @@ public: * Gets the skyrim shader type * \return The skyrim shader flag value */ - NIFLIB_API unsigned int GetSkyrimShaderType(); + NIFLIB_API BSLightingShaderPropertyShaderType GetSkyrimShaderType(); /*! * Set the skyrim shader type * \param[in] The new skyrim shader value */ - NIFLIB_API void SetSkyrimShaderType(unsigned int value); + NIFLIB_API void SetSkyrimShaderType(BSLightingShaderPropertyShaderType value); //--END CUSTOM CODE--// protected: - /*! - * Skyrim's shaders: 0=default 1=EnvMap, 2=Glow, 5=Skin, 6=Hair, 7=Unknown, - * 11=Ice/Parallax, 15=Eye. - */ - unsigned int skyrimShaderType; + /*! Configures the main shader path */ + BSLightingShaderPropertyShaderType skyrimShaderType; /*! Name of this controllable object, used to refer to the object in .kf files. */ IndexString name; /*! Extra data for pre-3.0 versions. */ diff --git a/include/obj/NiPSysData.h b/include/obj/NiPSysData.h index b8cb254da42269a3fb952caac3ee1415645d956e..1f580a8652ffe5d400e8e72f8ad38282c21da5d2 100644 --- a/include/obj/NiPSysData.h +++ b/include/obj/NiPSysData.h @@ -68,16 +68,14 @@ protected: unsigned short unknownShort1; /*! Unknown. */ unsigned short unknownShort2; - /*! Unknown, probably a boolean. */ - byte unknownByte2; - /*! Unknown, probably a boolean. */ - byte hasVertexColors2; - /*! Num bytes per */ - mutable unsigned int numVertexColors2; - /*! Unknown */ - unsigned int unknownInt3; - /*! Unknown */ - vector<Color4 > vertexColors; + /*! Boolean for Num Subtexture Offset UVs */ + bool hasSubtextureOffsetUvs; + /*! How many quads to use in BSPSysSubTexModifier for texture atlasing */ + mutable unsigned int numSubtextureOffsetUvs; + /*! Sets aspect ratio for Subtexture Offset UV quads */ + float aspectRatio; + /*! Defines UV offsets */ + vector<Vector4 > subtextureOffsetUvs; /*! Unknown */ unsigned int unknownInt4; /*! Unknown */ diff --git a/include/obj/NiParticleSystem.h b/include/obj/NiParticleSystem.h index bc04a4862b7a8fbdf2d8222e887d4bde5764a3a0..8edf0e3fec3d388547d683fb3a3df9c976079898 100644 --- a/include/obj/NiParticleSystem.h +++ b/include/obj/NiParticleSystem.h @@ -60,11 +60,11 @@ public: //--BEGIN MISC CUSTOM CODE--// //--END CUSTOM CODE--// protected: - /*! Unknown */ - unsigned short unknownShort1; /*! Unknown */ unsigned short unknownShort2; /*! Unknown */ + unsigned short unknownShort3; + /*! Unknown */ unsigned int unknownInt1; /*! * If true, Particles are birthed into world space. If false, Particles are diff --git a/include/obj/NiParticlesData.h b/include/obj/NiParticlesData.h index 85d25fbd9c74299af7904fcf2a70a3448efe12da..25116bb7f77021a17c2117daeb7d6ecdb3594881 100644 --- a/include/obj/NiParticlesData.h +++ b/include/obj/NiParticlesData.h @@ -93,12 +93,17 @@ protected: bool hasRotationAxes; /*! Unknown */ vector<Vector3 > rotationAxes; - /*! Unknown ushort */ - bool hasUnknownStuff1; - /*! Unknown */ - mutable short numUnknownStuff1; + /*! if value is no, a single image rendered */ + bool hasUvQuadrants; + /*! + * 2,4,8,16,32,64 are potential values. If "Has" was no then this should be 256, + * which represents a 16x16 framed image, which is invalid + */ + mutable byte numUvQuadrants; + /*! Unknown. */ + vector<Vector4 > uvQuadrants; /*! Unknown */ - vector<Vector4 > unknownStuff1; + byte unknownByte2; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/bhkBreakableConstraint.h b/include/obj/bhkBreakableConstraint.h index 3c3dbab4d6b3b25ec922d4618cc7eacae6b2bd33..8f1c15466de36ff4340b8c1993cb79ef882cc2b4 100644 --- a/include/obj/bhkBreakableConstraint.h +++ b/include/obj/bhkBreakableConstraint.h @@ -74,15 +74,17 @@ protected: /*! Unknown */ unsigned int unknownInt2; /*! Unknown */ - Vector3 unknownFloats1; + Vector3 position; /*! Unknown */ - Vector3 unknownFloats2; + Vector3 rotation; /*! Unknown */ unsigned int unknownInt3; /*! Unknown */ + float threshold; + /*! Unknown */ float unknownFloat1; /*! Unknown */ - byte unknownByte1; + byte removeIfBroken; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); diff --git a/include/obj/bhkCompressedMeshShape.h b/include/obj/bhkCompressedMeshShape.h index c9dcfc04d463570a9560a7cf73a1c95fe938ecc9..d474b4bc839fbe50abbaa257979150e578aa735e 100644 --- a/include/obj/bhkCompressedMeshShape.h +++ b/include/obj/bhkCompressedMeshShape.h @@ -32,9 +32,6 @@ public: /*! Constructor */ NIFLIB_API bhkCompressedMeshShape(); - /*! Copy constructor */ - NIFLIB_API bhkCompressedMeshShape(const bhkCompressedMeshShape& src); - /*! Destructor */ NIFLIB_API virtual ~bhkCompressedMeshShape(); @@ -96,9 +93,19 @@ protected: /*! Unknown. */ float unknownFloat1; /*! Unknown. */ - array<8,byte > unknown8Bytes; + array<4,byte > unknown4Bytes; + /*! Unknown */ + Vector4 unknownFloats1; + /*! A shell with that radius is added around the shape. */ + float radius; + /*! Scale */ + float scale; + /*! Unknown */ + float unknownFloat3; + /*! Unknown */ + float unknownFloat4; /*! Unknown */ - array<8,float > unknownFloats; + float unknownFloat5; /*! The collision mesh data. */ Ref<bhkCompressedMeshShapeData > data; public: diff --git a/include/obj/bhkCompressedMeshShapeData.h b/include/obj/bhkCompressedMeshShapeData.h index 8ea64f33062cc161adf04ab38aab1712c1ebc474..96f03b729565c851a35309e59c841aa7926d43a5 100644 --- a/include/obj/bhkCompressedMeshShapeData.h +++ b/include/obj/bhkCompressedMeshShapeData.h @@ -17,19 +17,16 @@ All rights reserved. Please see niflib.h for license. */ #include "NiObject.h" // Include structures -#include "../gen/bhkCMSD_Something.h" -#include "../gen/bhkCMSDData.h" -#include "../gen/bhkCMSD_Shape.h" -#include "../gen/bhkCMSDContainer.h" -#include "../gen/bhkCMSDChunk.h" -#include "../gen/bhkCMSDBigTris.h" +#include "../gen/bhkCMSDMaterial.h" #include "../gen/bhkCMSDTransform.h" +#include "../gen/bhkCMSDBigTris.h" +#include "../gen/bhkCMSDChunk.h" namespace Niflib { class bhkCompressedMeshShapeData; typedef Ref<bhkCompressedMeshShapeData> bhkCompressedMeshShapeDataRef; -/*! */ +/*! A compressed mesh shape for collision in Skyrim. */ class bhkCompressedMeshShapeData : public NiObject { public: /*! Constructor */ @@ -163,13 +160,13 @@ public: * Retrieve list of chunkMaterials * \return List of the chunkMaterials */ - NIFLIB_API virtual const vector<bhkCMSD_Something> & GetChunkMaterials() const; + NIFLIB_API virtual const vector<bhkCMSDMaterial> & GetChunkMaterials() const; /*! * Set list of chunkMaterials * \param[in] List of the chunkMaterials */ - NIFLIB_API virtual unsigned int SetChunkMaterials(vector<bhkCMSD_Something>& theChunkMaterials); + NIFLIB_API virtual unsigned int SetChunkMaterials(vector<bhkCMSDMaterial>& theChunkMaterials); /*! * Retrieve numTransforms @@ -269,20 +266,28 @@ public: //--END CUSTOM CODE--// protected: - /*! Number of bits defining index in shapeKey */ + /*! Number of bits in the shape-key reserved for a triangle index */ unsigned int bitsPerIndex; - /*! Number of bits defining index and winding in shapeKey */ + /*! Number of bits in the shape-key reserved for a triangle index and its winding */ unsigned int bitsPerWIndex; - /*! Mask for retrieving index and winding from shapeKey */ + /*! + * Mask used to get the triangle index and winding from a shape-key (common: 262143 + * = 0x3ffff) + */ unsigned int maskWIndex; - /*! Mask for retrieving index from shapeKey */ + /*! Mask used to get the triangle index from a shape-key (common: 131071 = 0x1ffff) */ unsigned int maskIndex; - - /*! error correction/? */ + /*! The radius of the storage mesh shape? Quantization error? */ float error; - /*! minimum AABB */ + /*! + * The minimum boundary of the AABB (the coordinates of the corner with the lowest + * numerical values) + */ Vector4 boundsMin; - /*! masimum AABB */ + /*! + * The maximum boundary of the AABB (the coordinates of the corner with the highest + * numerical values) + */ Vector4 boundsMax; /*! Unknown */ byte unknownByte1; @@ -294,28 +299,31 @@ protected: unsigned int unknownInt5; /*! Unknown */ byte unknownByte2; - /*! Number of bhkCMSDSomething */ + /*! Number of chunk materials */ mutable unsigned int numMaterials; - /*! Chunk materials */ - vector<bhkCMSD_Something > chunkMaterials; + /*! Table (array) with sets of materials. Chunks refers to this table by index. */ + vector<bhkCMSDMaterial > chunkMaterials; /*! Unknown */ unsigned int unknownInt6; - /*! Number of transformations */ + /*! Number of chunk transformations */ mutable unsigned int numTransforms; - /*! Chunk transformations */ - vector<bhkCMSDTransform > chunkTransforms; - /*! Number of BigVerts */ + /*! + * Table (array) with sets of transformations. Chunks refers to this table by + * index. + */ + vector<bhkCMSDTransform > chunkTransforms; + /*! Unknown */ mutable unsigned int numBigVerts; - /*! Vertices */ + /*! Compressed Vertices? */ vector<Vector4 > bigVerts; - /*! Number of triangles defind by vertices */ + /*! Unknown */ mutable unsigned int numBigTris; - /*! Triangles defining faces */ + /*! Unknown */ vector<bhkCMSDBigTris > bigTris; - /*! Number of chunks */ + /*! Unknown */ mutable unsigned int numChunks; - /*! Chunks */ - vector< bhkCMSDChunk > chunks; + /*! Unknown. */ + vector<bhkCMSDChunk > chunks; /*! Unknown, end of block. */ unsigned int unknownInt12; public: diff --git a/include/obj/bhkMoppBvTreeShape.h b/include/obj/bhkMoppBvTreeShape.h index 30db0dfe4a9038749f44c4c3ce3921c12284cd3c..10bd9af1bb3262af67c0e82f45ca650adc0e5e0f 100644 --- a/include/obj/bhkMoppBvTreeShape.h +++ b/include/obj/bhkMoppBvTreeShape.h @@ -30,9 +30,6 @@ public: /*! Constructor */ NIFLIB_API bhkMoppBvTreeShape(); - /*! Copy constructor */ - NIFLIB_API bhkMoppBvTreeShape(const bhkMoppBvTreeShape& src); - /*! Destructor */ NIFLIB_API virtual ~bhkMoppBvTreeShape(); diff --git a/include/obj/bhkRigidBody.h b/include/obj/bhkRigidBody.h index 4724bbba4abd29aaf636a32aa4c35b2d246bef04..0b8e56f73851ed6e067d99747d0e2769dbd545d8 100644 --- a/include/obj/bhkRigidBody.h +++ b/include/obj/bhkRigidBody.h @@ -39,9 +39,6 @@ public: /*! Constructor */ NIFLIB_API bhkRigidBody(); - /*! Copy constructor */ - NIFLIB_API bhkRigidBody(const bhkRigidBody& src); - /*! Destructor */ NIFLIB_API virtual ~bhkRigidBody(); @@ -377,8 +374,14 @@ protected: float linearDamping; /*! Damping value for angular movement. */ float angularDamping; + /*! Unknown. */ + float unknownTimefactorOrGravityfactor1; + /*! Unknown. */ + float unknownTimefactorOrGravityfactor2; /*! The body's friction. */ float friction; + /*! Unknown. */ + float rollingfrictionmultiplier_; /*! * The body's restitution (elasticity). * If the restitution is not 0.0 the object will need extra CPU for all @@ -387,12 +390,6 @@ protected: * buildings) */ float restitution; - /*! Unknown. */ - float unknownFloat51; - /*! Unknown. */ - float unknownFloat52; - /*! Unknown. */ - float unknownFloat53; /*! Maximal linear velocity. */ float maxLinearVelocity; /*! Maximal angular velocity. Pi x 10? */ diff --git a/niflib.vcproj b/niflib.vcproj index 6c7eab106ed202b277fc5656a099c7efb0425f57..ea93c329db560e8e2c1e231d6c6e45fcadc29a03 100644 --- a/niflib.vcproj +++ b/niflib.vcproj @@ -2453,11 +2453,11 @@ > </File> <File - RelativePath=".\src\gen\bhkCMSD_Shape.cpp" + RelativePath=".\src\gen\bhkCMSDBigTris.cpp" > </File> <File - RelativePath=".\src\gen\bhkCMSD_Something.cpp" + RelativePath=".\src\gen\bhkCMSDMaterial.cpp" > </File> <File @@ -4643,11 +4643,11 @@ > </File> <File - RelativePath=".\include\gen\bhkCMSD_Shape.h" + RelativePath=".\include\gen\bhkCMSDBigTris.h" > </File> <File - RelativePath=".\include\gen\bhkCMSD_Something.h" + RelativePath=".\include\gen\bhkCMSDMaterial.h" > </File> <File diff --git a/niflib.vcxproj b/niflib.vcxproj index 7293d61f3514492fce0546bc8e59f85c1039927c..ebcc87e5185a98fa764461da343b089f6b5bd7f7 100755 --- a/niflib.vcxproj +++ b/niflib.vcxproj @@ -764,8 +764,8 @@ <ClCompile Include="src\gen\AdditionalDataInfo.cpp" /> <ClCompile Include="src\gen\ArkTexture.cpp" /> <ClCompile Include="src\gen\AVObject.cpp" /> - <ClCompile Include="src\gen\bhkCMSD_Shape.cpp" /> - <ClCompile Include="src\gen\bhkCMSD_Something.cpp" /> + <ClCompile Include="src\gen\bhkCMSDBigTris.cpp" /> + <ClCompile Include="src\gen\bhkCMSDMaterial.cpp" /> <ClCompile Include="src\gen\bhkCMSDBigTris.cpp" /> <ClCompile Include="src\gen\bhkCMSDChunk.cpp" /> <ClCompile Include="src\gen\bhkCMSDContainer.cpp" /> @@ -1308,8 +1308,8 @@ <ClInclude Include="include\gen\AdditionalDataInfo.h" /> <ClInclude Include="include\gen\ArkTexture.h" /> <ClInclude Include="include\gen\AVObject.h" /> - <ClInclude Include="include\gen\bhkCMSD_Shape.h" /> - <ClInclude Include="include\gen\bhkCMSD_Something.h" /> + <ClInclude Include="include\gen\bhkCMSDBigTris.h" /> + <ClInclude Include="include\gen\bhkCMSDMaterial.h" /> <ClInclude Include="include\gen\bhkCMSDBigTris.h" /> <ClInclude Include="include\gen\bhkCMSDChunk.h" /> <ClInclude Include="include\gen\bhkCMSDContainer.h" /> diff --git a/niflib.vcxproj.filters b/niflib.vcxproj.filters index 5b5d687713692a5f815f99a8a8a6b316fe658184..8990cd38794bb474289e59a4d58be9d0fd713205 100755 --- a/niflib.vcxproj.filters +++ b/niflib.vcxproj.filters @@ -1407,10 +1407,10 @@ <ClCompile Include="src\gen\AVObject.cpp"> <Filter>Source Files\gen</Filter> </ClCompile> - <ClCompile Include="src\gen\bhkCMSD_Shape.cpp"> + <ClCompile Include="src\gen\bhkCMSDBigTris.cpp"> <Filter>Source Files\gen</Filter> </ClCompile> - <ClCompile Include="src\gen\bhkCMSD_Something.cpp"> + <ClCompile Include="src\gen\bhkCMSDMaterial.cpp"> <Filter>Source Files\gen</Filter> </ClCompile> <ClCompile Include="src\gen\bhkCMSDBigTris.cpp"> @@ -3035,10 +3035,10 @@ <ClInclude Include="include\gen\AVObject.h"> <Filter>Header Files\gen</Filter> </ClInclude> - <ClInclude Include="include\gen\bhkCMSD_Shape.h"> + <ClInclude Include="include\gen\bhkCMSDBigTris.h"> <Filter>Header Files\gen</Filter> </ClInclude> - <ClInclude Include="include\gen\bhkCMSD_Something.h"> + <ClInclude Include="include\gen\bhkCMSDMaterial.h"> <Filter>Header Files\gen</Filter> </ClInclude> <ClInclude Include="include\gen\bhkCMSDBigTris.h"> diff --git a/qhull b/qhull index fa9016e23211a428bf607af967f791e2323bc210..60d55819729d7b49391dde0271e15a56c70992b9 160000 --- a/qhull +++ b/qhull @@ -1 +1 @@ -Subproject commit fa9016e23211a428bf607af967f791e2323bc210 +Subproject commit 60d55819729d7b49391dde0271e15a56c70992b9 diff --git a/src/ComplexShape.cpp b/src/ComplexShape.cpp index 920172d5354ea83db31cbaccc949b8b9f75292b4..55aba7f35813cdfe8b89bf74c50563e6bd144cf5 100644 --- a/src/ComplexShape.cpp +++ b/src/ComplexShape.cpp @@ -258,7 +258,7 @@ void ComplexShape::Merge( NiAVObject * root ) { vector<NiPropertyRef> current_property_group = (*geom)->GetProperties(); //Special code to handle the Bethesda Skyrim properties - array<2, NiPropertyRef> bs_properties = (*geom)->getBsProperties(); + array<2, NiPropertyRef> bs_properties = (*geom)->getBSProperties(); if(bs_properties[0] != NULL) { current_property_group.push_back(bs_properties[0]); } @@ -396,14 +396,14 @@ void ComplexShape::Merge( NiAVObject * root ) { if(niProp != NULL) { bsTexProp = DynamicCast<BSShaderTextureSet>(niProp); } - niProp = (*geom)->getBsProperties()[0]; + niProp = (*geom)->getBSProperties()[0]; if(niProp != NULL && niProp->GetType().IsSameType(BSLightingShaderProperty::TYPE)) { BSLightingShaderPropertyRef bs_shader = DynamicCast<BSLightingShaderProperty>(niProp); if(bs_shader->getTextureSet() != NULL) { bsTexProp = bs_shader->getTextureSet(); } } - niProp = (*geom)->getBsProperties()[1]; + niProp = (*geom)->getBSProperties()[1]; if(niProp != NULL && niProp->GetType().IsSameType(BSLightingShaderProperty::TYPE)) { BSLightingShaderPropertyRef bs_shader = DynamicCast<BSLightingShaderProperty>(niProp); if(bs_shader->getTextureSet() != NULL) { @@ -952,7 +952,7 @@ Ref<NiAVObject> ComplexShape::Split( NiNode * parent, Matrix44 & transform, int array<2, NiPropertyRef> bs_properties; bs_properties[0] = shader_property; bs_properties[1] = alpha_property; - shapes[shape_num]->setBsProperties(bs_properties); + shapes[shape_num]->setBSProperties(bs_properties); } } diff --git a/src/gen/BSSegment.cpp b/src/gen/BSSegment.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c3ceb1c2748735719be5df125c3d13dbd94e2169 --- /dev/null +++ b/src/gen/BSSegment.cpp @@ -0,0 +1,32 @@ +/* Copyright (c) 2006, NIF File Format Library and Tools +All rights reserved. Please see niflib.h for license. */ + +//---THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT---// + +//To change this file, alter the niftools/docsys/gen_niflib.py Python script. + +#include "../../include/gen/BSSegment.h" +using namespace Niflib; + +//Constructor +BSSegment::BSSegment() : internalIndex((int)0), flags((BSSegmentFlags)0x00000000), unknownByte1((byte)0) {}; + +//Copy Constructor +BSSegment::BSSegment( const BSSegment & src ) { + *this = src; +}; + +//Copy Operator +BSSegment & BSSegment::operator=( const BSSegment & src ) { + this->internalIndex = src.internalIndex; + this->flags = src.flags; + this->unknownByte1 = src.unknownByte1; + return *this; +}; + +//Destructor +BSSegment::~BSSegment() {}; + +//--BEGIN MISC CUSTOM CODE--// + +//--END CUSTOM CODE--// diff --git a/src/gen/bhkCMSD_Shape.cpp b/src/gen/BoneLOD.cpp similarity index 56% rename from src/gen/bhkCMSD_Shape.cpp rename to src/gen/BoneLOD.cpp index 67fc86e5d33dff349c9c0193235e121af5da8337..84b6147f172fd1f6538c2bd371038d7f3d334447 100644 --- a/src/gen/bhkCMSD_Shape.cpp +++ b/src/gen/BoneLOD.cpp @@ -5,26 +5,26 @@ All rights reserved. Please see niflib.h for license. */ //To change this file, alter the niftools/docsys/gen_niflib.py Python script. -#include "../../include/gen/bhkCMSD_Shape.h" +#include "../../include/gen/BoneLOD.h" using namespace Niflib; //Constructor -bhkCMSD_Shape::bhkCMSD_Shape() : numShape((unsigned int)0) {}; +BoneLOD::BoneLOD() : distance((unsigned int)0) {}; //Copy Constructor -bhkCMSD_Shape::bhkCMSD_Shape( const bhkCMSD_Shape & src ) { +BoneLOD::BoneLOD( const BoneLOD & src ) { *this = src; }; //Copy Operator -bhkCMSD_Shape & bhkCMSD_Shape::operator=( const bhkCMSD_Shape & src ) { - this->numShape = src.numShape; - this->shape = src.shape; +BoneLOD & BoneLOD::operator=( const BoneLOD & src ) { + this->distance = src.distance; + this->boneName = src.boneName; return *this; }; //Destructor -bhkCMSD_Shape::~bhkCMSD_Shape() {}; +BoneLOD::~BoneLOD() {}; //--BEGIN MISC CUSTOM CODE--// diff --git a/src/gen/FurniturePosition.cpp b/src/gen/FurniturePosition.cpp index 055b8a35a8a362e24596ceed55afc89d287c813a..4f83912d4d1ec2cd9032a66cada894826eedc3e9 100644 --- a/src/gen/FurniturePosition.cpp +++ b/src/gen/FurniturePosition.cpp @@ -9,7 +9,7 @@ All rights reserved. Please see niflib.h for license. */ using namespace Niflib; //Constructor -FurniturePosition::FurniturePosition() : orientation((unsigned short)0), positionRef1((byte)0), positionRef2((byte)0), unknownShort1((unsigned short)0), unknownShort2((unsigned short)0) {}; +FurniturePosition::FurniturePosition() : orientation((unsigned short)0), positionRef1((byte)0), positionRef2((byte)0), heading(0.0f), animationType((AnimationType)0), entryProperties((FurnitureEntryPoints)0) {}; //Copy Constructor FurniturePosition::FurniturePosition( const FurniturePosition & src ) { @@ -22,8 +22,9 @@ FurniturePosition & FurniturePosition::operator=( const FurniturePosition & src this->orientation = src.orientation; this->positionRef1 = src.positionRef1; this->positionRef2 = src.positionRef2; - this->unknownShort1 = src.unknownShort1; - this->unknownShort2 = src.unknownShort2; + this->heading = src.heading; + this->animationType = src.animationType; + this->entryProperties = src.entryProperties; return *this; }; diff --git a/src/gen/Header.cpp b/src/gen/Header.cpp index 7592f8fb258a2692be5aad24ea69ac917a7380ce..c48bd20bcc86c69a6434367376a005ba90363368 100644 --- a/src/gen/Header.cpp +++ b/src/gen/Header.cpp @@ -65,7 +65,7 @@ NifInfo Header::Read( istream& in ) { NifStream( numBlocks, in, info ); }; if ( info.version >= 0x0A010000 ) { - if ( (userVersion >= 10) ) { + if ( ((userVersion >= 10) || ((userVersion == 1) && (version != 0x0A020000))) ) { NifStream( userVersion2, in, info ); }; }; @@ -81,7 +81,7 @@ NifInfo Header::Read( istream& in ) { NifStream( exportInfo.exportInfo2, in, info ); }; if ( info.version >= 0x0A010000 ) { - if ( (userVersion >= 10) ) { + if ( ((userVersion >= 10) || ((userVersion == 1) && (version != 0x0A020000))) ) { if ( info.version <= 0x0A000102 ) { NifStream( exportInfo.unknown, in, info ); }; @@ -124,6 +124,7 @@ NifInfo Header::Read( istream& in ) { //Fill out and return NifInfo structure. info.userVersion = userVersion; + info.userVersion2 = userVersion2; info.endian = EndianType(endianType); info.creator = exportInfo.creator.str; info.exportInfo1 = exportInfo.exportInfo1.str; @@ -156,7 +157,7 @@ void Header::Write( ostream& out, const NifInfo & info ) const { NifStream( numBlocks, out, info ); }; if ( info.version >= 0x0A010000 ) { - if ( (userVersion >= 10) ) { + if ( ((userVersion >= 10) || ((userVersion == 1) && (version != 0x0A020000))) ) { NifStream( userVersion2, out, info ); }; }; @@ -172,7 +173,7 @@ void Header::Write( ostream& out, const NifInfo & info ) const { NifStream( exportInfo.exportInfo2, out, info ); }; if ( info.version >= 0x0A010000 ) { - if ( (userVersion >= 10) ) { + if ( ((userVersion >= 10) || ((userVersion == 1) && (version != 0x0A020000))) ) { if ( info.version <= 0x0A000102 ) { NifStream( exportInfo.unknown, out, info ); }; @@ -230,7 +231,7 @@ string Header::asString( bool verbose ) const { out << " Endian Type: " << endianType << endl; out << " User Version: " << userVersion << endl; out << " Num Blocks: " << numBlocks << endl; - if ( (userVersion >= 10) ) { + if ( ((userVersion >= 10) || ((userVersion == 1) && (version != 0x0A020000))) ) { out << " User Version 2: " << userVersion2 << endl; }; out << " Unknown Int 3: " << unknownInt3 << endl; @@ -325,5 +326,3 @@ vector<unsigned short> Niflib::Header::getBlockTypeIndex() { } //--END CUSTOM CODE--// - - diff --git a/src/gen/MTransform.cpp b/src/gen/MTransform.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dff9de4b9c0e4aec7e52f91ba1b6c5446d982720 --- /dev/null +++ b/src/gen/MTransform.cpp @@ -0,0 +1,32 @@ +/* Copyright (c) 2006, NIF File Format Library and Tools +All rights reserved. Please see niflib.h for license. */ + +//---THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT---// + +//To change this file, alter the niftools/docsys/gen_niflib.py Python script. + +#include "../../include/gen/MTransform.h" +using namespace Niflib; + +//Constructor +MTransform::MTransform() : scale(0.0f) {}; + +//Copy Constructor +MTransform::MTransform( const MTransform & src ) { + *this = src; +}; + +//Copy Operator +MTransform & MTransform::operator=( const MTransform & src ) { + this->translation = src.translation; + this->rotation = src.rotation; + this->scale = src.scale; + return *this; +}; + +//Destructor +MTransform::~MTransform() {}; + +//--BEGIN MISC CUSTOM CODE--// + +//--END CUSTOM CODE--// diff --git a/src/gen/QTransform.cpp b/src/gen/QTransform.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d7c204c39b9b2dc43f8ac2f5dc482b0d190089a5 --- /dev/null +++ b/src/gen/QTransform.cpp @@ -0,0 +1,32 @@ +/* Copyright (c) 2006, NIF File Format Library and Tools +All rights reserved. Please see niflib.h for license. */ + +//---THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT---// + +//To change this file, alter the niftools/docsys/gen_niflib.py Python script. + +#include "../../include/gen/QTransform.h" +using namespace Niflib; + +//Constructor +QTransform::QTransform() : scale(0.0f) {}; + +//Copy Constructor +QTransform::QTransform( const QTransform & src ) { + *this = src; +}; + +//Copy Operator +QTransform & QTransform::operator=( const QTransform & src ) { + this->translation = src.translation; + this->rotation = src.rotation; + this->scale = src.scale; + return *this; +}; + +//Destructor +QTransform::~QTransform() {}; + +//--BEGIN MISC CUSTOM CODE--// + +//--END CUSTOM CODE--// diff --git a/src/gen/SkinPartition.cpp b/src/gen/SkinPartition.cpp index bd53d917878dc63d11f28dd54479277875f16f71..8157299a2caa96104b31fec98b36f78f70d4c36f 100644 --- a/src/gen/SkinPartition.cpp +++ b/src/gen/SkinPartition.cpp @@ -6,10 +6,11 @@ All rights reserved. Please see niflib.h for license. */ //To change this file, alter the niftools/docsys/gen_niflib.py Python script. #include "../../include/gen/SkinPartition.h" +#include "../../include/gen/SkinPartitionUnknownItem1.h" using namespace Niflib; //Constructor -SkinPartition::SkinPartition() : numVertices((unsigned short)0), numTriangles((unsigned short)0), numBones((unsigned short)0), numStrips((unsigned short)0), numWeightsPerVertex((unsigned short)0), hasVertexMap(false), hasVertexWeights(false), hasFaces(false), hasBoneIndices(false), unknownShort((unsigned short)0) {}; +SkinPartition::SkinPartition() : numVertices((unsigned short)0), numTriangles((unsigned short)0), numBones((unsigned short)0), numStrips((unsigned short)0), numWeightsPerVertex((unsigned short)0), hasVertexMap(false), hasVertexWeights(false), hasFaces(false), hasBoneIndices(false), unknownShort((unsigned short)0), unknown83C3((unsigned short)0), unknown00001((unsigned short)0), numVertices2((unsigned short)0), unknown00002((unsigned short)0), unknown00003((unsigned short)0), unknown00004((unsigned short)0) {}; //Copy Constructor SkinPartition::SkinPartition( const SkinPartition & src ) { @@ -35,6 +36,13 @@ SkinPartition & SkinPartition::operator=( const SkinPartition & src ) { this->hasBoneIndices = src.hasBoneIndices; this->boneIndices = src.boneIndices; this->unknownShort = src.unknownShort; + this->unknown83C3 = src.unknown83C3; + this->unknown00001 = src.unknown00001; + this->numVertices2 = src.numVertices2; + this->unknown00002 = src.unknown00002; + this->unknown00003 = src.unknown00003; + this->unknown00004 = src.unknown00004; + this->unknownArr1 = src.unknownArr1; return *this; }; diff --git a/src/gen/SkinPartitionUnknownItem1.cpp b/src/gen/SkinPartitionUnknownItem1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..984d654fe7ab5e45b5f29d2ed25bc5908fea73cc --- /dev/null +++ b/src/gen/SkinPartitionUnknownItem1.cpp @@ -0,0 +1,35 @@ +/* Copyright (c) 2006, NIF File Format Library and Tools +All rights reserved. Please see niflib.h for license. */ + +//---THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT---// + +//To change this file, alter the niftools/docsys/gen_niflib.py Python script. + +#include "../../include/gen/SkinPartitionUnknownItem1.h" +using namespace Niflib; + +//Constructor +SkinPartitionUnknownItem1::SkinPartitionUnknownItem1() : unknownFlags((unsigned int)0), f1(0.0f), f2(0.0f), f3(0.0f), f4(0.0f), f5(0.0f) {}; + +//Copy Constructor +SkinPartitionUnknownItem1::SkinPartitionUnknownItem1( const SkinPartitionUnknownItem1 & src ) { + *this = src; +}; + +//Copy Operator +SkinPartitionUnknownItem1 & SkinPartitionUnknownItem1::operator=( const SkinPartitionUnknownItem1 & src ) { + this->unknownFlags = src.unknownFlags; + this->f1 = src.f1; + this->f2 = src.f2; + this->f3 = src.f3; + this->f4 = src.f4; + this->f5 = src.f5; + return *this; +}; + +//Destructor +SkinPartitionUnknownItem1::~SkinPartitionUnknownItem1() {}; + +//--BEGIN MISC CUSTOM CODE--// + +//--END CUSTOM CODE--// diff --git a/src/gen/bhkCMSDBigTris.cpp b/src/gen/bhkCMSDBigTris.cpp index a54e887eb9f4da40fe22405a49e99649940d6348..a84435029d68f8b9bcbd2def252d7283bef303f3 100644 --- a/src/gen/bhkCMSDBigTris.cpp +++ b/src/gen/bhkCMSDBigTris.cpp @@ -9,7 +9,7 @@ All rights reserved. Please see niflib.h for license. */ using namespace Niflib; //Constructor -bhkCMSDBigTris::bhkCMSDBigTris() {}; +bhkCMSDBigTris::bhkCMSDBigTris() : triangle1((unsigned short)0), triangle2((unsigned short)0), triangle3((unsigned short)0), unknownInt1((unsigned int)0), unknownShort1((unsigned short)0) {}; //Copy Constructor bhkCMSDBigTris::bhkCMSDBigTris( const bhkCMSDBigTris & src ) { diff --git a/src/gen/bhkCMSDChunk.cpp b/src/gen/bhkCMSDChunk.cpp index 0a3ec6ad4dd7c8eab7c1ed798b362edabc64ef19..59cf27971f2de21ce7d84b7b5384d08cf227784e 100644 --- a/src/gen/bhkCMSDChunk.cpp +++ b/src/gen/bhkCMSDChunk.cpp @@ -9,7 +9,7 @@ All rights reserved. Please see niflib.h for license. */ using namespace Niflib; //Constructor -bhkCMSDChunk::bhkCMSDChunk() {}; +bhkCMSDChunk::bhkCMSDChunk() : materialIndex((unsigned int)0), unknownShort1((unsigned short)0), transformIndex((unsigned short)0), numVertices((unsigned int)0), numIndices((unsigned int)0), numStrips((unsigned int)0), numIndices2((unsigned int)0) {}; //Copy Constructor bhkCMSDChunk::bhkCMSDChunk( const bhkCMSDChunk & src ) { @@ -19,9 +19,9 @@ bhkCMSDChunk::bhkCMSDChunk( const bhkCMSDChunk & src ) { //Copy Operator bhkCMSDChunk & bhkCMSDChunk::operator=( const bhkCMSDChunk & src ) { this->translation = src.translation; - this->materialIndex = src.materialIndex; - this->unknownShort1 = src.unknownShort1; - this->transformIndex = src.transformIndex; + this->materialIndex = src.materialIndex; + this->unknownShort1 = src.unknownShort1; + this->transformIndex = src.transformIndex; this->numVertices = src.numVertices; this->vertices = src.vertices; this->numIndices = src.numIndices; diff --git a/src/gen/bhkCMSDContainer.cpp b/src/gen/bhkCMSDContainer.cpp deleted file mode 100644 index c7bef9ab3e385c5b58d965f530cb988c02a61d2d..0000000000000000000000000000000000000000 --- a/src/gen/bhkCMSDContainer.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (c) 2006, NIF File Format Library and Tools -All rights reserved. Please see niflib.h for license. */ - -//---THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT---// - -//To change this file, alter the niftools/docsys/gen_niflib.py Python script. - -#include "../../include/gen/bhkCMSDContainer.h" -#include "../../include/gen/bhkCMSD_Shape.h" -using namespace Niflib; - -//Constructor -bhkCMSDContainer::bhkCMSDContainer() : unknownInt((unsigned int)0), unknownShort1((unsigned short)0), unknownShort2((unsigned short)0) {}; - -//Copy Constructor -bhkCMSDContainer::bhkCMSDContainer( const bhkCMSDContainer & src ) { - *this = src; -}; - -//Copy Operator -bhkCMSDContainer & bhkCMSDContainer::operator=( const bhkCMSDContainer & src ) { - this->unknownFloats = src.unknownFloats; - this->unknownInt = src.unknownInt; - this->unknownShort1 = src.unknownShort1; - this->unknownShort2 = src.unknownShort2; - this->shape = src.shape; - return *this; -}; - -//Destructor -bhkCMSDContainer::~bhkCMSDContainer() {}; - -//--BEGIN MISC CUSTOM CODE--// - -//--END CUSTOM CODE--// diff --git a/src/gen/bhkCMSD_Something.cpp b/src/gen/bhkCMSDMaterial.cpp similarity index 55% rename from src/gen/bhkCMSD_Something.cpp rename to src/gen/bhkCMSDMaterial.cpp index a172832e3732aeb9bbbd4359ff859ea5cacf9985..ac5060173277b172bfd96c3afb985cd32d2663a1 100644 --- a/src/gen/bhkCMSD_Something.cpp +++ b/src/gen/bhkCMSDMaterial.cpp @@ -5,26 +5,26 @@ All rights reserved. Please see niflib.h for license. */ //To change this file, alter the niftools/docsys/gen_niflib.py Python script. -#include "../../include/gen/bhkCMSD_Something.h" +#include "../../include/gen/bhkCMSDMaterial.h" using namespace Niflib; //Constructor -bhkCMSD_Something::bhkCMSD_Something() : largeInt((unsigned int)0), unknownInteger((unsigned int)0) {}; +bhkCMSDMaterial::bhkCMSDMaterial() : material((HavokMaterial)0), unknownInteger((unsigned int)0) {}; //Copy Constructor -bhkCMSD_Something::bhkCMSD_Something( const bhkCMSD_Something & src ) { +bhkCMSDMaterial::bhkCMSDMaterial( const bhkCMSDMaterial & src ) { *this = src; }; //Copy Operator -bhkCMSD_Something & bhkCMSD_Something::operator=( const bhkCMSD_Something & src ) { - this->largeInt = src.largeInt; +bhkCMSDMaterial & bhkCMSDMaterial::operator=( const bhkCMSDMaterial & src ) { + this->material = src.material; this->unknownInteger = src.unknownInteger; return *this; }; //Destructor -bhkCMSD_Something::~bhkCMSD_Something() {}; +bhkCMSDMaterial::~bhkCMSDMaterial() {}; //--BEGIN MISC CUSTOM CODE--// diff --git a/src/gen/bhkCMSDTransform.cpp b/src/gen/bhkCMSDTransform.cpp index 0de932652c52f3a5d9b39022e8b6bdcfd0067aa1..9d0f844895268b3a7342af374564348053e3574f 100644 --- a/src/gen/bhkCMSDTransform.cpp +++ b/src/gen/bhkCMSDTransform.cpp @@ -6,6 +6,7 @@ All rights reserved. Please see niflib.h for license. */ //To change this file, alter the niftools/docsys/gen_niflib.py Python script. #include "../../include/gen/bhkCMSDTransform.h" +#include "../../include/gen/QuaternionXYZW.h" using namespace Niflib; //Constructor diff --git a/src/gen/enums.cpp b/src/gen/enums.cpp index 4cb58c9c94aaf92339c0598a25184e476de71d5a..c1ed2ce75e3011af45cdf913ba1f07c2f99d1a64 100644 --- a/src/gen/enums.cpp +++ b/src/gen/enums.cpp @@ -178,6 +178,30 @@ ostream & operator<<( ostream & out, HavokMaterial const & val ) { case HAV_MAT_SNOW_STAIRS: return out << "HAV_MAT_SNOW_STAIRS"; case HAV_MAT_ELEVATOR: return out << "HAV_MAT_ELEVATOR"; case HAV_MAT_RUBBER: return out << "HAV_MAT_RUBBER"; + case SKY_HAV_MAT_LIGHT_WOOD: return out << "SKY_HAV_MAT_LIGHT_WOOD"; + case SKY_HAV_MAT_BROKEN_STONE: return out << "SKY_HAV_MAT_BROKEN_STONE"; + case SKY_HAV_MAT_SNOW: return out << "SKY_HAV_MAT_SNOW"; + case SKY_HAV_MAT_GRAVEL: return out << "SKY_HAV_MAT_GRAVEL"; + case SKY_HAV_MAT_MATERIAL_CHAIN_METAL: return out << "SKY_HAV_MAT_MATERIAL_CHAIN_METAL"; + case SKY_HAV_MAT_WOOD: return out << "SKY_HAV_MAT_WOOD"; + case SKY_HAV_MAT_BARREL: return out << "SKY_HAV_MAT_BARREL"; + case SKY_HAV_MAT_MATERIAL_BASKET: return out << "SKY_HAV_MAT_MATERIAL_BASKET"; + case SKY_HAV_MAT_ICE: return out << "SKY_HAV_MAT_ICE"; + case SKY_HAV_MAT_STAIRSSTONE: return out << "SKY_HAV_MAT_STAIRSSTONE"; + case SKY_HAV_MAT_MATERIAL_BLADE_1HAND: return out << "SKY_HAV_MAT_MATERIAL_BLADE_1HAND"; + case SKY_HAV_MAT_MATERIALBOOK: return out << "SKY_HAV_MAT_MATERIALBOOK"; + case SKY_HAV_MAT_SOLID_METAL: return out << "SKY_HAV_MAT_SOLID_METAL"; + case SKY_HAV_MAT_MATERIAL_AXE_1HAND: return out << "SKY_HAV_MAT_MATERIAL_AXE_1HAND"; + case SKY_HAV_MAT_STAIRS_WOOD: return out << "SKY_HAV_MAT_STAIRS_WOOD"; + case SKY_HAV_MAT_MUD: return out << "SKY_HAV_MAT_MUD"; + case SKY_HAV_MAT_STAIRSSNOW: return out << "SKY_HAV_MAT_STAIRSSNOW"; + case SKY_HAV_MAT_UNKNOWN: return out << "SKY_HAV_MAT_UNKNOWN"; + case SKY_HAV_MAT_MATERIAL_BOWS_STAVES: return out << "SKY_HAV_MAT_MATERIAL_BOWS_STAVES"; + case SKY_HAV_MAT_GRASS: return out << "SKY_HAV_MAT_GRASS"; + case SKY_HAV_MAT_MATERIAL_BOULDER_LARGE: return out << "SKY_HAV_MAT_MATERIAL_BOULDER_LARGE"; + case SKY_HAV_MAT_MATERIALSTONEASSTAIRS: return out << "SKY_HAV_MAT_MATERIALSTONEASSTAIRS"; + case SKY_HAV_MAT_MATERIAL_BLADE_2HAND: return out << "SKY_HAV_MAT_MATERIAL_BLADE_2HAND"; + case SKY_HAV_MAT_MATERIAL_BOTTLE_SMALL: return out << "SKY_HAV_MAT_MATERIAL_BOTTLE_SMALL"; default: return out << "Invalid Value! - " << (unsigned int)(val); } } @@ -226,6 +250,28 @@ ostream & operator<<( ostream & out, VelocityType const & val ) { } +//--AnimationType--// + +void NifStream( AnimationType & val, istream& in, const NifInfo & info ) { + unsigned short temp; + NifStream( temp, in, info ); + val = AnimationType(temp); +} + +void NifStream( AnimationType const & val, ostream& out, const NifInfo & info ) { + NifStream( (unsigned short)(val), out, info ); +} + +ostream & operator<<( ostream & out, AnimationType const & val ) { + switch ( val ) { + case SIT: return out << "Sit"; + case SLEEP: return out << "Sleep"; + case LEAN: return out << "Lean"; + default: return out << "Invalid Value! - " << (unsigned int)(val); + } +} + + //--DataStreamUsage--// void NifStream( DataStreamUsage & val, istream& in, const NifInfo & info ) { @@ -446,6 +492,27 @@ ostream & operator<<( ostream & out, BSDismemberBodyPartType const & val ) { case BP_RIGHTLEG2: return out << "BP_RIGHTLEG2"; case BP_RIGHTLEG3: return out << "BP_RIGHTLEG3"; case BP_BRAIN: return out << "BP_BRAIN"; + case SBP_30_HEAD: return out << "SBP_30_HEAD"; + case SBP_31_HAIR: return out << "SBP_31_HAIR"; + case SBP_32_BODY: return out << "SBP_32_BODY"; + case SBP_33_HANDS: return out << "SBP_33_HANDS"; + case SBP_34_FOREARMS: return out << "SBP_34_FOREARMS"; + case SBP_35_AMULET: return out << "SBP_35_AMULET"; + case SBP_36_RING: return out << "SBP_36_RING"; + case SBP_37_FEET: return out << "SBP_37_FEET"; + case SBP_38_CALVES: return out << "SBP_38_CALVES"; + case SBP_39_SHIELD: return out << "SBP_39_SHIELD"; + case SBP_40_TAIL: return out << "SBP_40_TAIL"; + case SBP_41_LONGHAIR: return out << "SBP_41_LONGHAIR"; + case SBP_42_CIRCLET: return out << "SBP_42_CIRCLET"; + case SBP_43_EARS: return out << "SBP_43_EARS"; + case SBP_44_BLOODHEAD: return out << "SBP_44_BLOODHEAD"; + case SBP_45_BLOODWINGL: return out << "SBP_45_BLOODWINGL"; + case SBP_46_BLOODWINGR: return out << "SBP_46_BLOODWINGR"; + case SBP_47_BLOODTAIL: return out << "SBP_47_BLOODTAIL"; + case SBP_50_DECAPITATEDHEAD: return out << "SBP_50_DECAPITATEDHEAD"; + case SBP_51_DECAPITATE: return out << "SBP_51_DECAPITATE"; + case SBP_61_FX01: return out << "SBP_61_FX01"; case BP_SECTIONCAP_HEAD: return out << "BP_SECTIONCAP_HEAD"; case BP_SECTIONCAP_HEAD2: return out << "BP_SECTIONCAP_HEAD2"; case BP_SECTIONCAP_LEFTARM: return out << "BP_SECTIONCAP_LEFTARM"; @@ -459,6 +526,12 @@ ostream & operator<<( ostream & out, BSDismemberBodyPartType const & val ) { case BP_SECTIONCAP_RIGHTLEG2: return out << "BP_SECTIONCAP_RIGHTLEG2"; case BP_SECTIONCAP_RIGHTLEG3: return out << "BP_SECTIONCAP_RIGHTLEG3"; case BP_SECTIONCAP_BRAIN: return out << "BP_SECTIONCAP_BRAIN"; + case SBP_130_HEAD: return out << "SBP_130_HEAD"; + case SBP_131_HAIR: return out << "SBP_131_HAIR"; + case SBP_141_LONGHAIR: return out << "SBP_141_LONGHAIR"; + case SBP_142_CIRCLET: return out << "SBP_142_CIRCLET"; + case SBP_143_EARS: return out << "SBP_143_EARS"; + case SBP_150_DECAPITATEDHEAD: return out << "SBP_150_DECAPITATEDHEAD"; case BP_TORSOCAP_HEAD: return out << "BP_TORSOCAP_HEAD"; case BP_TORSOCAP_HEAD2: return out << "BP_TORSOCAP_HEAD2"; case BP_TORSOCAP_LEFTARM: return out << "BP_TORSOCAP_LEFTARM"; @@ -472,6 +545,7 @@ ostream & operator<<( ostream & out, BSDismemberBodyPartType const & val ) { case BP_TORSOCAP_RIGHTLEG2: return out << "BP_TORSOCAP_RIGHTLEG2"; case BP_TORSOCAP_RIGHTLEG3: return out << "BP_TORSOCAP_RIGHTLEG3"; case BP_TORSOCAP_BRAIN: return out << "BP_TORSOCAP_BRAIN"; + case SBP_230_HEAD: return out << "SBP_230_HEAD"; case BP_TORSOSECTION_HEAD: return out << "BP_TORSOSECTION_HEAD"; case BP_TORSOSECTION_HEAD2: return out << "BP_TORSOSECTION_HEAD2"; case BP_TORSOSECTION_LEFTARM: return out << "BP_TORSOSECTION_LEFTARM"; @@ -516,6 +590,31 @@ ostream & operator<<( ostream & out, ChannelType const & val ) { } +//--SkyObjectType--// + +void NifStream( SkyObjectType & val, istream& in, const NifInfo & info ) { + unsigned int temp; + NifStream( temp, in, info ); + val = SkyObjectType(temp); +} + +void NifStream( SkyObjectType const & val, ostream& out, const NifInfo & info ) { + NifStream( (unsigned int)(val), out, info ); +} + +ostream & operator<<( ostream & out, SkyObjectType const & val ) { + switch ( val ) { + case BSSM_SKY_TEXTURE: return out << "BSSM_SKY_TEXTURE"; + case BSSM_SKY_SUNGLARE: return out << "BSSM_SKY_SUNGLARE"; + case BSSM_SKY: return out << "BSSM_SKY"; + case BSSM_SKY_CLOUDS: return out << "BSSM_SKY_CLOUDS"; + case BSSM_SKY_STARS: return out << "BSSM_SKY_STARS"; + case BSSM_SKY_MOON_STARS_MASK: return out << "BSSM_SKY_MOON_STARS_MASK"; + default: return out << "Invalid Value! - " << (unsigned int)(val); + } +} + + //--OblivionLayer--// void NifStream( OblivionLayer & val, istream& in, const NifInfo & info ) { @@ -1081,6 +1180,26 @@ ostream & operator<<( ostream & out, ImageType const & val ) { } +//--BSSegmentFlags--// + +void NifStream( BSSegmentFlags & val, istream& in, const NifInfo & info ) { + unsigned int temp; + NifStream( temp, in, info ); + val = BSSegmentFlags(temp); +} + +void NifStream( BSSegmentFlags const & val, ostream& out, const NifInfo & info ) { + NifStream( (unsigned int)(val), out, info ); +} + +ostream & operator<<( ostream & out, BSSegmentFlags const & val ) { + switch ( val ) { + case BSSEG_WATER: return out << "BSSEG_WATER"; + default: return out << "Invalid Value! - " << (unsigned int)(val); + } +} + + //--PixelLayout--// void NifStream( PixelLayout & val, istream& in, const NifInfo & info ) { @@ -1376,6 +1495,45 @@ ostream & operator<<( ostream & out, FieldType const & val ) { } +//--BSLightingShaderPropertyShaderType--// + +void NifStream( BSLightingShaderPropertyShaderType & val, istream& in, const NifInfo & info ) { + unsigned int temp; + NifStream( temp, in, info ); + val = BSLightingShaderPropertyShaderType(temp); +} + +void NifStream( BSLightingShaderPropertyShaderType const & val, ostream& out, const NifInfo & info ) { + NifStream( (unsigned int)(val), out, info ); +} + +ostream & operator<<( ostream & out, BSLightingShaderPropertyShaderType const & val ) { + switch ( val ) { + case DEFAULT: return out << "Default"; + case ENVIRONMENT_MAP: return out << "Environment Map"; + case GLOW_SHADER: return out << "Glow Shader"; + case HEIGHTMAP: return out << "Heightmap"; + case FACE_TINT: return out << "Face Tint"; + case SKIN_TINT: return out << "Skin Tint"; + case HAIR_TINT: return out << "Hair Tint"; + case PARALLAX_OCC_MATERIAL: return out << "Parallax Occ Material"; + case WORLD_MULTITEXTURE: return out << "World Multitexture"; + case WORLDMAP1: return out << "WorldMap1"; + case UNKNOWN_10: return out << "Unknown 10"; + case MULTILAYER_PARALLAX: return out << "MultiLayer Parallax"; + case UNKNOWN_12: return out << "Unknown 12"; + case WORLDMAP2: return out << "WorldMap2"; + case SPARKLE_SNOW: return out << "Sparkle Snow"; + case WORLDMAP3: return out << "WorldMap3"; + case EYE_ENVMAP: return out << "Eye Envmap"; + case UNKNOWN_17: return out << "Unknown 17"; + case WORLDMAP4: return out << "WorldMap4"; + case WORLD_LOD_MULTITEXTURE: return out << "World LOD Multitexture"; + default: return out << "Invalid Value! - " << (unsigned int)(val); + } +} + + //--DecayType--// void NifStream( DecayType & val, istream& in, const NifInfo & info ) { @@ -1422,6 +1580,84 @@ ostream & operator<<( ostream & out, EmitFrom const & val ) { } +//--SkyrimWaterShaderFlags--// + +void NifStream( SkyrimWaterShaderFlags & val, istream& in, const NifInfo & info ) { + byte temp; + NifStream( temp, in, info ); + val = SkyrimWaterShaderFlags(temp); +} + +void NifStream( SkyrimWaterShaderFlags const & val, ostream& out, const NifInfo & info ) { + NifStream( (byte)(val), out, info ); +} + +ostream & operator<<( ostream & out, SkyrimWaterShaderFlags const & val ) { + switch ( val ) { + case SWSF1_UNKNOWN0: return out << "SWSF1_UNKNOWN0"; + case SWSF1_BYPASS_REFRACTION_MAP: return out << "SWSF1_Bypass_Refraction_Map"; + case SWSF1_WATER_TOGGLE: return out << "SWSF1_Water_Toggle"; + case SWSF1_UNKNOWN3: return out << "SWSF1_UNKNOWN3"; + case SWSF1_UNKNOWN4: return out << "SWSF1_UNKNOWN4"; + case SWSF1_UNKNOWN5: return out << "SWSF1_UNKNOWN5"; + case SWSF1_HIGHLIGHT_LAYER_TOGGLE: return out << "SWSF1_Highlight_Layer_Toggle"; + case SWSF1_ENABLED: return out << "SWSF1_Enabled"; + default: return out << "Invalid Value! - " << (unsigned int)(val); + } +} + + +//--SkyrimShaderPropertyFlags1--// + +void NifStream( SkyrimShaderPropertyFlags1 & val, istream& in, const NifInfo & info ) { + unsigned int temp; + NifStream( temp, in, info ); + val = SkyrimShaderPropertyFlags1(temp); +} + +void NifStream( SkyrimShaderPropertyFlags1 const & val, ostream& out, const NifInfo & info ) { + NifStream( (unsigned int)(val), out, info ); +} + +ostream & operator<<( ostream & out, SkyrimShaderPropertyFlags1 const & val ) { + switch ( val ) { + case SLSF1_SPECULAR: return out << "SLSF1_Specular"; + case SLSF1_SKINNED: return out << "SLSF1_Skinned"; + case SLSF1_TEMP_REFRACTION: return out << "SLSF1_Temp_Refraction"; + case SLSF1_VERTEX_ALPHA: return out << "SLSF1_Vertex_Alpha"; + case SLSF1_GREYSCALE_TO_PALETTECOLOR: return out << "SLSF1_Greyscale_To_PaletteColor"; + case SLSF1_GREYSCALE_TO_PALETTEALPHA: return out << "SLSF1_Greyscale_To_PaletteAlpha"; + case SLSF1_USE_FALLOFF: return out << "SLSF1_Use_Falloff"; + case SLSF1_ENVIRONMENT_MAPPING: return out << "SLSF1_Environment_Mapping"; + case SLSF1_RECIEVE_SHADOWS: return out << "SLSF1_Recieve_Shadows"; + case SLSF1_CAST_SHADOWS: return out << "SLSF1_Cast_Shadows"; + case SLSF1_FACEGEN_DETAIL_MAP: return out << "SLSF1_Facegen_Detail_Map"; + case SLSF1_PARALLAX: return out << "SLSF1_Parallax"; + case SLSF1_MODEL_SPACE_NORMALS: return out << "SLSF1_Model_Space_Normals"; + case SLSF1_NON_PROJECTIVE_SHADOWS: return out << "SLSF1_Non_Projective_Shadows"; + case SLSF1_LANDSCAPE: return out << "SLSF1_Landscape"; + case SLSF1_REFRACTION: return out << "SLSF1_Refraction"; + case SLSF1_FIRE_REFRACTION: return out << "SLSF1_Fire_Refraction"; + case SLSF1_EYE_ENVIRONMENT_MAPPING: return out << "SLSF1_Eye_Environment_Mapping"; + case SLSF1_HAIR_SOFT_LIGHTING: return out << "SLSF1_Hair_Soft_Lighting"; + case SLSF1_SCREENDOOR_ALPHA_FADE: return out << "SLSF1_Screendoor_Alpha_Fade"; + case SLSF1_LOCALMAP_HIDE_SECRET: return out << "SLSF1_Localmap_Hide_Secret"; + case SLSF1_FACEGEN_RGB_TINT: return out << "SLSF1_FaceGen_RGB_Tint"; + case SLSF1_OWN_EMIT: return out << "SLSF1_Own_Emit"; + case SLSF1_PROJECTED_UV: return out << "SLSF1_Projected_UV"; + case SLSF1_MULTIPLE_TEXTURES: return out << "SLSF1_Multiple_Textures"; + case SLSF1_REMAPPABLE_TEXTURES: return out << "SLSF1_Remappable_Textures"; + case SLSF1_DECAL: return out << "SLSF1_Decal"; + case SLSF1_DYNAMIC_DECAL: return out << "SLSF1_Dynamic_Decal"; + case SLSF1_PARALLAX_OCCLUSION: return out << "SLSF1_Parallax_Occlusion"; + case SLSF1_EXTERNAL_EMITTANCE: return out << "SLSF1_External_Emittance"; + case SLSF1_SOFT_EFFECT: return out << "SLSF1_Soft_Effect"; + case SLSF1_ZBUFFER_TEST: return out << "SLSF1_ZBuffer_Test"; + default: return out << "Invalid Value! - " << (unsigned int)(val); + } +} + + //--BSShaderFlags--// void NifStream( BSShaderFlags & val, istream& in, const NifInfo & info ) { @@ -1447,9 +1683,9 @@ ostream & operator<<( ostream & out, BSShaderFlags const & val ) { case SF_ALPHA_TEXTURE: return out << "SF_Alpha_Texture"; case SF_UNKNOWN_2: return out << "SF_Unknown_2"; case SF_FACEGEN: return out << "SF_FaceGen"; - case SF_PARALLAX_SHADER_INDEX_15: return out << "SF_Parallax/Shader_Index=15"; + case SF_PARALLAX_SHADER_INDEX_15: return out << "SF_Parallax_Shader_Index_15"; case SF_UNKNOWN_3: return out << "SF_Unknown_3"; - case SF_NON_PROJECTIVE_SHADOWS: return out << "SF_Non-Projective_Shadows"; + case SF_NON_PROJECTIVE_SHADOWS: return out << "SF_Non_Projective_Shadows"; case SF_UNKNOWN_4: return out << "SF_Unknown_4"; case SF_REFRACTION: return out << "SF_Refraction"; case SF_FIRE_REFRACTION: return out << "SF_Fire_Refraction"; @@ -1462,8 +1698,8 @@ ostream & operator<<( ostream & out, BSShaderFlags const & val ) { case SF_SHADOW_FRUSTUM: return out << "SF_Shadow_Frustum"; case SF_MULTIPLE_TEXTURES: return out << "SF_Multiple_Textures"; case SF_REMAPPABLE_TEXTURES: return out << "SF_Remappable_Textures"; - case SF_DECAL_SINGLE_PASS: return out << "SF_Decal/Single_Pass"; - case SF_DYNAMIC_DECAL_SINGLE_PASS: return out << "SF_Dynamic_Decal/Single_Pass"; + case SF_DECAL_SINGLE_PASS: return out << "SF_Decal_Single_Pass"; + case SF_DYNAMIC_DECAL_SINGLE_PASS: return out << "SF_Dynamic_Decal_Single_Pass"; case SF_PARALLAX_OCCULSION: return out << "SF_Parallax_Occulsion"; case SF_EXTERNAL_EMITTANCE: return out << "SF_External_Emittance"; case SF_SHADOW_MAP: return out << "SF_Shadow_Map"; @@ -1473,124 +1709,46 @@ ostream & operator<<( ostream & out, BSShaderFlags const & val ) { } -//--BSPartFlag--// +//--FurnitureEntryPoints--// -void NifStream( BSPartFlag & val, istream& in, const NifInfo & info ) { +void NifStream( FurnitureEntryPoints & val, istream& in, const NifInfo & info ) { unsigned short temp; NifStream( temp, in, info ); - val = BSPartFlag(temp); + val = FurnitureEntryPoints(temp); } -void NifStream( BSPartFlag const & val, ostream& out, const NifInfo & info ) { +void NifStream( FurnitureEntryPoints const & val, ostream& out, const NifInfo & info ) { NifStream( (unsigned short)(val), out, info ); } -ostream & operator<<( ostream & out, BSPartFlag const & val ) { - switch ( val ) { - case PF_EDITOR_VISIBLE: return out << "PF_EDITOR_VISIBLE"; - case PF_START_NET_BONESET: return out << "PF_START_NET_BONESET"; - default: return out << "Invalid Value! - " << (unsigned int)(val); - } -} - - -//--SkyrimLightingShaderFlags2--// - -void NifStream( SkyrimLightingShaderFlags2 & val, istream& in, const NifInfo & info ) { - unsigned int temp; - NifStream( temp, in, info ); - val = SkyrimLightingShaderFlags2(temp); -} - -void NifStream( SkyrimLightingShaderFlags2 const & val, ostream& out, const NifInfo & info ) { - NifStream( (unsigned int)(val), out, info ); -} - -ostream & operator<<( ostream & out, SkyrimLightingShaderFlags2 const & val ) { +ostream & operator<<( ostream & out, FurnitureEntryPoints const & val ) { switch ( val ) { - case SLSF2_ZBUFFER_WRITE: return out << "SLSF2_ZBuffer_Write"; - case SLSF2_1: return out << "SLSF2_1"; - case SLSF2_2: return out << "SLSF2_2"; - case SLSF2_3: return out << "SLSF2_3"; - case SLSF2_DOUBLE_SIDED: return out << "SLSF2_Double_Sided"; - case SLSF2_VERTEX_COLOR: return out << "SLSF2_Vertex_Color"; - case SLSF2_GLOW_MAP: return out << "SLSF2_Glow_Map"; - case SLSF2_7: return out << "SLSF2_7"; - case SLSF2_8: return out << "SLSF2_8"; - case SLSF2_9: return out << "SLSF2_9"; - case SLSF2_10: return out << "SLSF2_10"; - case SLSF2_11: return out << "SLSF2_11"; - case SLSF2_12: return out << "SLSF2_12"; - case SLSF2_13: return out << "SLSF2_13"; - case SLSF2_14: return out << "SLSF2_14"; - case SLSF2_15: return out << "SLSF2_15"; - case SLSF2_16: return out << "SLSF2_16"; - case SLSF2_17: return out << "SLSF2_17"; - case SLSF2_18: return out << "SLSF2_18"; - case SLSF2_19: return out << "SLSF2_19"; - case SLSF2_20: return out << "SLSF2_20"; - case SLSF2_21: return out << "SLSF2_21"; - case SLSF2_22: return out << "SLSF2_22"; - case SLSF2_23: return out << "SLSF2_23"; - case SLSF2_MULTI_LAYER: return out << "SLSF2_Multi_Layer"; - case SLSF2_SOFT_LIGHT: return out << "SLSF2_Soft_Light"; - case SLSF2_RIM_LIGHT: return out << "SLSF2_Rim_Light"; - case SLSF2_BACK_LIGHT: return out << "SLSF2_Back_Light"; - case SLSF2_28: return out << "SLSF2_28"; - case SLSF2_VERTEX_ANIMATION: return out << "SLSF2_Vertex_Animation"; - case SLSF2_30: return out << "SLSF2_30"; - case SLSF2_31: return out << "SLSF2_31"; + case FRONT: return out << "Front"; + case BEHIND: return out << "Behind"; + case RIGHT: return out << "Right"; + case LEFT: return out << "Left"; + case UP: return out << "Up"; default: return out << "Invalid Value! - " << (unsigned int)(val); } } -//--SkyrimLightingShaderFlags1--// +//--BSPartFlag--// -void NifStream( SkyrimLightingShaderFlags1 & val, istream& in, const NifInfo & info ) { - unsigned int temp; +void NifStream( BSPartFlag & val, istream& in, const NifInfo & info ) { + unsigned short temp; NifStream( temp, in, info ); - val = SkyrimLightingShaderFlags1(temp); + val = BSPartFlag(temp); } -void NifStream( SkyrimLightingShaderFlags1 const & val, ostream& out, const NifInfo & info ) { - NifStream( (unsigned int)(val), out, info ); +void NifStream( BSPartFlag const & val, ostream& out, const NifInfo & info ) { + NifStream( (unsigned short)(val), out, info ); } -ostream & operator<<( ostream & out, SkyrimLightingShaderFlags1 const & val ) { +ostream & operator<<( ostream & out, BSPartFlag const & val ) { switch ( val ) { - case SLSF1_SPECULAR: return out << "SLSF1_Specular"; - case SLSF1_SKINNED: return out << "SLSF1_Skinned"; - case SLSF1_2: return out << "SLSF1_2"; - case SLSF1_3: return out << "SLSF1_3"; - case SLSF1_4: return out << "SLSF1_4"; - case SLSF1_5: return out << "SLSF1_5"; - case SLSF1_6: return out << "SLSF1_6"; - case SLSF1_ENVIRONMENT_MAPPING: return out << "SLSF1_Environment_Mapping"; - case SLSF1_8: return out << "SLSF1_8"; - case SLSF1_CAST_SHADOWS: return out << "SLSF1_Cast_Shadows"; - case SLSF1_10: return out << "SLSF1_10"; - case SLSF1_11: return out << "SLSF1_11"; - case SLSF1_SPECULAR_MAP: return out << "SLSF1_Specular_Map"; - case SLSF1_13: return out << "SLSF1_13"; - case SLSF1_14: return out << "SLSF1_14"; - case SLSF1_15: return out << "SLSF1_15"; - case SLSF1_16: return out << "SLSF1_16"; - case SLSF1_EYE_ENVIRONMENT_MAPPING: return out << "SLSF1_Eye_Environment_Mapping"; - case SLSF1_18: return out << "SLSF1_18"; - case SLSF1_19: return out << "SLSF1_19"; - case SLSF1_20: return out << "SLSF1_20"; - case SLSF1_21: return out << "SLSF1_21"; - case SLSF1_22: return out << "SLSF1_22"; - case SLSF1_23: return out << "SLSF1_23"; - case SLSF1_24: return out << "SLSF1_24"; - case SLSF1_25: return out << "SLSF1_25"; - case SLSF1_26: return out << "SLSF1_26"; - case SLSF1_27: return out << "SLSF1_27"; - case SLSF1_28: return out << "SLSF1_28"; - case SLSF1_29: return out << "SLSF1_29"; - case SLSF1_30: return out << "SLSF1_30"; - case SLSF1_ZBUFFER_TEST: return out << "SLSF1_ZBuffer_Test"; + case PF_EDITOR_VISIBLE: return out << "PF_EDITOR_VISIBLE"; + case PF_START_NET_BONESET: return out << "PF_START_NET_BONESET"; default: return out << "Invalid Value! - " << (unsigned int)(val); } } @@ -1622,55 +1780,52 @@ ostream & operator<<( ostream & out, DataStreamAccess const & val ) { } -//--SkyrimEffectShaderFlags2--// - -void NifStream( SkyrimEffectShaderFlags2 & val, istream& in, const NifInfo & info ) { - unsigned int temp; - NifStream( temp, in, info ); - val = SkyrimEffectShaderFlags2(temp); -} - -void NifStream( SkyrimEffectShaderFlags2 const & val, ostream& out, const NifInfo & info ) { - NifStream( (unsigned int)(val), out, info ); -} - -ostream & operator<<( ostream & out, SkyrimEffectShaderFlags2 const & val ) { - switch ( val ) { - case SESF2_TEXTURE_TRANSFORM_U: return out << "SESF2_Texture_Transform_U"; - case SESF2_TEXTURE_TRANSFORM_V: return out << "SESF2_Texture_Transform_V"; - case SESF2_2: return out << "SESF2_2"; - case SESF2_3: return out << "SESF2_3"; - case SESF2_4: return out << "SESF2_4"; - case SESF2_5: return out << "SESF2_5"; - case SESF2_6: return out << "SESF2_6"; - case SESF2_7: return out << "SESF2_7"; - default: return out << "Invalid Value! - " << (unsigned int)(val); - } -} - - -//--SkyrimEffectShaderFlags1--// +//--SkyrimShaderPropertyFlags2--// -void NifStream( SkyrimEffectShaderFlags1 & val, istream& in, const NifInfo & info ) { +void NifStream( SkyrimShaderPropertyFlags2 & val, istream& in, const NifInfo & info ) { unsigned int temp; NifStream( temp, in, info ); - val = SkyrimEffectShaderFlags1(temp); + val = SkyrimShaderPropertyFlags2(temp); } -void NifStream( SkyrimEffectShaderFlags1 const & val, ostream& out, const NifInfo & info ) { +void NifStream( SkyrimShaderPropertyFlags2 const & val, ostream& out, const NifInfo & info ) { NifStream( (unsigned int)(val), out, info ); } -ostream & operator<<( ostream & out, SkyrimEffectShaderFlags1 const & val ) { +ostream & operator<<( ostream & out, SkyrimShaderPropertyFlags2 const & val ) { switch ( val ) { - case SESF1_0: return out << "SESF1_0"; - case SESF1_1: return out << "SESF1_1"; - case SESF1_2: return out << "SESF1_2"; - case SESF1_3: return out << "SESF1_3"; - case SESF1_DOUBLE_SIDED: return out << "SESF1_Double_Sided"; - case SESF1_5: return out << "SESF1_5"; - case SESF1_6: return out << "SESF1_6"; - case SESF1_7: return out << "SESF1_7"; + case SLSF2_ZBUFFER_WRITE: return out << "SLSF2_ZBuffer_Write"; + case SLSF2_LOD_LANDSCAPE: return out << "SLSF2_LOD_Landscape"; + case SLSF2_LOD_OBJECTS: return out << "SLSF2_LOD_Objects"; + case SLSF2_NO_FADE: return out << "SLSF2_No_Fade"; + case SLSF2_DOUBLE_SIDED: return out << "SLSF2_Double_Sided"; + case SLSF2_VERTEX_COLORS: return out << "SLSF2_Vertex_Colors"; + case SLSF2_GLOW_MAP: return out << "SLSF2_Glow_Map"; + case SLSF2_ASSUME_SHADOWMASK: return out << "SLSF2_Assume_Shadowmask"; + case SLSF2_PACKED_TANGENT: return out << "SLSF2_Packed_Tangent"; + case SLSF2_MULTI_INDEX_SNOW: return out << "SLSF2_Multi_Index_Snow"; + case SLSF2_VERTEX_LIGHTING: return out << "SLSF2_Vertex_Lighting"; + case SLSF2_UNIFORM_SCALE: return out << "SLSF2_Uniform_Scale"; + case SLSF2_FIT_SLOPE: return out << "SLSF2_Fit_Slope"; + case SLSF2_BILLBOARD: return out << "SLSF2_Billboard"; + case SLSF2_NO_LOD_LAND_BLEND: return out << "SLSF2_No_LOD_Land_Blend"; + case SLSF2_ENVMAP_LIGHT_FADE: return out << "SLSF2_EnvMap_Light_Fade"; + case SLSF2_WIREFRAME: return out << "SLSF2_Wireframe"; + case SLSF2_WEAPON_BLOOD: return out << "SLSF2_Weapon_Blood"; + case SLSF2_HIDE_ON_LOCAL_MAP: return out << "SLSF2_Hide_On_Local_Map"; + case SLSF2_PREMULT_ALPHA: return out << "SLSF2_Premult_Alpha"; + case SLSF2_CLOUD_LOD: return out << "SLSF2_Cloud_LOD"; + case SLSF2_ANISOTROPIC_LIGHTING: return out << "SLSF2_Anisotropic_Lighting"; + case SLSF2_NO_TRANSPARENCY_MULTISAMPLING: return out << "SLSF2_No_Transparency_Multisampling"; + case SLSF2_UNUSED01: return out << "SLSF2_Unused01"; + case SLSF2_MULTI_LAYER_PARALLAX: return out << "SLSF2_Multi_Layer_Parallax"; + case SLSF2_SOFT_LIGHTING: return out << "SLSF2_Soft_Lighting"; + case SLSF2_RIM_LIGHTING: return out << "SLSF2_Rim_Lighting"; + case SLSF2_BACK_LIGHTING: return out << "SLSF2_Back_Lighting"; + case SLSF2_UNUSED02: return out << "SLSF2_Unused02"; + case SLSF2_TREE_ANIM: return out << "SLSF2_Tree_Anim"; + case SLSF2_EFFECT_LIGHTING: return out << "SLSF2_Effect_Lighting"; + case SLSF2_HD_LOD_OBJECTS: return out << "SLSF2_HD_LOD_Objects"; default: return out << "Invalid Value! - " << (unsigned int)(val); } } diff --git a/src/gen/register.cpp b/src/gen/register.cpp index 8274db43144a1fc222b6bf69f3dfe7684942bdf9..9afe802050621f6d49970f65c7b05fb975ef25a9 100644 --- a/src/gen/register.cpp +++ b/src/gen/register.cpp @@ -330,10 +330,11 @@ All rights reserved. Please see niflib.h for license. */ #include "../../include/obj/BSShaderLightingProperty.h" #include "../../include/obj/BSShaderNoLightingProperty.h" #include "../../include/obj/BSShaderPPLightingProperty.h" -#include "../../include/obj/BSEffectShaderProperty.h" #include "../../include/obj/BSEffectShaderPropertyFloatController.h" +#include "../../include/obj/BSEffectShaderPropertyColorController.h" #include "../../include/obj/BSLightingShaderPropertyFloatController.h" #include "../../include/obj/BSLightingShaderPropertyColorController.h" +#include "../../include/obj/BSNiAlphaPropertyTestRefController.h" #include "../../include/obj/BSProceduralLightningController.h" #include "../../include/obj/BSShaderTextureSet.h" #include "../../include/obj/WaterShaderProperty.h" @@ -346,6 +347,9 @@ All rights reserved. Please see niflib.h for license. */ #include "../../include/obj/HairShaderProperty.h" #include "../../include/obj/Lighting30ShaderProperty.h" #include "../../include/obj/BSLightingShaderProperty.h" +#include "../../include/obj/BSEffectShaderProperty.h" +#include "../../include/obj/BSWaterShaderProperty.h" +#include "../../include/obj/BSSkyShaderProperty.h" #include "../../include/obj/BSDismemberSkinInstance.h" #include "../../include/obj/BSDecalPlacementVectorExtraData.h" #include "../../include/obj/BSPSysSimpleColorModifier.h" @@ -439,13 +443,9 @@ All rights reserved. Please see niflib.h for license. */ #include "../../include/obj/BSBehaviorGraphExtraData.h" #include "../../include/obj/BSLagBoneController.h" #include "../../include/obj/BSLODTriShape.h" -#include "../../include/obj/BSNiAlphaPropertyTestRefController.h" -#include "../../include/obj/BSEffectShaderPropertyColorController.h" #include "../../include/obj/BSFurnitureMarkerNode.h" #include "../../include/obj/BSLeafAnimNode.h" #include "../../include/obj/BSTreeNode.h" -#include "../../include/obj/BSSkyShaderProperty.h" -#include "../../include/obj/BSWaterShaderProperty.h" namespace Niflib { void RegisterObjects() { @@ -774,10 +774,11 @@ namespace Niflib { ObjectRegistry::RegisterObject( "BSShaderLightingProperty", BSShaderLightingProperty::Create ); ObjectRegistry::RegisterObject( "BSShaderNoLightingProperty", BSShaderNoLightingProperty::Create ); ObjectRegistry::RegisterObject( "BSShaderPPLightingProperty", BSShaderPPLightingProperty::Create ); - ObjectRegistry::RegisterObject( "BSEffectShaderProperty", BSEffectShaderProperty::Create ); ObjectRegistry::RegisterObject( "BSEffectShaderPropertyFloatController", BSEffectShaderPropertyFloatController::Create ); + ObjectRegistry::RegisterObject( "BSEffectShaderPropertyColorController", BSEffectShaderPropertyColorController::Create ); ObjectRegistry::RegisterObject( "BSLightingShaderPropertyFloatController", BSLightingShaderPropertyFloatController::Create ); ObjectRegistry::RegisterObject( "BSLightingShaderPropertyColorController", BSLightingShaderPropertyColorController::Create ); + ObjectRegistry::RegisterObject( "BSNiAlphaPropertyTestRefController", BSNiAlphaPropertyTestRefController::Create ); ObjectRegistry::RegisterObject( "BSProceduralLightningController", BSProceduralLightningController::Create ); ObjectRegistry::RegisterObject( "BSShaderTextureSet", BSShaderTextureSet::Create ); ObjectRegistry::RegisterObject( "WaterShaderProperty", WaterShaderProperty::Create ); @@ -790,6 +791,9 @@ namespace Niflib { ObjectRegistry::RegisterObject( "HairShaderProperty", HairShaderProperty::Create ); ObjectRegistry::RegisterObject( "Lighting30ShaderProperty", Lighting30ShaderProperty::Create ); ObjectRegistry::RegisterObject( "BSLightingShaderProperty", BSLightingShaderProperty::Create ); + ObjectRegistry::RegisterObject( "BSEffectShaderProperty", BSEffectShaderProperty::Create ); + ObjectRegistry::RegisterObject( "BSWaterShaderProperty", BSWaterShaderProperty::Create ); + ObjectRegistry::RegisterObject( "BSSkyShaderProperty", BSSkyShaderProperty::Create ); ObjectRegistry::RegisterObject( "BSDismemberSkinInstance", BSDismemberSkinInstance::Create ); ObjectRegistry::RegisterObject( "BSDecalPlacementVectorExtraData", BSDecalPlacementVectorExtraData::Create ); ObjectRegistry::RegisterObject( "BSPSysSimpleColorModifier", BSPSysSimpleColorModifier::Create ); @@ -883,13 +887,9 @@ namespace Niflib { ObjectRegistry::RegisterObject( "BSBehaviorGraphExtraData", BSBehaviorGraphExtraData::Create ); ObjectRegistry::RegisterObject( "BSLagBoneController", BSLagBoneController::Create ); ObjectRegistry::RegisterObject( "BSLODTriShape", BSLODTriShape::Create ); - ObjectRegistry::RegisterObject( "BSNiAlphaPropertyTestRefController", BSNiAlphaPropertyTestRefController::Create ); - ObjectRegistry::RegisterObject( "BSEffectShaderPropertyColorController", BSEffectShaderPropertyColorController::Create ); ObjectRegistry::RegisterObject( "BSFurnitureMarkerNode", BSFurnitureMarkerNode::Create ); ObjectRegistry::RegisterObject( "BSLeafAnimNode", BSLeafAnimNode::Create ); ObjectRegistry::RegisterObject( "BSTreeNode", BSTreeNode::Create ); - ObjectRegistry::RegisterObject( "BSSkyShaderProperty", BSSkyShaderProperty::Create ); - ObjectRegistry::RegisterObject( "BSWaterShaderProperty", BSWaterShaderProperty::Create ); } } diff --git a/src/obj/BSBehaviorGraphExtraData.cpp b/src/obj/BSBehaviorGraphExtraData.cpp index 3b6baa33fb015f4fc447b856c31282435798a23f..64271f95d3516274d8349c689177c519c8c1474e 100644 --- a/src/obj/BSBehaviorGraphExtraData.cpp +++ b/src/obj/BSBehaviorGraphExtraData.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type BSBehaviorGraphExtraData::TYPE("BSBehaviorGraphExtraData", &NiExtraData::TYPE ); -BSBehaviorGraphExtraData::BSBehaviorGraphExtraData() : unknownByte1((byte)0) { +BSBehaviorGraphExtraData::BSBehaviorGraphExtraData() : controlsBaseSkeleton((byte)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -47,7 +47,7 @@ void BSBehaviorGraphExtraData::Read( istream& in, list<unsigned int> & link_stac NiExtraData::Read( in, link_stack, info ); NifStream( behaviourGraphFile, in, info ); - NifStream( unknownByte1, in, info ); + NifStream( controlsBaseSkeleton, in, info ); //--BEGIN POST-READ CUSTOM CODE--// @@ -61,7 +61,7 @@ void BSBehaviorGraphExtraData::Write( ostream& out, const map<NiObjectRef,unsign NiExtraData::Write( out, link_map, missing_link_stack, info ); NifStream( behaviourGraphFile, out, info ); - NifStream( unknownByte1, out, info ); + NifStream( controlsBaseSkeleton, out, info ); //--BEGIN POST-WRITE CUSTOM CODE--// @@ -76,7 +76,7 @@ std::string BSBehaviorGraphExtraData::asString( bool verbose ) const { stringstream out; out << NiExtraData::asString(); out << " Behaviour Graph File: " << behaviourGraphFile << endl; - out << " Unknown Byte 1: " << unknownByte1 << endl; + out << " Controls Base Skeleton: " << controlsBaseSkeleton << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/BSBoneLODExtraData.cpp b/src/obj/BSBoneLODExtraData.cpp index 5e57b024797cf6b340e20343091f2a896f61b10e..240b7faa4316dbc1f11bcce5f7bc239124d13ce6 100644 --- a/src/obj/BSBoneLODExtraData.cpp +++ b/src/obj/BSBoneLODExtraData.cpp @@ -15,12 +15,13 @@ All rights reserved. Please see niflib.h for license. */ #include "../../include/ObjectRegistry.h" #include "../../include/NIF_IO.h" #include "../../include/obj/BSBoneLODExtraData.h" +#include "../../include/gen/BoneLOD.h" using namespace Niflib; //Definition of TYPE constant const Type BSBoneLODExtraData::TYPE("BSBoneLODExtraData", &NiExtraData::TYPE ); -BSBoneLODExtraData::BSBoneLODExtraData() : unknownInt1((unsigned int)0) { +BSBoneLODExtraData::BSBoneLODExtraData() : bonelodCount((unsigned int)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -46,16 +47,11 @@ void BSBoneLODExtraData::Read( istream& in, list<unsigned int> & link_stack, con //--END CUSTOM CODE--// NiExtraData::Read( in, link_stack, info ); - NifStream( unknownInt1, in, info ); - if ( (info.userVersion >= 12) ) { - unknownIntA1.resize(unknownInt1); - for (unsigned int i2 = 0; i2 < unknownIntA1.size(); i2++) { - NifStream( unknownIntA1[i2], in, info ); - }; - unknownIntA2.resize(unknownInt1); - for (unsigned int i2 = 0; i2 < unknownIntA2.size(); i2++) { - NifStream( unknownIntA2[i2], in, info ); - }; + NifStream( bonelodCount, in, info ); + bonelodInfo.resize(bonelodCount); + for (unsigned int i1 = 0; i1 < bonelodInfo.size(); i1++) { + NifStream( bonelodInfo[i1].distance, in, info ); + NifStream( bonelodInfo[i1].boneName, in, info ); }; //--BEGIN POST-READ CUSTOM CODE--// @@ -69,15 +65,11 @@ void BSBoneLODExtraData::Write( ostream& out, const map<NiObjectRef,unsigned int //--END CUSTOM CODE--// NiExtraData::Write( out, link_map, missing_link_stack, info ); - unknownInt1 = (unsigned int)(unknownIntA1.size()); - NifStream( unknownInt1, out, info ); - if ( (info.userVersion >= 12) ) { - for (unsigned int i2 = 0; i2 < unknownIntA1.size(); i2++) { - NifStream( unknownIntA1[i2], out, info ); - }; - for (unsigned int i2 = 0; i2 < unknownIntA2.size(); i2++) { - NifStream( unknownIntA2[i2], out, info ); - }; + bonelodCount = (unsigned int)(bonelodInfo.size()); + NifStream( bonelodCount, out, info ); + for (unsigned int i1 = 0; i1 < bonelodInfo.size(); i1++) { + NifStream( bonelodInfo[i1].distance, out, info ); + NifStream( bonelodInfo[i1].boneName, out, info ); }; //--BEGIN POST-WRITE CUSTOM CODE--// @@ -93,31 +85,16 @@ std::string BSBoneLODExtraData::asString( bool verbose ) const { stringstream out; unsigned int array_output_count = 0; out << NiExtraData::asString(); - unknownInt1 = (unsigned int)(unknownIntA1.size()); - out << " Unknown Int 1: " << unknownInt1 << endl; - array_output_count = 0; - for (unsigned int i1 = 0; i1 < unknownIntA1.size(); i1++) { - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; - break; - }; - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - break; - }; - out << " Unknown Int A1[" << i1 << "]: " << unknownIntA1[i1] << endl; - array_output_count++; - }; + bonelodCount = (unsigned int)(bonelodInfo.size()); + out << " BoneLOD Count: " << bonelodCount << endl; array_output_count = 0; - for (unsigned int i1 = 0; i1 < unknownIntA2.size(); i1++) { + for (unsigned int i1 = 0; i1 < bonelodInfo.size(); i1++) { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; break; }; - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - break; - }; - out << " Unknown Int A2[" << i1 << "]: " << unknownIntA2[i1] << endl; - array_output_count++; + out << " Distance: " << bonelodInfo[i1].distance << endl; + out << " Bone Name: " << bonelodInfo[i1].boneName << endl; }; return out.str(); diff --git a/src/obj/BSEffectShaderProperty.cpp b/src/obj/BSEffectShaderProperty.cpp index c356db1bf3d9393baa2ae885b9b74917dd2f88e3..935c71cb20e4b30801d16445a6981ba4a9d6be44 100644 --- a/src/obj/BSEffectShaderProperty.cpp +++ b/src/obj/BSEffectShaderProperty.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type BSEffectShaderProperty::TYPE("BSEffectShaderProperty", &NiProperty::TYPE ); -BSEffectShaderProperty::BSEffectShaderProperty() : unknownByte1((byte)0), unknownShort1((unsigned short)0), unknownByte2((byte)0), effectShaderFlags1((unsigned int)0), effectShaderFlags2((unsigned short)0), unknownShort2((unsigned short)0), unknownFloat1(0.0f), unknownFloat2(0.0f), unknownFloat3(0.0f), unknownFloat4(0.0f), alpha(0.0f), emissive(0.0f), unknownFloat5(0.0f) { +BSEffectShaderProperty::BSEffectShaderProperty() : shaderFlags1((SkyrimShaderPropertyFlags1)0), shaderFlags2((SkyrimShaderPropertyFlags2)0), uvScale(1.0, 1.0), textureClampMode((unsigned int)0), falloffStartAngle(1.0f), falloffStopAngle(1.0f), falloffStartOpacity(0.0f), falloffStopOpacity(0.0f), emissiveMultiple(0.0f), softFalloffDepth(0.0f) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -46,24 +46,20 @@ void BSEffectShaderProperty::Read( istream& in, list<unsigned int> & link_stack, //--END CUSTOM CODE--// NiProperty::Read( in, link_stack, info ); - NifStream( unknownByte1, in, info ); - NifStream( unknownShort1, in, info ); - NifStream( unknownByte2, in, info ); - NifStream( effectShaderFlags1, in, info ); - NifStream( textureTranslation1, in, info ); - NifStream( textureTranslation2, in, info ); + NifStream( shaderFlags1, in, info ); + NifStream( shaderFlags2, in, info ); + NifStream( uvOffset, in, info ); + NifStream( uvScale, in, info ); NifStream( sourceTexture, in, info ); - NifStream( effectShaderFlags2, in, info ); - NifStream( unknownShort2, in, info ); - NifStream( unknownFloat1, in, info ); - NifStream( unknownFloat2, in, info ); - NifStream( unknownFloat3, in, info ); - NifStream( unknownFloat4, in, info ); - NifStream( diffuseColor, in, info ); - NifStream( alpha, in, info ); - NifStream( emissive, in, info ); - NifStream( unknownFloat5, in, info ); - NifStream( gradientTexture, in, info ); + NifStream( textureClampMode, in, info ); + NifStream( falloffStartAngle, in, info ); + NifStream( falloffStopAngle, in, info ); + NifStream( falloffStartOpacity, in, info ); + NifStream( falloffStopOpacity, in, info ); + NifStream( emissiveColor, in, info ); + NifStream( emissiveMultiple, in, info ); + NifStream( softFalloffDepth, in, info ); + NifStream( greyscaleTexture, in, info ); //--BEGIN POST-READ CUSTOM CODE--// @@ -76,24 +72,20 @@ void BSEffectShaderProperty::Write( ostream& out, const map<NiObjectRef,unsigned //--END CUSTOM CODE--// NiProperty::Write( out, link_map, missing_link_stack, info ); - NifStream( unknownByte1, out, info ); - NifStream( unknownShort1, out, info ); - NifStream( unknownByte2, out, info ); - NifStream( effectShaderFlags1, out, info ); - NifStream( textureTranslation1, out, info ); - NifStream( textureTranslation2, out, info ); + NifStream( shaderFlags1, out, info ); + NifStream( shaderFlags2, out, info ); + NifStream( uvOffset, out, info ); + NifStream( uvScale, out, info ); NifStream( sourceTexture, out, info ); - NifStream( effectShaderFlags2, out, info ); - NifStream( unknownShort2, out, info ); - NifStream( unknownFloat1, out, info ); - NifStream( unknownFloat2, out, info ); - NifStream( unknownFloat3, out, info ); - NifStream( unknownFloat4, out, info ); - NifStream( diffuseColor, out, info ); - NifStream( alpha, out, info ); - NifStream( emissive, out, info ); - NifStream( unknownFloat5, out, info ); - NifStream( gradientTexture, out, info ); + NifStream( textureClampMode, out, info ); + NifStream( falloffStartAngle, out, info ); + NifStream( falloffStopAngle, out, info ); + NifStream( falloffStartOpacity, out, info ); + NifStream( falloffStopOpacity, out, info ); + NifStream( emissiveColor, out, info ); + NifStream( emissiveMultiple, out, info ); + NifStream( softFalloffDepth, out, info ); + NifStream( greyscaleTexture, out, info ); //--BEGIN POST-WRITE CUSTOM CODE--// @@ -107,24 +99,20 @@ std::string BSEffectShaderProperty::asString( bool verbose ) const { stringstream out; out << NiProperty::asString(); - out << " Unknown Byte 1: " << unknownByte1 << endl; - out << " Unknown Short 1: " << unknownShort1 << endl; - out << " Unknown Byte 2: " << unknownByte2 << endl; - out << " Effect Shader Flags 1: " << effectShaderFlags1 << endl; - out << " Texture Translation 1: " << textureTranslation1 << endl; - out << " Texture Translation 2: " << textureTranslation2 << endl; + out << " Shader Flags 1: " << shaderFlags1 << endl; + out << " Shader Flags 2: " << shaderFlags2 << endl; + out << " UV Offset: " << uvOffset << endl; + out << " UV Scale: " << uvScale << endl; out << " Source Texture: " << sourceTexture << endl; - out << " Effect Shader Flags 2: " << effectShaderFlags2 << endl; - out << " Unknown Short 2: " << unknownShort2 << endl; - out << " Unknown Float 1: " << unknownFloat1 << endl; - out << " Unknown Float 2: " << unknownFloat2 << endl; - out << " Unknown Float 3: " << unknownFloat3 << endl; - out << " Unknown Float 4: " << unknownFloat4 << endl; - out << " Diffuse Color: " << diffuseColor << endl; - out << " Alpha: " << alpha << endl; - out << " Emissive: " << emissive << endl; - out << " Unknown Float 5: " << unknownFloat5 << endl; - out << " Gradient Texture: " << gradientTexture << endl; + out << " Texture Clamp Mode: " << textureClampMode << endl; + out << " Falloff Start Angle: " << falloffStartAngle << endl; + out << " Falloff Stop Angle: " << falloffStopAngle << endl; + out << " Falloff Start Opacity: " << falloffStartOpacity << endl; + out << " Falloff Stop Opacity: " << falloffStopOpacity << endl; + out << " Emissive Color: " << emissiveColor << endl; + out << " Emissive Multiple: " << emissiveMultiple << endl; + out << " Soft Falloff Depth: " << softFalloffDepth << endl; + out << " Greyscale Texture: " << greyscaleTexture << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/BSEffectShaderPropertyFloatController.cpp b/src/obj/BSEffectShaderPropertyFloatController.cpp index b0170e576629e8a548f02a7648c431c55e2adddb..b1f4d98bb54550f5e23ec55b76a4b3acf255b57b 100644 --- a/src/obj/BSEffectShaderPropertyFloatController.cpp +++ b/src/obj/BSEffectShaderPropertyFloatController.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type BSEffectShaderPropertyFloatController::TYPE("BSEffectShaderPropertyFloatController", &NiFloatInterpController::TYPE ); -BSEffectShaderPropertyFloatController::BSEffectShaderPropertyFloatController() : unknownInt2((unsigned int)0) { +BSEffectShaderPropertyFloatController::BSEffectShaderPropertyFloatController() : targetVariable((unsigned int)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -46,7 +46,7 @@ void BSEffectShaderPropertyFloatController::Read( istream& in, list<unsigned int //--END CUSTOM CODE--// NiFloatInterpController::Read( in, link_stack, info ); - NifStream( unknownInt2, in, info ); + NifStream( targetVariable, in, info ); //--BEGIN POST-READ CUSTOM CODE--// @@ -59,7 +59,7 @@ void BSEffectShaderPropertyFloatController::Write( ostream& out, const map<NiObj //--END CUSTOM CODE--// NiFloatInterpController::Write( out, link_map, missing_link_stack, info ); - NifStream( unknownInt2, out, info ); + NifStream( targetVariable, out, info ); //--BEGIN POST-WRITE CUSTOM CODE--// @@ -73,7 +73,7 @@ std::string BSEffectShaderPropertyFloatController::asString( bool verbose ) cons stringstream out; out << NiFloatInterpController::asString(); - out << " Unknown Int 2: " << unknownInt2 << endl; + out << " Target Variable: " << targetVariable << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/BSFurnitureMarker.cpp b/src/obj/BSFurnitureMarker.cpp index 4377bf71aca6f4226d1248ce1398bf4514be8732..9cd3e90b1524e4843b7bb720752ff8f863bb506b 100644 --- a/src/obj/BSFurnitureMarker.cpp +++ b/src/obj/BSFurnitureMarker.cpp @@ -47,12 +47,15 @@ void BSFurnitureMarker::Read( istream& in, list<unsigned int> & link_stack, cons positions.resize(numPositions); for (unsigned int i1 = 0; i1 < positions.size(); i1++) { NifStream( positions[i1].offset, in, info ); - NifStream( positions[i1].orientation, in, info ); - NifStream( positions[i1].positionRef1, in, info ); - NifStream( positions[i1].positionRef2, in, info ); + if ( (info.userVersion <= 11) ) { + NifStream( positions[i1].orientation, in, info ); + NifStream( positions[i1].positionRef1, in, info ); + NifStream( positions[i1].positionRef2, in, info ); + }; if ( ((info.version >= 0x14020007) && (info.userVersion >= 12)) ) { - NifStream( positions[i1].unknownShort1, in, info ); - NifStream( positions[i1].unknownShort2, in, info ); + NifStream( positions[i1].heading, in, info ); + NifStream( positions[i1].animationType, in, info ); + NifStream( positions[i1].entryProperties, in, info ); }; }; @@ -69,12 +72,15 @@ void BSFurnitureMarker::Write( ostream& out, const map<NiObjectRef,unsigned int> NifStream( numPositions, out, info ); for (unsigned int i1 = 0; i1 < positions.size(); i1++) { NifStream( positions[i1].offset, out, info ); - NifStream( positions[i1].orientation, out, info ); - NifStream( positions[i1].positionRef1, out, info ); - NifStream( positions[i1].positionRef2, out, info ); + if ( (info.userVersion <= 11) ) { + NifStream( positions[i1].orientation, out, info ); + NifStream( positions[i1].positionRef1, out, info ); + NifStream( positions[i1].positionRef2, out, info ); + }; if ( ((info.version >= 0x14020007) && (info.userVersion >= 12)) ) { - NifStream( positions[i1].unknownShort1, out, info ); - NifStream( positions[i1].unknownShort2, out, info ); + NifStream( positions[i1].heading, out, info ); + NifStream( positions[i1].animationType, out, info ); + NifStream( positions[i1].entryProperties, out, info ); }; }; @@ -101,8 +107,9 @@ std::string BSFurnitureMarker::asString( bool verbose ) const { out << " Orientation: " << positions[i1].orientation << endl; out << " Position Ref 1: " << positions[i1].positionRef1 << endl; out << " Position Ref 2: " << positions[i1].positionRef2 << endl; - out << " Unknown Short 1: " << positions[i1].unknownShort1 << endl; - out << " Unknown Short 2: " << positions[i1].unknownShort2 << endl; + out << " Heading: " << positions[i1].heading << endl; + out << " Animation Type: " << positions[i1].animationType << endl; + out << " Entry Properties: " << positions[i1].entryProperties << endl; }; return out.str(); diff --git a/src/obj/BSInvMarker.cpp b/src/obj/BSInvMarker.cpp index bacfdc4a727ae0f347cf9f9e43e901ac2768b133..70dc826a44e4529e7c7059eadf3beebb402aedc4 100644 --- a/src/obj/BSInvMarker.cpp +++ b/src/obj/BSInvMarker.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type BSInvMarker::TYPE("BSInvMarker", &NiExtraData::TYPE ); -BSInvMarker::BSInvMarker() : rotation1((unsigned int)0), rotation2((unsigned int)0), zoom((unsigned short)16256) { +BSInvMarker::BSInvMarker() : rotationX((unsigned short)4712), rotationY((unsigned short)6283), rotationZ((unsigned short)0), zoom(1.0f) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -46,8 +46,9 @@ void BSInvMarker::Read( istream& in, list<unsigned int> & link_stack, const NifI //--END CUSTOM CODE--// NiExtraData::Read( in, link_stack, info ); - NifStream( rotation1, in, info ); - NifStream( rotation2, in, info ); + NifStream( rotationX, in, info ); + NifStream( rotationY, in, info ); + NifStream( rotationZ, in, info ); NifStream( zoom, in, info ); //--BEGIN POST-READ CUSTOM CODE--// @@ -61,8 +62,9 @@ void BSInvMarker::Write( ostream& out, const map<NiObjectRef,unsigned int> & lin //--END CUSTOM CODE--// NiExtraData::Write( out, link_map, missing_link_stack, info ); - NifStream( rotation1, out, info ); - NifStream( rotation2, out, info ); + NifStream( rotationX, out, info ); + NifStream( rotationY, out, info ); + NifStream( rotationZ, out, info ); NifStream( zoom, out, info ); //--BEGIN POST-WRITE CUSTOM CODE--// @@ -77,8 +79,9 @@ std::string BSInvMarker::asString( bool verbose ) const { stringstream out; out << NiExtraData::asString(); - out << " Rotation 1: " << rotation1 << endl; - out << " Rotation 2: " << rotation2 << endl; + out << " Rotation X: " << rotationX << endl; + out << " Rotation Y: " << rotationY << endl; + out << " Rotation Z: " << rotationZ << endl; out << " Zoom: " << zoom << endl; return out.str(); diff --git a/src/obj/BSLODTriShape.cpp b/src/obj/BSLODTriShape.cpp index 851744e4386817fa2ac1ddb8f33f1c175836ff2a..b853960703f0303682cfa892146962dfeaa46a88 100644 --- a/src/obj/BSLODTriShape.cpp +++ b/src/obj/BSLODTriShape.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type BSLODTriShape::TYPE("BSLODTriShape", &NiTriBasedGeom::TYPE ); -BSLODTriShape::BSLODTriShape() : unknownInt1((unsigned int)0), unknownInt2((unsigned int)0), unknownInt3((unsigned int)0) { +BSLODTriShape::BSLODTriShape() : level0Size((unsigned int)0), level1Size((unsigned int)0), level2Size((unsigned int)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -46,9 +46,9 @@ void BSLODTriShape::Read( istream& in, list<unsigned int> & link_stack, const Ni //--END CUSTOM CODE--// NiTriBasedGeom::Read( in, link_stack, info ); - NifStream( unknownInt1, in, info ); - NifStream( unknownInt2, in, info ); - NifStream( unknownInt3, in, info ); + NifStream( level0Size, in, info ); + NifStream( level1Size, in, info ); + NifStream( level2Size, in, info ); //--BEGIN POST-READ CUSTOM CODE--// @@ -61,9 +61,9 @@ void BSLODTriShape::Write( ostream& out, const map<NiObjectRef,unsigned int> & l //--END CUSTOM CODE--// NiTriBasedGeom::Write( out, link_map, missing_link_stack, info ); - NifStream( unknownInt1, out, info ); - NifStream( unknownInt2, out, info ); - NifStream( unknownInt3, out, info ); + NifStream( level0Size, out, info ); + NifStream( level1Size, out, info ); + NifStream( level2Size, out, info ); //--BEGIN POST-WRITE CUSTOM CODE--// @@ -77,9 +77,9 @@ std::string BSLODTriShape::asString( bool verbose ) const { stringstream out; out << NiTriBasedGeom::asString(); - out << " Unknown Int 1: " << unknownInt1 << endl; - out << " Unknown Int 2: " << unknownInt2 << endl; - out << " Unknown Int 3: " << unknownInt3 << endl; + out << " Level 0 Size: " << level0Size << endl; + out << " Level 1 Size: " << level1Size << endl; + out << " Level 2 Size: " << level2Size << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/BSLagBoneController.cpp b/src/obj/BSLagBoneController.cpp index c40e717666821a4fef8a959d510ed3209d2927e1..1be71860efaa4981bea6132246d2b4b5182835a1 100644 --- a/src/obj/BSLagBoneController.cpp +++ b/src/obj/BSLagBoneController.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type BSLagBoneController::TYPE("BSLagBoneController", &NiTimeController::TYPE ); -BSLagBoneController::BSLagBoneController() : rotationLag(0.0f), unknownFloat3(0.0f), length(0.0f) { +BSLagBoneController::BSLagBoneController() : linearVelocity(0.0f), linearRotation(0.0f), maximumDistance(0.0f) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -46,9 +46,9 @@ void BSLagBoneController::Read( istream& in, list<unsigned int> & link_stack, co //--END CUSTOM CODE--// NiTimeController::Read( in, link_stack, info ); - NifStream( rotationLag, in, info ); - NifStream( unknownFloat3, in, info ); - NifStream( length, in, info ); + NifStream( linearVelocity, in, info ); + NifStream( linearRotation, in, info ); + NifStream( maximumDistance, in, info ); //--BEGIN POST-READ CUSTOM CODE--// @@ -61,9 +61,9 @@ void BSLagBoneController::Write( ostream& out, const map<NiObjectRef,unsigned in //--END CUSTOM CODE--// NiTimeController::Write( out, link_map, missing_link_stack, info ); - NifStream( rotationLag, out, info ); - NifStream( unknownFloat3, out, info ); - NifStream( length, out, info ); + NifStream( linearVelocity, out, info ); + NifStream( linearRotation, out, info ); + NifStream( maximumDistance, out, info ); //--BEGIN POST-WRITE CUSTOM CODE--// @@ -77,9 +77,9 @@ std::string BSLagBoneController::asString( bool verbose ) const { stringstream out; out << NiTimeController::asString(); - out << " Rotation Lag: " << rotationLag << endl; - out << " Unknown Float 3: " << unknownFloat3 << endl; - out << " Length: " << length << endl; + out << " Linear Velocity: " << linearVelocity << endl; + out << " Linear Rotation: " << linearRotation << endl; + out << " Maximum Distance: " << maximumDistance << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/BSLightingShaderProperty.cpp b/src/obj/BSLightingShaderProperty.cpp index f3ce76908228c603b809436ceb12d0c636dedc9d..cd71da36092498e37a558a726e648a4004d70ea0 100644 --- a/src/obj/BSLightingShaderProperty.cpp +++ b/src/obj/BSLightingShaderProperty.cpp @@ -21,42 +21,12 @@ using namespace Niflib; //Definition of TYPE constant const Type BSLightingShaderProperty::TYPE("BSLightingShaderProperty", &NiProperty::TYPE ); -BSLightingShaderProperty::BSLightingShaderProperty() : shaderFlags1((unsigned int)0), shaderFlags2((unsigned int)0), textureSet(NULL), emissiveSaturation(0.0f), unknownInt7((unsigned int)0), alpha(0.0f), unknownFloat2(0.0f), glossiness(0.0f), specularStrength(0.0f), lightingEffect1(0.0f), lightingEffect2(0.0f), environmentMapStrength(0.0f), unknownFloat9(0.0f), eyeCubemapScale(0.0f) { +BSLightingShaderProperty::BSLightingShaderProperty() : shaderFlags1((SkyrimShaderPropertyFlags1)2185233153), shaderFlags2((SkyrimShaderPropertyFlags2)32801), uvScale(1.0, 1.0), textureSet(NULL), emissiveMultiple(0.0f), textureClampMode((TexClampMode)0), alpha(1.0f), unknownFloat2(0.0f), glossiness(0.0f), specularStrength(1.0f), lightingEffect1(0.0f), lightingEffect2(0.0f), environmentMapScale(0.0f), maxPasses(0.0f), scale(0.0f), parallaxInnerLayerThickness(0.0f), parallaxRefractionScale(0.0f), parallaxEnvmapStrength(0.0f), eyeCubemapScale(0.0f) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// } -BSLightingShaderProperty::BSLightingShaderProperty(const BSLightingShaderProperty& src) - : shaderFlags1(src.shaderFlags1), - shaderFlags2(src.shaderFlags2), - textureSet(NULL), - emissiveSaturation(src.emissiveSaturation), - unknownInt7(src.unknownInt7), - alpha(src.alpha), - unknownFloat2(src.unknownFloat2), - glossiness(src.glossiness), - specularStrength(src.specularStrength), - lightingEffect1(src.lightingEffect1), - lightingEffect2(src.lightingEffect2), - environmentMapStrength(src.environmentMapStrength), - unknownFloat9(src.unknownFloat9), - eyeCubemapScale(src.eyeCubemapScale), - emissiveColor(src.emissiveColor), - specularColor(src.specularColor), - unknownColor1(src.unknownColor1), - unknownColor2(src.unknownColor2), - unknownFloatSet1(src.unknownFloatSet1), - unknownFloatSet5(src.unknownFloatSet5), - leftEyeReflectionCenter(src.leftEyeReflectionCenter), - rightEyeReflectionCenter(src.rightEyeReflectionCenter), - textureTranslation1(src.textureTranslation1), - textureRepeat(src.textureRepeat) -{ - //--BEGIN CONSTRUCTOR CUSTOM CODE--// - //--END CUSTOM CODE--// -} - BSLightingShaderProperty::~BSLightingShaderProperty() { //--BEGIN DESTRUCTOR CUSTOM CODE--// @@ -82,13 +52,13 @@ void BSLightingShaderProperty::Read( istream& in, list<unsigned int> & link_stac NifStream( shaderFlags1, in, info ); NifStream( shaderFlags2, in, info ); }; - NifStream( textureTranslation1, in, info ); - NifStream( textureRepeat, in, info ); + NifStream( uvOffset, in, info ); + NifStream( uvScale, in, info ); NifStream( block_num, in, info ); link_stack.push_back( block_num ); NifStream( emissiveColor, in, info ); - NifStream( emissiveSaturation, in, info ); - NifStream( unknownInt7, in, info ); + NifStream( emissiveMultiple, in, info ); + NifStream( textureClampMode, in, info ); NifStream( alpha, in, info ); NifStream( unknownFloat2, in, info ); NifStream( glossiness, in, info ); @@ -97,25 +67,26 @@ void BSLightingShaderProperty::Read( istream& in, list<unsigned int> & link_stac NifStream( lightingEffect1, in, info ); NifStream( lightingEffect2, in, info ); if ( (skyrimShaderType == 1) ) { - NifStream( environmentMapStrength, in, info ); + NifStream( environmentMapScale, in, info ); }; if ( (skyrimShaderType == 5) ) { - NifStream( unknownFloatSet1, in, info ); + NifStream( skinTintColor, in, info ); }; if ( (skyrimShaderType == 6) ) { - NifStream( unknownColor1, in, info ); + NifStream( hairTintColor, in, info ); }; if ( (skyrimShaderType == 7) ) { - for (unsigned int i2 = 0; i2 < 2; i2++) { - NifStream( unknownFloatSet3[i2], in, info ); - }; + NifStream( maxPasses, in, info ); + NifStream( scale, in, info ); }; if ( (skyrimShaderType == 11) ) { - NifStream( unknownFloat9, in, info ); - NifStream( unknownColor2, in, info ); + NifStream( parallaxInnerLayerThickness, in, info ); + NifStream( parallaxRefractionScale, in, info ); + NifStream( parallaxInnerLayerTextureScale, in, info ); + NifStream( parallaxEnvmapStrength, in, info ); }; if ( (skyrimShaderType == 14) ) { - NifStream( unknownFloatSet5, in, info ); + NifStream( sparkleParameters, in, info ); }; if ( (skyrimShaderType == 16) ) { NifStream( eyeCubemapScale, in, info ); @@ -138,8 +109,8 @@ void BSLightingShaderProperty::Write( ostream& out, const map<NiObjectRef,unsign NifStream( shaderFlags1, out, info ); NifStream( shaderFlags2, out, info ); }; - NifStream( textureTranslation1, out, info ); - NifStream( textureRepeat, out, info ); + NifStream( uvOffset, out, info ); + NifStream( uvScale, out, info ); if ( info.version < VER_3_3_0_13 ) { WritePtr32( &(*textureSet), out ); } else { @@ -158,8 +129,8 @@ void BSLightingShaderProperty::Write( ostream& out, const map<NiObjectRef,unsign } } NifStream( emissiveColor, out, info ); - NifStream( emissiveSaturation, out, info ); - NifStream( unknownInt7, out, info ); + NifStream( emissiveMultiple, out, info ); + NifStream( textureClampMode, out, info ); NifStream( alpha, out, info ); NifStream( unknownFloat2, out, info ); NifStream( glossiness, out, info ); @@ -168,25 +139,26 @@ void BSLightingShaderProperty::Write( ostream& out, const map<NiObjectRef,unsign NifStream( lightingEffect1, out, info ); NifStream( lightingEffect2, out, info ); if ( (skyrimShaderType == 1) ) { - NifStream( environmentMapStrength, out, info ); + NifStream( environmentMapScale, out, info ); }; if ( (skyrimShaderType == 5) ) { - NifStream( unknownFloatSet1, out, info ); + NifStream( skinTintColor, out, info ); }; if ( (skyrimShaderType == 6) ) { - NifStream( unknownColor1, out, info ); + NifStream( hairTintColor, out, info ); }; if ( (skyrimShaderType == 7) ) { - for (unsigned int i2 = 0; i2 < 2; i2++) { - NifStream( unknownFloatSet3[i2], out, info ); - }; + NifStream( maxPasses, out, info ); + NifStream( scale, out, info ); }; if ( (skyrimShaderType == 11) ) { - NifStream( unknownFloat9, out, info ); - NifStream( unknownColor2, out, info ); + NifStream( parallaxInnerLayerThickness, out, info ); + NifStream( parallaxRefractionScale, out, info ); + NifStream( parallaxInnerLayerTextureScale, out, info ); + NifStream( parallaxEnvmapStrength, out, info ); }; if ( (skyrimShaderType == 14) ) { - NifStream( unknownFloatSet5, out, info ); + NifStream( sparkleParameters, out, info ); }; if ( (skyrimShaderType == 16) ) { NifStream( eyeCubemapScale, out, info ); @@ -205,16 +177,15 @@ std::string BSLightingShaderProperty::asString( bool verbose ) const { //--END CUSTOM CODE--// stringstream out; - unsigned int array_output_count = 0; out << NiProperty::asString(); out << " Shader Flags 1: " << shaderFlags1 << endl; out << " Shader Flags 2: " << shaderFlags2 << endl; - out << " Texture Translation 1: " << textureTranslation1 << endl; - out << " Texture Repeat: " << textureRepeat << endl; + out << " UV Offset: " << uvOffset << endl; + out << " UV Scale: " << uvScale << endl; out << " Texture Set: " << textureSet << endl; out << " Emissive Color: " << emissiveColor << endl; - out << " Emissive Saturation: " << emissiveSaturation << endl; - out << " Unknown Int 7: " << unknownInt7 << endl; + out << " Emissive Multiple: " << emissiveMultiple << endl; + out << " Texture Clamp Mode: " << textureClampMode << endl; out << " Alpha: " << alpha << endl; out << " Unknown Float 2: " << unknownFloat2 << endl; out << " Glossiness: " << glossiness << endl; @@ -223,34 +194,26 @@ std::string BSLightingShaderProperty::asString( bool verbose ) const { out << " Lighting Effect 1: " << lightingEffect1 << endl; out << " Lighting Effect 2: " << lightingEffect2 << endl; if ( (skyrimShaderType == 1) ) { - out << " Environment Map Strength: " << environmentMapStrength << endl; + out << " Environment Map Scale: " << environmentMapScale << endl; }; if ( (skyrimShaderType == 5) ) { - out << " Unknown Float Set 1: " << unknownFloatSet1 << endl; + out << " Skin Tint Color: " << skinTintColor << endl; }; if ( (skyrimShaderType == 6) ) { - out << " Unknown Color 1: " << unknownColor1 << endl; + out << " Hair Tint Color: " << hairTintColor << endl; }; if ( (skyrimShaderType == 7) ) { - array_output_count = 0; - for (unsigned int i2 = 0; i2 < 2; i2++) { - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; - break; - }; - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - break; - }; - out << " Unknown Float Set 3[" << i2 << "]: " << unknownFloatSet3[i2] << endl; - array_output_count++; - }; + out << " Max Passes: " << maxPasses << endl; + out << " Scale: " << scale << endl; }; if ( (skyrimShaderType == 11) ) { - out << " Unknown Float 9: " << unknownFloat9 << endl; - out << " Unknown Color 2: " << unknownColor2 << endl; + out << " Parallax Inner Layer Thickness: " << parallaxInnerLayerThickness << endl; + out << " Parallax Refraction Scale: " << parallaxRefractionScale << endl; + out << " Parallax Inner Layer Texture Scale: " << parallaxInnerLayerTextureScale << endl; + out << " Parallax Envmap Strength: " << parallaxEnvmapStrength << endl; }; if ( (skyrimShaderType == 14) ) { - out << " Unknown Float Set 5: " << unknownFloatSet5 << endl; + out << " Sparkle Parameters: " << sparkleParameters << endl; }; if ( (skyrimShaderType == 16) ) { out << " Eye Cubemap Scale: " << eyeCubemapScale << endl; @@ -293,36 +256,36 @@ std::list<NiObject *> BSLightingShaderProperty::GetPtrs() const { //--BEGIN MISC CUSTOM CODE--// -unsigned int BSLightingShaderProperty::getShaderFlags1() { +SkyrimShaderPropertyFlags1 BSLightingShaderProperty::getShaderFlags1() { return shaderFlags1; } -void BSLightingShaderProperty::setShaderFlags1( unsigned int value ) { +void BSLightingShaderProperty::setShaderFlags1( SkyrimShaderPropertyFlags1 value ) { shaderFlags1 = value; } -unsigned int BSLightingShaderProperty::getShaderFlags2() { +SkyrimShaderPropertyFlags2 BSLightingShaderProperty::getShaderFlags2() { return shaderFlags2; } -void BSLightingShaderProperty::setShaderFlags2( unsigned int value ) { +void BSLightingShaderProperty::setShaderFlags2( SkyrimShaderPropertyFlags2 value ) { shaderFlags2 = value; } -TexCoord BSLightingShaderProperty::getTextureTranslation1() { - return textureTranslation1; +TexCoord BSLightingShaderProperty::getUVOffset() { + return uvOffset; } -void BSLightingShaderProperty::setTextureTranslation1( TexCoord value ) { - textureTranslation1 = value; +void BSLightingShaderProperty::setUVOffset( TexCoord value ) { + uvOffset = value; } -TexCoord BSLightingShaderProperty::getTextureRepeat() { - return textureRepeat; +TexCoord BSLightingShaderProperty::getUVScale() { + return uvScale; } -void BSLightingShaderProperty::setTextureRepeat( TexCoord value ) { - textureRepeat = value; +void BSLightingShaderProperty::setUVScale( TexCoord value ) { + uvScale = value; } Ref<BSShaderTextureSet > BSLightingShaderProperty::getTextureSet() { @@ -341,20 +304,20 @@ void BSLightingShaderProperty::setEmissiveColor( Color3 value ) { emissiveColor = value; } -float BSLightingShaderProperty::getEmissiveSaturation() { - return emissiveSaturation; +float BSLightingShaderProperty::getEmissiveMultiple() { + return emissiveMultiple; } -void BSLightingShaderProperty::setEmissiveSaturation( float value ) { - emissiveSaturation = value; +void BSLightingShaderProperty::setEmissiveMultiple( float value ) { + emissiveMultiple = value; } -unsigned int BSLightingShaderProperty::getUnkownInt7() { - return unknownInt7; +TexClampMode BSLightingShaderProperty::getTextureClampMode() { + return textureClampMode; } -void BSLightingShaderProperty::setUnknownInt7( unsigned int value ) { - unknownInt7 = value; +void BSLightingShaderProperty::setTextureClampMode( TexClampMode value ) { + textureClampMode = value; } float BSLightingShaderProperty::getAlpha() { @@ -415,44 +378,20 @@ void BSLightingShaderProperty::setLightningEffect2( float value ) { lightingEffect2 = value; } -float BSLightingShaderProperty::getEnvironmentMapStrength() { - return environmentMapStrength; -} - -void BSLightingShaderProperty::setEnvironmentMapStrength( float value ) { - environmentMapStrength = value; -} - -array<2, float> BSLightingShaderProperty::getUnknownFloatSet3() { - return unknownFloatSet3; -} - -void BSLightingShaderProperty::setUnknownFloatSet3( array<2, float> value ) { - unknownFloatSet3 = value; -} - -float BSLightingShaderProperty::getUnknownFloat9() { - return unknownFloat9; -} - -void BSLightingShaderProperty::setUnknownFloat9( float value ) { - unknownFloat9 = value; +float BSLightingShaderProperty::getEnvironmentMapScale() { + return environmentMapScale; } -Color4 BSLightingShaderProperty::getUnknownColor2() { - return unknownColor2; +void BSLightingShaderProperty::setEnvironmentMapScale( float value ) { + environmentMapScale = value; } -void BSLightingShaderProperty::setUnknownColor2( Color4 value ) { - unknownColor2 = value; +Vector4 BSLightingShaderProperty::getSparkleParameters() { + return sparkleParameters; } -Vector4 BSLightingShaderProperty::getUnknownFloatSet5() { - return unknownFloatSet5; -} - -void BSLightingShaderProperty::setUnknownFloatSet5( Vector4 value ) { - unknownFloatSet5 = value; +void BSLightingShaderProperty::setSparkleParameters( Vector4 value ) { + sparkleParameters = value; } float BSLightingShaderProperty::getEyeCubemapScale() { @@ -480,5 +419,3 @@ void BSLightingShaderProperty::setRightEyeReflectionCenter( Vector3 value ) { } //--END CUSTOM CODE--// - - diff --git a/src/obj/BSLightingShaderPropertyColorController.cpp b/src/obj/BSLightingShaderPropertyColorController.cpp index 15d862356dede8ee29efd7a29a31b8f4d0346fbf..789e8933ee01f57b43cdabc2715092346cefb52d 100644 --- a/src/obj/BSLightingShaderPropertyColorController.cpp +++ b/src/obj/BSLightingShaderPropertyColorController.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type BSLightingShaderPropertyColorController::TYPE("BSLightingShaderPropertyColorController", &NiFloatInterpController::TYPE ); -BSLightingShaderPropertyColorController::BSLightingShaderPropertyColorController() : unknownInt2((unsigned int)0) { +BSLightingShaderPropertyColorController::BSLightingShaderPropertyColorController() : targetVariable((unsigned int)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -46,7 +46,7 @@ void BSLightingShaderPropertyColorController::Read( istream& in, list<unsigned i //--END CUSTOM CODE--// NiFloatInterpController::Read( in, link_stack, info ); - NifStream( unknownInt2, in, info ); + NifStream( targetVariable, in, info ); //--BEGIN POST-READ CUSTOM CODE--// @@ -59,7 +59,7 @@ void BSLightingShaderPropertyColorController::Write( ostream& out, const map<NiO //--END CUSTOM CODE--// NiFloatInterpController::Write( out, link_map, missing_link_stack, info ); - NifStream( unknownInt2, out, info ); + NifStream( targetVariable, out, info ); //--BEGIN POST-WRITE CUSTOM CODE--// @@ -73,7 +73,7 @@ std::string BSLightingShaderPropertyColorController::asString( bool verbose ) co stringstream out; out << NiFloatInterpController::asString(); - out << " Unknown Int 2: " << unknownInt2 << endl; + out << " Target Variable: " << targetVariable << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/BSMultiBoundAABB.cpp b/src/obj/BSMultiBoundAABB.cpp index eff919744e287a4b920341d7375e6b90f99a68f8..26003b95ed589a789f2cf379bac298ae0d0861a8 100644 --- a/src/obj/BSMultiBoundAABB.cpp +++ b/src/obj/BSMultiBoundAABB.cpp @@ -46,9 +46,8 @@ void BSMultiBoundAABB::Read( istream& in, list<unsigned int> & link_stack, const //--END CUSTOM CODE--// BSMultiBoundData::Read( in, link_stack, info ); - for (unsigned int i1 = 0; i1 < 6; i1++) { - NifStream( unknownFloats1[i1], in, info ); - }; + NifStream( position, in, info ); + NifStream( extent, in, info ); //--BEGIN POST-READ CUSTOM CODE--// @@ -61,9 +60,8 @@ void BSMultiBoundAABB::Write( ostream& out, const map<NiObjectRef,unsigned int> //--END CUSTOM CODE--// BSMultiBoundData::Write( out, link_map, missing_link_stack, info ); - for (unsigned int i1 = 0; i1 < 6; i1++) { - NifStream( unknownFloats1[i1], out, info ); - }; + NifStream( position, out, info ); + NifStream( extent, out, info ); //--BEGIN POST-WRITE CUSTOM CODE--// @@ -76,20 +74,9 @@ std::string BSMultiBoundAABB::asString( bool verbose ) const { //--END CUSTOM CODE--// stringstream out; - unsigned int array_output_count = 0; out << BSMultiBoundData::asString(); - array_output_count = 0; - for (unsigned int i1 = 0; i1 < 6; i1++) { - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; - break; - }; - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - break; - }; - out << " Unknown Floats 1[" << i1 << "]: " << unknownFloats1[i1] << endl; - array_output_count++; - }; + out << " Position: " << position << endl; + out << " Extent: " << extent << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/BSPSysSubTexModifier.cpp b/src/obj/BSPSysSubTexModifier.cpp index 36ddf3a59b625736f66241dcaa7f4ff716393279..3639503b0d01d508c437d4cc4fa6e77b8fe7d58e 100644 --- a/src/obj/BSPSysSubTexModifier.cpp +++ b/src/obj/BSPSysSubTexModifier.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type BSPSysSubTexModifier::TYPE("BSPSysSubTexModifier", &NiPSysModifier::TYPE ); -BSPSysSubTexModifier::BSPSysSubTexModifier() : unknownInt1((unsigned int)0), unknownFloat1(0.0f), unknownFloat2(0.0f), unknownFloat3(0.0f), unknownFloat4(0.0f), unknownFloat5(0.0f), unknownFloat6(0.0f) { +BSPSysSubTexModifier::BSPSysSubTexModifier() : startFrame((unsigned int)0), startFrameFudge(0.0f), endFrame(0.0f), loopStartFrame(0.0f), loopStartFrameFudge(0.0f), frameCount(0.0f), frameCountFudge(0.0f) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -46,13 +46,13 @@ void BSPSysSubTexModifier::Read( istream& in, list<unsigned int> & link_stack, c //--END CUSTOM CODE--// NiPSysModifier::Read( in, link_stack, info ); - NifStream( unknownInt1, in, info ); - NifStream( unknownFloat1, in, info ); - NifStream( unknownFloat2, in, info ); - NifStream( unknownFloat3, in, info ); - NifStream( unknownFloat4, in, info ); - NifStream( unknownFloat5, in, info ); - NifStream( unknownFloat6, in, info ); + NifStream( startFrame, in, info ); + NifStream( startFrameFudge, in, info ); + NifStream( endFrame, in, info ); + NifStream( loopStartFrame, in, info ); + NifStream( loopStartFrameFudge, in, info ); + NifStream( frameCount, in, info ); + NifStream( frameCountFudge, in, info ); //--BEGIN POST-READ CUSTOM CODE--// @@ -65,13 +65,13 @@ void BSPSysSubTexModifier::Write( ostream& out, const map<NiObjectRef,unsigned i //--END CUSTOM CODE--// NiPSysModifier::Write( out, link_map, missing_link_stack, info ); - NifStream( unknownInt1, out, info ); - NifStream( unknownFloat1, out, info ); - NifStream( unknownFloat2, out, info ); - NifStream( unknownFloat3, out, info ); - NifStream( unknownFloat4, out, info ); - NifStream( unknownFloat5, out, info ); - NifStream( unknownFloat6, out, info ); + NifStream( startFrame, out, info ); + NifStream( startFrameFudge, out, info ); + NifStream( endFrame, out, info ); + NifStream( loopStartFrame, out, info ); + NifStream( loopStartFrameFudge, out, info ); + NifStream( frameCount, out, info ); + NifStream( frameCountFudge, out, info ); //--BEGIN POST-WRITE CUSTOM CODE--// @@ -85,13 +85,13 @@ std::string BSPSysSubTexModifier::asString( bool verbose ) const { stringstream out; out << NiPSysModifier::asString(); - out << " Unknown Int 1: " << unknownInt1 << endl; - out << " Unknown Float 1: " << unknownFloat1 << endl; - out << " Unknown Float 2: " << unknownFloat2 << endl; - out << " Unknown Float 3: " << unknownFloat3 << endl; - out << " Unknown Float 4: " << unknownFloat4 << endl; - out << " Unknown Float 5: " << unknownFloat5 << endl; - out << " Unknown Float 6: " << unknownFloat6 << endl; + out << " Start Frame: " << startFrame << endl; + out << " Start Frame Fudge: " << startFrameFudge << endl; + out << " End Frame: " << endFrame << endl; + out << " Loop Start Frame: " << loopStartFrame << endl; + out << " Loop Start Frame Fudge: " << loopStartFrameFudge << endl; + out << " Frame Count: " << frameCount << endl; + out << " Frame Count Fudge: " << frameCountFudge << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/BSProceduralLightningController.cpp b/src/obj/BSProceduralLightningController.cpp index 5be5d30c0810cd66619833c987344ecf2e45dcfe..2d49c052c45ab879dd6fd5ba8a06d8839d2f3d14 100644 --- a/src/obj/BSProceduralLightningController.cpp +++ b/src/obj/BSProceduralLightningController.cpp @@ -15,12 +15,13 @@ All rights reserved. Please see niflib.h for license. */ #include "../../include/ObjectRegistry.h" #include "../../include/NIF_IO.h" #include "../../include/obj/BSProceduralLightningController.h" +#include "../../include/obj/NiInterpolator.h" using namespace Niflib; //Definition of TYPE constant const Type BSProceduralLightningController::TYPE("BSProceduralLightningController", &NiFloatInterpController::TYPE ); -BSProceduralLightningController::BSProceduralLightningController() : unknownInt2((unsigned int)0), target___1((unsigned int)0), target___2((unsigned int)0), target___3((unsigned int)0), target___4((unsigned int)0), target___5((unsigned int)0), target___6((unsigned int)0), target___7((unsigned int)0), unknownShort1((unsigned short)0), unknownShort2((unsigned short)0), unknownShort3((unsigned short)0), float1(0.0f), float2(0.0f), float3(0.0f), float4(0.0f), float5(0.0f), byte1((byte)0), byte2((byte)0), byte3((byte)0), target___8((unsigned int)0) { +BSProceduralLightningController::BSProceduralLightningController() : interpolator2_Mutation(NULL), interpolator3(NULL), interpolator4(NULL), interpolator5(NULL), interpolator6(NULL), interpolator7(NULL), interpolator8(NULL), interpolator9_ArcOffset(NULL), unknownShort1((unsigned short)0), unknownShort2((unsigned short)0), unknownShort3((unsigned short)0), distanceWeight(0.0f), float2(0.0f), stripWidth(0.0f), fork(0.0f), float5(0.0f), byte1((byte)0), byte2((byte)0), byte3((byte)0), interpolator10_(NULL) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -45,27 +46,37 @@ void BSProceduralLightningController::Read( istream& in, list<unsigned int> & li //--END CUSTOM CODE--// + unsigned int block_num; NiFloatInterpController::Read( in, link_stack, info ); - NifStream( unknownInt2, in, info ); - NifStream( target___1, in, info ); - NifStream( target___2, in, info ); - NifStream( target___3, in, info ); - NifStream( target___4, in, info ); - NifStream( target___5, in, info ); - NifStream( target___6, in, info ); - NifStream( target___7, in, info ); + NifStream( block_num, in, info ); + link_stack.push_back( block_num ); + NifStream( block_num, in, info ); + link_stack.push_back( block_num ); + NifStream( block_num, in, info ); + link_stack.push_back( block_num ); + NifStream( block_num, in, info ); + link_stack.push_back( block_num ); + NifStream( block_num, in, info ); + link_stack.push_back( block_num ); + NifStream( block_num, in, info ); + link_stack.push_back( block_num ); + NifStream( block_num, in, info ); + link_stack.push_back( block_num ); + NifStream( block_num, in, info ); + link_stack.push_back( block_num ); NifStream( unknownShort1, in, info ); NifStream( unknownShort2, in, info ); NifStream( unknownShort3, in, info ); - NifStream( float1, in, info ); + NifStream( distanceWeight, in, info ); NifStream( float2, in, info ); - NifStream( float3, in, info ); - NifStream( float4, in, info ); + NifStream( stripWidth, in, info ); + NifStream( fork, in, info ); NifStream( float5, in, info ); NifStream( byte1, in, info ); NifStream( byte2, in, info ); NifStream( byte3, in, info ); - NifStream( target___8, in, info ); + NifStream( block_num, in, info ); + link_stack.push_back( block_num ); //--BEGIN POST-READ CUSTOM CODE--// @@ -78,26 +89,170 @@ void BSProceduralLightningController::Write( ostream& out, const map<NiObjectRef //--END CUSTOM CODE--// NiFloatInterpController::Write( out, link_map, missing_link_stack, info ); - NifStream( unknownInt2, out, info ); - NifStream( target___1, out, info ); - NifStream( target___2, out, info ); - NifStream( target___3, out, info ); - NifStream( target___4, out, info ); - NifStream( target___5, out, info ); - NifStream( target___6, out, info ); - NifStream( target___7, out, info ); + if ( info.version < VER_3_3_0_13 ) { + WritePtr32( &(*interpolator2_Mutation), out ); + } else { + if ( interpolator2_Mutation != NULL ) { + map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(interpolator2_Mutation) ); + if (it != link_map.end()) { + NifStream( it->second, out, info ); + missing_link_stack.push_back( NULL ); + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( interpolator2_Mutation ); + } + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( NULL ); + } + } + if ( info.version < VER_3_3_0_13 ) { + WritePtr32( &(*interpolator3), out ); + } else { + if ( interpolator3 != NULL ) { + map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(interpolator3) ); + if (it != link_map.end()) { + NifStream( it->second, out, info ); + missing_link_stack.push_back( NULL ); + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( interpolator3 ); + } + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( NULL ); + } + } + if ( info.version < VER_3_3_0_13 ) { + WritePtr32( &(*interpolator4), out ); + } else { + if ( interpolator4 != NULL ) { + map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(interpolator4) ); + if (it != link_map.end()) { + NifStream( it->second, out, info ); + missing_link_stack.push_back( NULL ); + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( interpolator4 ); + } + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( NULL ); + } + } + if ( info.version < VER_3_3_0_13 ) { + WritePtr32( &(*interpolator5), out ); + } else { + if ( interpolator5 != NULL ) { + map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(interpolator5) ); + if (it != link_map.end()) { + NifStream( it->second, out, info ); + missing_link_stack.push_back( NULL ); + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( interpolator5 ); + } + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( NULL ); + } + } + if ( info.version < VER_3_3_0_13 ) { + WritePtr32( &(*interpolator6), out ); + } else { + if ( interpolator6 != NULL ) { + map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(interpolator6) ); + if (it != link_map.end()) { + NifStream( it->second, out, info ); + missing_link_stack.push_back( NULL ); + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( interpolator6 ); + } + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( NULL ); + } + } + if ( info.version < VER_3_3_0_13 ) { + WritePtr32( &(*interpolator7), out ); + } else { + if ( interpolator7 != NULL ) { + map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(interpolator7) ); + if (it != link_map.end()) { + NifStream( it->second, out, info ); + missing_link_stack.push_back( NULL ); + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( interpolator7 ); + } + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( NULL ); + } + } + if ( info.version < VER_3_3_0_13 ) { + WritePtr32( &(*interpolator8), out ); + } else { + if ( interpolator8 != NULL ) { + map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(interpolator8) ); + if (it != link_map.end()) { + NifStream( it->second, out, info ); + missing_link_stack.push_back( NULL ); + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( interpolator8 ); + } + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( NULL ); + } + } + if ( info.version < VER_3_3_0_13 ) { + WritePtr32( &(*interpolator9_ArcOffset), out ); + } else { + if ( interpolator9_ArcOffset != NULL ) { + map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(interpolator9_ArcOffset) ); + if (it != link_map.end()) { + NifStream( it->second, out, info ); + missing_link_stack.push_back( NULL ); + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( interpolator9_ArcOffset ); + } + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( NULL ); + } + } NifStream( unknownShort1, out, info ); NifStream( unknownShort2, out, info ); NifStream( unknownShort3, out, info ); - NifStream( float1, out, info ); + NifStream( distanceWeight, out, info ); NifStream( float2, out, info ); - NifStream( float3, out, info ); - NifStream( float4, out, info ); + NifStream( stripWidth, out, info ); + NifStream( fork, out, info ); NifStream( float5, out, info ); NifStream( byte1, out, info ); NifStream( byte2, out, info ); NifStream( byte3, out, info ); - NifStream( target___8, out, info ); + if ( info.version < VER_3_3_0_13 ) { + WritePtr32( &(*interpolator10_), out ); + } else { + if ( interpolator10_ != NULL ) { + map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(interpolator10_) ); + if (it != link_map.end()) { + NifStream( it->second, out, info ); + missing_link_stack.push_back( NULL ); + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( interpolator10_ ); + } + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( NULL ); + } + } //--BEGIN POST-WRITE CUSTOM CODE--// @@ -111,26 +266,26 @@ std::string BSProceduralLightningController::asString( bool verbose ) const { stringstream out; out << NiFloatInterpController::asString(); - out << " Unknown Int 2: " << unknownInt2 << endl; - out << " Target(?)1: " << target___1 << endl; - out << " Target(?)2: " << target___2 << endl; - out << " Target(?)3: " << target___3 << endl; - out << " Target(?)4: " << target___4 << endl; - out << " Target(?)5: " << target___5 << endl; - out << " Target(?)6: " << target___6 << endl; - out << " Target(?)7: " << target___7 << endl; + out << " Interpolator 2: Mutation: " << interpolator2_Mutation << endl; + out << " Interpolator 3: " << interpolator3 << endl; + out << " Interpolator 4: " << interpolator4 << endl; + out << " Interpolator 5: " << interpolator5 << endl; + out << " Interpolator 6: " << interpolator6 << endl; + out << " Interpolator 7: " << interpolator7 << endl; + out << " Interpolator 8: " << interpolator8 << endl; + out << " Interpolator 9: Arc Offset: " << interpolator9_ArcOffset << endl; out << " Unknown Short 1: " << unknownShort1 << endl; out << " Unknown Short 2: " << unknownShort2 << endl; out << " Unknown Short 3: " << unknownShort3 << endl; - out << " Float 1: " << float1 << endl; + out << " Distance Weight: " << distanceWeight << endl; out << " Float 2: " << float2 << endl; - out << " Float 3: " << float3 << endl; - out << " Float 4: " << float4 << endl; + out << " Strip Width: " << stripWidth << endl; + out << " Fork: " << fork << endl; out << " Float 5: " << float5 << endl; out << " Byte 1: " << byte1 << endl; out << " Byte 2: " << byte2 << endl; out << " Byte 3: " << byte3 << endl; - out << " Target(?)8: " << target___8 << endl; + out << " Interpolator 10?: " << interpolator10_ << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// @@ -144,6 +299,15 @@ void BSProceduralLightningController::FixLinks( const map<unsigned int,NiObjectR //--END CUSTOM CODE--// NiFloatInterpController::FixLinks( objects, link_stack, missing_link_stack, info ); + interpolator2_Mutation = FixLink<NiInterpolator>( objects, link_stack, missing_link_stack, info ); + interpolator3 = FixLink<NiInterpolator>( objects, link_stack, missing_link_stack, info ); + interpolator4 = FixLink<NiInterpolator>( objects, link_stack, missing_link_stack, info ); + interpolator5 = FixLink<NiInterpolator>( objects, link_stack, missing_link_stack, info ); + interpolator6 = FixLink<NiInterpolator>( objects, link_stack, missing_link_stack, info ); + interpolator7 = FixLink<NiInterpolator>( objects, link_stack, missing_link_stack, info ); + interpolator8 = FixLink<NiInterpolator>( objects, link_stack, missing_link_stack, info ); + interpolator9_ArcOffset = FixLink<NiInterpolator>( objects, link_stack, missing_link_stack, info ); + interpolator10_ = FixLink<NiInterpolator>( objects, link_stack, missing_link_stack, info ); //--BEGIN POST-FIXLINKS CUSTOM CODE--// @@ -153,6 +317,24 @@ void BSProceduralLightningController::FixLinks( const map<unsigned int,NiObjectR std::list<NiObjectRef> BSProceduralLightningController::GetRefs() const { list<Ref<NiObject> > refs; refs = NiFloatInterpController::GetRefs(); + if ( interpolator2_Mutation != NULL ) + refs.push_back(StaticCast<NiObject>(interpolator2_Mutation)); + if ( interpolator3 != NULL ) + refs.push_back(StaticCast<NiObject>(interpolator3)); + if ( interpolator4 != NULL ) + refs.push_back(StaticCast<NiObject>(interpolator4)); + if ( interpolator5 != NULL ) + refs.push_back(StaticCast<NiObject>(interpolator5)); + if ( interpolator6 != NULL ) + refs.push_back(StaticCast<NiObject>(interpolator6)); + if ( interpolator7 != NULL ) + refs.push_back(StaticCast<NiObject>(interpolator7)); + if ( interpolator8 != NULL ) + refs.push_back(StaticCast<NiObject>(interpolator8)); + if ( interpolator9_ArcOffset != NULL ) + refs.push_back(StaticCast<NiObject>(interpolator9_ArcOffset)); + if ( interpolator10_ != NULL ) + refs.push_back(StaticCast<NiObject>(interpolator10_)); return refs; } diff --git a/src/obj/BSSegmentedTriShape.cpp b/src/obj/BSSegmentedTriShape.cpp index 3d2bfe4f605502b8b103c6bb00fcf269597ac0cc..2d7c3c4eeb39fc21476ec1ee87b60c145e6e9da6 100644 --- a/src/obj/BSSegmentedTriShape.cpp +++ b/src/obj/BSSegmentedTriShape.cpp @@ -15,13 +15,13 @@ All rights reserved. Please see niflib.h for license. */ #include "../../include/ObjectRegistry.h" #include "../../include/NIF_IO.h" #include "../../include/obj/BSSegmentedTriShape.h" -#include "../../include/gen/BSSegmentedTriangle.h" +#include "../../include/gen/BSSegment.h" using namespace Niflib; //Definition of TYPE constant const Type BSSegmentedTriShape::TYPE("BSSegmentedTriShape", &NiTriShape::TYPE ); -BSSegmentedTriShape::BSSegmentedTriShape() : numSegTriangles((int)0) { +BSSegmentedTriShape::BSSegmentedTriShape() : numSegments((int)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -47,12 +47,12 @@ void BSSegmentedTriShape::Read( istream& in, list<unsigned int> & link_stack, co //--END CUSTOM CODE--// NiTriShape::Read( in, link_stack, info ); - NifStream( numSegTriangles, in, info ); - segTriangles.resize(numSegTriangles); - for (unsigned int i1 = 0; i1 < segTriangles.size(); i1++) { - NifStream( segTriangles[i1].unknownInt1, in, info ); - NifStream( segTriangles[i1].unknownInt2, in, info ); - NifStream( segTriangles[i1].unknownByte1, in, info ); + NifStream( numSegments, in, info ); + segment.resize(numSegments); + for (unsigned int i1 = 0; i1 < segment.size(); i1++) { + NifStream( segment[i1].internalIndex, in, info ); + NifStream( segment[i1].flags, in, info ); + NifStream( segment[i1].unknownByte1, in, info ); }; //--BEGIN POST-READ CUSTOM CODE--// @@ -66,12 +66,12 @@ void BSSegmentedTriShape::Write( ostream& out, const map<NiObjectRef,unsigned in //--END CUSTOM CODE--// NiTriShape::Write( out, link_map, missing_link_stack, info ); - numSegTriangles = (int)(segTriangles.size()); - NifStream( numSegTriangles, out, info ); - for (unsigned int i1 = 0; i1 < segTriangles.size(); i1++) { - NifStream( segTriangles[i1].unknownInt1, out, info ); - NifStream( segTriangles[i1].unknownInt2, out, info ); - NifStream( segTriangles[i1].unknownByte1, out, info ); + numSegments = (int)(segment.size()); + NifStream( numSegments, out, info ); + for (unsigned int i1 = 0; i1 < segment.size(); i1++) { + NifStream( segment[i1].internalIndex, out, info ); + NifStream( segment[i1].flags, out, info ); + NifStream( segment[i1].unknownByte1, out, info ); }; //--BEGIN POST-WRITE CUSTOM CODE--// @@ -87,17 +87,17 @@ std::string BSSegmentedTriShape::asString( bool verbose ) const { stringstream out; unsigned int array_output_count = 0; out << NiTriShape::asString(); - numSegTriangles = (int)(segTriangles.size()); - out << " Num Seg Triangles: " << numSegTriangles << endl; + numSegments = (int)(segment.size()); + out << " Num Segments: " << numSegments << endl; array_output_count = 0; - for (unsigned int i1 = 0; i1 < segTriangles.size(); i1++) { + for (unsigned int i1 = 0; i1 < segment.size(); i1++) { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; break; }; - out << " Unknown Int 1: " << segTriangles[i1].unknownInt1 << endl; - out << " Unknown Int 2: " << segTriangles[i1].unknownInt2 << endl; - out << " Unknown Byte 1: " << segTriangles[i1].unknownByte1 << endl; + out << " Internal index: " << segment[i1].internalIndex << endl; + out << " Flags: " << segment[i1].flags << endl; + out << " Unknown Byte 1: " << segment[i1].unknownByte1 << endl; }; return out.str(); diff --git a/src/obj/BSShaderPPLightingProperty.cpp b/src/obj/BSShaderPPLightingProperty.cpp index 7fb3d34d80c357206022abd82b84b68b3a4c2f45..b848bdd1cafd62ad9579fc2210b008e5bf640208 100644 --- a/src/obj/BSShaderPPLightingProperty.cpp +++ b/src/obj/BSShaderPPLightingProperty.cpp @@ -58,6 +58,9 @@ void BSShaderPPLightingProperty::Read( istream& in, list<unsigned int> & link_st NifStream( unknownFloat4, in, info ); NifStream( unknownFloat5, in, info ); }; + if ( (info.userVersion >= 12) ) { + NifStream( emissiveColor, in, info ); + }; //--BEGIN POST-READ CUSTOM CODE--// @@ -95,6 +98,9 @@ void BSShaderPPLightingProperty::Write( ostream& out, const map<NiObjectRef,unsi NifStream( unknownFloat4, out, info ); NifStream( unknownFloat5, out, info ); }; + if ( (info.userVersion >= 12) ) { + NifStream( emissiveColor, out, info ); + }; //--BEGIN POST-WRITE CUSTOM CODE--// @@ -113,6 +119,7 @@ std::string BSShaderPPLightingProperty::asString( bool verbose ) const { out << " Refraction Period: " << refractionPeriod << endl; out << " Unknown Float 4: " << unknownFloat4 << endl; out << " Unknown Float 5: " << unknownFloat5 << endl; + out << " Emissive Color: " << emissiveColor << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/BSSkyShaderProperty.cpp b/src/obj/BSSkyShaderProperty.cpp index 92ac6947d1d90e814e85c6bcd194ee4acd6cd4c7..d1d94b2c184c5fd83cad821cb00bf8bfa9cb26f3 100644 --- a/src/obj/BSSkyShaderProperty.cpp +++ b/src/obj/BSSkyShaderProperty.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type BSSkyShaderProperty::TYPE("BSSkyShaderProperty", &NiProperty::TYPE ); -BSSkyShaderProperty::BSSkyShaderProperty() : unknownFloat1(0.0f), unknownInt1((unsigned int)0), unknownInt2((unsigned int)0), unknownInt3((unsigned int)0) { +BSSkyShaderProperty::BSSkyShaderProperty() : shaderFlags1((SkyrimShaderPropertyFlags1)0), shaderFlags2((SkyrimShaderPropertyFlags2)0), uvScale(1.0, 1.0), skyObjectType((SkyObjectType)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -46,12 +46,12 @@ void BSSkyShaderProperty::Read( istream& in, list<unsigned int> & link_stack, co //--END CUSTOM CODE--// NiProperty::Read( in, link_stack, info ); - NifStream( unknownFloat1, in, info ); - NifStream( unknownInt1, in, info ); - NifStream( unknownInt2, in, info ); - NifStream( unknownFloats, in, info ); - NifStream( texture, in, info ); - NifStream( unknownInt3, in, info ); + NifStream( shaderFlags1, in, info ); + NifStream( shaderFlags2, in, info ); + NifStream( uvOffset, in, info ); + NifStream( uvScale, in, info ); + NifStream( sourceTexture, in, info ); + NifStream( skyObjectType, in, info ); //--BEGIN POST-READ CUSTOM CODE--// @@ -64,12 +64,12 @@ void BSSkyShaderProperty::Write( ostream& out, const map<NiObjectRef,unsigned in //--END CUSTOM CODE--// NiProperty::Write( out, link_map, missing_link_stack, info ); - NifStream( unknownFloat1, out, info ); - NifStream( unknownInt1, out, info ); - NifStream( unknownInt2, out, info ); - NifStream( unknownFloats, out, info ); - NifStream( texture, out, info ); - NifStream( unknownInt3, out, info ); + NifStream( shaderFlags1, out, info ); + NifStream( shaderFlags2, out, info ); + NifStream( uvOffset, out, info ); + NifStream( uvScale, out, info ); + NifStream( sourceTexture, out, info ); + NifStream( skyObjectType, out, info ); //--BEGIN POST-WRITE CUSTOM CODE--// @@ -83,12 +83,12 @@ std::string BSSkyShaderProperty::asString( bool verbose ) const { stringstream out; out << NiProperty::asString(); - out << " Unknown Float 1: " << unknownFloat1 << endl; - out << " Unknown Int 1: " << unknownInt1 << endl; - out << " Unknown Int 2: " << unknownInt2 << endl; - out << " Unknown Floats: " << unknownFloats << endl; - out << " Texture: " << texture << endl; - out << " Unknown Int 3: " << unknownInt3 << endl; + out << " Shader Flags 1: " << shaderFlags1 << endl; + out << " Shader Flags 2: " << shaderFlags2 << endl; + out << " UV Offset: " << uvOffset << endl; + out << " UV Scale: " << uvScale << endl; + out << " Source Texture: " << sourceTexture << endl; + out << " Sky Object Type: " << skyObjectType << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/BSStripPSysData.cpp b/src/obj/BSStripPSysData.cpp index a029a5711f462f50fcb0cb071cfee8a140503c6a..09b12fef09e76e691d443d45008d71c3e2b0b69f 100644 --- a/src/obj/BSStripPSysData.cpp +++ b/src/obj/BSStripPSysData.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type BSStripPSysData::TYPE("BSStripPSysData", &NiPSysData::TYPE ); -BSStripPSysData::BSStripPSysData() : unknownShort3((short)0), unknownByte1((byte)0), unknownInt2((int)0), unknownInt3((int)0) { +BSStripPSysData::BSStripPSysData() : unknownShort5((short)0), unknownByte6((byte)0), unknownInt7((int)0), unknownFloat8(0.0f) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -46,10 +46,10 @@ void BSStripPSysData::Read( istream& in, list<unsigned int> & link_stack, const //--END CUSTOM CODE--// NiPSysData::Read( in, link_stack, info ); - NifStream( unknownShort3, in, info ); - NifStream( unknownByte1, in, info ); - NifStream( unknownInt2, in, info ); - NifStream( unknownInt3, in, info ); + NifStream( unknownShort5, in, info ); + NifStream( unknownByte6, in, info ); + NifStream( unknownInt7, in, info ); + NifStream( unknownFloat8, in, info ); //--BEGIN POST-READ CUSTOM CODE--// @@ -62,10 +62,10 @@ void BSStripPSysData::Write( ostream& out, const map<NiObjectRef,unsigned int> & //--END CUSTOM CODE--// NiPSysData::Write( out, link_map, missing_link_stack, info ); - NifStream( unknownShort3, out, info ); - NifStream( unknownByte1, out, info ); - NifStream( unknownInt2, out, info ); - NifStream( unknownInt3, out, info ); + NifStream( unknownShort5, out, info ); + NifStream( unknownByte6, out, info ); + NifStream( unknownInt7, out, info ); + NifStream( unknownFloat8, out, info ); //--BEGIN POST-WRITE CUSTOM CODE--// @@ -79,10 +79,10 @@ std::string BSStripPSysData::asString( bool verbose ) const { stringstream out; out << NiPSysData::asString(); - out << " Unknown Short 3: " << unknownShort3 << endl; - out << " Unknown byte 1: " << unknownByte1 << endl; - out << " Unknown Int 2: " << unknownInt2 << endl; - out << " Unknown Int 3: " << unknownInt3 << endl; + out << " Unknown Short 5: " << unknownShort5 << endl; + out << " Unknown Byte 6: " << unknownByte6 << endl; + out << " Unknown Int 7: " << unknownInt7 << endl; + out << " Unknown Float 8: " << unknownFloat8 << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/BSTreeNode.cpp b/src/obj/BSTreeNode.cpp index b8fc112ce6a6dccf6de1bbca65dbec356f303c40..19dc172b18dc203945e520640f3400f8b30dccc4 100644 --- a/src/obj/BSTreeNode.cpp +++ b/src/obj/BSTreeNode.cpp @@ -15,14 +15,13 @@ All rights reserved. Please see niflib.h for license. */ #include "../../include/ObjectRegistry.h" #include "../../include/NIF_IO.h" #include "../../include/obj/BSTreeNode.h" -#include "../../include/obj/NiAVObject.h" #include "../../include/obj/NiNode.h" using namespace Niflib; //Definition of TYPE constant -const Type BSTreeNode::TYPE("BSTreeNode", &NiAVObject::TYPE ); +const Type BSTreeNode::TYPE("BSTreeNode", &NiNode::TYPE ); -BSTreeNode::BSTreeNode() : numChildren((unsigned int)0), unknownInt1((unsigned int)0), numBones1((unsigned int)0), numBones2((unsigned int)0) { +BSTreeNode::BSTreeNode() : numBones1((unsigned int)0), numBones2((unsigned int)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -48,14 +47,7 @@ void BSTreeNode::Read( istream& in, list<unsigned int> & link_stack, const NifIn //--END CUSTOM CODE--// unsigned int block_num; - NiAVObject::Read( in, link_stack, info ); - NifStream( numChildren, in, info ); - children.resize(numChildren); - for (unsigned int i1 = 0; i1 < children.size(); i1++) { - NifStream( block_num, in, info ); - link_stack.push_back( block_num ); - }; - NifStream( unknownInt1, in, info ); + NiNode::Read( in, link_stack, info ); NifStream( numBones1, in, info ); bones1.resize(numBones1); for (unsigned int i1 = 0; i1 < bones1.size(); i1++) { @@ -79,31 +71,9 @@ void BSTreeNode::Write( ostream& out, const map<NiObjectRef,unsigned int> & link //--END CUSTOM CODE--// - NiAVObject::Write( out, link_map, missing_link_stack, info ); + NiNode::Write( out, link_map, missing_link_stack, info ); numBones2 = (unsigned int)(bones.size()); numBones1 = (unsigned int)(bones1.size()); - numChildren = (unsigned int)(children.size()); - NifStream( numChildren, out, info ); - for (unsigned int i1 = 0; i1 < children.size(); i1++) { - if ( info.version < VER_3_3_0_13 ) { - WritePtr32( &(*children[i1]), out ); - } else { - if ( children[i1] != NULL ) { - map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(children[i1]) ); - if (it != link_map.end()) { - NifStream( it->second, out, info ); - missing_link_stack.push_back( NULL ); - } else { - NifStream( 0xFFFFFFFF, out, info ); - missing_link_stack.push_back( children[i1] ); - } - } else { - NifStream( 0xFFFFFFFF, out, info ); - missing_link_stack.push_back( NULL ); - } - } - }; - NifStream( unknownInt1, out, info ); NifStream( numBones1, out, info ); for (unsigned int i1 = 0; i1 < bones1.size(); i1++) { if ( info.version < VER_3_3_0_13 ) { @@ -157,24 +127,9 @@ std::string BSTreeNode::asString( bool verbose ) const { stringstream out; unsigned int array_output_count = 0; - out << NiAVObject::asString(); + out << NiNode::asString(); numBones2 = (unsigned int)(bones.size()); numBones1 = (unsigned int)(bones1.size()); - numChildren = (unsigned int)(children.size()); - out << " Num Children: " << numChildren << endl; - array_output_count = 0; - for (unsigned int i1 = 0; i1 < children.size(); i1++) { - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; - break; - }; - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - break; - }; - out << " Children[" << i1 << "]: " << children[i1] << endl; - array_output_count++; - }; - out << " Unknown Int 1: " << unknownInt1 << endl; out << " Num Bones 1: " << numBones1 << endl; array_output_count = 0; for (unsigned int i1 = 0; i1 < bones1.size(); i1++) { @@ -213,10 +168,7 @@ void BSTreeNode::FixLinks( const map<unsigned int,NiObjectRef> & objects, list<u //--END CUSTOM CODE--// - NiAVObject::FixLinks( objects, link_stack, missing_link_stack, info ); - for (unsigned int i1 = 0; i1 < children.size(); i1++) { - children[i1] = FixLink<NiAVObject>( objects, link_stack, missing_link_stack, info ); - }; + NiNode::FixLinks( objects, link_stack, missing_link_stack, info ); for (unsigned int i1 = 0; i1 < bones1.size(); i1++) { bones1[i1] = FixLink<NiNode>( objects, link_stack, missing_link_stack, info ); }; @@ -231,11 +183,7 @@ void BSTreeNode::FixLinks( const map<unsigned int,NiObjectRef> & objects, list<u std::list<NiObjectRef> BSTreeNode::GetRefs() const { list<Ref<NiObject> > refs; - refs = NiAVObject::GetRefs(); - for (unsigned int i1 = 0; i1 < children.size(); i1++) { - if ( children[i1] != NULL ) - refs.push_back(StaticCast<NiObject>(children[i1])); - }; + refs = NiNode::GetRefs(); for (unsigned int i1 = 0; i1 < bones1.size(); i1++) { if ( bones1[i1] != NULL ) refs.push_back(StaticCast<NiObject>(bones1[i1])); @@ -249,9 +197,7 @@ std::list<NiObjectRef> BSTreeNode::GetRefs() const { std::list<NiObject *> BSTreeNode::GetPtrs() const { list<NiObject *> ptrs; - ptrs = NiAVObject::GetPtrs(); - for (unsigned int i1 = 0; i1 < children.size(); i1++) { - }; + ptrs = NiNode::GetPtrs(); for (unsigned int i1 = 0; i1 < bones1.size(); i1++) { }; for (unsigned int i1 = 0; i1 < bones.size(); i1++) { diff --git a/src/obj/BSWaterShaderProperty.cpp b/src/obj/BSWaterShaderProperty.cpp index 94c510d4f02f3376b6a0b2d5dcf5550af071fb34..38bded5ab910c14f2f1cbba550467126da8bbfc9 100644 --- a/src/obj/BSWaterShaderProperty.cpp +++ b/src/obj/BSWaterShaderProperty.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type BSWaterShaderProperty::TYPE("BSWaterShaderProperty", &NiProperty::TYPE ); -BSWaterShaderProperty::BSWaterShaderProperty() : unknownShort1((unsigned short)0), unknownShort2((unsigned short)0), unknownInt1((unsigned int)0), unknownInt2((unsigned int)0), unknownInt3((unsigned int)0), unknownFloat1(0.0f), unknownFloat2(0.0f), unknownShort3((unsigned short)0), unknownShort4((unsigned short)0) { +BSWaterShaderProperty::BSWaterShaderProperty() : shaderFlags1((SkyrimShaderPropertyFlags1)0), shaderFlags2((SkyrimShaderPropertyFlags2)0), uvScale(1.0, 1.0), waterShaderFlags((SkyrimWaterShaderFlags)0), waterDirection((byte)3), unknownShort3((unsigned short)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -46,15 +46,13 @@ void BSWaterShaderProperty::Read( istream& in, list<unsigned int> & link_stack, //--END CUSTOM CODE--// NiProperty::Read( in, link_stack, info ); - NifStream( unknownShort1, in, info ); - NifStream( unknownShort2, in, info ); - NifStream( unknownInt1, in, info ); - NifStream( unknownInt2, in, info ); - NifStream( unknownInt3, in, info ); - NifStream( unknownFloat1, in, info ); - NifStream( unknownFloat2, in, info ); + NifStream( shaderFlags1, in, info ); + NifStream( shaderFlags2, in, info ); + NifStream( uvOffset, in, info ); + NifStream( uvScale, in, info ); + NifStream( waterShaderFlags, in, info ); + NifStream( waterDirection, in, info ); NifStream( unknownShort3, in, info ); - NifStream( unknownShort4, in, info ); //--BEGIN POST-READ CUSTOM CODE--// @@ -67,15 +65,13 @@ void BSWaterShaderProperty::Write( ostream& out, const map<NiObjectRef,unsigned //--END CUSTOM CODE--// NiProperty::Write( out, link_map, missing_link_stack, info ); - NifStream( unknownShort1, out, info ); - NifStream( unknownShort2, out, info ); - NifStream( unknownInt1, out, info ); - NifStream( unknownInt2, out, info ); - NifStream( unknownInt3, out, info ); - NifStream( unknownFloat1, out, info ); - NifStream( unknownFloat2, out, info ); + NifStream( shaderFlags1, out, info ); + NifStream( shaderFlags2, out, info ); + NifStream( uvOffset, out, info ); + NifStream( uvScale, out, info ); + NifStream( waterShaderFlags, out, info ); + NifStream( waterDirection, out, info ); NifStream( unknownShort3, out, info ); - NifStream( unknownShort4, out, info ); //--BEGIN POST-WRITE CUSTOM CODE--// @@ -89,15 +85,13 @@ std::string BSWaterShaderProperty::asString( bool verbose ) const { stringstream out; out << NiProperty::asString(); - out << " Unknown Short 1: " << unknownShort1 << endl; - out << " Unknown Short 2: " << unknownShort2 << endl; - out << " Unknown Int 1: " << unknownInt1 << endl; - out << " Unknown Int 2: " << unknownInt2 << endl; - out << " Unknown Int 3: " << unknownInt3 << endl; - out << " Unknown Float 1: " << unknownFloat1 << endl; - out << " Unknown Float 2: " << unknownFloat2 << endl; + out << " Shader Flags 1: " << shaderFlags1 << endl; + out << " Shader Flags 2: " << shaderFlags2 << endl; + out << " UV Offset: " << uvOffset << endl; + out << " UV Scale: " << uvScale << endl; + out << " Water Shader Flags: " << waterShaderFlags << endl; + out << " Water Direction: " << waterDirection << endl; out << " Unknown Short 3: " << unknownShort3 << endl; - out << " Unknown Short 4: " << unknownShort4 << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/NiAVObject.cpp b/src/obj/NiAVObject.cpp index a888c1c9de6244c9e81610a25978b31284ffa943..7805fa68703cdf39caf352a55990ac534d3c9411 100644 --- a/src/obj/NiAVObject.cpp +++ b/src/obj/NiAVObject.cpp @@ -28,24 +28,6 @@ NiAVObject::NiAVObject() : flags((unsigned short)0), unknownShort1((unsigned sho parent = NULL; - //--END CUSTOM CODE--// -} - -NiAVObject::NiAVObject(const NiAVObject& src) - : NiObjectNET(src), - flags(src.flags), - unknownShort1(src.unknownShort1), - scale(src.scale), - numProperties((unsigned int)0), - unknown2(src.unknown2), - hasBoundingBox(src.hasBoundingBox), - collisionObject(NULL), - translation(src.translation), - velocity(src.velocity), - rotation(src.rotation), - boundingBox(src.boundingBox) -{ - //--BEGIN CONSTRUCTOR CUSTOM CODE--// parent = NULL; @@ -92,7 +74,7 @@ void NiAVObject::Read( istream& in, list<unsigned int> & link_stack, const NifIn if ( info.version <= 0x04020200 ) { NifStream( velocity, in, info ); }; - if ( (info.userVersion <= 11) ) { + if ( ((info.version < 0x14020007) || (info.userVersion <= 11)) ) { NifStream( numProperties, in, info ); properties.resize(numProperties); for (unsigned int i2 = 0; i2 < properties.size(); i2++) { @@ -142,7 +124,7 @@ void NiAVObject::Write( ostream& out, const map<NiObjectRef,unsigned int> & link if ( info.version <= 0x04020200 ) { NifStream( velocity, out, info ); }; - if ( (info.userVersion <= 11) ) { + if ( ((info.version < 0x14020007) || (info.userVersion <= 11)) ) { NifStream( numProperties, out, info ); for (unsigned int i2 = 0; i2 < properties.size(); i2++) { if ( info.version < VER_3_3_0_13 ) { @@ -262,7 +244,7 @@ void NiAVObject::FixLinks( const map<unsigned int,NiObjectRef> & objects, list<u //--END CUSTOM CODE--// NiObjectNET::FixLinks( objects, link_stack, missing_link_stack, info ); - if ( (info.userVersion <= 11) ) { + if ( ((info.version < 0x14020007) || (info.userVersion <= 11)) ) { for (unsigned int i2 = 0; i2 < properties.size(); i2++) { properties[i2] = FixLink<NiProperty>( objects, link_stack, missing_link_stack, info ); }; diff --git a/src/obj/NiGeometry.cpp b/src/obj/NiGeometry.cpp index 51eb1bcc0d613602345d947371a8a807f2dbff66..c39a191bdc07fede1584d6cd26f6d13305869180 100644 --- a/src/obj/NiGeometry.cpp +++ b/src/obj/NiGeometry.cpp @@ -645,14 +645,12 @@ void NiGeometry::setBSProperty(short index, Niflib::Ref<NiProperty> value) { } } -array<2,Ref<NiProperty > > Niflib::NiGeometry::getBsProperties() { +array<2,Ref<NiProperty > > Niflib::NiGeometry::getBSProperties() { return this->bsProperties; } -void Niflib::NiGeometry::setBsProperties( array<2, Ref<NiProperty>> value ) { +void Niflib::NiGeometry::setBSProperties( array<2, Ref<NiProperty> > value ) { this->bsProperties = value; } //--END CUSTOM CODE--// - - diff --git a/src/obj/NiGeometryData.cpp b/src/obj/NiGeometryData.cpp index 84b57d5603711ec41fb34aebf58bd5ed44e11229..c0008bd185942a04ea6d26e57c75d1532b3aa5c5 100644 --- a/src/obj/NiGeometryData.cpp +++ b/src/obj/NiGeometryData.cpp @@ -79,7 +79,9 @@ void NiGeometryData::Read( istream& in, list<unsigned int> & link_stack, const N NifStream( bsNumUvSets, in, info ); }; if ( ( info.version >= 0x14020007 ) && ( info.userVersion == 12 ) ) { - NifStream( unknownInt2, in, info ); + if ( (!IsDerivedType(NiPSysData::TYPE)) ) { + NifStream( unknownInt2, in, info ); + }; }; NifStream( hasNormals, in, info ); if ( hasNormals ) { @@ -138,13 +140,24 @@ void NiGeometryData::Read( istream& in, list<unsigned int> & link_stack, const N }; }; }; - if ( info.version >= 0x0A000100 ) { + if ( ( info.version >= 0x0A000100 ) && ( (info.userVersion < 12) ) ) { NifStream( consistencyFlags, in, info ); }; - if ( info.version >= 0x14000004 ) { + if ( ( info.version >= 0x0A000100 ) && ( (info.userVersion >= 12) ) ) { + if ( (!IsDerivedType(NiPSysData::TYPE)) ) { + NifStream( consistencyFlags, in, info ); + }; + }; + if ( ( info.version >= 0x14000004 ) && ( (info.userVersion < 12) ) ) { NifStream( block_num, in, info ); link_stack.push_back( block_num ); }; + if ( ( info.version >= 0x14000004 ) && ( (info.userVersion >= 12) ) ) { + if ( (!IsDerivedType(NiPSysData::TYPE)) ) { + NifStream( block_num, in, info ); + link_stack.push_back( block_num ); + }; + }; //--BEGIN POST-READ CUSTOM CODE--// //--END CUSTOM CODE--// @@ -155,7 +168,7 @@ void NiGeometryData::Write( ostream& out, const map<NiObjectRef,unsigned int> & //--END CUSTOM CODE--// NiObject::Write( out, link_map, missing_link_stack, info ); - bsNumUvSets = ((unsigned short)(uvSets.size()) | (bsNumUvSets & 0xFF00)); + bsNumUvSets = (unsigned short)(uvSets.size()); numUvSets = (unsigned short)(uvSets.size()); numVertices = (unsigned short)(vertices.size()); if ( info.version >= 0x0A020000 ) { @@ -191,7 +204,9 @@ void NiGeometryData::Write( ostream& out, const map<NiObjectRef,unsigned int> & NifStream( bsNumUvSets, out, info ); }; if ( ( info.version >= 0x14020007 ) && ( info.userVersion == 12 ) ) { - NifStream( unknownInt2, out, info ); + if ( (!IsDerivedType(NiPSysData::TYPE)) ) { + NifStream( unknownInt2, out, info ); + }; }; NifStream( hasNormals, out, info ); if ( hasNormals ) { @@ -242,10 +257,15 @@ void NiGeometryData::Write( ostream& out, const map<NiObjectRef,unsigned int> & }; }; }; - if ( info.version >= 0x0A000100 ) { + if ( ( info.version >= 0x0A000100 ) && ( (info.userVersion < 12) ) ) { NifStream( consistencyFlags, out, info ); }; - if ( info.version >= 0x14000004 ) { + if ( ( info.version >= 0x0A000100 ) && ( (info.userVersion >= 12) ) ) { + if ( (!IsDerivedType(NiPSysData::TYPE)) ) { + NifStream( consistencyFlags, out, info ); + }; + }; + if ( ( info.version >= 0x14000004 ) && ( (info.userVersion < 12) ) ) { if ( info.version < VER_3_3_0_13 ) { WritePtr32( &(*additionalData), out ); } else { @@ -264,6 +284,27 @@ void NiGeometryData::Write( ostream& out, const map<NiObjectRef,unsigned int> & } } }; + if ( ( info.version >= 0x14000004 ) && ( (info.userVersion >= 12) ) ) { + if ( (!IsDerivedType(NiPSysData::TYPE)) ) { + if ( info.version < VER_3_3_0_13 ) { + WritePtr32( &(*additionalData), out ); + } else { + if ( additionalData != NULL ) { + map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(additionalData) ); + if (it != link_map.end()) { + NifStream( it->second, out, info ); + missing_link_stack.push_back( NULL ); + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( additionalData ); + } + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( NULL ); + } + } + }; + }; //--BEGIN POST-WRITE CUSTOM CODE--// //--END CUSTOM CODE--// @@ -305,7 +346,9 @@ std::string NiGeometryData::asString( bool verbose ) const { }; out << " Num UV Sets: " << numUvSets << endl; out << " BS Num UV Sets: " << bsNumUvSets << endl; - out << " Unknown Int 2: " << unknownInt2 << endl; + if ( (!IsDerivedType(NiPSysData::TYPE)) ) { + out << " Unknown Int 2: " << unknownInt2 << endl; + }; out << " Has Normals: " << hasNormals << endl; if ( hasNormals ) { array_output_count = 0; @@ -404,9 +447,14 @@ void NiGeometryData::FixLinks( const map<unsigned int,NiObjectRef> & objects, li //--END CUSTOM CODE--// NiObject::FixLinks( objects, link_stack, missing_link_stack, info ); - if ( info.version >= 0x14000004 ) { + if ( ( info.version >= 0x14000004 ) && ( (info.userVersion < 12) ) ) { additionalData = FixLink<AbstractAdditionalGeometryData>( objects, link_stack, missing_link_stack, info ); }; + if ( ( info.version >= 0x14000004 ) && ( (info.userVersion >= 12) ) ) { + if ( (!IsDerivedType(NiPSysData::TYPE)) ) { + additionalData = FixLink<AbstractAdditionalGeometryData>( objects, link_stack, missing_link_stack, info ); + }; + }; //--BEGIN POST-FIXLINKS CUSTOM CODE--// //--END CUSTOM CODE--// diff --git a/src/obj/NiNode.cpp b/src/obj/NiNode.cpp index 1908062e5f7d734b970359ea57766733bf19fae8..1325acc7b5913890a15a5903f760072b3e368c02 100644 --- a/src/obj/NiNode.cpp +++ b/src/obj/NiNode.cpp @@ -33,13 +33,6 @@ NiNode::NiNode() : numChildren((unsigned int)0), numEffects((unsigned int)0) { //--END CUSTOM CODE--// } -NiNode::NiNode(const NiNode& src) - : NiAVObject(src), - numChildren((unsigned int)0), - numEffects((unsigned int)0) -{ -} - NiNode::~NiNode() { //--BEGIN DESTRUCTOR CUSTOM CODE--// diff --git a/src/obj/NiObject.cpp b/src/obj/NiObject.cpp index f9e2ccf2a90c0e87d3ba139dca98804a2b3df9c7..deb2fb2f8165a33bdb37205dd8f7418076c34899 100644 --- a/src/obj/NiObject.cpp +++ b/src/obj/NiObject.cpp @@ -25,14 +25,6 @@ NiObject::NiObject() { //--END CUSTOM CODE--// } -NiObject::NiObject(const NiObject& src) - : RefObject(src), - internal_block_number(src.internal_block_number) -{ - //--BEGIN CONSTRUCTOR CUSTOM CODE--// - //--END CUSTOM CODE--// -} - NiObject::~NiObject() { //--BEGIN DESTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// diff --git a/src/obj/NiObjectNET.cpp b/src/obj/NiObjectNET.cpp index d29c35bf8a280341928b42f9559d5ede6f940fc5..93a83a7538f9a2477de128daa71dddfa38e3060c 100644 --- a/src/obj/NiObjectNET.cpp +++ b/src/obj/NiObjectNET.cpp @@ -22,24 +22,7 @@ using namespace Niflib; //Definition of TYPE constant const Type NiObjectNET::TYPE("NiObjectNET", &NiObject::TYPE ); -NiObjectNET::NiObjectNET() : skyrimShaderType((unsigned int)0), hasOldExtraData(false), oldExtraInternalId((unsigned int)0), unknownByte((byte)0), extraData(NULL), numExtraDataList((unsigned int)0), controller(NULL) { - //--BEGIN CONSTRUCTOR CUSTOM CODE--// - //--END CUSTOM CODE--// -} - -NiObjectNET::NiObjectNET(const NiObjectNET& src) - : NiObject(src), - skyrimShaderType(src.skyrimShaderType), - name(src.name), - hasOldExtraData (src.hasOldExtraData), - oldExtraPropName(src.oldExtraPropName), - oldExtraInternalId(src.oldExtraInternalId), - oldExtraString(src.oldExtraString), - unknownByte(src.unknownByte), - extraData(NULL), - numExtraDataList((unsigned int)0), - controller(NULL) -{ +NiObjectNET::NiObjectNET() : skyrimShaderType((BSLightingShaderPropertyShaderType)0), hasOldExtraData(false), oldExtraInternalId((unsigned int)0), unknownByte((byte)0), extraData(NULL), numExtraDataList((unsigned int)0), controller(NULL) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// } @@ -422,14 +405,12 @@ list< Ref<NiTimeController> > NiObjectNET::GetControllers() const { return conts; } -unsigned int NiObjectNET::GetSkyrimShaderType() { +BSLightingShaderPropertyShaderType NiObjectNET::GetSkyrimShaderType() { return skyrimShaderType; } -void NiObjectNET::SetSkyrimShaderType( unsigned int value ) { +void NiObjectNET::SetSkyrimShaderType( BSLightingShaderPropertyShaderType value ) { skyrimShaderType = value; } //--END CUSTOM CODE--// - - diff --git a/src/obj/NiPSysData.cpp b/src/obj/NiPSysData.cpp index 00e1c461890ca301629fb4f55187c63383ca7944..c09fb7577c09bd8a5bdb47d23260b80cec9d8c3a 100644 --- a/src/obj/NiPSysData.cpp +++ b/src/obj/NiPSysData.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type NiPSysData::TYPE("NiPSysData", &NiRotatingParticlesData::TYPE ); -NiPSysData::NiPSysData() : hasUnknownFloats3(false), unknownShort1((unsigned short)0), unknownShort2((unsigned short)0), unknownByte2((byte)0), hasVertexColors2((byte)0), numVertexColors2((unsigned int)0), unknownInt3((unsigned int)0), unknownInt4((unsigned int)0), unknownInt5((unsigned int)0), unknownInt6((unsigned int)0), unknownShort3((unsigned short)0), unknownByte4((byte)0) { +NiPSysData::NiPSysData() : hasUnknownFloats3(false), unknownShort1((unsigned short)0), unknownShort2((unsigned short)0), hasSubtextureOffsetUvs(false), numSubtextureOffsetUvs((unsigned int)0), aspectRatio(0.0f), unknownInt4((unsigned int)0), unknownInt5((unsigned int)0), unknownInt6((unsigned int)0), unknownShort3((unsigned short)0), unknownByte4((byte)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// } @@ -43,18 +43,20 @@ void NiPSysData::Read( istream& in, list<unsigned int> & link_stack, const NifIn //--END CUSTOM CODE--// NiRotatingParticlesData::Read( in, link_stack, info ); - particleDescriptions.resize(numVertices); - for (unsigned int i1 = 0; i1 < particleDescriptions.size(); i1++) { - NifStream( particleDescriptions[i1].translation, in, info ); - if ( info.version <= 0x0A040001 ) { - for (unsigned int i3 = 0; i3 < 3; i3++) { - NifStream( particleDescriptions[i1].unknownFloats1[i3], in, info ); + if ( (!((info.version >= 0x14020007) && (info.userVersion >= 11))) ) { + particleDescriptions.resize(numVertices); + for (unsigned int i2 = 0; i2 < particleDescriptions.size(); i2++) { + NifStream( particleDescriptions[i2].translation, in, info ); + if ( info.version <= 0x0A040001 ) { + for (unsigned int i4 = 0; i4 < 3; i4++) { + NifStream( particleDescriptions[i2].unknownFloats1[i4], in, info ); + }; }; + NifStream( particleDescriptions[i2].unknownFloat1, in, info ); + NifStream( particleDescriptions[i2].unknownFloat2, in, info ); + NifStream( particleDescriptions[i2].unknownFloat3, in, info ); + NifStream( particleDescriptions[i2].unknownInt1, in, info ); }; - NifStream( particleDescriptions[i1].unknownFloat1, in, info ); - NifStream( particleDescriptions[i1].unknownFloat2, in, info ); - NifStream( particleDescriptions[i1].unknownFloat3, in, info ); - NifStream( particleDescriptions[i1].unknownInt1, in, info ); }; if ( ( info.version >= 0x14000004 ) && ( (!((info.version >= 0x14020007) && (info.userVersion >= 11))) ) ) { NifStream( hasUnknownFloats3, in, info ); @@ -65,21 +67,18 @@ void NiPSysData::Read( istream& in, list<unsigned int> & link_stack, const NifIn }; }; }; - if ( (!((info.version >= 0x14020007) && (info.userVersion >= 11))) ) { + if ( (!((info.version >= 0x14020007) && (info.userVersion == 11))) ) { NifStream( unknownShort1, in, info ); NifStream( unknownShort2, in, info ); }; if ( ((info.version >= 0x14020007) && (info.userVersion >= 12)) ) { - NifStream( unknownByte2, in, info ); - NifStream( unknownShort1, in, info ); - NifStream( unknownShort2, in, info ); - NifStream( hasVertexColors2, in, info ); - NifStream( numVertexColors2, in, info ); - NifStream( unknownInt3, in, info ); - if ( (hasVertexColors2 == 1) ) { - vertexColors.resize(numVertexColors2); - for (unsigned int i3 = 0; i3 < vertexColors.size(); i3++) { - NifStream( vertexColors[i3], in, info ); + NifStream( hasSubtextureOffsetUvs, in, info ); + NifStream( numSubtextureOffsetUvs, in, info ); + NifStream( aspectRatio, in, info ); + if ( (hasSubtextureOffsetUvs == 1) ) { + subtextureOffsetUvs.resize(numSubtextureOffsetUvs); + for (unsigned int i3 = 0; i3 < subtextureOffsetUvs.size(); i3++) { + NifStream( subtextureOffsetUvs[i3], in, info ); }; }; NifStream( unknownInt4, in, info ); @@ -98,18 +97,20 @@ void NiPSysData::Write( ostream& out, const map<NiObjectRef,unsigned int> & link //--END CUSTOM CODE--// NiRotatingParticlesData::Write( out, link_map, missing_link_stack, info ); - numVertexColors2 = (unsigned int)(vertexColors.size()); - for (unsigned int i1 = 0; i1 < particleDescriptions.size(); i1++) { - NifStream( particleDescriptions[i1].translation, out, info ); - if ( info.version <= 0x0A040001 ) { - for (unsigned int i3 = 0; i3 < 3; i3++) { - NifStream( particleDescriptions[i1].unknownFloats1[i3], out, info ); + numSubtextureOffsetUvs = (unsigned int)(subtextureOffsetUvs.size()); + if ( (!((info.version >= 0x14020007) && (info.userVersion >= 11))) ) { + for (unsigned int i2 = 0; i2 < particleDescriptions.size(); i2++) { + NifStream( particleDescriptions[i2].translation, out, info ); + if ( info.version <= 0x0A040001 ) { + for (unsigned int i4 = 0; i4 < 3; i4++) { + NifStream( particleDescriptions[i2].unknownFloats1[i4], out, info ); + }; }; + NifStream( particleDescriptions[i2].unknownFloat1, out, info ); + NifStream( particleDescriptions[i2].unknownFloat2, out, info ); + NifStream( particleDescriptions[i2].unknownFloat3, out, info ); + NifStream( particleDescriptions[i2].unknownInt1, out, info ); }; - NifStream( particleDescriptions[i1].unknownFloat1, out, info ); - NifStream( particleDescriptions[i1].unknownFloat2, out, info ); - NifStream( particleDescriptions[i1].unknownFloat3, out, info ); - NifStream( particleDescriptions[i1].unknownInt1, out, info ); }; if ( ( info.version >= 0x14000004 ) && ( (!((info.version >= 0x14020007) && (info.userVersion >= 11))) ) ) { NifStream( hasUnknownFloats3, out, info ); @@ -119,20 +120,17 @@ void NiPSysData::Write( ostream& out, const map<NiObjectRef,unsigned int> & link }; }; }; - if ( (!((info.version >= 0x14020007) && (info.userVersion >= 11))) ) { + if ( (!((info.version >= 0x14020007) && (info.userVersion == 11))) ) { NifStream( unknownShort1, out, info ); NifStream( unknownShort2, out, info ); }; if ( ((info.version >= 0x14020007) && (info.userVersion >= 12)) ) { - NifStream( unknownByte2, out, info ); - NifStream( unknownShort1, out, info ); - NifStream( unknownShort2, out, info ); - NifStream( hasVertexColors2, out, info ); - NifStream( numVertexColors2, out, info ); - NifStream( unknownInt3, out, info ); - if ( (hasVertexColors2 == 1) ) { - for (unsigned int i3 = 0; i3 < vertexColors.size(); i3++) { - NifStream( vertexColors[i3], out, info ); + NifStream( hasSubtextureOffsetUvs, out, info ); + NifStream( numSubtextureOffsetUvs, out, info ); + NifStream( aspectRatio, out, info ); + if ( (hasSubtextureOffsetUvs == 1) ) { + for (unsigned int i3 = 0; i3 < subtextureOffsetUvs.size(); i3++) { + NifStream( subtextureOffsetUvs[i3], out, info ); }; }; NifStream( unknownInt4, out, info ); @@ -153,7 +151,7 @@ std::string NiPSysData::asString( bool verbose ) const { stringstream out; unsigned int array_output_count = 0; out << NiRotatingParticlesData::asString(); - numVertexColors2 = (unsigned int)(vertexColors.size()); + numSubtextureOffsetUvs = (unsigned int)(subtextureOffsetUvs.size()); array_output_count = 0; for (unsigned int i1 = 0; i1 < particleDescriptions.size(); i1++) { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { @@ -195,13 +193,12 @@ std::string NiPSysData::asString( bool verbose ) const { }; out << " Unknown Short 1: " << unknownShort1 << endl; out << " Unknown Short 2: " << unknownShort2 << endl; - out << " Unknown Byte 2: " << unknownByte2 << endl; - out << " Has Vertex Colors 2: " << hasVertexColors2 << endl; - out << " Num Vertex Colors 2: " << numVertexColors2 << endl; - out << " Unknown Int 3: " << unknownInt3 << endl; - if ( (hasVertexColors2 == 1) ) { + out << " Has Subtexture Offset UVs: " << hasSubtextureOffsetUvs << endl; + out << " Num Subtexture Offset UVs: " << numSubtextureOffsetUvs << endl; + out << " Aspect Ratio: " << aspectRatio << endl; + if ( (hasSubtextureOffsetUvs == 1) ) { array_output_count = 0; - for (unsigned int i2 = 0; i2 < vertexColors.size(); i2++) { + for (unsigned int i2 = 0; i2 < subtextureOffsetUvs.size(); i2++) { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; break; @@ -209,7 +206,7 @@ std::string NiPSysData::asString( bool verbose ) const { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { break; }; - out << " Vertex Colors[" << i2 << "]: " << vertexColors[i2] << endl; + out << " Subtexture Offset UVs[" << i2 << "]: " << subtextureOffsetUvs[i2] << endl; array_output_count++; }; }; diff --git a/src/obj/NiParticleSystem.cpp b/src/obj/NiParticleSystem.cpp index 3b6ea4d92e09a8394d44eca0ed1c8e21ae00da47..a5c03a8e0ff839835cd6ab947b919391226b7ea9 100644 --- a/src/obj/NiParticleSystem.cpp +++ b/src/obj/NiParticleSystem.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type NiParticleSystem::TYPE("NiParticleSystem", &NiParticles::TYPE ); -NiParticleSystem::NiParticleSystem() : unknownShort1((unsigned short)0), unknownShort2((unsigned short)0), unknownInt1((unsigned int)0), worldSpace(false), numModifiers((unsigned int)0) { +NiParticleSystem::NiParticleSystem() : unknownShort2((unsigned short)0), unknownShort3((unsigned short)0), unknownInt1((unsigned int)0), worldSpace(false), numModifiers((unsigned int)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// } @@ -45,8 +45,8 @@ void NiParticleSystem::Read( istream& in, list<unsigned int> & link_stack, const unsigned int block_num; NiParticles::Read( in, link_stack, info ); if ( (info.userVersion >= 12) ) { - NifStream( unknownShort1, in, info ); NifStream( unknownShort2, in, info ); + NifStream( unknownShort3, in, info ); NifStream( unknownInt1, in, info ); }; if ( info.version >= 0x0A010000 ) { @@ -70,8 +70,8 @@ void NiParticleSystem::Write( ostream& out, const map<NiObjectRef,unsigned int> NiParticles::Write( out, link_map, missing_link_stack, info ); numModifiers = (unsigned int)(modifiers.size()); if ( (info.userVersion >= 12) ) { - NifStream( unknownShort1, out, info ); NifStream( unknownShort2, out, info ); + NifStream( unknownShort3, out, info ); NifStream( unknownInt1, out, info ); }; if ( info.version >= 0x0A010000 ) { @@ -110,8 +110,8 @@ std::string NiParticleSystem::asString( bool verbose ) const { unsigned int array_output_count = 0; out << NiParticles::asString(); numModifiers = (unsigned int)(modifiers.size()); - out << " Unknown Short 1: " << unknownShort1 << endl; out << " Unknown Short 2: " << unknownShort2 << endl; + out << " Unknown Short 3: " << unknownShort3 << endl; out << " Unknown Int 1: " << unknownInt1 << endl; out << " World Space: " << worldSpace << endl; out << " Num Modifiers: " << numModifiers << endl; diff --git a/src/obj/NiParticlesData.cpp b/src/obj/NiParticlesData.cpp index daaaeca38405bb0fa977a746b3d00c300ac70e6e..c6edd7ae5885ee2a9c172e92cc926cc77ad3b60b 100644 --- a/src/obj/NiParticlesData.cpp +++ b/src/obj/NiParticlesData.cpp @@ -20,7 +20,7 @@ using namespace Niflib; //Definition of TYPE constant const Type NiParticlesData::TYPE("NiParticlesData", &NiGeometryData::TYPE ); -NiParticlesData::NiParticlesData() : numParticles((unsigned short)0), particleRadius(0.0f), hasRadii(false), numActive((unsigned short)0), hasSizes(false), hasRotations(false), unknownByte1((byte)0), unknownLink(NULL), hasRotationAngles(false), hasRotationAxes(false), hasUnknownStuff1(false), numUnknownStuff1((short)0) { +NiParticlesData::NiParticlesData() : numParticles((unsigned short)0), particleRadius(0.0f), hasRadii(false), numActive((unsigned short)0), hasSizes(false), hasRotations(false), unknownByte1((byte)0), unknownLink(NULL), hasRotationAngles(false), hasRotationAxes(false), hasUvQuadrants(false), numUvQuadrants((byte)0), unknownByte2((byte)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// } @@ -110,15 +110,18 @@ void NiParticlesData::Read( istream& in, list<unsigned int> & link_stack, const }; }; if ( ((info.version >= 0x14020007) && (info.userVersion == 11)) ) { - NifStream( hasUnknownStuff1, in, info ); - NifStream( numUnknownStuff1, in, info ); - if ( hasUnknownStuff1 ) { - unknownStuff1.resize(numUnknownStuff1); - for (unsigned int i3 = 0; i3 < unknownStuff1.size(); i3++) { - NifStream( unknownStuff1[i3], in, info ); + NifStream( hasUvQuadrants, in, info ); + NifStream( numUvQuadrants, in, info ); + if ( hasUvQuadrants ) { + uvQuadrants.resize(numUvQuadrants); + for (unsigned int i3 = 0; i3 < uvQuadrants.size(); i3++) { + NifStream( uvQuadrants[i3], in, info ); }; }; }; + if ( ((info.version == 0x14020007) && (info.userVersion >= 11)) ) { + NifStream( unknownByte2, in, info ); + }; //--BEGIN POST-READ CUSTOM CODE--// //--END CUSTOM CODE--// @@ -129,7 +132,7 @@ void NiParticlesData::Write( ostream& out, const map<NiObjectRef,unsigned int> & //--END CUSTOM CODE--// NiGeometryData::Write( out, link_map, missing_link_stack, info ); - numUnknownStuff1 = (short)(unknownStuff1.size()); + numUvQuadrants = (byte)(uvQuadrants.size()); if ( info.version <= 0x04000002 ) { NifStream( numParticles, out, info ); }; @@ -206,14 +209,17 @@ void NiParticlesData::Write( ostream& out, const map<NiObjectRef,unsigned int> & }; }; if ( ((info.version >= 0x14020007) && (info.userVersion == 11)) ) { - NifStream( hasUnknownStuff1, out, info ); - NifStream( numUnknownStuff1, out, info ); - if ( hasUnknownStuff1 ) { - for (unsigned int i3 = 0; i3 < unknownStuff1.size(); i3++) { - NifStream( unknownStuff1[i3], out, info ); + NifStream( hasUvQuadrants, out, info ); + NifStream( numUvQuadrants, out, info ); + if ( hasUvQuadrants ) { + for (unsigned int i3 = 0; i3 < uvQuadrants.size(); i3++) { + NifStream( uvQuadrants[i3], out, info ); }; }; }; + if ( ((info.version == 0x14020007) && (info.userVersion >= 11)) ) { + NifStream( unknownByte2, out, info ); + }; //--BEGIN POST-WRITE CUSTOM CODE--// //--END CUSTOM CODE--// @@ -226,7 +232,7 @@ std::string NiParticlesData::asString( bool verbose ) const { stringstream out; unsigned int array_output_count = 0; out << NiGeometryData::asString(); - numUnknownStuff1 = (short)(unknownStuff1.size()); + numUvQuadrants = (byte)(uvQuadrants.size()); out << " Num Particles: " << numParticles << endl; out << " Particle Radius: " << particleRadius << endl; out << " Has Radii: " << hasRadii << endl; @@ -307,11 +313,11 @@ std::string NiParticlesData::asString( bool verbose ) const { array_output_count++; }; }; - out << " Has Unknown Stuff 1: " << hasUnknownStuff1 << endl; - out << " Num Unknown Stuff 1: " << numUnknownStuff1 << endl; - if ( hasUnknownStuff1 ) { + out << " Has UV Quadrants: " << hasUvQuadrants << endl; + out << " Num UV Quadrants: " << numUvQuadrants << endl; + if ( hasUvQuadrants ) { array_output_count = 0; - for (unsigned int i2 = 0; i2 < unknownStuff1.size(); i2++) { + for (unsigned int i2 = 0; i2 < uvQuadrants.size(); i2++) { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; break; @@ -319,10 +325,11 @@ std::string NiParticlesData::asString( bool verbose ) const { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { break; }; - out << " Unknown Stuff 1[" << i2 << "]: " << unknownStuff1[i2] << endl; + out << " UV Quadrants[" << i2 << "]: " << uvQuadrants[i2] << endl; array_output_count++; }; }; + out << " Unknown Byte 2: " << unknownByte2 << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/NiSkinPartition.cpp b/src/obj/NiSkinPartition.cpp index 76341103be5eb45ec3b9e3847e3f58a19605aaf4..b074a8f209248c03c646d6c252450478b77a5875 100644 --- a/src/obj/NiSkinPartition.cpp +++ b/src/obj/NiSkinPartition.cpp @@ -44,6 +44,7 @@ typedef vector<SkinPartition> PartitionList; #include "../../include/NIF_IO.h" #include "../../include/obj/NiSkinPartition.h" #include "../../include/gen/SkinPartition.h" +#include "../../include/gen/SkinPartitionUnknownItem1.h" using namespace Niflib; //Definition of TYPE constant @@ -180,6 +181,23 @@ void NiSkinPartition::Read( istream& in, list<unsigned int> & link_stack, const if ( (info.userVersion >= 12) ) { NifStream( skinPartitionBlocks[i1].unknownShort, in, info ); }; + if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x0A020000 ) && ( (info.userVersion == 1) ) ) { + NifStream( skinPartitionBlocks[i1].unknown83C3, in, info ); + NifStream( skinPartitionBlocks[i1].unknown00001, in, info ); + NifStream( skinPartitionBlocks[i1].numVertices2, in, info ); + NifStream( skinPartitionBlocks[i1].unknown00002, in, info ); + NifStream( skinPartitionBlocks[i1].unknown00003, in, info ); + NifStream( skinPartitionBlocks[i1].unknown00004, in, info ); + skinPartitionBlocks[i1].unknownArr1.resize(skinPartitionBlocks[i1].numVertices2); + for (unsigned int i3 = 0; i3 < skinPartitionBlocks[i1].unknownArr1.size(); i3++) { + NifStream( skinPartitionBlocks[i1].unknownArr1[i3].unknownFlags, in, info ); + NifStream( skinPartitionBlocks[i1].unknownArr1[i3].f1, in, info ); + NifStream( skinPartitionBlocks[i1].unknownArr1[i3].f2, in, info ); + NifStream( skinPartitionBlocks[i1].unknownArr1[i3].f3, in, info ); + NifStream( skinPartitionBlocks[i1].unknownArr1[i3].f4, in, info ); + NifStream( skinPartitionBlocks[i1].unknownArr1[i3].f5, in, info ); + }; + }; }; //--BEGIN POST-READ CUSTOM CODE--// @@ -194,6 +212,7 @@ void NiSkinPartition::Write( ostream& out, const map<NiObjectRef,unsigned int> & numSkinPartitionBlocks = (unsigned int)(skinPartitionBlocks.size()); NifStream( numSkinPartitionBlocks, out, info ); for (unsigned int i1 = 0; i1 < skinPartitionBlocks.size(); i1++) { + skinPartitionBlocks[i1].numVertices2 = (unsigned short)(skinPartitionBlocks[i1].unknownArr1.size()); for (unsigned int i2 = 0; i2 < skinPartitionBlocks[i1].strips.size(); i2++) skinPartitionBlocks[i1].stripLengths[i2] = (unsigned short)(skinPartitionBlocks[i1].strips[i2].size()); skinPartitionBlocks[i1].numWeightsPerVertex = (unsigned short)((skinPartitionBlocks[i1].vertexWeights.size() > 0) ? skinPartitionBlocks[i1].vertexWeights[0].size() : 0); @@ -290,6 +309,22 @@ void NiSkinPartition::Write( ostream& out, const map<NiObjectRef,unsigned int> & if ( (info.userVersion >= 12) ) { NifStream( skinPartitionBlocks[i1].unknownShort, out, info ); }; + if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x0A020000 ) && ( (info.userVersion == 1) ) ) { + NifStream( skinPartitionBlocks[i1].unknown83C3, out, info ); + NifStream( skinPartitionBlocks[i1].unknown00001, out, info ); + NifStream( skinPartitionBlocks[i1].numVertices2, out, info ); + NifStream( skinPartitionBlocks[i1].unknown00002, out, info ); + NifStream( skinPartitionBlocks[i1].unknown00003, out, info ); + NifStream( skinPartitionBlocks[i1].unknown00004, out, info ); + for (unsigned int i3 = 0; i3 < skinPartitionBlocks[i1].unknownArr1.size(); i3++) { + NifStream( skinPartitionBlocks[i1].unknownArr1[i3].unknownFlags, out, info ); + NifStream( skinPartitionBlocks[i1].unknownArr1[i3].f1, out, info ); + NifStream( skinPartitionBlocks[i1].unknownArr1[i3].f2, out, info ); + NifStream( skinPartitionBlocks[i1].unknownArr1[i3].f3, out, info ); + NifStream( skinPartitionBlocks[i1].unknownArr1[i3].f4, out, info ); + NifStream( skinPartitionBlocks[i1].unknownArr1[i3].f5, out, info ); + }; + }; }; //--BEGIN POST-WRITE CUSTOM CODE--// @@ -311,6 +346,7 @@ std::string NiSkinPartition::asString( bool verbose ) const { out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; break; }; + skinPartitionBlocks[i1].numVertices2 = (unsigned short)(skinPartitionBlocks[i1].unknownArr1.size()); for (unsigned int i2 = 0; i2 < skinPartitionBlocks[i1].strips.size(); i2++) skinPartitionBlocks[i1].stripLengths[i2] = (unsigned short)(skinPartitionBlocks[i1].strips[i2].size()); skinPartitionBlocks[i1].numWeightsPerVertex = (unsigned short)((skinPartitionBlocks[i1].vertexWeights.size() > 0) ? skinPartitionBlocks[i1].vertexWeights[0].size() : 0); @@ -424,6 +460,25 @@ std::string NiSkinPartition::asString( bool verbose ) const { }; }; out << " Unknown Short: " << skinPartitionBlocks[i1].unknownShort << endl; + out << " Unknown 83 C3: " << skinPartitionBlocks[i1].unknown83C3 << endl; + out << " Unknown 00 00 1: " << skinPartitionBlocks[i1].unknown00001 << endl; + out << " Num Vertices 2: " << skinPartitionBlocks[i1].numVertices2 << endl; + out << " Unknown 00 00 2: " << skinPartitionBlocks[i1].unknown00002 << endl; + out << " Unknown 00 00 3: " << skinPartitionBlocks[i1].unknown00003 << endl; + out << " Unknown 00 00 4: " << skinPartitionBlocks[i1].unknown00004 << endl; + array_output_count = 0; + for (unsigned int i2 = 0; i2 < skinPartitionBlocks[i1].unknownArr1.size(); i2++) { + if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { + out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; + break; + }; + out << " Unknown Flags: " << skinPartitionBlocks[i1].unknownArr1[i2].unknownFlags << endl; + out << " f1: " << skinPartitionBlocks[i1].unknownArr1[i2].f1 << endl; + out << " f2: " << skinPartitionBlocks[i1].unknownArr1[i2].f2 << endl; + out << " f3: " << skinPartitionBlocks[i1].unknownArr1[i2].f3 << endl; + out << " f4: " << skinPartitionBlocks[i1].unknownArr1[i2].f4 << endl; + out << " f5: " << skinPartitionBlocks[i1].unknownArr1[i2].f5 << endl; + }; }; return out.str(); diff --git a/src/obj/NiTriBasedGeom.cpp b/src/obj/NiTriBasedGeom.cpp index 5bd06fdbd780dfa3abd80b949959e1c9aabbd48c..cfd3b7b2e76d9d5654c1399b9b849c49720f5d8e 100644 --- a/src/obj/NiTriBasedGeom.cpp +++ b/src/obj/NiTriBasedGeom.cpp @@ -332,5 +332,3 @@ void NiTriBasedGeom::UpdateTangentSpace(int method) { } //--END CUSTOM CODE--// - - diff --git a/src/obj/NiTriShapeData.cpp b/src/obj/NiTriShapeData.cpp index 57782cd739be4d7624a35cd73e85f36ca1cd787a..f9b538c29b919b45c3ce6befdfa777c7aab0c45d 100644 --- a/src/obj/NiTriShapeData.cpp +++ b/src/obj/NiTriShapeData.cpp @@ -49,7 +49,6 @@ void NiTriShapeData::Read( istream& in, list<unsigned int> & link_stack, const N }; if ( info.version <= 0x0A000102 ) { triangles.resize(numTriangles); - hasTriangles = (triangles.size() > 0); for (unsigned int i2 = 0; i2 < triangles.size(); i2++) { NifStream( triangles[i2], in, info ); }; diff --git a/src/obj/bhkBallSocketConstraintChain.cpp b/src/obj/bhkBallSocketConstraintChain.cpp index dfe8cab49c207e24d74584242bfc0791e1ec9ba6..d3a1dfd21da8df11d234dd81b4bdcbdc8f33439b 100644 --- a/src/obj/bhkBallSocketConstraintChain.cpp +++ b/src/obj/bhkBallSocketConstraintChain.cpp @@ -58,20 +58,16 @@ void bhkBallSocketConstraintChain::Read( istream& in, list<unsigned int> & link_ NifStream( unknownInt1, in, info ); NifStream( unknownInt2, in, info ); NifStream( numLinks, in, info ); - if ( (numLinks >= 1) ) { - links.resize(numLinks); - for (unsigned int i2 = 0; i2 < links.size(); i2++) { - NifStream( block_num, in, info ); - link_stack.push_back( block_num ); - }; + links.resize(numLinks); + for (unsigned int i1 = 0; i1 < links.size(); i1++) { + NifStream( block_num, in, info ); + link_stack.push_back( block_num ); }; NifStream( numLinks2, in, info ); - if ( (numLinks2 >= 1) ) { - links2.resize(numLinks2); - for (unsigned int i2 = 0; i2 < links2.size(); i2++) { - NifStream( block_num, in, info ); - link_stack.push_back( block_num ); - }; + links2.resize(numLinks2); + for (unsigned int i1 = 0; i1 < links2.size(); i1++) { + NifStream( block_num, in, info ); + link_stack.push_back( block_num ); }; NifStream( unknownInt3, in, info ); @@ -98,48 +94,44 @@ void bhkBallSocketConstraintChain::Write( ostream& out, const map<NiObjectRef,un NifStream( unknownInt1, out, info ); NifStream( unknownInt2, out, info ); NifStream( numLinks, out, info ); - if ( (numLinks >= 1) ) { - for (unsigned int i2 = 0; i2 < links.size(); i2++) { - if ( info.version < VER_3_3_0_13 ) { - WritePtr32( &(*links[i2]), out ); - } else { - if ( links[i2] != NULL ) { - map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(links[i2]) ); - if (it != link_map.end()) { - NifStream( it->second, out, info ); - missing_link_stack.push_back( NULL ); - } else { - NifStream( 0xFFFFFFFF, out, info ); - missing_link_stack.push_back( links[i2] ); - } + for (unsigned int i1 = 0; i1 < links.size(); i1++) { + if ( info.version < VER_3_3_0_13 ) { + WritePtr32( &(*links[i1]), out ); + } else { + if ( links[i1] != NULL ) { + map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(links[i1]) ); + if (it != link_map.end()) { + NifStream( it->second, out, info ); + missing_link_stack.push_back( NULL ); } else { NifStream( 0xFFFFFFFF, out, info ); - missing_link_stack.push_back( NULL ); + missing_link_stack.push_back( links[i1] ); } + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( NULL ); } - }; + } }; NifStream( numLinks2, out, info ); - if ( (numLinks2 >= 1) ) { - for (unsigned int i2 = 0; i2 < links2.size(); i2++) { - if ( info.version < VER_3_3_0_13 ) { - WritePtr32( &(*links2[i2]), out ); - } else { - if ( links2[i2] != NULL ) { - map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(links2[i2]) ); - if (it != link_map.end()) { - NifStream( it->second, out, info ); - missing_link_stack.push_back( NULL ); - } else { - NifStream( 0xFFFFFFFF, out, info ); - missing_link_stack.push_back( links2[i2] ); - } + for (unsigned int i1 = 0; i1 < links2.size(); i1++) { + if ( info.version < VER_3_3_0_13 ) { + WritePtr32( &(*links2[i1]), out ); + } else { + if ( links2[i1] != NULL ) { + map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(links2[i1]) ); + if (it != link_map.end()) { + NifStream( it->second, out, info ); + missing_link_stack.push_back( NULL ); } else { NifStream( 0xFFFFFFFF, out, info ); - missing_link_stack.push_back( NULL ); + missing_link_stack.push_back( links2[i1] ); } + } else { + NifStream( 0xFFFFFFFF, out, info ); + missing_link_stack.push_back( NULL ); } - }; + } }; NifStream( unknownInt3, out, info ); @@ -177,34 +169,30 @@ std::string bhkBallSocketConstraintChain::asString( bool verbose ) const { out << " Unknown Int 1: " << unknownInt1 << endl; out << " Unknown Int 2: " << unknownInt2 << endl; out << " Num Links: " << numLinks << endl; - if ( (numLinks >= 1) ) { - array_output_count = 0; - for (unsigned int i2 = 0; i2 < links.size(); i2++) { - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; - break; - }; - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - break; - }; - out << " Links[" << i2 << "]: " << links[i2] << endl; - array_output_count++; + array_output_count = 0; + for (unsigned int i1 = 0; i1 < links.size(); i1++) { + if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { + out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; + break; + }; + if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { + break; }; + out << " Links[" << i1 << "]: " << links[i1] << endl; + array_output_count++; }; out << " Num Links 2: " << numLinks2 << endl; - if ( (numLinks2 >= 1) ) { - array_output_count = 0; - for (unsigned int i2 = 0; i2 < links2.size(); i2++) { - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; - break; - }; - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - break; - }; - out << " Links 2[" << i2 << "]: " << links2[i2] << endl; - array_output_count++; + array_output_count = 0; + for (unsigned int i1 = 0; i1 < links2.size(); i1++) { + if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { + out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; + break; }; + if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { + break; + }; + out << " Links 2[" << i1 << "]: " << links2[i1] << endl; + array_output_count++; }; out << " Unknown Int 3: " << unknownInt3 << endl; return out.str(); @@ -220,15 +208,11 @@ void bhkBallSocketConstraintChain::FixLinks( const map<unsigned int,NiObjectRef> //--END CUSTOM CODE--// bhkSerializable::FixLinks( objects, link_stack, missing_link_stack, info ); - if ( (numLinks >= 1) ) { - for (unsigned int i2 = 0; i2 < links.size(); i2++) { - links[i2] = FixLink<NiObject>( objects, link_stack, missing_link_stack, info ); - }; + for (unsigned int i1 = 0; i1 < links.size(); i1++) { + links[i1] = FixLink<NiObject>( objects, link_stack, missing_link_stack, info ); }; - if ( (numLinks2 >= 1) ) { - for (unsigned int i2 = 0; i2 < links2.size(); i2++) { - links2[i2] = FixLink<NiObject>( objects, link_stack, missing_link_stack, info ); - }; + for (unsigned int i1 = 0; i1 < links2.size(); i1++) { + links2[i1] = FixLink<NiObject>( objects, link_stack, missing_link_stack, info ); }; //--BEGIN POST-FIXLINKS CUSTOM CODE--// diff --git a/src/obj/bhkBreakableConstraint.cpp b/src/obj/bhkBreakableConstraint.cpp index 5403b8c4dd352da7079bc0fea73d2d82774e6878..f1a12894eefcf32b58d048fff992b3e18fe0ee2a 100644 --- a/src/obj/bhkBreakableConstraint.cpp +++ b/src/obj/bhkBreakableConstraint.cpp @@ -21,7 +21,7 @@ using namespace Niflib; //Definition of TYPE constant const Type bhkBreakableConstraint::TYPE("bhkBreakableConstraint", &bhkConstraint::TYPE ); -bhkBreakableConstraint::bhkBreakableConstraint() : unknownShort1((short)0), unknownInt1((unsigned int)0), numEntities2((unsigned int)0), priority2((unsigned int)1), unknownInt2((unsigned int)0), unknownInt3((unsigned int)0), unknownFloat1(0.0f), unknownByte1((byte)0) { +bhkBreakableConstraint::bhkBreakableConstraint() : unknownShort1((short)0), unknownInt1((unsigned int)0), numEntities2((unsigned int)0), priority2((unsigned int)1), unknownInt2((unsigned int)0), unknownInt3((unsigned int)0), threshold(0.0f), unknownFloat1(0.0f), removeIfBroken((byte)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -64,14 +64,14 @@ void bhkBreakableConstraint::Read( istream& in, list<unsigned int> & link_stack, }; NifStream( priority2, in, info ); NifStream( unknownInt2, in, info ); - NifStream( unknownFloats1, in, info ); - NifStream( unknownFloats2, in, info ); + NifStream( position, in, info ); + NifStream( rotation, in, info ); NifStream( unknownInt3, in, info ); - NifStream( unknownFloat1, in, info ); + NifStream( threshold, in, info ); if ( (unknownInt1 >= 1) ) { NifStream( unknownFloat1, in, info ); }; - NifStream( unknownByte1, in, info ); + NifStream( removeIfBroken, in, info ); }; //--BEGIN POST-READ CUSTOM CODE--// @@ -116,14 +116,14 @@ void bhkBreakableConstraint::Write( ostream& out, const map<NiObjectRef,unsigned }; NifStream( priority2, out, info ); NifStream( unknownInt2, out, info ); - NifStream( unknownFloats1, out, info ); - NifStream( unknownFloats2, out, info ); + NifStream( position, out, info ); + NifStream( rotation, out, info ); NifStream( unknownInt3, out, info ); - NifStream( unknownFloat1, out, info ); + NifStream( threshold, out, info ); if ( (unknownInt1 >= 1) ) { NifStream( unknownFloat1, out, info ); }; - NifStream( unknownByte1, out, info ); + NifStream( removeIfBroken, out, info ); }; //--BEGIN POST-WRITE CUSTOM CODE--// @@ -169,11 +169,14 @@ std::string bhkBreakableConstraint::asString( bool verbose ) const { }; out << " Priority 2: " << priority2 << endl; out << " Unknown Int 2: " << unknownInt2 << endl; - out << " Unknown Floats 1: " << unknownFloats1 << endl; - out << " Unknown Floats 2: " << unknownFloats2 << endl; + out << " Position: " << position << endl; + out << " Rotation: " << rotation << endl; out << " Unknown Int 3: " << unknownInt3 << endl; - out << " Unknown Float 1: " << unknownFloat1 << endl; - out << " Unknown Byte 1: " << unknownByte1 << endl; + out << " Threshold: " << threshold << endl; + if ( (unknownInt1 >= 1) ) { + out << " Unknown Float 1: " << unknownFloat1 << endl; + }; + out << " Remove if Broken: " << removeIfBroken << endl; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// diff --git a/src/obj/bhkCompressedMeshShape.cpp b/src/obj/bhkCompressedMeshShape.cpp index 159f0fec9ffa3a2f490334b11a13f44c968a2eb8..7026d70c16adaf0175ca074680c5347dde6957b7 100644 --- a/src/obj/bhkCompressedMeshShape.cpp +++ b/src/obj/bhkCompressedMeshShape.cpp @@ -22,25 +22,12 @@ using namespace Niflib; //Definition of TYPE constant const Type bhkCompressedMeshShape::TYPE("bhkCompressedMeshShape", &bhkShape::TYPE ); -bhkCompressedMeshShape::bhkCompressedMeshShape() : target(NULL), material((HavokMaterial)0), unknownFloat1(0.0f), data(NULL) { +bhkCompressedMeshShape::bhkCompressedMeshShape() : target(NULL), material((HavokMaterial)0), unknownFloat1(0.0f), radius(0.0f), scale(0.0f), unknownFloat3(0.0f), unknownFloat4(0.0f), unknownFloat5(0.0f), data(NULL) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// } -bhkCompressedMeshShape::bhkCompressedMeshShape(const bhkCompressedMeshShape& src) - : target(NULL), - material(src.material), - unknownFloat1(src.unknownFloat1), - data(NULL) -{ - for (short i(0); i < 8; ++i) - { - unknown8Bytes[i] = src.unknown8Bytes[i]; - unknownFloats[i] = src.unknownFloats[i]; - } -} - bhkCompressedMeshShape::~bhkCompressedMeshShape() { //--BEGIN DESTRUCTOR CUSTOM CODE--// @@ -66,12 +53,15 @@ void bhkCompressedMeshShape::Read( istream& in, list<unsigned int> & link_stack, link_stack.push_back( block_num ); NifStream( material, in, info ); NifStream( unknownFloat1, in, info ); - for (unsigned int i1 = 0; i1 < 8; i1++) { - NifStream( unknown8Bytes[i1], in, info ); - }; - for (unsigned int i1 = 0; i1 < 8; i1++) { - NifStream( unknownFloats[i1], in, info ); + for (unsigned int i1 = 0; i1 < 4; i1++) { + NifStream( unknown4Bytes[i1], in, info ); }; + NifStream( unknownFloats1, in, info ); + NifStream( radius, in, info ); + NifStream( scale, in, info ); + NifStream( unknownFloat3, in, info ); + NifStream( unknownFloat4, in, info ); + NifStream( unknownFloat5, in, info ); NifStream( block_num, in, info ); link_stack.push_back( block_num ); @@ -105,12 +95,15 @@ void bhkCompressedMeshShape::Write( ostream& out, const map<NiObjectRef,unsigned } NifStream( material, out, info ); NifStream( unknownFloat1, out, info ); - for (unsigned int i1 = 0; i1 < 8; i1++) { - NifStream( unknown8Bytes[i1], out, info ); - }; - for (unsigned int i1 = 0; i1 < 8; i1++) { - NifStream( unknownFloats[i1], out, info ); + for (unsigned int i1 = 0; i1 < 4; i1++) { + NifStream( unknown4Bytes[i1], out, info ); }; + NifStream( unknownFloats1, out, info ); + NifStream( radius, out, info ); + NifStream( scale, out, info ); + NifStream( unknownFloat3, out, info ); + NifStream( unknownFloat4, out, info ); + NifStream( unknownFloat5, out, info ); if ( info.version < VER_3_3_0_13 ) { WritePtr32( &(*data), out ); } else { @@ -146,19 +139,7 @@ std::string bhkCompressedMeshShape::asString( bool verbose ) const { out << " Material: " << material << endl; out << " Unknown Float 1: " << unknownFloat1 << endl; array_output_count = 0; - for (unsigned int i1 = 0; i1 < 8; i1++) { - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; - break; - }; - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - break; - }; - out << " Unknown 8 Bytes[" << i1 << "]: " << unknown8Bytes[i1] << endl; - array_output_count++; - }; - array_output_count = 0; - for (unsigned int i1 = 0; i1 < 8; i1++) { + for (unsigned int i1 = 0; i1 < 4; i1++) { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; break; @@ -166,9 +147,15 @@ std::string bhkCompressedMeshShape::asString( bool verbose ) const { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { break; }; - out << " Unknown Floats[" << i1 << "]: " << unknownFloats[i1] << endl; + out << " Unknown 4 Bytes[" << i1 << "]: " << unknown4Bytes[i1] << endl; array_output_count++; }; + out << " Unknown Floats 1: " << unknownFloats1 << endl; + out << " Radius: " << radius << endl; + out << " Scale: " << scale << endl; + out << " Unknown Float 3: " << unknownFloat3 << endl; + out << " Unknown Float 4: " << unknownFloat4 << endl; + out << " Unknown Float 5: " << unknownFloat5 << endl; out << " Data: " << data << endl; return out.str(); diff --git a/src/obj/bhkCompressedMeshShapeData.cpp b/src/obj/bhkCompressedMeshShapeData.cpp index 5d69089fa9497cb985922fa0bafb73aa28ec426c..3528c8fcfd7c85b4b503f0a013c3cd56709531ea 100644 --- a/src/obj/bhkCompressedMeshShapeData.cpp +++ b/src/obj/bhkCompressedMeshShapeData.cpp @@ -15,18 +15,17 @@ All rights reserved. Please see niflib.h for license. */ #include "../../include/ObjectRegistry.h" #include "../../include/NIF_IO.h" #include "../../include/obj/bhkCompressedMeshShapeData.h" -#include "../../include/gen/bhkCMSD_Something.h" -#include "../../include/gen/bhkCMSDData.h" -#include "../../include/gen/bhkCMSDData.h" -#include "../../include/gen/bhkCMSD_Shape.h" -#include "../../include/gen/bhkCMSDContainer.h" -#include "../../include/gen/bhkCMSD_Shape.h" +#include "../../include/gen/bhkCMSDMaterial.h" +#include "../../include/gen/bhkCMSDTransform.h" +#include "../../include/gen/QuaternionXYZW.h" +#include "../../include/gen/bhkCMSDBigTris.h" +#include "../../include/gen/bhkCMSDChunk.h" using namespace Niflib; //Definition of TYPE constant const Type bhkCompressedMeshShapeData::TYPE("bhkCompressedMeshShapeData", &NiObject::TYPE ); -bhkCompressedMeshShapeData::bhkCompressedMeshShapeData() : bitsPerIndex((unsigned int)0), bitsPerWIndex((unsigned int)0), maskWIndex((unsigned short)0), maskIndex((unsigned short)0), error(0.0f), unknownByte1((byte)0), unknownInt3((unsigned int)0), unknownInt4((unsigned int)0), unknownInt5((unsigned int)0), unknownByte2((byte)0), numMaterials((unsigned int)0), unknownInt6((unsigned int)0), numTransforms((unsigned int)0), numBigVerts((unsigned int)0), numBigTris((unsigned int)0), numChunks((unsigned int)0), unknownInt12((unsigned int)0) { +bhkCompressedMeshShapeData::bhkCompressedMeshShapeData() : bitsPerIndex((unsigned int)0), bitsPerWIndex((unsigned int)0), maskWIndex((unsigned int)0), maskIndex((unsigned int)0), error(0.0f), unknownByte1((byte)0), unknownInt3((unsigned int)0), unknownInt4((unsigned int)0), unknownInt5((unsigned int)0), unknownByte2((byte)0), numMaterials((unsigned int)0), unknownInt6((unsigned int)0), numTransforms((unsigned int)0), numBigVerts((unsigned int)0), numBigTris((unsigned int)0), numChunks((unsigned int)0), unknownInt12((unsigned int)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -67,75 +66,59 @@ void bhkCompressedMeshShapeData::Read( istream& in, list<unsigned int> & link_st NifStream( numMaterials, in, info ); chunkMaterials.resize(numMaterials); for (unsigned int i1 = 0; i1 < chunkMaterials.size(); i1++) { - NifStream( chunkMaterials[i1].largeInt, in, info ); + NifStream( chunkMaterials[i1].material, in, info ); NifStream( chunkMaterials[i1].unknownInteger, in, info ); }; NifStream( unknownInt6, in, info ); NifStream( numTransforms, in, info ); - if ( (numTransforms >= 1) ) { - chunkTransforms.resize(numTransforms); - for (unsigned int i2 = 0; i2 < chunkTransforms.size(); i2++) { - NifStream( chunkTransforms[i2].translation, in, info ); - NifStream( chunkTransforms[i2].rotation.x, in, info ); - NifStream( chunkTransforms[i2].rotation.y, in, info ); - NifStream( chunkTransforms[i2].rotation.z, in, info ); - NifStream( chunkTransforms[i2].rotation.w, in, info ); - }; + chunkTransforms.resize(numTransforms); + for (unsigned int i1 = 0; i1 < chunkTransforms.size(); i1++) { + NifStream( chunkTransforms[i1].translation, in, info ); + NifStream( chunkTransforms[i1].rotation.x, in, info ); + NifStream( chunkTransforms[i1].rotation.y, in, info ); + NifStream( chunkTransforms[i1].rotation.z, in, info ); + NifStream( chunkTransforms[i1].rotation.w, in, info ); }; NifStream( numBigVerts, in, info ); - if ( (numBigVerts >= 1) ) { - bigVerts.resize(numBigVerts); - for (unsigned int i2 = 0; i2 < bigVerts.size(); i2++) { - NifStream( bigVerts[i2], in, info ); - }; + bigVerts.resize(numBigVerts); + for (unsigned int i1 = 0; i1 < bigVerts.size(); i1++) { + NifStream( bigVerts[i1], in, info ); }; NifStream( numBigTris, in, info ); - if ( (numBigTris >= 1) ) { - bigTris.resize(numBigTris); - for (unsigned int i2 = 0; i2 < bigTris.size(); i2++) { - NifStream( bigTris[i2].triangle1, in, info ); - NifStream( bigTris[i2].triangle2, in, info ); - NifStream( bigTris[i2].triangle3, in, info ); - NifStream( bigTris[i2].unknownInt1, in, info ); - NifStream( bigTris[i2].unknownShort1, in, info ); - }; + bigTris.resize(numBigTris); + for (unsigned int i1 = 0; i1 < bigTris.size(); i1++) { + NifStream( bigTris[i1].triangle1, in, info ); + NifStream( bigTris[i1].triangle2, in, info ); + NifStream( bigTris[i1].triangle3, in, info ); + NifStream( bigTris[i1].unknownInt1, in, info ); + NifStream( bigTris[i1].unknownShort1, in, info ); }; NifStream( numChunks, in, info ); - if ( (numChunks >= 1) ) { - chunks.resize(numChunks); - for (unsigned int i2 = 0; i2 < chunks.size(); i2++) { - NifStream( chunks[i2].translation, in, info ); - NifStream( chunks[i2].materialIndex, in, info ); - NifStream( chunks[i2].unknownShort1, in, info ); - NifStream( chunks[i2].transformIndex, in, info ); - NifStream( chunks[i2].numVertices, in, info ); - if ( (chunks[i2].numVertices >= 1) ) { - chunks[i2].vertices.resize(chunks[i2].numVertices); - for (unsigned int i4 = 0; i4 < chunks[i2].vertices.size(); i4++) { - NifStream( chunks[i2].vertices[i4], in, info ); - }; - }; - NifStream( chunks[i2].numIndices, in, info ); - if ( (chunks[i2].numIndices >= 1) ) { - chunks[i2].indices.resize(chunks[i2].numIndices); - for (unsigned int i4 = 0; i4 < chunks[i2].indices.size(); i4++) { - NifStream( chunks[i2].indices[i4], in, info ); - }; - }; - NifStream( chunks[i2].numStrips, in, info ); - if ( (chunks[i2].numStrips >= 1) ) { - chunks[i2].strips.resize(chunks[i2].numStrips); - for (unsigned int i4 = 0; i4 < chunks[i2].strips.size(); i4++) { - NifStream( chunks[i2].strips[i4], in, info ); - }; - }; - NifStream( chunks[i2].numIndices2, in, info ); - if ( (chunks[i2].numIndices2 >= 1) ) { - chunks[i2].indices2.resize(chunks[i2].numIndices2); - for (unsigned int i4 = 0; i4 < chunks[i2].indices2.size(); i4++) { - NifStream( chunks[i2].indices2[i4], in, info ); - }; - }; + chunks.resize(numChunks); + for (unsigned int i1 = 0; i1 < chunks.size(); i1++) { + NifStream( chunks[i1].translation, in, info ); + NifStream( chunks[i1].materialIndex, in, info ); + NifStream( chunks[i1].unknownShort1, in, info ); + NifStream( chunks[i1].transformIndex, in, info ); + NifStream( chunks[i1].numVertices, in, info ); + chunks[i1].vertices.resize(chunks[i1].numVertices); + for (unsigned int i2 = 0; i2 < chunks[i1].vertices.size(); i2++) { + NifStream( chunks[i1].vertices[i2], in, info ); + }; + NifStream( chunks[i1].numIndices, in, info ); + chunks[i1].indices.resize(chunks[i1].numIndices); + for (unsigned int i2 = 0; i2 < chunks[i1].indices.size(); i2++) { + NifStream( chunks[i1].indices[i2], in, info ); + }; + NifStream( chunks[i1].numStrips, in, info ); + chunks[i1].strips.resize(chunks[i1].numStrips); + for (unsigned int i2 = 0; i2 < chunks[i1].strips.size(); i2++) { + NifStream( chunks[i1].strips[i2], in, info ); + }; + NifStream( chunks[i1].numIndices2, in, info ); + chunks[i1].indices2.resize(chunks[i1].numIndices2); + for (unsigned int i2 = 0; i2 < chunks[i1].indices2.size(); i2++) { + NifStream( chunks[i1].indices2[i2], in, info ); }; }; NifStream( unknownInt12, in, info ); @@ -170,71 +153,55 @@ void bhkCompressedMeshShapeData::Write( ostream& out, const map<NiObjectRef,unsi NifStream( unknownByte2, out, info ); NifStream( numMaterials, out, info ); for (unsigned int i1 = 0; i1 < chunkMaterials.size(); i1++) { - NifStream( chunkMaterials[i1].largeInt, out, info ); + NifStream( chunkMaterials[i1].material, out, info ); NifStream( chunkMaterials[i1].unknownInteger, out, info ); }; NifStream( unknownInt6, out, info ); NifStream( numTransforms, out, info ); - if ( (numTransforms >= 1) ) { - for (unsigned int i2 = 0; i2 < chunkTransforms.size(); i2++) { - NifStream( chunkTransforms[i2].translation, out, info ); - NifStream( chunkTransforms[i2].rotation.x, out, info ); - NifStream( chunkTransforms[i2].rotation.y, out, info ); - NifStream( chunkTransforms[i2].rotation.z, out, info ); - NifStream( chunkTransforms[i2].rotation.w, out, info ); - }; + for (unsigned int i1 = 0; i1 < chunkTransforms.size(); i1++) { + NifStream( chunkTransforms[i1].translation, out, info ); + NifStream( chunkTransforms[i1].rotation.x, out, info ); + NifStream( chunkTransforms[i1].rotation.y, out, info ); + NifStream( chunkTransforms[i1].rotation.z, out, info ); + NifStream( chunkTransforms[i1].rotation.w, out, info ); }; NifStream( numBigVerts, out, info ); - if ( (numBigVerts >= 1) ) { - for (unsigned int i2 = 0; i2 < bigVerts.size(); i2++) { - NifStream( bigVerts[i2], out, info ); - }; + for (unsigned int i1 = 0; i1 < bigVerts.size(); i1++) { + NifStream( bigVerts[i1], out, info ); }; NifStream( numBigTris, out, info ); - if ( (numBigTris >= 1) ) { - for (unsigned int i2 = 0; i2 < bigTris.size(); i2++) { - NifStream( bigTris[i2].triangle1, out, info ); - NifStream( bigTris[i2].triangle2, out, info ); - NifStream( bigTris[i2].triangle3, out, info ); - NifStream( bigTris[i2].unknownInt1, out, info ); - NifStream( bigTris[i2].unknownShort1, out, info ); - }; + for (unsigned int i1 = 0; i1 < bigTris.size(); i1++) { + NifStream( bigTris[i1].triangle1, out, info ); + NifStream( bigTris[i1].triangle2, out, info ); + NifStream( bigTris[i1].triangle3, out, info ); + NifStream( bigTris[i1].unknownInt1, out, info ); + NifStream( bigTris[i1].unknownShort1, out, info ); }; NifStream( numChunks, out, info ); - if ( (numChunks >= 1) ) { - for (unsigned int i2 = 0; i2 < chunks.size(); i2++) { - NifStream( chunks[i2].translation, out, info ); - NifStream( chunks[i2].materialIndex, out, info ); - NifStream( chunks[i2].unknownShort1, out, info ); - NifStream( chunks[i2].transformIndex, out, info ); - chunks[i2].numVertices = chunks[i2].vertices.size(); - NifStream( chunks[i2].numVertices, out, info ); - if ( (chunks[i2].numVertices >= 1) ) { - for (unsigned int i4 = 0; i4 < chunks[i2].vertices.size(); i4++) { - NifStream( chunks[i2].vertices[i4], out, info ); - }; - }; - chunks[i2].numIndices = chunks[i2].indices.size(); - NifStream( chunks[i2].numIndices, out, info ); - if ( (chunks[i2].numIndices >= 1) ) { - for (unsigned int i4 = 0; i4 < chunks[i2].indices.size(); i4++) { - NifStream( chunks[i2].indices[i4], out, info ); - }; - }; - chunks[i2].numStrips = chunks[i2].strips.size(); - NifStream( chunks[i2].numStrips, out, info ); - if ( (chunks[i2].numStrips >= 1) ) { - for (unsigned int i4 = 0; i4 < chunks[i2].strips.size(); i4++) { - NifStream( chunks[i2].strips[i4], out, info ); - }; - }; - chunks[i2].numIndices2 = chunks[i2].indices2.size(); - NifStream( chunks[i2].numIndices2, out, info ); - if ( (chunks[i2].numIndices2 >= 1) ) { - for (unsigned int i4 = 0; i4 < chunks[i2].indices2.size(); i4++) { - NifStream( chunks[i2].indices2[i4], out, info ); - }; - }; + for (unsigned int i1 = 0; i1 < chunks.size(); i1++) { + chunks[i1].numIndices2 = (unsigned int)(chunks[i1].indices2.size()); + chunks[i1].numStrips = (unsigned int)(chunks[i1].strips.size()); + chunks[i1].numIndices = (unsigned int)(chunks[i1].indices.size()); + chunks[i1].numVertices = (unsigned int)(chunks[i1].vertices.size()); + NifStream( chunks[i1].translation, out, info ); + NifStream( chunks[i1].materialIndex, out, info ); + NifStream( chunks[i1].unknownShort1, out, info ); + NifStream( chunks[i1].transformIndex, out, info ); + NifStream( chunks[i1].numVertices, out, info ); + for (unsigned int i2 = 0; i2 < chunks[i1].vertices.size(); i2++) { + NifStream( chunks[i1].vertices[i2], out, info ); + }; + NifStream( chunks[i1].numIndices, out, info ); + for (unsigned int i2 = 0; i2 < chunks[i1].indices.size(); i2++) { + NifStream( chunks[i1].indices[i2], out, info ); + }; + NifStream( chunks[i1].numStrips, out, info ); + for (unsigned int i2 = 0; i2 < chunks[i1].strips.size(); i2++) { + NifStream( chunks[i1].strips[i2], out, info ); + }; + NifStream( chunks[i1].numIndices2, out, info ); + for (unsigned int i2 = 0; i2 < chunks[i1].indices2.size(); i2++) { + NifStream( chunks[i1].indices2[i2], out, info ); }; }; NifStream( unknownInt12, out, info ); @@ -258,133 +225,133 @@ std::string bhkCompressedMeshShapeData::asString( bool verbose ) const { numTransforms = (unsigned int)(chunkTransforms.size()); numMaterials = (unsigned int)(chunkMaterials.size()); out << " Bits Per Index: " << bitsPerIndex << endl; - out << " Bits Per WIndex: " << bitsPerWIndex << endl; - out << " Mask WIndex: " << maskWIndex << endl; + out << " Bits Per W Index: " << bitsPerWIndex << endl; + out << " Mask W Index: " << maskWIndex << endl; out << " Mask Index: " << maskIndex << endl; out << " Error: " << error << endl; - out << " boundsMin: " << boundsMin << endl; - out << " boundsMax: " << boundsMax << endl; + out << " Bounds Min: " << boundsMin << endl; + out << " Bounds Max: " << boundsMax << endl; out << " Unknown Byte 1: " << unknownByte1 << endl; out << " Unknown Int 3: " << unknownInt3 << endl; out << " Unknown Int 4: " << unknownInt4 << endl; out << " Unknown Int 5: " << unknownInt5 << endl; out << " Unknown Byte 2: " << unknownByte2 << endl; - out << " numMaterials: " << numMaterials << endl; + out << " Num Materials: " << numMaterials << endl; array_output_count = 0; for (unsigned int i1 = 0; i1 < chunkMaterials.size(); i1++) { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; break; }; - out << " Large Int: " << chunkMaterials[i1].largeInt << endl; + out << " Material: " << chunkMaterials[i1].material << endl; out << " Unknown Integer: " << chunkMaterials[i1].unknownInteger << endl; }; out << " Unknown Int 6: " << unknownInt6 << endl; out << " Num Transforms: " << numTransforms << endl; - if ( (numTransforms >= 1) ) { + array_output_count = 0; + for (unsigned int i1 = 0; i1 < chunkTransforms.size(); i1++) { + if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { + out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; + break; + }; + out << " Translation: " << chunkTransforms[i1].translation << endl; + out << " x: " << chunkTransforms[i1].rotation.x << endl; + out << " y: " << chunkTransforms[i1].rotation.y << endl; + out << " z: " << chunkTransforms[i1].rotation.z << endl; + out << " w: " << chunkTransforms[i1].rotation.w << endl; + }; + out << " Num Big Verts: " << numBigVerts << endl; + array_output_count = 0; + for (unsigned int i1 = 0; i1 < bigVerts.size(); i1++) { + if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { + out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; + break; + }; + if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { + break; + }; + out << " Big Verts[" << i1 << "]: " << bigVerts[i1] << endl; + array_output_count++; + }; + out << " Num Big Tris: " << numBigTris << endl; + array_output_count = 0; + for (unsigned int i1 = 0; i1 < bigTris.size(); i1++) { + if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { + out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; + break; + }; + out << " Triangle 1: " << bigTris[i1].triangle1 << endl; + out << " Triangle 2: " << bigTris[i1].triangle2 << endl; + out << " Triangle 3: " << bigTris[i1].triangle3 << endl; + out << " Unknown Int 1: " << bigTris[i1].unknownInt1 << endl; + out << " Unknown Short 1: " << bigTris[i1].unknownShort1 << endl; + }; + out << " Num Chunks: " << numChunks << endl; + array_output_count = 0; + for (unsigned int i1 = 0; i1 < chunks.size(); i1++) { + if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { + out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; + break; + }; + chunks[i1].numIndices2 = (unsigned int)(chunks[i1].indices2.size()); + chunks[i1].numStrips = (unsigned int)(chunks[i1].strips.size()); + chunks[i1].numIndices = (unsigned int)(chunks[i1].indices.size()); + chunks[i1].numVertices = (unsigned int)(chunks[i1].vertices.size()); + out << " Translation: " << chunks[i1].translation << endl; + out << " Material Index: " << chunks[i1].materialIndex << endl; + out << " Unknown Short 1: " << chunks[i1].unknownShort1 << endl; + out << " Transform Index: " << chunks[i1].transformIndex << endl; + out << " Num Vertices: " << chunks[i1].numVertices << endl; array_output_count = 0; - for (unsigned int i2 = 0; i2 < chunkTransforms.size(); i2++) { + for (unsigned int i2 = 0; i2 < chunks[i1].vertices.size(); i2++) { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; break; }; - out << " Translation: " << chunkTransforms[i2].translation << endl; - out << " Rotation: " << chunkTransforms[i2].rotation.x << ", " << chunkTransforms[i2].rotation.y << ", " << chunkTransforms[i2].rotation.z << ", " << chunkTransforms[i2].rotation.w << endl; + if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { + break; + }; + out << " Vertices[" << i2 << "]: " << chunks[i1].vertices[i2] << endl; + array_output_count++; }; - }; - out << " Num Big Verts: " << numBigVerts << endl; - if ( (numBigVerts >= 1) ) { + out << " Num Indices: " << chunks[i1].numIndices << endl; array_output_count = 0; - for (unsigned int i2 = 0; i2 < bigVerts.size(); i2++) { + for (unsigned int i2 = 0; i2 < chunks[i1].indices.size(); i2++) { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; break; }; if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; break; }; - out << " Vertices[" << i2 << "]: " << bigVerts[i2] << endl; + out << " Indices[" << i2 << "]: " << chunks[i1].indices[i2] << endl; array_output_count++; }; - }; - out << " Num Big Tris: " << numBigTris << endl; - if ( (numBigTris >= 1) ) { + out << " Num Strips: " << chunks[i1].numStrips << endl; array_output_count = 0; - for (unsigned int i2 = 0; i2 < bigTris.size(); i2++) { + for (unsigned int i2 = 0; i2 < chunks[i1].strips.size(); i2++) { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; break; }; - out << " Triangle1: " << bigTris[i2].triangle1 << endl; - out << " Triangle2: " << bigTris[i2].triangle2 << endl; - out << " Triangle3: " << bigTris[i2].triangle3 << endl; - out << " unknown Int 1: " << bigTris[i2].unknownInt1 << endl; - out << " unknown Short 1: " << bigTris[i2].unknownShort1 << endl; + if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { + break; + }; + out << " Strips[" << i2 << "]: " << chunks[i1].strips[i2] << endl; + array_output_count++; }; - }; - out << " Num Chunks: " << numChunks << endl; - if ( (numChunks >= 1) ) { + out << " Num Indices 2: " << chunks[i1].numIndices2 << endl; array_output_count = 0; - for (unsigned int i2 = 0; i2 < chunks.size(); i2++) { + for (unsigned int i2 = 0; i2 < chunks[i1].indices2.size(); i2++) { if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; break; }; - out << " Translation: " << chunks[i2].translation << endl; - out << " MaterialIndex: " << chunks[i2].materialIndex << endl; - out << " Unknown Short 1: " << chunks[i2].unknownShort1 << endl; - out << " TransformIndex: " << chunks[i2].transformIndex << endl; - chunks[i2].numVertices = chunks[i2].vertices.size(); - out << " Num Vertices: " << chunks[i2].numVertices << endl; - if ( (chunks[i2].numVertices >= 1) ) { - array_output_count = 0; - for (unsigned int i4 = 0; i4 < chunks[i2].vertices.size(); i4++) { - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; - break; - }; - out << " Vertex[" << i4 << "]: " << chunks[i2].vertices[i4] << endl; - array_output_count++; - }; - }; - chunks[i2].numIndices = chunks[i2].indices.size(); - out << " Num Indices: " << chunks[i2].numIndices << endl; - if ( (chunks[i2].numIndices >= 1) ) { - array_output_count = 0; - for (unsigned int i4 = 0; i4 < chunks[i2].indices.size(); i4++) { - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; - break; - }; - out << " Indices[" << i4 << "]: " << chunks[i2].indices[i4] << endl; - array_output_count++; - }; - }; - chunks[i2].numStrips = chunks[i2].strips.size(); - out << " Num Strips: " << chunks[i2].numStrips << endl; - if ( (chunks[i2].numStrips >= 1) ) { - array_output_count = 0; - for (unsigned int i4 = 0; i4 < chunks[i2].strips.size(); i4++) { - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; - break; - }; - out << " Strips[" << i4 << "]: " << chunks[i2].strips[i4] << endl; - }; - }; - chunks[i2].numIndices2 = chunks[i2].indices2.size(); - out << " Num Indices2: " << chunks[i2].numIndices2 << endl; - if ( (chunks[i2].numIndices2 >= 1) ) { - array_output_count = 0; - for (unsigned int i4 = 0; i4 < chunks[i2].indices2.size(); i4++) { - if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { - out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; - break; - }; - out << " Indices2[" << i4 << "]: " << chunks[i2].indices2[i4] << endl; - }; + if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) { + break; }; + out << " Indices 2[" << i2 << "]: " << chunks[i1].indices2[i2] << endl; + array_output_count++; }; }; out << " Unknown Int 12: " << unknownInt12 << endl; @@ -484,11 +451,11 @@ void bhkCompressedMeshShapeData::SetNumMaterials(unsigned int value) { numMaterials = value; } -const vector<bhkCMSD_Something> & bhkCompressedMeshShapeData::GetChunkMaterials() const { +const vector<bhkCMSDMaterial> & bhkCompressedMeshShapeData::GetChunkMaterials() const { return chunkMaterials; } -unsigned int bhkCompressedMeshShapeData::SetChunkMaterials(vector<bhkCMSD_Something>& theChunkMaterials) +unsigned int bhkCompressedMeshShapeData::SetChunkMaterials(vector<bhkCMSDMaterial>& theChunkMaterials) { numMaterials = theChunkMaterials.size(); chunkMaterials = theChunkMaterials; diff --git a/src/obj/bhkMoppBvTreeShape.cpp b/src/obj/bhkMoppBvTreeShape.cpp index d56cae54b81f7c103392a47a62968d214de068d9..9f26181258b53d009c4f7cb86995c0b92dc3f5fc 100644 --- a/src/obj/bhkMoppBvTreeShape.cpp +++ b/src/obj/bhkMoppBvTreeShape.cpp @@ -25,24 +25,6 @@ bhkMoppBvTreeShape::bhkMoppBvTreeShape() : shape(NULL), material((HavokMaterial) //--END CUSTOM CODE--// } -bhkMoppBvTreeShape::bhkMoppBvTreeShape(const bhkMoppBvTreeShape& src) - : shape(NULL), - material(src.material), - unknownInt1(src.unknownInt1), - unknownInt2(src.unknownInt2), - unknownFloat(src.unknownFloat), - moppDataSize(src.moppDataSize), - scale(src.scale), - unknownByte1(src.unknownByte1), - origin(src.origin) -{ - moppData.resize(src.moppData.size()); - for (unsigned int i(0); i < src.moppData.size(); ++i) - { - moppData[i] = src.moppData[i]; - } -} - bhkMoppBvTreeShape::~bhkMoppBvTreeShape() { //--BEGIN DESTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -83,7 +65,7 @@ void bhkMoppBvTreeShape::Read( istream& in, list<unsigned int> & link_stack, con NifStream( moppData[i2], in, info ); }; }; - if ( (info.userVersion >= 12) ) { + if ( ( info.version >= 0x14020007 ) && ( (info.userVersion >= 12) ) ) { NifStream( unknownByte1, in, info ); }; @@ -97,9 +79,6 @@ void bhkMoppBvTreeShape::Write( ostream& out, const map<NiObjectRef,unsigned int bhkBvTreeShape::Write( out, link_map, missing_link_stack, info ); moppDataSize = (unsigned int)(oldMoppData.size()); - if ( info.version >= 0x0A000102 ) { - moppDataSize = (unsigned int)(moppData.size()); - } if ( info.version < VER_3_3_0_13 ) { WritePtr32( &(*shape), out ); } else { @@ -134,7 +113,7 @@ void bhkMoppBvTreeShape::Write( ostream& out, const map<NiObjectRef,unsigned int NifStream( moppData[i2], out, info ); }; }; - if ( (info.userVersion >= 12) ) { + if ( ( info.version >= 0x14020007 ) && ( (info.userVersion >= 12) ) ) { NifStream( unknownByte1, out, info ); }; diff --git a/src/obj/bhkRigidBody.cpp b/src/obj/bhkRigidBody.cpp index 6d238812a13a0467b13dd88c771b25747552b2d5..b5be3b724da6c29ee496ff10b50091cfea32e662 100644 --- a/src/obj/bhkRigidBody.cpp +++ b/src/obj/bhkRigidBody.cpp @@ -22,65 +22,11 @@ using namespace Niflib; //Definition of TYPE constant const Type bhkRigidBody::TYPE("bhkRigidBody", &bhkEntity::TYPE ); -bhkRigidBody::bhkRigidBody() : unknownInt1((int)0), unknownInt2((int)0x00000001), unknown3Ints(3,(int)0,(int)0,(int)0x80000000), collisionResponse_((hkResponseType)RESPONSE_SIMPLE_CONTACT), unknownByte((byte)0xbe), processContactCallbackDelay_((unsigned short)0xffff), unknown2Shorts(2,(unsigned short)35899,(unsigned short)16336), layerCopy((OblivionLayer)OL_STATIC), colFilterCopy((byte)0), unknown7Shorts(7,(unsigned short)0,(unsigned short)21280,(unsigned short)2481,(unsigned short)62977,(unsigned short)65535,(unsigned short)44,(unsigned short)0), mass(1.0f), linearDamping(0.1f), angularDamping(0.05f), friction(0.3f), restitution(0.3f), unknownFloat51(0.0f), unknownFloat52(0.0f), unknownFloat53(0.0f), maxLinearVelocity(250.0f), maxAngularVelocity(31.4159f), penetrationDepth(0.15f), motionSystem((MotionSystem)MO_SYS_DYNAMIC), deactivatorType((DeactivatorType)DEACTIVATOR_NEVER), solverDeactivation((SolverDeactivation)SOLVER_DEACTIVATION_OFF), qualityType((MotionQuality)MO_QUAL_FIXED), unknownInt6((unsigned int)512), unknownInt7((unsigned int)160), unknownInt8((unsigned int)161), unknownInt81((unsigned int)0), numConstraints((unsigned int)0), unknownInt9((unsigned int)0), unknownInt91((unsigned short)0) { +bhkRigidBody::bhkRigidBody() : unknownInt1((int)0), unknownInt2((int)0x00000001), unknown3Ints(3,(int)0,(int)0,(int)0x80000000), collisionResponse_((hkResponseType)RESPONSE_SIMPLE_CONTACT), unknownByte((byte)0xbe), processContactCallbackDelay_((unsigned short)0xffff), unknown2Shorts(2,(unsigned short)35899,(unsigned short)16336), layerCopy((OblivionLayer)OL_STATIC), colFilterCopy((byte)0), unknown7Shorts(7,(unsigned short)0,(unsigned short)21280,(unsigned short)2481,(unsigned short)62977,(unsigned short)65535,(unsigned short)44,(unsigned short)0), mass(1.0f), linearDamping(0.1f), angularDamping(0.05f), unknownTimefactorOrGravityfactor1(0.0f), unknownTimefactorOrGravityfactor2(0.0f), friction(0.3f), rollingfrictionmultiplier_(0.0f), restitution(0.3f), maxLinearVelocity(250.0f), maxAngularVelocity(31.4159f), penetrationDepth(0.15f), motionSystem((MotionSystem)MO_SYS_DYNAMIC), deactivatorType((DeactivatorType)DEACTIVATOR_NEVER), solverDeactivation((SolverDeactivation)SOLVER_DEACTIVATION_OFF), qualityType((MotionQuality)MO_QUAL_FIXED), unknownInt6((unsigned int)512), unknownInt7((unsigned int)160), unknownInt8((unsigned int)161), unknownInt81((unsigned int)0), numConstraints((unsigned int)0), unknownInt9((unsigned int)0), unknownInt91((unsigned short)0) { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// } -bhkRigidBody::bhkRigidBody(const bhkRigidBody& src) - : unknownInt1(src.unknownInt1), - unknownInt2(src.unknownInt2), - collisionResponse_(src.collisionResponse_), - unknownByte(src.unknownByte), - processContactCallbackDelay_(src.processContactCallbackDelay_), - layerCopy(src.layerCopy), - colFilterCopy(src.colFilterCopy), - translation(src.translation), - rotation(src.rotation), - linearVelocity(src.linearVelocity), - angularVelocity(src.angularVelocity), - inertia(src.inertia), - center(src.center), - mass(src.mass), - linearDamping(src.linearDamping), - angularDamping(src.angularDamping), - friction(src.friction), - restitution(src.restitution), - unknownFloat51(src.unknownFloat51), - unknownFloat52(src.unknownFloat52), - unknownFloat53(src.unknownFloat53), - maxLinearVelocity(src.maxLinearVelocity), - maxAngularVelocity(src.maxAngularVelocity), - penetrationDepth(src.penetrationDepth), - motionSystem(src.motionSystem), - deactivatorType(src.deactivatorType), - solverDeactivation(src.solverDeactivation), - qualityType(src.qualityType), - unknownInt6(src.unknownInt6), - unknownInt7(src.unknownInt7), - unknownInt8(src.unknownInt8), - unknownInt81(src.unknownInt81), - numConstraints(src.numConstraints), - unknownInt9(src.unknownInt9), - unknownInt91(src.unknownInt91) -{ - //--BEGIN CONSTRUCTOR CUSTOM CODE--// - for (short i(0); i < 3; ++i) - { - unknown3Ints[i] = src.unknown3Ints[i]; - } - for (short i(0); i < 2; ++i) - { - unknown2Shorts[i] = src.unknown2Shorts[i]; - } - for (short i(0); i < 7; ++i) - { - unknown7Shorts[i] = src.unknown7Shorts[i]; - } - //vector<Ref<bhkSerializable > > constraints; vector<Ref<bhkSerializable > > constraints; - //--END CUSTOM CODE--// -} - bhkRigidBody::~bhkRigidBody() { //--BEGIN DESTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// @@ -128,13 +74,15 @@ void bhkRigidBody::Read( istream& in, list<unsigned int> & link_stack, const Nif NifStream( mass, in, info ); NifStream( linearDamping, in, info ); NifStream( angularDamping, in, info ); + if ( (info.userVersion >= 12) ) { + NifStream( unknownTimefactorOrGravityfactor1, in, info ); + NifStream( unknownTimefactorOrGravityfactor2, in, info ); + }; NifStream( friction, in, info ); - NifStream( restitution, in, info ); if ( (info.userVersion >= 12) ) { - NifStream( unknownFloat51, in, info ); - NifStream( unknownFloat52, in, info ); - NifStream( unknownFloat53, in, info ); + NifStream( rollingfrictionmultiplier_, in, info ); }; + NifStream( restitution, in, info ); NifStream( maxLinearVelocity, in, info ); NifStream( maxAngularVelocity, in, info ); NifStream( penetrationDepth, in, info ); @@ -199,13 +147,15 @@ void bhkRigidBody::Write( ostream& out, const map<NiObjectRef,unsigned int> & li NifStream( mass, out, info ); NifStream( linearDamping, out, info ); NifStream( angularDamping, out, info ); + if ( (info.userVersion >= 12) ) { + NifStream( unknownTimefactorOrGravityfactor1, out, info ); + NifStream( unknownTimefactorOrGravityfactor2, out, info ); + }; NifStream( friction, out, info ); - NifStream( restitution, out, info ); if ( (info.userVersion >= 12) ) { - NifStream( unknownFloat51, out, info ); - NifStream( unknownFloat52, out, info ); - NifStream( unknownFloat53, out, info ); + NifStream( rollingfrictionmultiplier_, out, info ); }; + NifStream( restitution, out, info ); NifStream( maxLinearVelocity, out, info ); NifStream( maxAngularVelocity, out, info ); NifStream( penetrationDepth, out, info ); @@ -313,11 +263,11 @@ std::string bhkRigidBody::asString( bool verbose ) const { out << " Mass: " << mass << endl; out << " Linear Damping: " << linearDamping << endl; out << " Angular Damping: " << angularDamping << endl; + out << " Unknown TimeFactor or GravityFactor 1: " << unknownTimefactorOrGravityfactor1 << endl; + out << " Unknown TimeFactor or GravityFactor 2: " << unknownTimefactorOrGravityfactor2 << endl; out << " Friction: " << friction << endl; + out << " RollingFrictionMultiplier?: " << rollingfrictionmultiplier_ << endl; out << " Restitution: " << restitution << endl; - out << " Unknown Float 51: " << unknownFloat51 << endl; - out << " Unknown Float 52: " << unknownFloat52 << endl; - out << " Unknown Float 53: " << unknownFloat53 << endl; out << " Max Linear Velocity: " << maxLinearVelocity << endl; out << " Max Angular Velocity: " << maxAngularVelocity << endl; out << " Penetration Depth: " << penetrationDepth << endl;