diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index d680f49d6..e1de2a556 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -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 diff --git a/apps/openmw/mwrender/debugging.cpp b/apps/openmw/mwrender/pathgrid.cpp similarity index 92% rename from apps/openmw/mwrender/debugging.cpp rename to apps/openmw/mwrender/pathgrid.cpp index 9cbf94d46..5e559eeed 100644 --- a/apps/openmw/mwrender/debugging.cpp +++ b/apps/openmw/mwrender/pathgrid.cpp @@ -1,4 +1,4 @@ -#include "debugging.hpp" +#include "pathgrid.hpp" #include @@ -7,8 +7,6 @@ #include #include -#include - #include #include @@ -27,7 +25,7 @@ namespace MWRender static const int POINT_MESH_BASE = 35; -osg::ref_ptr Debugging::createPathgridLines(const ESM::Pathgrid *pathgrid) +osg::ref_ptr Pathgrid::createPathgridLines(const ESM::Pathgrid *pathgrid) { osg::ref_ptr geom = new osg::Geometry; @@ -62,7 +60,7 @@ osg::ref_ptr Debugging::createPathgridLines(const ESM::Pathgrid * return geom; } -osg::ref_ptr Debugging::createPathgridPoints(const ESM::Pathgrid *pathgrid) +osg::ref_ptr Pathgrid::createPathgridPoints(const ESM::Pathgrid *pathgrid) { osg::ref_ptr geom = new osg::Geometry; @@ -126,7 +124,7 @@ osg::ref_ptr Debugging::createPathgridPoints(const ESM::Pathgrid return geom; } -Debugging::Debugging(osg::ref_ptr root /*, OEngine::Physic::PhysicEngine *engine*/) +Pathgrid::Pathgrid(osg::ref_ptr root) : mRootNode(root) , mPathgridEnabled(false) , mInteriorPathgridNode(NULL) @@ -134,7 +132,7 @@ Debugging::Debugging(osg::ref_ptr 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()) { diff --git a/apps/openmw/mwrender/debugging.hpp b/apps/openmw/mwrender/pathgrid.hpp similarity index 81% rename from apps/openmw/mwrender/debugging.hpp rename to apps/openmw/mwrender/pathgrid.hpp index 4ec5bc41d..39a6d71ed 100644 --- a/apps/openmw/mwrender/debugging.hpp +++ b/apps/openmw/mwrender/pathgrid.hpp @@ -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 createPathgridLines(const ESM::Pathgrid *pathgrid); osg::ref_ptr createPathgridPoints(const ESM::Pathgrid *pathgrid); public: - Debugging(osg::ref_ptr root /*, OEngine::Physic::PhysicEngine *engine*/); - ~Debugging(); + Pathgrid(osg::ref_ptr root); + ~Pathgrid(); bool toggleRenderMode (int mode); void addCell(const MWWorld::CellStore* store); diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 4f13df8e7..4d06d901a 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -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; diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index 334025096..0dc0fe571 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -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 mSunLight; - std::auto_ptr mDebugging; + std::auto_ptr mPathgrid; std::auto_ptr mObjects; std::auto_ptr mSky; std::auto_ptr mEffectManager; diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 464f2d605..cb58f0496 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -1,8 +1,6 @@ #ifndef GAME_MWWORLD_WORLDIMP_H #define GAME_MWWORLD_WORLDIMP_H -#include "../mwrender/debugging.hpp" - #include #include @@ -23,6 +21,14 @@ #include +namespace OEngine +{ +namespace Physic +{ + class PhysicEngine; +} +} + namespace osg { class Group;