mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 06:53:52 +00:00
Merge branch 'master' of https://github.com/zinnschlag/openmw into inputsystem
This commit is contained in:
commit
6c72b77718
4 changed files with 54 additions and 12 deletions
|
@ -254,7 +254,8 @@ RenderingManager::rotateObject(
|
|||
Ogre::Vector3 &rot,
|
||||
bool adjust)
|
||||
{
|
||||
bool isPlayer = ptr.getRefData().getHandle() == "player";
|
||||
bool isActive = ptr.getRefData().getBaseNode() != 0;
|
||||
bool isPlayer = isActive && ptr.getRefData().getHandle() == "player";
|
||||
bool force = true;
|
||||
|
||||
if (isPlayer) {
|
||||
|
@ -271,7 +272,7 @@ RenderingManager::rotateObject(
|
|||
float *f = ptr.getRefData().getPosition().rot;
|
||||
rot.x += f[0], rot.y += f[1], rot.z += f[2];
|
||||
}
|
||||
if (!isPlayer) {
|
||||
if (!isPlayer && isActive) {
|
||||
Ogre::Quaternion xr(Ogre::Radian(rot.x), Ogre::Vector3::UNIT_X);
|
||||
Ogre::Quaternion yr(Ogre::Radian(rot.y), Ogre::Vector3::UNIT_Y);
|
||||
Ogre::Quaternion zr(Ogre::Radian(rot.z), Ogre::Vector3::UNIT_Z);
|
||||
|
|
|
@ -563,9 +563,9 @@ namespace MWWorld
|
|||
mWorldScene->changeCell(cellX, cellY, pos, false);
|
||||
}
|
||||
} else {
|
||||
if (!mWorldScene->isCellActive(newCell)) {
|
||||
if (!mWorldScene->isCellActive(*currCell)) {
|
||||
copyObjectToCell(ptr, newCell, pos);
|
||||
} else if (!mWorldScene->isCellActive(*currCell)) {
|
||||
} else if (!mWorldScene->isCellActive(newCell)) {
|
||||
MWWorld::Class::get(ptr).copyToCell(ptr, newCell);
|
||||
mWorldScene->removeObjectFromScene(ptr);
|
||||
mLocalScripts.remove(ptr);
|
||||
|
@ -640,10 +640,12 @@ namespace MWWorld
|
|||
float *objRot = ptr.getRefData().getPosition().rot;
|
||||
objRot[0] = rot.x, objRot[1] = rot.y, objRot[2] = rot.z;
|
||||
|
||||
mPhysics->rotateObject(
|
||||
ptr.getRefData().getHandle(),
|
||||
ptr.getRefData().getBaseNode()->getOrientation()
|
||||
);
|
||||
if (ptr.getRefData().getBaseNode() != 0) {
|
||||
mPhysics->rotateObject(
|
||||
ptr.getRefData().getHandle(),
|
||||
ptr.getRefData().getBaseNode()->getOrientation()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,21 @@
|
|||
using namespace Ogre;
|
||||
using namespace OEngine::Render;
|
||||
|
||||
#if defined(__APPLE__) && !defined(__LP64__)
|
||||
|
||||
CustomRoot::CustomRoot(const Ogre::String& pluginFileName,
|
||||
const Ogre::String& configFileName,
|
||||
const Ogre::String& logFileName)
|
||||
: Ogre::Root(pluginFileName, configFileName, logFileName)
|
||||
{}
|
||||
|
||||
bool CustomRoot::isQueuedEnd() const
|
||||
{
|
||||
return mQueuedEnd;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void OgreRenderer::cleanup()
|
||||
{
|
||||
delete mFader;
|
||||
|
@ -36,7 +51,6 @@ void OgreRenderer::cleanup()
|
|||
void OgreRenderer::start()
|
||||
{
|
||||
#if defined(__APPLE__) && !defined(__LP64__)
|
||||
bool quit = false;
|
||||
// OSX Carbon Message Pump
|
||||
do {
|
||||
EventRef event = NULL;
|
||||
|
@ -54,11 +68,11 @@ void OgreRenderer::start()
|
|||
ReleaseEvent(event);
|
||||
}
|
||||
|
||||
if (!Ogre::Root::getSingleton().renderOneFrame()) {
|
||||
quit = true;
|
||||
if (!mRoot->renderOneFrame()) {
|
||||
break;
|
||||
}
|
||||
|
||||
} while (!quit);
|
||||
} while (!mRoot->isQueuedEnd());
|
||||
#else
|
||||
mRoot->startRendering();
|
||||
#endif
|
||||
|
@ -120,7 +134,11 @@ void OgreRenderer::configure(const std::string &logPath,
|
|||
// Disable logging
|
||||
log->setDebugOutputEnabled(false);
|
||||
|
||||
#if defined(__APPLE__) && !defined(__LP64__)
|
||||
mRoot = new CustomRoot("", "", "");
|
||||
#else
|
||||
mRoot = new Root("", "", "");
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_PLUGIN_GL) || defined(ENABLE_PLUGIN_Direct3D9) || defined(ENABLE_PLUGIN_CgProgramManager) || defined(ENABLE_PLUGIN_OctreeSceneManager) || defined(ENABLE_PLUGIN_ParticleFX)
|
||||
loadPlugins();
|
||||
|
|
|
@ -27,9 +27,15 @@
|
|||
#include "OgreTexture.h"
|
||||
#include <OgreWindowEventUtilities.h>
|
||||
|
||||
#if defined(__APPLE__) && !defined(__LP64__)
|
||||
#include <OgreRoot.h>
|
||||
#endif
|
||||
|
||||
namespace Ogre
|
||||
{
|
||||
#if !defined(__APPLE__) || defined(__LP64__)
|
||||
class Root;
|
||||
#endif
|
||||
class RenderWindow;
|
||||
class SceneManager;
|
||||
class Camera;
|
||||
|
@ -48,10 +54,25 @@ namespace OEngine
|
|||
std::string fsaa;
|
||||
};
|
||||
|
||||
#if defined(__APPLE__) && !defined(__LP64__)
|
||||
class CustomRoot : public Ogre::Root {
|
||||
public:
|
||||
bool isQueuedEnd() const;
|
||||
|
||||
CustomRoot(const Ogre::String& pluginFileName = "plugins.cfg",
|
||||
const Ogre::String& configFileName = "ogre.cfg",
|
||||
const Ogre::String& logFileName = "Ogre.log");
|
||||
};
|
||||
#endif
|
||||
|
||||
class Fader;
|
||||
class OgreRenderer
|
||||
{
|
||||
#if defined(__APPLE__) && !defined(__LP64__)
|
||||
CustomRoot *mRoot;
|
||||
#else
|
||||
Ogre::Root *mRoot;
|
||||
#endif
|
||||
Ogre::RenderWindow *mWindow;
|
||||
Ogre::SceneManager *mScene;
|
||||
Ogre::Camera *mCamera;
|
||||
|
|
Loading…
Reference in a new issue