Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-02-05 00:10:02 +0000
committerStijn Buys <ingar@osirion.org>2008-02-05 00:10:02 +0000
commit95ca0e469ef856c0182bb0da411e4417391e3780 (patch)
treea07db9b9d726d175d8305dc3cc5520b8a70f7a73 /src/client/input.cc
parentcf61370df80de6dc659dbd9b803c973b300c1b4c (diff)
renamed client and server application objects
cleaned up namespaces
Diffstat (limited to 'src/client/input.cc')
-rw-r--r--src/client/input.cc23
1 files changed, 16 insertions, 7 deletions
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;
}