mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-13 21:40:11 +00:00
LocalMap no longer depends on osgViewer
This commit is contained in:
parent
b2ae45f0eb
commit
8bfcf259a3
@ -282,7 +282,7 @@ namespace MWGui
|
|||||||
|
|
||||||
mRecharge = new Recharge();
|
mRecharge = new Recharge();
|
||||||
mMenu = new MainMenu(w, h, mResourceSystem->getVFS(), mVersionDescription);
|
mMenu = new MainMenu(w, h, mResourceSystem->getVFS(), mVersionDescription);
|
||||||
mLocalMapRender = new MWRender::LocalMap(mViewer);
|
mLocalMapRender = new MWRender::LocalMap(mViewer->getSceneData()->asGroup());
|
||||||
mMap = new MapWindow(mCustomMarkers, mDragAndDrop, mLocalMapRender);
|
mMap = new MapWindow(mCustomMarkers, mDragAndDrop, mLocalMapRender);
|
||||||
trackWindow(mMap, "map");
|
trackWindow(mMap, "map");
|
||||||
mStatsWindow = new StatsWindow(mDragAndDrop);
|
mStatsWindow = new StatsWindow(mDragAndDrop);
|
||||||
|
@ -7,11 +7,10 @@
|
|||||||
#include <osg/LightModel>
|
#include <osg/LightModel>
|
||||||
#include <osg/Texture2D>
|
#include <osg/Texture2D>
|
||||||
#include <osg/ComputeBoundsVisitor>
|
#include <osg/ComputeBoundsVisitor>
|
||||||
|
#include <osg/LightSource>
|
||||||
|
|
||||||
#include <osgDB/ReadFile>
|
#include <osgDB/ReadFile>
|
||||||
|
|
||||||
#include <osgViewer/Viewer>
|
|
||||||
|
|
||||||
#include <components/esm/fogstate.hpp>
|
#include <components/esm/fogstate.hpp>
|
||||||
#include <components/esm/loadcell.hpp>
|
#include <components/esm/loadcell.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/settings.hpp>
|
||||||
@ -68,16 +67,14 @@ namespace
|
|||||||
namespace MWRender
|
namespace MWRender
|
||||||
{
|
{
|
||||||
|
|
||||||
LocalMap::LocalMap(osgViewer::Viewer* viewer)
|
LocalMap::LocalMap(osg::Group* root)
|
||||||
: mViewer(viewer)
|
: mRoot(root)
|
||||||
, mMapResolution(Settings::Manager::getInt("local map resolution", "Map"))
|
, mMapResolution(Settings::Manager::getInt("local map resolution", "Map"))
|
||||||
, mMapWorldSize(8192.f)
|
, mMapWorldSize(8192.f)
|
||||||
, mCellDistance(Settings::Manager::getInt("local map cell distance", "Map"))
|
, mCellDistance(Settings::Manager::getInt("local map cell distance", "Map"))
|
||||||
, mAngle(0.f)
|
, mAngle(0.f)
|
||||||
, mInterior(false)
|
, mInterior(false)
|
||||||
{
|
{
|
||||||
mRoot = mViewer->getSceneData()->asGroup();
|
|
||||||
|
|
||||||
SceneUtil::FindByNameVisitor find("Scene Root");
|
SceneUtil::FindByNameVisitor find("Scene Root");
|
||||||
mRoot->accept(find);
|
mRoot->accept(find);
|
||||||
mSceneRoot = find.mFoundNode;
|
mSceneRoot = find.mFoundNode;
|
||||||
@ -310,7 +307,7 @@ void LocalMap::requestExteriorMap(const MWWorld::CellStore* cell)
|
|||||||
int x = cell->getCell()->getGridX();
|
int x = cell->getCell()->getGridX();
|
||||||
int y = cell->getCell()->getGridY();
|
int y = cell->getCell()->getGridY();
|
||||||
|
|
||||||
osg::BoundingSphere bound = mViewer->getSceneData()->getBound();
|
osg::BoundingSphere bound = mSceneRoot->getBound();
|
||||||
float zmin = bound.center().z() - bound.radius();
|
float zmin = bound.center().z() - bound.radius();
|
||||||
float zmax = bound.center().z() + bound.radius();
|
float zmax = bound.center().z() + bound.radius();
|
||||||
|
|
||||||
|
@ -19,11 +19,6 @@ namespace ESM
|
|||||||
struct FogTexture;
|
struct FogTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace osgViewer
|
|
||||||
{
|
|
||||||
class Viewer;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace osg
|
namespace osg
|
||||||
{
|
{
|
||||||
class Texture2D;
|
class Texture2D;
|
||||||
@ -41,7 +36,7 @@ namespace MWRender
|
|||||||
class LocalMap
|
class LocalMap
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LocalMap(osgViewer::Viewer* viewer);
|
LocalMap(osg::Group* root);
|
||||||
~LocalMap();
|
~LocalMap();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,8 +101,6 @@ namespace MWRender
|
|||||||
osg::Group* getRoot();
|
osg::Group* getRoot();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
osg::ref_ptr<osgViewer::Viewer> mViewer;
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Group> mRoot;
|
osg::ref_ptr<osg::Group> mRoot;
|
||||||
osg::ref_ptr<osg::Node> mSceneRoot;
|
osg::ref_ptr<osg::Node> mSceneRoot;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user