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 add_openmw_dir (mwrender
actors objects renderingmanager animation sky npcanimation vismask actors objects renderingmanager animation sky npcanimation vismask
creatureanimation effectmanager util renderinginterface debugging rendermode creatureanimation effectmanager util renderinginterface pathgrid rendermode
bulletdebugdraw bulletdebugdraw
# camera # camera
# localmap occlusionquery water shadows # localmap occlusionquery water shadows

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

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

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

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

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

Loading…
Cancel
Save