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