From 95ca0e469ef856c0182bb0da411e4417391e3780 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 5 Feb 2008 00:10:02 +0000 Subject: renamed client and server application objects cleaned up namespaces --- src/client/input.cc | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'src/client/input.cc') diff --git a/src/client/input.cc b/src/client/input.cc index 08fa9ca..91f462c 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -1,11 +1,16 @@ /* - input.cc + client/input.h This file is part of the Osirion project and is distributed under the terms and conditions of the GNU General Public License version 2 */ -//project headers + #include "client/client.h" +#include "client/input.h" +#include "client/console.h" +#include "client/camera.h" + +#include "SDL/SDL.h" namespace client { @@ -60,15 +65,19 @@ void handle_keypressed(SDL_keysym* keysym) camera::rotate_down(); break; case SDLK_KP_PLUS: + // TODO set core entity params game.ship.set_thrust(game.ship.thrust() + 0.08f); break; case SDLK_KP_MINUS: + // TODO set core entity params game.ship.set_thrust(game.ship.thrust() - 0.1f); break; case SDLK_KP4: + // TODO set core entity params game.ship.set_yaw(game.ship.yaw() + 10); break; case SDLK_KP6: + // TODO set core entity params game.ship.set_yaw(game.ship.yaw() - 10); break; default: @@ -90,7 +99,7 @@ void frame(float seconds) client::application.shutdown(); } */ - if (core::connected() && !console.visible()) { + if (core::connected() && !console::visible()) { // send key events to the game world handle_keypressed( &event.key.keysym ); } @@ -98,10 +107,10 @@ void frame(float seconds) case SDL_KEYUP: if (event.key.keysym.sym == '`' || event.key.keysym.sym == '~') { - console.toggle(); - } else if (console.visible()) { + console::toggle(); + } else if (console::visible()) { // send key events to the console - console.handle_keyreleased( &event.key.keysym ); + console::handle_keyreleased( &event.key.keysym ); } else if (core::connected()) { // send key events to the game world handle_keyreleased( &event.key.keysym ); @@ -109,7 +118,7 @@ void frame(float seconds) break; case SDL_QUIT: - client::application.shutdown(); + core::application()->shutdown(); break; } -- cgit v1.2.3