Rename MWRender::Debugging to MWRender::Pathgrid

c++11
scrawl 10 years ago
parent c1edc30ad7
commit e191f0e044

@ -21,7 +21,7 @@ source_group(game FILES ${GAME} ${GAME_HEADER})
add_openmw_dir (mwrender
actors objects renderingmanager animation sky npcanimation vismask
creatureanimation effectmanager util renderinginterface debugging rendermode
creatureanimation effectmanager util renderinginterface pathgrid rendermode
bulletdebugdraw
# camera
# localmap occlusionquery water shadows

@ -1,4 +1,4 @@
#include "debugging.hpp"
#include "pathgrid.hpp"
#include <cassert>
@ -7,8 +7,6 @@
#include <osg/Geode>
#include <osg/Group>
#include <openengine/bullet/physic.hpp>
#include <components/esm/loadstat.hpp>
#include <components/esm/loadpgrd.hpp>
@ -27,7 +25,7 @@ namespace MWRender
static const int POINT_MESH_BASE = 35;
osg::ref_ptr<osg::Geometry> Debugging::createPathgridLines(const ESM::Pathgrid *pathgrid)
osg::ref_ptr<osg::Geometry> Pathgrid::createPathgridLines(const ESM::Pathgrid *pathgrid)
{
osg::ref_ptr<osg::Geometry> geom = new osg::Geometry;
@ -62,7 +60,7 @@ osg::ref_ptr<osg::Geometry> Debugging::createPathgridLines(const ESM::Pathgrid *
return geom;
}
osg::ref_ptr<osg::Geometry> Debugging::createPathgridPoints(const ESM::Pathgrid *pathgrid)
osg::ref_ptr<osg::Geometry> Pathgrid::createPathgridPoints(const ESM::Pathgrid *pathgrid)
{
osg::ref_ptr<osg::Geometry> geom = new osg::Geometry;
@ -126,7 +124,7 @@ osg::ref_ptr<osg::Geometry> Debugging::createPathgridPoints(const ESM::Pathgrid
return geom;
}
Debugging::Debugging(osg::ref_ptr<osg::Group> root /*, OEngine::Physic::PhysicEngine *engine*/)
Pathgrid::Pathgrid(osg::ref_ptr<osg::Group> root)
: mRootNode(root)
, mPathgridEnabled(false)
, mInteriorPathgridNode(NULL)
@ -134,7 +132,7 @@ Debugging::Debugging(osg::ref_ptr<osg::Group> root /*, OEngine::Physic::PhysicEn
{
}
Debugging::~Debugging()
Pathgrid::~Pathgrid()
{
if (mPathgridEnabled)
{
@ -143,7 +141,7 @@ Debugging::~Debugging()
}
bool Debugging::toggleRenderMode (int mode){
bool Pathgrid::toggleRenderMode (int mode){
switch (mode)
{
case Render_Pathgrid:
@ -156,21 +154,21 @@ bool Debugging::toggleRenderMode (int mode){
return false;
}
void Debugging::addCell(const MWWorld::CellStore *store)
void Pathgrid::addCell(const MWWorld::CellStore *store)
{
mActiveCells.push_back(store);
if (mPathgridEnabled)
enableCellPathgrid(store);
}
void Debugging::removeCell(const MWWorld::CellStore *store)
void Pathgrid::removeCell(const MWWorld::CellStore *store)
{
mActiveCells.erase(std::remove(mActiveCells.begin(), mActiveCells.end(), store), mActiveCells.end());
if (mPathgridEnabled)
disableCellPathgrid(store);
}
void Debugging::togglePathgrid()
void Pathgrid::togglePathgrid()
{
mPathgridEnabled = !mPathgridEnabled;
if (mPathgridEnabled)
@ -201,7 +199,7 @@ void Debugging::togglePathgrid()
}
}
void Debugging::enableCellPathgrid(const MWWorld::CellStore *store)
void Pathgrid::enableCellPathgrid(const MWWorld::CellStore *store)
{
MWBase::World* world = MWBase::Environment::get().getWorld();
const ESM::Pathgrid *pathgrid =
@ -242,7 +240,7 @@ void Debugging::enableCellPathgrid(const MWWorld::CellStore *store)
}
}
void Debugging::disableCellPathgrid(const MWWorld::CellStore *store)
void Pathgrid::disableCellPathgrid(const MWWorld::CellStore *store)
{
if (store->getCell()->isExterior())
{

@ -14,14 +14,6 @@ namespace ESM
struct Pathgrid;
}
namespace OEngine
{
namespace Physic
{
class PhysicEngine;
}
}
namespace osg
{
class Group;
@ -36,11 +28,8 @@ namespace MWWorld
namespace MWRender
{
class Debugging
class Pathgrid
{
//OEngine::Physic::PhysicEngine* mEngine;
// Path grid stuff
bool mPathgridEnabled;
void togglePathgrid();
@ -63,8 +52,8 @@ namespace MWRender
osg::ref_ptr<osg::Geometry> createPathgridLines(const ESM::Pathgrid *pathgrid);
osg::ref_ptr<osg::Geometry> createPathgridPoints(const ESM::Pathgrid *pathgrid);
public:
Debugging(osg::ref_ptr<osg::Group> root /*, OEngine::Physic::PhysicEngine *engine*/);
~Debugging();
Pathgrid(osg::ref_ptr<osg::Group> root);
~Pathgrid();
bool toggleRenderMode (int mode);
void addCell(const MWWorld::CellStore* store);

@ -29,7 +29,7 @@
#include "effectmanager.hpp"
#include "npcanimation.hpp"
#include "vismask.hpp"
#include "debugging.hpp"
#include "pathgrid.hpp"
namespace MWRender
{
@ -93,7 +93,7 @@ namespace MWRender
mRootNode->addChild(lightRoot);
mDebugging.reset(new Debugging(mRootNode));
mPathgrid.reset(new Pathgrid(mRootNode));
mObjects.reset(new Objects(mResourceSystem, lightRoot));
@ -195,12 +195,12 @@ namespace MWRender
void RenderingManager::addCell(const MWWorld::CellStore *store)
{
mDebugging->addCell(store);
mPathgrid->addCell(store);
}
void RenderingManager::removeCell(const MWWorld::CellStore *store)
{
mDebugging->removeCell(store);
mPathgrid->removeCell(store);
mObjects->removeCell(store);
}
@ -212,7 +212,7 @@ namespace MWRender
bool RenderingManager::toggleRenderMode(RenderMode mode)
{
if (mode == Render_CollisionDebug || mode == Render_Pathgrid)
return mDebugging->toggleRenderMode(mode);
return mPathgrid->toggleRenderMode(mode);
else if (mode == Render_Wireframe)
{
return false;

@ -38,7 +38,7 @@ namespace MWRender
class EffectManager;
class SkyManager;
class NpcAnimation;
class Debugging;
class Pathgrid;
class RenderingManager : public MWRender::RenderingInterface
{
@ -99,7 +99,7 @@ namespace MWRender
osg::ref_ptr<osg::Light> mSunLight;
std::auto_ptr<Debugging> mDebugging;
std::auto_ptr<Pathgrid> mPathgrid;
std::auto_ptr<Objects> mObjects;
std::auto_ptr<SkyManager> mSky;
std::auto_ptr<EffectManager> mEffectManager;

@ -1,8 +1,6 @@
#ifndef GAME_MWWORLD_WORLDIMP_H
#define GAME_MWWORLD_WORLDIMP_H
#include "../mwrender/debugging.hpp"
#include <boost/shared_ptr.hpp>
#include <osg/ref_ptr>
@ -23,6 +21,14 @@
#include <components/settings/settings.hpp>
namespace OEngine
{
namespace Physic
{
class PhysicEngine;
}
}
namespace osg
{
class Group;

Loading…
Cancel
Save