diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 62e106f3f..f76590ae8 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -442,8 +442,6 @@ void OMW::Engine::go() if (!mStartupScript.empty()) MWBase::Environment::get().getWindowManager()->executeInConsole (mStartupScript); - std::cout << "\nPress Q/ESC or close window to exit.\n"; - // Start the main rendering loop mOgre->start(); diff --git a/apps/openmw/mwgui/charactercreation.cpp b/apps/openmw/mwgui/charactercreation.cpp index 1719c5768..fbed0a874 100644 --- a/apps/openmw/mwgui/charactercreation.cpp +++ b/apps/openmw/mwgui/charactercreation.cpp @@ -206,7 +206,9 @@ void CharacterCreation::spawnDialog(const char id) mRaceDialog->setRaceId(mPlayerRaceId); mRaceDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone); mRaceDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack); - mRaceDialog->setVisible(true);; + mRaceDialog->setVisible(true); + if (mCreationStage < CSE_NameChosen) + mCreationStage = CSE_NameChosen; break; case GM_Class: @@ -215,6 +217,8 @@ void CharacterCreation::spawnDialog(const char id) mClassChoiceDialog = new ClassChoiceDialog(*mWM); mClassChoiceDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassChoice); mClassChoiceDialog->setVisible(true); + if (mCreationStage < CSE_RaceChosen) + mCreationStage = CSE_RaceChosen; break; case GM_ClassPick: @@ -226,6 +230,8 @@ void CharacterCreation::spawnDialog(const char id) mPickClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone); mPickClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack); mPickClassDialog->setVisible(true); + if (mCreationStage < CSE_RaceChosen) + mCreationStage = CSE_RaceChosen; break; case GM_Birth: @@ -237,6 +243,8 @@ void CharacterCreation::spawnDialog(const char id) mBirthSignDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone); mBirthSignDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack); mBirthSignDialog->setVisible(true); + if (mCreationStage < CSE_ClassChosen) + mCreationStage = CSE_ClassChosen; break; case GM_ClassCreate: @@ -247,6 +255,8 @@ void CharacterCreation::spawnDialog(const char id) mCreateClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone); mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack); mCreateClassDialog->setVisible(true); + if (mCreationStage < CSE_RaceChosen) + mCreationStage = CSE_RaceChosen; break; case GM_ClassGenerate: mGenerateClassStep = 0; @@ -255,6 +265,8 @@ void CharacterCreation::spawnDialog(const char id) mGenerateClassSpecializations[1] = 0; mGenerateClassSpecializations[2] = 0; showClassQuestionDialog(); + if (mCreationStage < CSE_RaceChosen) + mCreationStage = CSE_RaceChosen; break; case GM_Review: mWM->removeDialog(mReviewDialog); @@ -292,6 +304,8 @@ void CharacterCreation::spawnDialog(const char id) mReviewDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack); mReviewDialog->eventActivateDialog += MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog); mReviewDialog->setVisible(true); + if (mCreationStage < CSE_BirthSignChosen) + mCreationStage = CSE_BirthSignChosen; break; } } diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 4b06d6a08..35ea8bbef 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1188,6 +1188,9 @@ namespace MWWorld pos.pos[0] = result.second[0]; pos.pos[1] = result.second[1]; pos.pos[2] = result.second[2]; + // We want only the Z part of the player's rotation + pos.rot[0] = 0; + pos.rot[1] = 0; Ptr dropped = copyObjectToCell(object, *cell, pos); PCDropped(dropped); @@ -1242,6 +1245,9 @@ namespace MWWorld ESM::Position pos = actor.getRefData().getPosition(); + // We want only the Z part of the actor's rotation + pos.rot[0] = 0; + pos.rot[1] = 0; Ogre::Vector3 orig = Ogre::Vector3(pos.pos[0], pos.pos[1], pos.pos[2]); diff --git a/components/interpreter/controlopcodes.hpp b/components/interpreter/controlopcodes.hpp index 534ccc4dd..caa755989 100644 --- a/components/interpreter/controlopcodes.hpp +++ b/components/interpreter/controlopcodes.hpp @@ -11,66 +11,66 @@ namespace Interpreter class OpReturn : public Opcode0 { public: - + virtual void execute (Runtime& runtime) { runtime.setPC (-1); - } + } }; - + class OpSkipZero : public Opcode0 { public: - + virtual void execute (Runtime& runtime) { Type_Integer data = runtime[0].mInteger; runtime.pop(); - + if (data==0) runtime.setPC (runtime.getPC()+1); - } - }; - + } + }; + class OpSkipNonZero : public Opcode0 { public: - + virtual void execute (Runtime& runtime) { Type_Integer data = runtime[0].mInteger; runtime.pop(); - + if (data!=0) runtime.setPC (runtime.getPC()+1); - } - }; - + } + }; + class OpJumpForward : public Opcode1 { public: - + virtual void execute (Runtime& runtime, unsigned int arg0) { if (arg0==0) - throw std::logic_error ("inifite loop"); - + throw std::logic_error ("infinite loop"); + runtime.setPC (runtime.getPC()+arg0-1); - } - }; + } + }; class OpJumpBackward : public Opcode1 { public: - + virtual void execute (Runtime& runtime, unsigned int arg0) { if (arg0==0) - throw std::logic_error ("inifite loop"); - + throw std::logic_error ("infinite loop"); + runtime.setPC (runtime.getPC()-arg0-1); - } - }; + } + }; } #endif diff --git a/components/nifbullet/bulletnifloader.cpp b/components/nifbullet/bulletnifloader.cpp index 192eb9aaf..af1243346 100644 --- a/components/nifbullet/bulletnifloader.cpp +++ b/components/nifbullet/bulletnifloader.cpp @@ -25,7 +25,8 @@ http://www.gnu.org/licenses/ . #include -#include + +#include #include "../nif/niffile.hpp" #include "../nif/node.hpp" @@ -188,7 +189,7 @@ void ManualBulletShapeLoader::handleNode(btTriangleMesh* mesh, const Nif::Node * // Marker objects: no collision /// \todo don't do this in the editor std::string nodename = node->name; - boost::algorithm::to_lower(nodename); + Misc::StringUtils::toLower(nodename); if (nodename.find("marker") != std::string::npos) { return; @@ -222,16 +223,19 @@ void ManualBulletShapeLoader::handleNode(btTriangleMesh* mesh, const Nif::Node * } } - if(node->hasBounds) + if (isCollisionNode || (!hasCollisionNode && !raycasting)) { - cShape->mBoxTranslation = node->boundPos; - cShape->mBoxRotation = node->boundRot; - mBoundingBox = new btBoxShape(getbtVector(node->boundXYZ)); - } - else if( (isCollisionNode || (!hasCollisionNode && !raycasting)) && node->recType == Nif::RC_NiTriShape) - { - cShape->mCollide = !(flags&0x800); - handleNiTriShape(mesh, static_cast(node), flags, node->getWorldTransform(), raycasting); + if(node->hasBounds) + { + cShape->mBoxTranslation = node->boundPos; + cShape->mBoxRotation = node->boundRot; + mBoundingBox = new btBoxShape(getbtVector(node->boundXYZ)); + } + else if(node->recType == Nif::RC_NiTriShape) + { + cShape->mCollide = !(flags&0x800); + handleNiTriShape(mesh, static_cast(node), flags, node->getWorldTransform(), raycasting); + } } // For NiNodes, loop through children