added support for out of world rendering

actorid
Marc Zinnschlag 12 years ago
parent 44c644dd7b
commit b7c9285b24

@ -16,7 +16,7 @@ source_group(game FILES ${GAME} ${GAME_HEADER})
add_openmw_dir (mwrender
renderingmanager debugging sky player animation npcanimation creatureanimation actors objects
renderinginterface localmap occlusionquery terrain terrainmaterial water shadows
compositors
compositors externalrendering
)
add_openmw_dir (mwinput

@ -35,6 +35,11 @@ namespace ESMS
struct ESMStore;
}
namespace MWRender
{
class ExternalRendering;
}
namespace MWWorld
{
class CellStore;
@ -271,6 +276,8 @@ namespace MWBase
virtual void togglePlayerLooking(bool enable) = 0;
virtual void renderPlayer() = 0;
virtual void setupExternalRendering (MWRender::ExternalRendering& rendering) = 0;
};
}

@ -0,0 +1,23 @@
#ifndef GAME_RENDERING_EXTERNALRENDERING_H
#define GAME_RENDERING_EXTERNALRENDERING_H
namespace Ogre
{
class SceneManager;
}
namespace MWRender
{
/// \brief Base class for out of world rendering
class ExternalRendering
{
public:
virtual void setup (Ogre::SceneManager *sceneManager) = 0;
virtual ~ExternalRendering() {}
};
}
#endif

@ -34,6 +34,7 @@
#include "water.hpp"
#include "compositors.hpp"
#include "npcanimation.hpp"
#include "externalrendering.hpp"
using namespace MWRender;
using namespace Ogre;
@ -882,4 +883,9 @@ bool RenderingManager::isPositionExplored (float nX, float nY, int x, int y, boo
return mLocalMap->isPositionExplored(nX, nY, x, y, interior);
}
void RenderingManager::setupExternalRendering (MWRender::ExternalRendering& rendering)
{
rendering.setup (mRendering.getScene());
}
} // namespace

@ -43,6 +43,7 @@ namespace MWRender
class LocalMap;
class Water;
class Compositors;
class ExternalRendering;
class RenderingManager: private RenderingInterface, public Ogre::WindowEventListener {
@ -185,12 +186,14 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList
static bool waterShaderSupported();
virtual void getInteriorMapPosition (Ogre::Vector2 position, float& nX, float& nY, int &x, int& y);
void getInteriorMapPosition (Ogre::Vector2 position, float& nX, float& nY, int &x, int& y);
///< see MWRender::LocalMap::getInteriorMapPosition
virtual bool isPositionExplored (float nX, float nY, int x, int y, bool interior);
bool isPositionExplored (float nX, float nY, int x, int y, bool interior);
///< see MWRender::LocalMap::isPositionExplored
void setupExternalRendering (MWRender::ExternalRendering& rendering);
protected:
virtual void windowResized(Ogre::RenderWindow* rw);
virtual void windowClosed(Ogre::RenderWindow* rw);

@ -1222,4 +1222,9 @@ namespace MWWorld
{
mRendering->renderPlayer(mPlayer->getPlayer());
}
void World::setupExternalRendering (MWRender::ExternalRendering& rendering)
{
mRendering->setupExternalRendering (rendering);
}
}

@ -307,6 +307,8 @@ namespace MWWorld
}
virtual void renderPlayer();
virtual void setupExternalRendering (MWRender::ExternalRendering& rendering);
};
}

Loading…
Cancel
Save