From 30ba9b74daf60afd7d781423e6c9cef23f9ddab3 Mon Sep 17 00:00:00 2001 From: Jason Hooks Date: Sat, 22 Oct 2011 00:15:15 -0400 Subject: [PATCH] Simple Debugging class --- apps/openmw/mwrender/mwscene.cpp | 18 ++++++++++++++++++ apps/openmw/mwrender/mwscene.hpp | 9 +++++++++ apps/openmw/mwrender/renderingmanager.hpp | 2 ++ 3 files changed, 29 insertions(+) diff --git a/apps/openmw/mwrender/mwscene.cpp b/apps/openmw/mwrender/mwscene.cpp index 900b4d249d..cabed7beeb 100644 --- a/apps/openmw/mwrender/mwscene.cpp +++ b/apps/openmw/mwrender/mwscene.cpp @@ -18,6 +18,24 @@ using namespace MWRender; using namespace Ogre; +Debugging::Debugging(OEngine::Physic::PhysicEngine* engine){ + eng = engine; +} + +bool Debugging::toggleRenderMode (int mode){ + switch (mode) + { + case MWWorld::World::Render_CollisionDebug: + + // TODO use a proper function instead of accessing the member variable + // directly. + eng->setDebugRenderingMode (!eng->isDebugCreated); + return eng->isDebugCreated; + } + + return false; +} + MWScene::MWScene(OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng) : rend(_rend) { diff --git a/apps/openmw/mwrender/mwscene.hpp b/apps/openmw/mwrender/mwscene.hpp index 9186790351..d68fb6ad57 100644 --- a/apps/openmw/mwrender/mwscene.hpp +++ b/apps/openmw/mwrender/mwscene.hpp @@ -28,6 +28,15 @@ namespace MWRender { class Player; + class Debugging{ + OEngine::Physic::PhysicEngine* eng; + + + public: + Debugging(OEngine::Physic::PhysicEngine* engine); + bool toggleRenderMode (int mode); + }; + /// \brief 3D-scene (rendering and physics) class MWScene diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index ec03e970a0..8c76f8f26f 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -34,6 +34,8 @@ namespace MWWorld namespace MWRender { class Player; + + class RenderingManager { OEngine::Render::OgreRenderer &rend;