From 5e1ac0cca1c8a20095da079065b2fad0aa443fbe Mon Sep 17 00:00:00 2001 From: Jason Hooks Date: Sat, 14 Apr 2012 20:32:46 -0400 Subject: [PATCH] Gloves, Gauntlets, Boots, Shoes --- apps/openmw/mwrender/npcanimation.cpp | 71 ++++++++++++++++++++++++++- apps/openmw/mwrender/npcanimation.hpp | 4 ++ 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 5adb9914dd..3a9525949c 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -16,6 +16,9 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,O robe(inv.getSlot(MWWorld::InventoryStore::Slot_Robe)), helmet(inv.getSlot(MWWorld::InventoryStore::Slot_Helmet)), shirt(inv.getSlot(MWWorld::InventoryStore::Slot_Shirt)), cuirass(inv.getSlot(MWWorld::InventoryStore::Slot_Cuirass)), greaves(inv.getSlot(MWWorld::InventoryStore::Slot_Greaves)), leftpauldron(inv.getSlot(MWWorld::InventoryStore::Slot_LeftPauldron)), rightpauldron(inv.getSlot(MWWorld::InventoryStore::Slot_RightPauldron)), + boots(inv.getSlot(MWWorld::InventoryStore::Slot_Boots)), + leftglove(inv.getSlot(MWWorld::InventoryStore::Slot_LeftGauntlet)), rightglove(inv.getSlot(MWWorld::InventoryStore::Slot_RightGauntlet)), + pants(inv.getSlot(MWWorld::InventoryStore::Slot_Pants)), lclavicle(0), rclavicle(0), rupperArm(0), @@ -197,10 +200,28 @@ void NpcAnimation::updateParts(){ } if(rightpauldron != inv.getSlot(MWWorld::InventoryStore::Slot_RightPauldron)){ - leftpauldron = inv.getSlot(MWWorld::InventoryStore::Slot_RightPauldron); + rightpauldron = inv.getSlot(MWWorld::InventoryStore::Slot_RightPauldron); removePartGroup(MWWorld::InventoryStore::Slot_RightPauldron); apparelChanged = true; + } + if(boots != inv.getSlot(MWWorld::InventoryStore::Slot_Boots)){ + boots = inv.getSlot(MWWorld::InventoryStore::Slot_Boots); + removePartGroup(MWWorld::InventoryStore::Slot_Boots); + apparelChanged = true; + + } + if(leftglove != inv.getSlot(MWWorld::InventoryStore::Slot_LeftGauntlet)){ + leftglove = inv.getSlot(MWWorld::InventoryStore::Slot_LeftGauntlet); + removePartGroup(MWWorld::InventoryStore::Slot_LeftGauntlet); + apparelChanged = true; + + } + if(rightglove != inv.getSlot(MWWorld::InventoryStore::Slot_RightGauntlet)){ + rightglove = inv.getSlot(MWWorld::InventoryStore::Slot_RightGauntlet); + removePartGroup(MWWorld::InventoryStore::Slot_RightGauntlet); + apparelChanged = true; + } if(shirt != inv.getSlot(MWWorld::InventoryStore::Slot_Shirt)){ shirt = inv.getSlot(MWWorld::InventoryStore::Slot_Shirt); @@ -210,6 +231,7 @@ void NpcAnimation::updateParts(){ } if(apparelChanged){ + std::cout << "Modifying stuff\n"; if(robe != inv.end()) { MWWorld::Ptr ptr = *robe; @@ -238,6 +260,7 @@ void NpcAnimation::updateParts(){ addPartGroup(MWWorld::InventoryStore::Slot_Greaves, 3, parts); } + if(leftpauldron != inv.end()){ const ESM::Armor *armor = (leftpauldron->get())->base; std::vector parts = armor->parts.parts; @@ -250,6 +273,52 @@ void NpcAnimation::updateParts(){ addPartGroup(MWWorld::InventoryStore::Slot_RightPauldron, 3, parts); } + if(boots != inv.end()){ + + if(boots->getTypeName() == "struct ESM::Clothing"){ + const ESM::Clothing *clothes = (boots->get())->base; + std::vector parts = clothes->parts.parts; + addPartGroup(MWWorld::InventoryStore::Slot_Boots, 2, parts); + } + else + { + const ESM::Armor *armor = (boots->get())->base; + std::vector parts = armor->parts.parts; + addPartGroup(MWWorld::InventoryStore::Slot_Boots, 3, parts); + } + + } + if(leftglove != inv.end()){ + + if(leftglove->getTypeName() == "struct ESM::Clothing"){ + const ESM::Clothing *clothes = (leftglove->get())->base; + std::vector parts = clothes->parts.parts; + addPartGroup(MWWorld::InventoryStore::Slot_LeftGauntlet, 2, parts); + } + else + { + const ESM::Armor *armor = (leftglove->get())->base; + std::vector parts = armor->parts.parts; + addPartGroup(MWWorld::InventoryStore::Slot_LeftGauntlet, 3, parts); + } + + } + if(rightglove != inv.end()){ + + if(rightglove->getTypeName() == "struct ESM::Clothing"){ + const ESM::Clothing *clothes = (rightglove->get())->base; + std::vector parts = clothes->parts.parts; + addPartGroup(MWWorld::InventoryStore::Slot_RightGauntlet, 2, parts); + } + else + { + const ESM::Armor *armor = (rightglove->get())->base; + std::vector parts = armor->parts.parts; + addPartGroup(MWWorld::InventoryStore::Slot_RightGauntlet, 3, parts); + } + + } + if(shirt != inv.end()){ const ESM::Clothing *clothes = (shirt->get())->base; std::vector parts = clothes->parts.parts; diff --git a/apps/openmw/mwrender/npcanimation.hpp b/apps/openmw/mwrender/npcanimation.hpp index 7785ffc1a0..255989d286 100644 --- a/apps/openmw/mwrender/npcanimation.hpp +++ b/apps/openmw/mwrender/npcanimation.hpp @@ -75,6 +75,10 @@ private: MWWorld::ContainerStoreIterator greaves; MWWorld::ContainerStoreIterator leftpauldron; MWWorld::ContainerStoreIterator rightpauldron; + MWWorld::ContainerStoreIterator boots; + MWWorld::ContainerStoreIterator pants; + MWWorld::ContainerStoreIterator leftglove; + MWWorld::ContainerStoreIterator rightglove; public: NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend, MWWorld::InventoryStore& _inv);