forked from mirror/openmw-tes3mp
Declare some variables closer to where they're used
This commit is contained in:
parent
0cf531ba12
commit
063322b081
1 changed files with 29 additions and 31 deletions
|
@ -263,30 +263,6 @@ void NpcAnimation::updateParts(bool forceupdate)
|
|||
|
||||
showWeapons(mShowWeapons);
|
||||
|
||||
std::map<int, int> bodypartMap;
|
||||
bodypartMap[ESM::PRT_Neck] = ESM::BodyPart::MP_Neck;
|
||||
bodypartMap[ESM::PRT_Cuirass] = ESM::BodyPart::MP_Chest;
|
||||
bodypartMap[ESM::PRT_Groin] = ESM::BodyPart::MP_Groin;
|
||||
bodypartMap[ESM::PRT_RHand] = ESM::BodyPart::MP_Hand;
|
||||
bodypartMap[ESM::PRT_LHand] = ESM::BodyPart::MP_Hand;
|
||||
bodypartMap[ESM::PRT_RWrist] = ESM::BodyPart::MP_Wrist;
|
||||
bodypartMap[ESM::PRT_LWrist] = ESM::BodyPart::MP_Wrist;
|
||||
bodypartMap[ESM::PRT_RForearm] = ESM::BodyPart::MP_Forearm;
|
||||
bodypartMap[ESM::PRT_LForearm] = ESM::BodyPart::MP_Forearm;
|
||||
bodypartMap[ESM::PRT_RUpperarm] = ESM::BodyPart::MP_Upperarm;
|
||||
bodypartMap[ESM::PRT_LUpperarm] = ESM::BodyPart::MP_Upperarm;
|
||||
bodypartMap[ESM::PRT_RFoot] = ESM::BodyPart::MP_Foot;
|
||||
bodypartMap[ESM::PRT_LFoot] = ESM::BodyPart::MP_Foot;
|
||||
bodypartMap[ESM::PRT_RAnkle] = ESM::BodyPart::MP_Ankle;
|
||||
bodypartMap[ESM::PRT_LAnkle] = ESM::BodyPart::MP_Ankle;
|
||||
bodypartMap[ESM::PRT_RKnee] = ESM::BodyPart::MP_Knee;
|
||||
bodypartMap[ESM::PRT_LKnee] = ESM::BodyPart::MP_Knee;
|
||||
bodypartMap[ESM::PRT_RLeg] = ESM::BodyPart::MP_Upperleg;
|
||||
bodypartMap[ESM::PRT_LLeg] = ESM::BodyPart::MP_Upperleg;
|
||||
bodypartMap[ESM::PRT_Tail] = ESM::BodyPart::MP_Tail;
|
||||
|
||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
const int Flag_Female = 0x01;
|
||||
const int Flag_FirstPerson = 0x02;
|
||||
|
||||
|
@ -302,21 +278,43 @@ void NpcAnimation::updateParts(bool forceupdate)
|
|||
std::pair<std::string, int> thisCombination = std::make_pair(race, flags);
|
||||
if (sRaceMapping.find(thisCombination) == sRaceMapping.end())
|
||||
{
|
||||
sRaceMapping[thisCombination].resize(ESM::PRT_Count);
|
||||
for (int i=0; i<ESM::PRT_Count; ++i)
|
||||
sRaceMapping[thisCombination][i] = NULL;
|
||||
static std::map<int, int> bodypartMap;
|
||||
if(bodypartMap.size() == 0)
|
||||
{
|
||||
bodypartMap[ESM::PRT_Neck] = ESM::BodyPart::MP_Neck;
|
||||
bodypartMap[ESM::PRT_Cuirass] = ESM::BodyPart::MP_Chest;
|
||||
bodypartMap[ESM::PRT_Groin] = ESM::BodyPart::MP_Groin;
|
||||
bodypartMap[ESM::PRT_RHand] = ESM::BodyPart::MP_Hand;
|
||||
bodypartMap[ESM::PRT_LHand] = ESM::BodyPart::MP_Hand;
|
||||
bodypartMap[ESM::PRT_RWrist] = ESM::BodyPart::MP_Wrist;
|
||||
bodypartMap[ESM::PRT_LWrist] = ESM::BodyPart::MP_Wrist;
|
||||
bodypartMap[ESM::PRT_RForearm] = ESM::BodyPart::MP_Forearm;
|
||||
bodypartMap[ESM::PRT_LForearm] = ESM::BodyPart::MP_Forearm;
|
||||
bodypartMap[ESM::PRT_RUpperarm] = ESM::BodyPart::MP_Upperarm;
|
||||
bodypartMap[ESM::PRT_LUpperarm] = ESM::BodyPart::MP_Upperarm;
|
||||
bodypartMap[ESM::PRT_RFoot] = ESM::BodyPart::MP_Foot;
|
||||
bodypartMap[ESM::PRT_LFoot] = ESM::BodyPart::MP_Foot;
|
||||
bodypartMap[ESM::PRT_RAnkle] = ESM::BodyPart::MP_Ankle;
|
||||
bodypartMap[ESM::PRT_LAnkle] = ESM::BodyPart::MP_Ankle;
|
||||
bodypartMap[ESM::PRT_RKnee] = ESM::BodyPart::MP_Knee;
|
||||
bodypartMap[ESM::PRT_LKnee] = ESM::BodyPart::MP_Knee;
|
||||
bodypartMap[ESM::PRT_RLeg] = ESM::BodyPart::MP_Upperleg;
|
||||
bodypartMap[ESM::PRT_LLeg] = ESM::BodyPart::MP_Upperleg;
|
||||
bodypartMap[ESM::PRT_Tail] = ESM::BodyPart::MP_Tail;
|
||||
}
|
||||
|
||||
sRaceMapping[thisCombination].resize(ESM::PRT_Count, NULL);
|
||||
|
||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::Store<ESM::BodyPart> &partStore = store.get<ESM::BodyPart>();
|
||||
|
||||
for (MWWorld::Store<ESM::BodyPart>::iterator it = partStore.begin(); it != partStore.end(); ++it)
|
||||
for(MWWorld::Store<ESM::BodyPart>::iterator it = partStore.begin(); it != partStore.end(); ++it)
|
||||
{
|
||||
const ESM::BodyPart& bodypart = *it;
|
||||
if (bodypart.mData.mFlags & ESM::BodyPart::BPF_NotPlayable)
|
||||
continue;
|
||||
if (bodypart.mData.mType != ESM::BodyPart::MT_Skin)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!mNpc->isMale() != (bodypart.mData.mFlags & ESM::BodyPart::BPF_Female))
|
||||
continue;
|
||||
if (!Misc::StringUtils::ciEqual(bodypart.mRace, mNpc->mRace))
|
||||
|
|
Loading…
Reference in a new issue