diff options
author | Stijn Buys <ingar@osirion.org> | 2008-02-04 18:42:05 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-02-04 18:42:05 +0000 |
commit | 151a2ac2434f4b4c23c107d9c21e4a18dd1a3c68 (patch) | |
tree | 18154b52b44327de28d82ff187f25c8369ddc5d9 /src/client/input.cc | |
parent | 09fb43f3d36847977ac202c10c5a11f34af03a43 (diff) |
converted client:: singleton classes to namespaces
Diffstat (limited to 'src/client/input.cc')
-rw-r--r-- | src/client/input.cc | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/client/input.cc b/src/client/input.cc index c46c66f..08fa9ca 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -7,33 +7,36 @@ //project headers #include "client/client.h" -namespace client { +namespace client +{ + +namespace input +{ -void Input::init() +void init() { - con_debug << "Initializing input..." << std::endl; + con_print << "Initializing input..." << std::endl; //condebug << "SDL_DEFAULT_REPEAT_DELAY " << SDL_DEFAULT_REPEAT_DELAY << std::endl; //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); SDL_EnableKeyRepeat(10, SDL_DEFAULT_REPEAT_INTERVAL); } -void Input::shutdown() +void shutdown() { - con_debug << "Shutting down input..." << std::endl; + con_print << "Shutting down input..." << std::endl; } /* see http://docs.mandragor.org/files/Common_libs_documentation/SDL/SDL_Documentation_project_en/sdlevent.html */ - // handle key_release events for the game world -void Input::handle_keyreleased(SDL_keysym* keysym) +void handle_keyreleased(SDL_keysym* keysym) { switch( keysym->sym ) { case SDLK_SPACE: - camera.nextmode(); + camera::nextmode(); break; default: break; @@ -41,20 +44,20 @@ void Input::handle_keyreleased(SDL_keysym* keysym) } // handle pressed keys for the game world -void Input::handle_keypressed(SDL_keysym* keysym) +void handle_keypressed(SDL_keysym* keysym) { switch( keysym->sym ) { case SDLK_LEFT: - camera.rotate_left(); + camera::rotate_left(); break; case SDLK_RIGHT: - camera.rotate_right(); + camera::rotate_right(); break; case SDLK_UP: - camera.rotate_up(); + camera::rotate_up(); break; case SDLK_DOWN: - camera.rotate_down(); + camera::rotate_down(); break; case SDLK_KP_PLUS: game.ship.set_thrust(game.ship.thrust() + 0.08f); @@ -74,7 +77,7 @@ void Input::handle_keypressed(SDL_keysym* keysym) } -void Input::frame() +void frame(float seconds) { SDL_Event event; @@ -114,5 +117,7 @@ void Input::frame() } +} // namespace input + } // namespace client |