From cc4c96d0f1358c9c8cc745f2354c817a858d172f Mon Sep 17 00:00:00 2001 From: Alexei Dobrohotov Date: Wed, 10 Nov 2021 22:50:01 +0300 Subject: [PATCH] Follow global naming convention for new records --- components/nif/controller.cpp | 2 +- components/nif/controller.hpp | 2 +- components/nif/extra.cpp | 22 ++++++++--------- components/nif/extra.hpp | 17 ++++++------- components/nif/physics.cpp | 30 +++++++++++------------ components/nif/physics.hpp | 45 ++++++++++++++++++----------------- 6 files changed, 60 insertions(+), 58 deletions(-) diff --git a/components/nif/controller.cpp b/components/nif/controller.cpp index 513c781c58..16e6b5e40f 100644 --- a/components/nif/controller.cpp +++ b/components/nif/controller.cpp @@ -273,7 +273,7 @@ namespace Nif void NiControllerManager::read(NIFStream *nif) { Controller::read(nif); - cumulative = nif->getBoolean(); + mCumulative = nif->getBoolean(); unsigned int numSequences = nif->getUInt(); nif->skip(4 * numSequences); // Controller sequences nif->skip(4); // Object palette diff --git a/components/nif/controller.hpp b/components/nif/controller.hpp index 15a2937b80..210eaab217 100644 --- a/components/nif/controller.hpp +++ b/components/nif/controller.hpp @@ -186,7 +186,7 @@ struct bhkBlendController : public Controller struct NiControllerManager : public Controller { - bool cumulative; + bool mCumulative; void read(NIFStream *nif) override; }; diff --git a/components/nif/extra.cpp b/components/nif/extra.cpp index 1401291a0f..04217995ac 100644 --- a/components/nif/extra.cpp +++ b/components/nif/extra.cpp @@ -96,18 +96,18 @@ void BSBound::read(NIFStream *nif) void BSFurnitureMarker::LegacyFurniturePosition::read(NIFStream *nif) { - offset = nif->getVector3(); - orientation = nif->getUShort(); - positionRef = nif->getChar(); + mOffset = nif->getVector3(); + mOrientation = nif->getUShort(); + mPositionRef = nif->getChar(); nif->skip(1); // Position ref 2 } void BSFurnitureMarker::FurniturePosition::read(NIFStream *nif) { - offset = nif->getVector3(); - heading = nif->getFloat(); - type = nif->getUShort(); - entryPoint = nif->getUShort(); + mOffset = nif->getVector3(); + mHeading = nif->getFloat(); + mType = nif->getUShort(); + mEntryPoint = nif->getUShort(); } void BSFurnitureMarker::read(NIFStream *nif) @@ -116,14 +116,14 @@ void BSFurnitureMarker::read(NIFStream *nif) unsigned int num = nif->getUInt(); if (nif->getBethVersion() <= NIFFile::BethVersion::BETHVER_FO3) { - legacyMarkers.resize(num); - for (auto& marker : legacyMarkers) + mLegacyMarkers.resize(num); + for (auto& marker : mLegacyMarkers) marker.read(nif); } else { - markers.resize(num); - for (auto& marker : markers) + mMarkers.resize(num); + for (auto& marker : mMarkers) marker.read(nif); } } diff --git a/components/nif/extra.hpp b/components/nif/extra.hpp index bbc5c216d8..8eb14f9b01 100644 --- a/components/nif/extra.hpp +++ b/components/nif/extra.hpp @@ -124,22 +124,23 @@ struct BSFurnitureMarker : public Extra { struct LegacyFurniturePosition { - osg::Vec3f offset; - uint16_t orientation; - uint8_t positionRef; + osg::Vec3f mOffset; + uint16_t mOrientation; + uint8_t mPositionRef; void read(NIFStream *nif); }; struct FurniturePosition { - osg::Vec3f offset; - float heading; - uint16_t type, entryPoint; + osg::Vec3f mOffset; + float mHeading; + uint16_t mType; + uint16_t mEntryPoint; void read(NIFStream *nif); }; - std::vector legacyMarkers; - std::vector markers; + std::vector mLegacyMarkers; + std::vector mMarkers; void read(NIFStream *nif) override; }; diff --git a/components/nif/physics.cpp b/components/nif/physics.cpp index fddaaa8cc1..992a56c9b7 100644 --- a/components/nif/physics.cpp +++ b/components/nif/physics.cpp @@ -6,49 +6,49 @@ namespace Nif void bhkCollisionObject::read(NIFStream *nif) { NiCollisionObject::read(nif); - flags = nif->getUShort(); - body.read(nif); + mFlags = nif->getUShort(); + mBody.read(nif); } void bhkWorldObject::read(NIFStream *nif) { - shape.read(nif); + mShape.read(nif); if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB_OLD) nif->skip(4); // Unknown - flags = nif->getUInt(); + mFlags = nif->getUInt(); nif->skip(4); // Unused - worldObjectInfo.phaseType = nif->getChar(); + mWorldObjectInfo.mPhaseType = nif->getChar(); nif->skip(3); // Unused - worldObjectInfo.data = nif->getUInt(); - worldObjectInfo.size = nif->getUInt(); - worldObjectInfo.capacityAndFlags = nif->getUInt(); + mWorldObjectInfo.mData = nif->getUInt(); + mWorldObjectInfo.mSize = nif->getUInt(); + mWorldObjectInfo.mCapacityAndFlags = nif->getUInt(); } void bhkWorldObject::post(NIFFile *nif) { - shape.post(nif); + mShape.post(nif); } void bhkEntity::read(NIFStream *nif) { bhkWorldObject::read(nif); - responseType = static_cast(nif->getChar()); + mResponseType = static_cast(nif->getChar()); nif->skip(1); // Unused - processContactDelay = nif->getUShort(); + mProcessContactDelay = nif->getUShort(); } void HavokMaterial::read(NIFStream *nif) { if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB_OLD) nif->skip(4); // Unknown - material = nif->getUInt(); + mMaterial = nif->getUInt(); } void hkSubPartData::read(NIFStream *nif) { - havokFilter = nif->getUInt(); - numVertices = nif->getUInt(); - material.read(nif); + mHavokFilter = nif->getUInt(); + mNumVertices = nif->getUInt(); + mHavokMaterial.read(nif); } } // Namespace \ No newline at end of file diff --git a/components/nif/physics.hpp b/components/nif/physics.hpp index ae7da6d141..ca31512c71 100644 --- a/components/nif/physics.hpp +++ b/components/nif/physics.hpp @@ -12,45 +12,45 @@ namespace Nif struct NiCollisionObject : public Record { // The node that references this object - NodePtr target; + NodePtr mTarget; void read(NIFStream *nif) override { - target.read(nif); + mTarget.read(nif); } void post(NIFFile *nif) override { - target.post(nif); + mTarget.post(nif); } }; // Bethesda Havok-specific collision object struct bhkCollisionObject : public NiCollisionObject { - unsigned short flags; - CollisionBodyPtr body; + unsigned short mFlags; + CollisionBodyPtr mBody; void read(NIFStream *nif) override; void post(NIFFile *nif) override { NiCollisionObject::post(nif); - body.post(nif); + mBody.post(nif); } }; // Abstract Havok shape info record struct bhkWorldObject : public Record { - bhkShapePtr shape; - unsigned int flags; // Havok layer type, collision filter flags and group + bhkShapePtr mShape; + unsigned int mFlags; // Havok layer type, collision filter flags and group struct WorldObjectInfo { - unsigned char phaseType; - unsigned int data; - unsigned int size; - unsigned int capacityAndFlags; + unsigned char mPhaseType; + unsigned int mData; + unsigned int mSize; + unsigned int mCapacityAndFlags; }; - WorldObjectInfo worldObjectInfo; + WorldObjectInfo mWorldObjectInfo; void read(NIFStream *nif) override; void post(NIFFile *nif) override; }; @@ -59,29 +59,30 @@ struct bhkShape : public Record {}; enum class hkResponseType : uint8_t { - Invalid = 0, - SimpleContact = 1, - Reporting = 2, - None = 3 + Response_Invalid = 0, + Response_SimpleContact = 1, + Response_Reporting = 2, + Response_None = 3 }; struct bhkEntity : public bhkWorldObject { - hkResponseType responseType; - unsigned short processContactDelay; + hkResponseType mResponseType; + unsigned short mProcessContactDelay; void read(NIFStream *nif) override; }; struct HavokMaterial { - unsigned int material; + unsigned int mMaterial; void read(NIFStream *nif); }; struct hkSubPartData { - HavokMaterial material; - unsigned int numVertices, havokFilter; + HavokMaterial mHavokMaterial; + unsigned int mNumVertices; + unsigned int mHavokFilter; void read(NIFStream *nif); };