src/Graphics/GameView.cc
branchnew_graphics
changeset 416 38cba347a3a9
parent 414 cede5463b845
--- a/src/Graphics/GameView.cc	Thu Jan 22 00:13:53 2009 +0200
+++ b/src/Graphics/GameView.cc	Thu Jan 22 00:28:26 2009 +0200
@@ -20,6 +20,7 @@
     message_view.add_message(CL_Color::white, "Hello World!");
 
     // enable GUI input
+    slots.connect(graphics->input.gui.sig_input(), this, &GameView::handleInput);
     graphics->input.gui.enable();
 }
 
@@ -33,6 +34,7 @@
     info_view = new PlayerInfoView(getInfoViewArea(), player);
 
     // enable player input
+    slots.connect(graphics->input.player.sig_input(), player, &LocalPlayer::handleInput);
     graphics->input.player.enable();
 }
 
@@ -82,19 +84,6 @@
 void GameView::draw (Display &display) {
     CL_GraphicContext *gc = display.get_gc();
     
-    // XXX: these should not be done from here
-    handleInput(graphics->input.readGuiInput(), 0);
-    
-    // XXX: this should /really/ be somewhere else
-    if (player) {
-        PlayerInput input;
-        TimeMS dt;
-
-        graphics->input.readPlayerInput(input, dt);
-
-        player->handleInput(input, dt);
-    }
-
     // calculate camera
     PixelCoordinate camera(0, 0);