diff --git a/gui/events.cpp b/gui/events.cpp index 39b5e9f1cc..146d3ea802 100644 --- a/gui/events.cpp +++ b/gui/events.cpp @@ -1,8 +1,11 @@ #include #include +#include "events.hpp" + using namespace MyGUI; using namespace OIS; +using namespace OEngine::GUI; void EventInjector::event(Type type, int index, const void *p) { diff --git a/gui/events.hpp b/gui/events.hpp index b994a422da..ec483536af 100644 --- a/gui/events.hpp +++ b/gui/events.hpp @@ -8,6 +8,7 @@ namespace MyGUI class Gui; } +namespace OEngine { namespace GUI { /** Event handler that injects OIS events into MyGUI @@ -22,5 +23,5 @@ namespace GUI EventInjector(MyGUI::Gui *g) : gui(g), enabled(true) {} void event(Type type, int index, const void *p); }; -} +}} #endif diff --git a/gui/layout.hpp b/gui/layout.hpp index 7a1b6b86c7..f02ddbdff1 100644 --- a/gui/layout.hpp +++ b/gui/layout.hpp @@ -4,6 +4,7 @@ #include #include +namespace OEngine { namespace GUI { /** The Layout class is an utility class used to load MyGUI layouts @@ -114,5 +115,5 @@ namespace GUI std::string mLayoutName; MyGUI::VectorWidgetPtr mListWindowRoot; }; -} +}} #endif diff --git a/gui/manager.cpp b/gui/manager.cpp index e5e01e7d71..564a33cfed 100644 --- a/gui/manager.cpp +++ b/gui/manager.cpp @@ -4,7 +4,7 @@ #include "manager.hpp" -using namespace GUI; +using namespace OEngine::GUI; void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging) { diff --git a/gui/manager.hpp b/gui/manager.hpp index 3669c0cb20..5f67e9f91a 100644 --- a/gui/manager.hpp +++ b/gui/manager.hpp @@ -13,6 +13,7 @@ namespace Ogre class SceneManager; } +namespace OEngine { namespace GUI { class MyGUIManager @@ -29,5 +30,5 @@ namespace GUI void setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging=false); void shutdown(); }; -} +}} #endif diff --git a/input/dispatch_map.hpp b/input/dispatch_map.hpp index a8e03e18dc..f0d4cabe92 100644 --- a/input/dispatch_map.hpp +++ b/input/dispatch_map.hpp @@ -5,6 +5,7 @@ #include #include +namespace OEngine { namespace Input { /** @@ -70,6 +71,5 @@ struct DispatchMap return out; } }; - -} +}} #endif diff --git a/input/dispatcher.hpp b/input/dispatcher.hpp index 0a9cfd7956..bba13893d3 100644 --- a/input/dispatcher.hpp +++ b/input/dispatcher.hpp @@ -5,6 +5,7 @@ #include "func_binder.hpp" #include +namespace OEngine { namespace Input { struct Dispatcher : Mangle::Input::Event @@ -44,6 +45,5 @@ struct Dispatcher : Mangle::Input::Event funcs.call(*it, p); } }; - -} +}} #endif diff --git a/input/func_binder.hpp b/input/func_binder.hpp index 234971bae3..d2bfd53e5b 100644 --- a/input/func_binder.hpp +++ b/input/func_binder.hpp @@ -6,6 +6,7 @@ #include #include +namespace OEngine { namespace Input { /** @@ -99,6 +100,5 @@ public: return bindings[index].name; } }; - -} +}} #endif diff --git a/input/poller.hpp b/input/poller.hpp index 9c93fe1bf7..c544aed529 100644 --- a/input/poller.hpp +++ b/input/poller.hpp @@ -4,6 +4,7 @@ #include "dispatch_map.hpp" #include +namespace OEngine { namespace Input { /** The poller is used to check (poll) for keys rather than waiting @@ -41,6 +42,5 @@ struct Poller return false; } }; - -} +}} #endif diff --git a/input/tests/dispatch_map_test.cpp b/input/tests/dispatch_map_test.cpp index 5cc7e1ef29..5f262494e5 100644 --- a/input/tests/dispatch_map_test.cpp +++ b/input/tests/dispatch_map_test.cpp @@ -3,7 +3,7 @@ using namespace std; #include "../dispatch_map.hpp" -using namespace Input; +using namespace OEngine::Input; typedef DispatchMap::OutList OutList; typedef OutList::const_iterator Cit; diff --git a/input/tests/funcbind_test.cpp b/input/tests/funcbind_test.cpp index 4716f8b81f..bb4ad34e18 100644 --- a/input/tests/funcbind_test.cpp +++ b/input/tests/funcbind_test.cpp @@ -17,7 +17,7 @@ void f2(int i, const void *p) cout << " F2 i=" << i << endl; } -using namespace Input; +using namespace OEngine::Input; int main() { diff --git a/input/tests/sdl_binder_test.cpp b/input/tests/sdl_binder_test.cpp index 715e797bb8..7de5f5d4fd 100644 --- a/input/tests/sdl_binder_test.cpp +++ b/input/tests/sdl_binder_test.cpp @@ -6,7 +6,7 @@ using namespace std; using namespace Mangle::Input; -using namespace Input; +using namespace OEngine::Input; enum Actions { @@ -34,17 +34,17 @@ int main(int argc, char** argv) SDL_Init(SDL_INIT_VIDEO); SDL_SetVideoMode(640, 480, 0, SDL_SWSURFACE); SDLDriver input; - Dispatcher disp(A_LAST); + Dispatcher *disp = new Dispatcher(A_LAST); Poller poll(input); - input.setEvent(&disp); + input.setEvent(EventPtr(disp)); - disp.funcs.bind(A_Quit, &doExit); - disp.funcs.bind(A_Left, &goLeft); + disp->funcs.bind(A_Quit, &doExit); + disp->funcs.bind(A_Left, &goLeft); - disp.bind(A_Quit, SDLK_q); - disp.bind(A_Left, SDLK_a); - disp.bind(A_Left, SDLK_LEFT); + disp->bind(A_Quit, SDLK_q); + disp->bind(A_Left, SDLK_a); + disp->bind(A_Left, SDLK_LEFT); poll.bind(A_Right, SDLK_d); poll.bind(A_Right, SDLK_RIGHT); diff --git a/ogre/exitlistener.hpp b/ogre/exitlistener.hpp index e1af9604f9..ed07ee55c8 100644 --- a/ogre/exitlistener.hpp +++ b/ogre/exitlistener.hpp @@ -10,6 +10,7 @@ #include #include +namespace OEngine { namespace Render { struct ExitListener : Ogre::FrameListener @@ -28,6 +29,5 @@ namespace Render return !exit; } }; -} - +}} #endif diff --git a/ogre/mouselook.cpp b/ogre/mouselook.cpp index d4d15cee96..84e6e03975 100644 --- a/ogre/mouselook.cpp +++ b/ogre/mouselook.cpp @@ -5,6 +5,7 @@ using namespace OIS; using namespace Ogre; +using namespace OEngine::Render; void MouseLookEvent::event(Type type, int index, const void *p) { diff --git a/ogre/mouselook.hpp b/ogre/mouselook.hpp index 0b11c0b794..b5c7849452 100644 --- a/ogre/mouselook.hpp +++ b/ogre/mouselook.hpp @@ -23,6 +23,7 @@ namespace Ogre class Camera; } +namespace OEngine { namespace Render { class MouseLookEvent : public Mangle::Input::Event @@ -49,6 +50,5 @@ namespace Render void event(Type type, int index, const void *p); }; -} - +}} #endif diff --git a/ogre/renderer.cpp b/ogre/renderer.cpp index 86382127c9..c60a29c77b 100644 --- a/ogre/renderer.cpp +++ b/ogre/renderer.cpp @@ -8,7 +8,7 @@ #include using namespace Ogre; -using namespace Render; +using namespace OEngine::Render; void OgreRenderer::cleanup() { diff --git a/ogre/renderer.hpp b/ogre/renderer.hpp index ac44f5ee11..f706b16f7e 100644 --- a/ogre/renderer.hpp +++ b/ogre/renderer.hpp @@ -16,6 +16,7 @@ namespace Ogre class Viewport; } +namespace OEngine { namespace Render { class OgreRenderer @@ -71,6 +72,5 @@ namespace Render /// Viewport Ogre::Viewport *getViewport() { return mView; } }; -} - +}} #endif