This commit is contained in:
vorenon 2013-03-09 18:33:59 +01:00
commit 071dd1e437
5 changed files with 59 additions and 37 deletions

View file

@ -442,8 +442,6 @@ void OMW::Engine::go()
if (!mStartupScript.empty()) if (!mStartupScript.empty())
MWBase::Environment::get().getWindowManager()->executeInConsole (mStartupScript); MWBase::Environment::get().getWindowManager()->executeInConsole (mStartupScript);
std::cout << "\nPress Q/ESC or close window to exit.\n";
// Start the main rendering loop // Start the main rendering loop
mOgre->start(); mOgre->start();

View file

@ -206,7 +206,9 @@ void CharacterCreation::spawnDialog(const char id)
mRaceDialog->setRaceId(mPlayerRaceId); mRaceDialog->setRaceId(mPlayerRaceId);
mRaceDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone); mRaceDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
mRaceDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack); mRaceDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack);
mRaceDialog->setVisible(true);; mRaceDialog->setVisible(true);
if (mCreationStage < CSE_NameChosen)
mCreationStage = CSE_NameChosen;
break; break;
case GM_Class: case GM_Class:
@ -215,6 +217,8 @@ void CharacterCreation::spawnDialog(const char id)
mClassChoiceDialog = new ClassChoiceDialog(*mWM); mClassChoiceDialog = new ClassChoiceDialog(*mWM);
mClassChoiceDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassChoice); mClassChoiceDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
mClassChoiceDialog->setVisible(true); mClassChoiceDialog->setVisible(true);
if (mCreationStage < CSE_RaceChosen)
mCreationStage = CSE_RaceChosen;
break; break;
case GM_ClassPick: case GM_ClassPick:
@ -226,6 +230,8 @@ void CharacterCreation::spawnDialog(const char id)
mPickClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone); mPickClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
mPickClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack); mPickClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack);
mPickClassDialog->setVisible(true); mPickClassDialog->setVisible(true);
if (mCreationStage < CSE_RaceChosen)
mCreationStage = CSE_RaceChosen;
break; break;
case GM_Birth: case GM_Birth:
@ -237,6 +243,8 @@ void CharacterCreation::spawnDialog(const char id)
mBirthSignDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone); mBirthSignDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
mBirthSignDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack); mBirthSignDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack);
mBirthSignDialog->setVisible(true); mBirthSignDialog->setVisible(true);
if (mCreationStage < CSE_ClassChosen)
mCreationStage = CSE_ClassChosen;
break; break;
case GM_ClassCreate: case GM_ClassCreate:
@ -247,6 +255,8 @@ void CharacterCreation::spawnDialog(const char id)
mCreateClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone); mCreateClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack); mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
mCreateClassDialog->setVisible(true); mCreateClassDialog->setVisible(true);
if (mCreationStage < CSE_RaceChosen)
mCreationStage = CSE_RaceChosen;
break; break;
case GM_ClassGenerate: case GM_ClassGenerate:
mGenerateClassStep = 0; mGenerateClassStep = 0;
@ -255,6 +265,8 @@ void CharacterCreation::spawnDialog(const char id)
mGenerateClassSpecializations[1] = 0; mGenerateClassSpecializations[1] = 0;
mGenerateClassSpecializations[2] = 0; mGenerateClassSpecializations[2] = 0;
showClassQuestionDialog(); showClassQuestionDialog();
if (mCreationStage < CSE_RaceChosen)
mCreationStage = CSE_RaceChosen;
break; break;
case GM_Review: case GM_Review:
mWM->removeDialog(mReviewDialog); mWM->removeDialog(mReviewDialog);
@ -292,6 +304,8 @@ void CharacterCreation::spawnDialog(const char id)
mReviewDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack); mReviewDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack);
mReviewDialog->eventActivateDialog += MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog); mReviewDialog->eventActivateDialog += MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog);
mReviewDialog->setVisible(true); mReviewDialog->setVisible(true);
if (mCreationStage < CSE_BirthSignChosen)
mCreationStage = CSE_BirthSignChosen;
break; break;
} }
} }

View file

@ -1188,6 +1188,9 @@ namespace MWWorld
pos.pos[0] = result.second[0]; pos.pos[0] = result.second[0];
pos.pos[1] = result.second[1]; pos.pos[1] = result.second[1];
pos.pos[2] = result.second[2]; 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); Ptr dropped = copyObjectToCell(object, *cell, pos);
PCDropped(dropped); PCDropped(dropped);
@ -1242,6 +1245,9 @@ namespace MWWorld
ESM::Position pos = ESM::Position pos =
actor.getRefData().getPosition(); 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 orig =
Ogre::Vector3(pos.pos[0], pos.pos[1], pos.pos[2]); Ogre::Vector3(pos.pos[0], pos.pos[1], pos.pos[2]);

View file

@ -53,7 +53,7 @@ namespace Interpreter
virtual void execute (Runtime& runtime, unsigned int arg0) virtual void execute (Runtime& runtime, unsigned int arg0)
{ {
if (arg0==0) if (arg0==0)
throw std::logic_error ("inifite loop"); throw std::logic_error ("infinite loop");
runtime.setPC (runtime.getPC()+arg0-1); runtime.setPC (runtime.getPC()+arg0-1);
} }
@ -66,7 +66,7 @@ namespace Interpreter
virtual void execute (Runtime& runtime, unsigned int arg0) virtual void execute (Runtime& runtime, unsigned int arg0)
{ {
if (arg0==0) if (arg0==0)
throw std::logic_error ("inifite loop"); throw std::logic_error ("infinite loop");
runtime.setPC (runtime.getPC()-arg0-1); runtime.setPC (runtime.getPC()-arg0-1);
} }

View file

@ -25,7 +25,8 @@ http://www.gnu.org/licenses/ .
#include <cstdio> #include <cstdio>
#include <boost/algorithm/string.hpp>
#include <components/misc/stringops.hpp>
#include "../nif/niffile.hpp" #include "../nif/niffile.hpp"
#include "../nif/node.hpp" #include "../nif/node.hpp"
@ -188,7 +189,7 @@ void ManualBulletShapeLoader::handleNode(btTriangleMesh* mesh, const Nif::Node *
// Marker objects: no collision // Marker objects: no collision
/// \todo don't do this in the editor /// \todo don't do this in the editor
std::string nodename = node->name; std::string nodename = node->name;
boost::algorithm::to_lower(nodename); Misc::StringUtils::toLower(nodename);
if (nodename.find("marker") != std::string::npos) if (nodename.find("marker") != std::string::npos)
{ {
return; return;
@ -222,17 +223,20 @@ void ManualBulletShapeLoader::handleNode(btTriangleMesh* mesh, const Nif::Node *
} }
} }
if (isCollisionNode || (!hasCollisionNode && !raycasting))
{
if(node->hasBounds) if(node->hasBounds)
{ {
cShape->mBoxTranslation = node->boundPos; cShape->mBoxTranslation = node->boundPos;
cShape->mBoxRotation = node->boundRot; cShape->mBoxRotation = node->boundRot;
mBoundingBox = new btBoxShape(getbtVector(node->boundXYZ)); mBoundingBox = new btBoxShape(getbtVector(node->boundXYZ));
} }
else if( (isCollisionNode || (!hasCollisionNode && !raycasting)) && node->recType == Nif::RC_NiTriShape) else if(node->recType == Nif::RC_NiTriShape)
{ {
cShape->mCollide = !(flags&0x800); cShape->mCollide = !(flags&0x800);
handleNiTriShape(mesh, static_cast<const Nif::NiTriShape*>(node), flags, node->getWorldTransform(), raycasting); handleNiTriShape(mesh, static_cast<const Nif::NiTriShape*>(node), flags, node->getWorldTransform(), raycasting);
} }
}
// For NiNodes, loop through children // For NiNodes, loop through children
const Nif::NiNode *ninode = dynamic_cast<const Nif::NiNode*>(node); const Nif::NiNode *ninode = dynamic_cast<const Nif::NiNode*>(node);