1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 02:53:51 +00:00

added support for out of world rendering

This commit is contained in:
Marc Zinnschlag 2012-09-14 21:12:16 +02:00
parent 44c644dd7b
commit b7c9285b24
7 changed files with 49 additions and 3 deletions

View file

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

View file

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

View file

@ -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

View file

@ -34,6 +34,7 @@
#include "water.hpp" #include "water.hpp"
#include "compositors.hpp" #include "compositors.hpp"
#include "npcanimation.hpp" #include "npcanimation.hpp"
#include "externalrendering.hpp"
using namespace MWRender; using namespace MWRender;
using namespace Ogre; 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); return mLocalMap->isPositionExplored(nX, nY, x, y, interior);
} }
void RenderingManager::setupExternalRendering (MWRender::ExternalRendering& rendering)
{
rendering.setup (mRendering.getScene());
}
} // namespace } // namespace

View file

@ -43,6 +43,7 @@ namespace MWRender
class LocalMap; class LocalMap;
class Water; class Water;
class Compositors; class Compositors;
class ExternalRendering;
class RenderingManager: private RenderingInterface, public Ogre::WindowEventListener { class RenderingManager: private RenderingInterface, public Ogre::WindowEventListener {
@ -185,12 +186,14 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList
static bool waterShaderSupported(); 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 ///< 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 ///< see MWRender::LocalMap::isPositionExplored
void setupExternalRendering (MWRender::ExternalRendering& rendering);
protected: protected:
virtual void windowResized(Ogre::RenderWindow* rw); virtual void windowResized(Ogre::RenderWindow* rw);
virtual void windowClosed(Ogre::RenderWindow* rw); virtual void windowClosed(Ogre::RenderWindow* rw);

View file

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

View file

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