diff --git a/apps/opencs/model/world/actoradapter.cpp b/apps/opencs/model/world/actoradapter.cpp index 40bfe17989..acbe6b5d38 100644 --- a/apps/opencs/model/world/actoradapter.cpp +++ b/apps/opencs/model/world/actoradapter.cpp @@ -67,9 +67,9 @@ namespace CSMWorld return mMaleParts[ESM::getMeshPart(index)]; } - const osg::Vec2f& ActorAdapter::RaceData::getHeightWeight(bool isFemale) + const osg::Vec2f& ActorAdapter::RaceData::getGenderWeightHeight(bool isFemale) { - return isFemale ? mHeightsWeights.mFemaleHeightWeight : mHeightsWeights.mMaleHeightWeight; + return isFemale ? mWeightsHeights.mFemaleWeightHeight : mWeightsHeights.mMaleWeightHeight; } bool ActorAdapter::RaceData::hasDependency(const ESM::RefId& id) const @@ -95,11 +95,11 @@ namespace CSMWorld mDependencies.emplace(id); } - void ActorAdapter::RaceData::reset_data(const ESM::RefId& id, const HeightsWeights& raceStats, bool isBeast) + void ActorAdapter::RaceData::reset_data(const ESM::RefId& id, const WeightsHeights& raceStats, bool isBeast) { mId = id; mIsBeast = isBeast; - mHeightsWeights = raceStats; + mWeightsHeights = raceStats; for (auto& str : mFemaleParts) str = ESM::RefId(); for (auto& str : mMaleParts) @@ -169,9 +169,9 @@ namespace CSMWorld return it->second.first; } - const osg::Vec2f& ActorAdapter::ActorData::getRaceHeightWeight() const + const osg::Vec2f& ActorAdapter::ActorData::getRaceWeightHeight() const { - return mRaceData->getHeightWeight(isFemale()); + return mRaceData->getGenderWeightHeight(isFemale()); } bool ActorAdapter::ActorData::hasDependency(const ESM::RefId& id) const @@ -516,8 +516,8 @@ namespace CSMWorld auto& race = raceRecord.get(); - HeightsWeights scaleStats = HeightsWeights(osg::Vec2f(race.mData.mMaleWeight, race.mData.mMaleHeight), - osg::Vec2f(race.mData.mFemaleWeight, race.mData.mFemaleHeight)); + WeightsHeights scaleStats = { osg::Vec2f(race.mData.mMaleWeight, race.mData.mMaleHeight), + osg::Vec2f(race.mData.mFemaleWeight, race.mData.mFemaleHeight) }; data->reset_data(id, scaleStats, race.mData.mFlags & ESM::Race::Beast); diff --git a/apps/opencs/model/world/actoradapter.hpp b/apps/opencs/model/world/actoradapter.hpp index e516325455..1650fc9006 100644 --- a/apps/opencs/model/world/actoradapter.hpp +++ b/apps/opencs/model/world/actoradapter.hpp @@ -41,23 +41,10 @@ namespace CSMWorld /// Tracks unique strings using RefIdSet = std::unordered_set; - class HeightsWeights + struct WeightsHeights { - public: - osg::Vec2f mMaleHeightWeight; - osg::Vec2f mFemaleHeightWeight; - - HeightsWeights() - : mMaleHeightWeight(osg::Vec2f(1.0f, 1.0f)) - , mFemaleHeightWeight(osg::Vec2f(1.0f, 1.0f)) - { - } - - HeightsWeights(const osg::Vec2f& maleHeightWeight, const osg::Vec2f& femaleHeightWeight) - { - mMaleHeightWeight = maleHeightWeight; - mFemaleHeightWeight = femaleHeightWeight; - } + osg::Vec2f mMaleWeightHeight; + osg::Vec2f mFemaleWeightHeight; }; /// Contains base race data shared between actors @@ -77,7 +64,7 @@ namespace CSMWorld /// Retrieves the associated body part const ESM::RefId& getMalePart(ESM::PartReferenceType index) const; - const osg::Vec2f& getHeightWeight(bool isFemale); + const osg::Vec2f& getGenderWeightHeight(bool isFemale); /// Checks if the race has a data dependency bool hasDependency(const ESM::RefId& id) const; @@ -88,8 +75,8 @@ namespace CSMWorld /// Marks an additional dependency void addOtherDependency(const ESM::RefId& id); /// Clears parts and dependencies - void reset_data( - const ESM::RefId& raceId, const HeightsWeights& raceStats = HeightsWeights(), bool isBeast = false); + void reset_data(const ESM::RefId& raceId, + const WeightsHeights& raceStats = { osg::Vec2f(1.f, 1.f), osg::Vec2f(1.f, 1.f) }, bool isBeast = false); private: bool handles(ESM::PartReferenceType type) const; @@ -97,7 +84,7 @@ namespace CSMWorld bool mIsBeast; RacePartList mFemaleParts; RacePartList mMaleParts; - HeightsWeights mHeightsWeights; + WeightsHeights mWeightsHeights; RefIdSet mDependencies; }; using RaceDataPtr = std::shared_ptr; @@ -120,7 +107,7 @@ namespace CSMWorld /// Retrieves the associated actor part ESM::RefId getPart(ESM::PartReferenceType index) const; - const osg::Vec2f& getRaceHeightWeight() const; + const osg::Vec2f& getRaceWeightHeight() const; /// Checks if the actor has a data dependency bool hasDependency(const ESM::RefId& id) const; diff --git a/apps/opencs/view/render/actor.cpp b/apps/opencs/view/render/actor.cpp index e609efa5a1..8aa08e443e 100644 --- a/apps/opencs/view/render/actor.cpp +++ b/apps/opencs/view/render/actor.cpp @@ -21,7 +21,6 @@ #include #include -#include "../../model/world/columns.hpp" #include "../../model/world/data.hpp" namespace CSVRender @@ -63,7 +62,7 @@ namespace CSVRender // Attach parts to skeleton loadBodyParts(); - const osg::Vec2f& attributes = mActorData.get()->getRaceHeightWeight(); + const osg::Vec2f& attributes = mActorData->getRaceWeightHeight(); mBaseNode->setScale(osg::Vec3d(attributes.x(), attributes.x(), attributes.y())); }