From 696861349e6d68268b6330991c9d2ac892cfd11d Mon Sep 17 00:00:00 2001 From: Jan-Peter Nilsson Date: Wed, 12 Jan 2011 00:19:43 +0100 Subject: [PATCH 1/7] Rename skel to mSkel --- components/nifogre/ogre_nif_loader.cpp | 12 ++++++------ components/nifogre/ogre_nif_loader.hpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp index 923c171db..4a1696631 100644 --- a/components/nifogre/ogre_nif_loader.cpp +++ b/components/nifogre/ogre_nif_loader.cpp @@ -644,7 +644,7 @@ void NIFLoader::handleNiTriShape(NiTriShape *shape, int flags, BoundsFinder &bou it != boneList.end(); it++) { //get the bone from bones array of skindata - bonePtr = skel->getBone(shape->skin->bones[boneIndex].name.toString()); + bonePtr = mSkel->getBone(shape->skin->bones[boneIndex].name.toString()); // final_vector = old_vector + old_rotation*new_vector*old_scale vecPos = bonePtr->_getDerivedPosition() + @@ -767,7 +767,7 @@ void NIFLoader::handleNode(Nif::Node *node, int flags, //FIXME: "Bip01" isn't every time the root bone if (node->name == "Bip01" || node->name == "Root Bone") //root node, create a skeleton { - skel = SkeletonManager::getSingleton().create(getSkeletonName(), resourceGroup, true); + mSkel = SkeletonManager::getSingleton().create(getSkeletonName(), resourceGroup, true); /*if (node->extra->recType == RC_NiTextKeyExtraData ) { @@ -776,16 +776,16 @@ void NIFLoader::handleNode(Nif::Node *node, int flags, }*/ } - if (!skel.isNull()) //if there is a skeleton + if (!mSkel.isNull()) //if there is a skeleton { std::string name = node->name.toString(); //if (isBeast && isChest) // std::cout << "NAME: " << name << "\n"; // Quick-n-dirty workaround for the fact that several // bones may have the same name. - if(!skel->hasBone(name)) + if(!mSkel->hasBone(name)) { - bone = skel->createBone(name); + bone = mSkel->createBone(name); if (parentBone) parentBone->addChild(bone); @@ -1017,7 +1017,7 @@ void NIFLoader::loadResource(Resource *resource) //cout << "THISNAME: " << ptr->getName() << "\n"; //cout << "RESOURCE:"<< resource->getName(); mesh = 0; - skel.setNull(); + mSkel.setNull(); // Set up the VFS if it hasn't been done already if (!vfs) vfs = new OgreVFS(resourceGroup); diff --git a/components/nifogre/ogre_nif_loader.hpp b/components/nifogre/ogre_nif_loader.hpp index 18d511c96..6ab22aa2f 100644 --- a/components/nifogre/ogre_nif_loader.hpp +++ b/components/nifogre/ogre_nif_loader.hpp @@ -135,7 +135,7 @@ class NIFLoader : Ogre::ManualResourceLoader // pointer to the ogre mesh which is currently build Ogre::Mesh *mesh; - Ogre::SkeletonPtr skel; + Ogre::SkeletonPtr mSkel; }; #endif From 9ee83caaa214ed17f038ff25a066bfcb9b7fa61e Mon Sep 17 00:00:00 2001 From: Jan-Peter Nilsson Date: Wed, 12 Jan 2011 00:20:18 +0100 Subject: [PATCH 2/7] Avoid crash when no bones are available --- components/nifogre/ogre_nif_loader.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp index 4a1696631..df1898764 100644 --- a/components/nifogre/ogre_nif_loader.cpp +++ b/components/nifogre/ogre_nif_loader.cpp @@ -643,6 +643,11 @@ void NIFLoader::handleNiTriShape(NiTriShape *shape, int flags, BoundsFinder &bou for (std::vector::iterator it = boneList.begin(); it != boneList.end(); it++) { + if(mSkel.isNull()) + { + std::cout << "No skeleton for :" << shape->skin->bones[boneIndex].name.toString() << std::endl; + break; + } //get the bone from bones array of skindata bonePtr = mSkel->getBone(shape->skin->bones[boneIndex].name.toString()); From 6840e2c42f8ae804b5c3e2daebfc3139e4759a3a Mon Sep 17 00:00:00 2001 From: Jan-Peter Nilsson Date: Fri, 14 Jan 2011 00:53:46 +0100 Subject: [PATCH 3/7] Fix mising of signed/unsigned types in WindowManager::showClassQuestionDialog --- apps/openmw/mwgui/window_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index 4e33a002b..adbde20be 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -691,7 +691,7 @@ namespace MWGui const char *id; // Specialization points to match, in order: Stealth, Combat, Magic // Note: Order is taken from http://www.uesp.net/wiki/Morrowind:Class_Quiz - int points[3]; + unsigned int points[3]; }; } From d68141d203761d8c89328afd748ea23e86f1080f Mon Sep 17 00:00:00 2001 From: Jan-Peter Nilsson Date: Fri, 14 Jan 2011 00:54:47 +0100 Subject: [PATCH 4/7] Remove unused variables --- apps/openmw/mwclass/npc.cpp | 2 -- components/nifogre/ogre_nif_loader.cpp | 1 - 2 files changed, 3 deletions(-) diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index ed247cc80..f31fe81e3 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -75,7 +75,6 @@ namespace MWClass std::string upperleft[5] = {"", "", "", "", ""}; std::string upperright[5] = {"", "", "", "", ""}; std::string neckandup[5] = {"", "", "","",""}; - std::string empty[6] = {"", "", "", "","", ""}; int numbers = 0; int uppernumbers = 0; int neckNumbers = 0; @@ -110,7 +109,6 @@ namespace MWClass //std::cout << "RACE" << bodyRaceID << "\n"; Ogre::Vector3 pos2 = Ogre::Vector3( 0, .5, 75); - std::string upperarmpath[2] = {npcName + "chest", npcName + "upper arm"}; if (groin){ cellRender.insertMesh("meshes\\" + groin->model, pos2, axis, kOgrePi, npcName + "groin", addresses, numbers); diff --git a/components/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp index df1898764..aca2e126d 100644 --- a/components/nifogre/ogre_nif_loader.cpp +++ b/components/nifogre/ogre_nif_loader.cpp @@ -1016,7 +1016,6 @@ void NIFLoader::loadResource(Resource *resource) //if(split== "Skins.NIF") // std::cout << "\nSPECIAL PROPS\n"; resourceName = ""; - MeshManager *m = MeshManager::getSingletonPtr(); // Check if the resource already exists //MeshPtr ptr = m->load(name, "custom"); //cout << "THISNAME: " << ptr->getName() << "\n"; From f65f210149ecdbd107880f24a5f1ad228dd476f1 Mon Sep 17 00:00:00 2001 From: Jan-Peter Nilsson Date: Sat, 5 Mar 2011 00:43:47 +0100 Subject: [PATCH 5/7] An unsigned integer can not be smaller than 0 so there's no point in checking --- components/esm/esm_reader.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/components/esm/esm_reader.hpp b/components/esm/esm_reader.hpp index 927c3b085..8f4fafd88 100644 --- a/components/esm/esm_reader.hpp +++ b/components/esm/esm_reader.hpp @@ -490,10 +490,6 @@ public: // Adjust number of record bytes left mCtx.leftRec -= mCtx.leftSub + 4; - - // Check that sizes added up - if(mCtx.leftRec < 0) - fail("Not enough bytes left in record for this subrecord."); } /** Get sub header and check the size From 4dd76ff36e8a4a89e3d1be1259d04217da3346df Mon Sep 17 00:00:00 2001 From: Jan-Peter Nilsson Date: Sat, 5 Mar 2011 00:47:27 +0100 Subject: [PATCH 6/7] Remove no longer needed local .gitignore --- components/esm/.gitignore | 2 -- components/terrain/.gitignore | 1 - 2 files changed, 3 deletions(-) delete mode 100644 components/esm/.gitignore delete mode 100644 components/terrain/.gitignore diff --git a/components/esm/.gitignore b/components/esm/.gitignore deleted file mode 100644 index be5edceaa..000000000 --- a/components/esm/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -old -*.d diff --git a/components/terrain/.gitignore b/components/terrain/.gitignore deleted file mode 100644 index 3367afdbb..000000000 --- a/components/terrain/.gitignore +++ /dev/null @@ -1 +0,0 @@ -old From 12db15d9a2b09bc91b02fc9082df3a32a6829c5c Mon Sep 17 00:00:00 2001 From: Jan-Peter Nilsson Date: Sat, 5 Mar 2011 00:53:18 +0100 Subject: [PATCH 7/7] Reset arm position changed by commit 27f69d0f5b9c95a7eeae871d280fc92505b56ecb --- apps/openmw/mwclass/npc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index f31fe81e3..93d1e43b1 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -179,7 +179,7 @@ namespace MWClass upperleft[uppernumbers] = npcName + "upper arm"; upperright[uppernumbers++] = npcName + "upper arm2"; cellRender.scaleMesh(Ogre::Vector3(1, -1, 1), upperleft, uppernumbers); //1 -1 1 - cellRender.rotateMesh(Ogre::Vector3(0, 1, 0), kOgrePiOverTwo, upperleft, uppernumbers); + cellRender.rotateMesh(Ogre::Vector3(0, .1, 0), kOgrePiOverTwo, upperleft, uppernumbers); } if (forearm)