Fixed namespaces, added OEngine:: to everything

This commit is contained in:
Nicolay Korslund 2010-07-10 13:41:43 +02:00
parent b9b306cd4c
commit 5333b8e230
17 changed files with 36 additions and 29 deletions

View file

@ -1,8 +1,11 @@
#include <MyGUI.h> #include <MyGUI.h>
#include <OIS/OIS.h> #include <OIS/OIS.h>
#include "events.hpp"
using namespace MyGUI; using namespace MyGUI;
using namespace OIS; using namespace OIS;
using namespace OEngine::GUI;
void EventInjector::event(Type type, int index, const void *p) void EventInjector::event(Type type, int index, const void *p)
{ {

View file

@ -8,6 +8,7 @@ namespace MyGUI
class Gui; class Gui;
} }
namespace OEngine {
namespace GUI namespace GUI
{ {
/** Event handler that injects OIS events into MyGUI /** Event handler that injects OIS events into MyGUI
@ -22,5 +23,5 @@ namespace GUI
EventInjector(MyGUI::Gui *g) : gui(g), enabled(true) {} EventInjector(MyGUI::Gui *g) : gui(g), enabled(true) {}
void event(Type type, int index, const void *p); void event(Type type, int index, const void *p);
}; };
} }}
#endif #endif

View file

@ -4,6 +4,7 @@
#include <assert.h> #include <assert.h>
#include <MyGUI.h> #include <MyGUI.h>
namespace OEngine {
namespace GUI namespace GUI
{ {
/** The Layout class is an utility class used to load MyGUI layouts /** The Layout class is an utility class used to load MyGUI layouts
@ -114,5 +115,5 @@ namespace GUI
std::string mLayoutName; std::string mLayoutName;
MyGUI::VectorWidgetPtr mListWindowRoot; MyGUI::VectorWidgetPtr mListWindowRoot;
}; };
} }}
#endif #endif

View file

@ -4,7 +4,7 @@
#include "manager.hpp" #include "manager.hpp"
using namespace GUI; using namespace OEngine::GUI;
void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging) void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging)
{ {

View file

@ -13,6 +13,7 @@ namespace Ogre
class SceneManager; class SceneManager;
} }
namespace OEngine {
namespace GUI namespace GUI
{ {
class MyGUIManager class MyGUIManager
@ -29,5 +30,5 @@ namespace GUI
void setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging=false); void setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging=false);
void shutdown(); void shutdown();
}; };
} }}
#endif #endif

View file

@ -5,6 +5,7 @@
#include <map> #include <map>
#include <assert.h> #include <assert.h>
namespace OEngine {
namespace Input { namespace Input {
/** /**
@ -70,6 +71,5 @@ struct DispatchMap
return out; return out;
} }
}; };
}}
}
#endif #endif

View file

@ -5,6 +5,7 @@
#include "func_binder.hpp" #include "func_binder.hpp"
#include <mangle/input/event.hpp> #include <mangle/input/event.hpp>
namespace OEngine {
namespace Input { namespace Input {
struct Dispatcher : Mangle::Input::Event struct Dispatcher : Mangle::Input::Event
@ -44,6 +45,5 @@ struct Dispatcher : Mangle::Input::Event
funcs.call(*it, p); funcs.call(*it, p);
} }
}; };
}}
}
#endif #endif

View file

@ -6,6 +6,7 @@
#include <boost/function.hpp> #include <boost/function.hpp>
#include <assert.h> #include <assert.h>
namespace OEngine {
namespace Input { namespace Input {
/** /**
@ -99,6 +100,5 @@ public:
return bindings[index].name; return bindings[index].name;
} }
}; };
}}
}
#endif #endif

View file

@ -4,6 +4,7 @@
#include "dispatch_map.hpp" #include "dispatch_map.hpp"
#include <mangle/input/driver.hpp> #include <mangle/input/driver.hpp>
namespace OEngine {
namespace Input { namespace Input {
/** The poller is used to check (poll) for keys rather than waiting /** The poller is used to check (poll) for keys rather than waiting
@ -41,6 +42,5 @@ struct Poller
return false; return false;
} }
}; };
}}
}
#endif #endif

View file

@ -3,7 +3,7 @@ using namespace std;
#include "../dispatch_map.hpp" #include "../dispatch_map.hpp"
using namespace Input; using namespace OEngine::Input;
typedef DispatchMap::OutList OutList; typedef DispatchMap::OutList OutList;
typedef OutList::const_iterator Cit; typedef OutList::const_iterator Cit;

View file

@ -17,7 +17,7 @@ void f2(int i, const void *p)
cout << " F2 i=" << i << endl; cout << " F2 i=" << i << endl;
} }
using namespace Input; using namespace OEngine::Input;
int main() int main()
{ {

View file

@ -6,7 +6,7 @@
using namespace std; using namespace std;
using namespace Mangle::Input; using namespace Mangle::Input;
using namespace Input; using namespace OEngine::Input;
enum Actions enum Actions
{ {
@ -34,17 +34,17 @@ int main(int argc, char** argv)
SDL_Init(SDL_INIT_VIDEO); SDL_Init(SDL_INIT_VIDEO);
SDL_SetVideoMode(640, 480, 0, SDL_SWSURFACE); SDL_SetVideoMode(640, 480, 0, SDL_SWSURFACE);
SDLDriver input; SDLDriver input;
Dispatcher disp(A_LAST); Dispatcher *disp = new Dispatcher(A_LAST);
Poller poll(input); Poller poll(input);
input.setEvent(&disp); input.setEvent(EventPtr(disp));
disp.funcs.bind(A_Quit, &doExit); disp->funcs.bind(A_Quit, &doExit);
disp.funcs.bind(A_Left, &goLeft); disp->funcs.bind(A_Left, &goLeft);
disp.bind(A_Quit, SDLK_q); disp->bind(A_Quit, SDLK_q);
disp.bind(A_Left, SDLK_a); disp->bind(A_Left, SDLK_a);
disp.bind(A_Left, SDLK_LEFT); disp->bind(A_Left, SDLK_LEFT);
poll.bind(A_Right, SDLK_d); poll.bind(A_Right, SDLK_d);
poll.bind(A_Right, SDLK_RIGHT); poll.bind(A_Right, SDLK_RIGHT);

View file

@ -10,6 +10,7 @@
#include <OgreFrameListener.h> #include <OgreFrameListener.h>
#include <OgreRenderWindow.h> #include <OgreRenderWindow.h>
namespace OEngine {
namespace Render namespace Render
{ {
struct ExitListener : Ogre::FrameListener struct ExitListener : Ogre::FrameListener
@ -28,6 +29,5 @@ namespace Render
return !exit; return !exit;
} }
}; };
} }}
#endif #endif

View file

@ -5,6 +5,7 @@
using namespace OIS; using namespace OIS;
using namespace Ogre; using namespace Ogre;
using namespace OEngine::Render;
void MouseLookEvent::event(Type type, int index, const void *p) void MouseLookEvent::event(Type type, int index, const void *p)
{ {

View file

@ -23,6 +23,7 @@ namespace Ogre
class Camera; class Camera;
} }
namespace OEngine {
namespace Render namespace Render
{ {
class MouseLookEvent : public Mangle::Input::Event class MouseLookEvent : public Mangle::Input::Event
@ -49,6 +50,5 @@ namespace Render
void event(Type type, int index, const void *p); void event(Type type, int index, const void *p);
}; };
} }}
#endif #endif

View file

@ -8,7 +8,7 @@
#include <assert.h> #include <assert.h>
using namespace Ogre; using namespace Ogre;
using namespace Render; using namespace OEngine::Render;
void OgreRenderer::cleanup() void OgreRenderer::cleanup()
{ {

View file

@ -16,6 +16,7 @@ namespace Ogre
class Viewport; class Viewport;
} }
namespace OEngine {
namespace Render namespace Render
{ {
class OgreRenderer class OgreRenderer
@ -71,6 +72,5 @@ namespace Render
/// Viewport /// Viewport
Ogre::Viewport *getViewport() { return mView; } Ogre::Viewport *getViewport() { return mView; }
}; };
} }}
#endif #endif