feuerkraft-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Feuerkraft-CVS] rev 329 - in trunk: data src/input


From: Ingo Ruhnke
Subject: [Feuerkraft-CVS] rev 329 - in trunk: data src/input
Date: Sat, 10 Jan 2004 16:49:00 +0100

Author: grumbel
Date: 2004-01-10 16:48:59 +0100 (Sat, 10 Jan 2004)
New Revision: 329

Modified:
   trunk/data/feuerkraft.scm
   trunk/src/input/Makefile.am
   trunk/src/input/axis_factory.cxx
   trunk/src/input/button_factory.cxx
   trunk/src/input/button_factory.hxx
   trunk/src/input/input_manager.cxx
Log:
- added axisbutton

Modified: trunk/data/feuerkraft.scm
===================================================================
--- trunk/data/feuerkraft.scm   2004-01-10 15:10:45 UTC (rev 328)
+++ trunk/data/feuerkraft.scm   2004-01-10 15:48:59 UTC (rev 329)
@@ -347,7 +347,7 @@
 (list-cdr-set! editor-insert-funcs (1- (length editor-insert-funcs)) 
editor-insert-funcs)
 
 ;; Core events
-(input-register-callback "key_k" join-nearest-vehicle)
+;;(input-register-callback "key_k" join-nearest-vehicle)
 
 ;; Support events, also reachable via menu
 (input-register-callback "mouse_right"

Modified: trunk/src/input/Makefile.am
===================================================================
--- trunk/src/input/Makefile.am 2004-01-10 15:10:45 UTC (rev 328)
+++ trunk/src/input/Makefile.am 2004-01-10 15:48:59 UTC (rev 329)
@@ -18,6 +18,8 @@
   input_button_input_device.cxx \
   input_axis_input_device.hxx \
   input_axis_input_device.cxx \
+  axis_button.hxx \
+  axis_button.cxx \
   button_axis.hxx \
   button_axis.cxx \
   button_factory.hxx \

Modified: trunk/src/input/axis_factory.cxx
===================================================================
--- trunk/src/input/axis_factory.cxx    2004-01-10 15:10:45 UTC (rev 328)
+++ trunk/src/input/axis_factory.cxx    2004-01-10 15:48:59 UTC (rev 329)
@@ -72,6 +72,7 @@
 {
   InputButton* left  = ButtonFactory::create(gh_car(lst));
   InputButton* right = ButtonFactory::create(gh_cadr(lst));
+
   return new ButtonAxis(left, right);
 }
 

Modified: trunk/src/input/button_factory.cxx
===================================================================
--- trunk/src/input/button_factory.cxx  2004-01-10 15:10:45 UTC (rev 328)
+++ trunk/src/input/button_factory.cxx  2004-01-10 15:48:59 UTC (rev 329)
@@ -23,7 +23,10 @@
 #include "../string_converter.hxx"
 #include "../feuerkraft_error.hxx"
 #include "input_button.hxx"
+#include "input_axis.hxx"
 #include "input_button_input_device.hxx"
+#include "axis_factory.hxx"
+#include "axis_button.hxx"
 #include "button_factory.hxx"
 
 InputButton* 
@@ -39,16 +42,30 @@
     {
       return create_keyboard_button(gh_cdr(lst));
     }
+  else if (gh_equal_p(sym, gh_symbol2scm("axis-button")))
+    {
+      return create_axis_button(gh_cdr(lst));
+    }
   else
     {
-      throw FeuerkraftError("ButtonFactory::create: parse error: "
-                            + Guile::scm2string(lst));
+      throw FeuerkraftError("ButtonFactory::create: parse error: '"
+                            + Guile::scm2string(lst) + "'");
     }
       
   return 0;
 }
 
 InputButton*
+ButtonFactory::create_axis_button(SCM lst)
+{
+  std::cout << "ButtonFactory::create_axis_button: " << Guile::scm2string(lst) 
<< std::endl;
+  InputAxis* axis = AxisFactory::create(gh_car(lst));
+  bool top = gh_scm2bool(gh_cadr(lst));
+  
+  return new AxisButton(axis, top);
+}
+
+InputButton*
 ButtonFactory::create_joystick_button(SCM lst)
 {
   int device_num = gh_scm2int(gh_car(lst));

Modified: trunk/src/input/button_factory.hxx
===================================================================
--- trunk/src/input/button_factory.hxx  2004-01-10 15:10:45 UTC (rev 328)
+++ trunk/src/input/button_factory.hxx  2004-01-10 15:48:59 UTC (rev 329)
@@ -34,6 +34,7 @@
 private:
   static InputButton* create_joystick_button(SCM lst);
   static InputButton* create_keyboard_button(SCM lst);
+  static InputButton* create_axis_button(SCM lst);
 
   ButtonFactory (const ButtonFactory&);
   ButtonFactory& operator= (const ButtonFactory&);

Modified: trunk/src/input/input_manager.cxx
===================================================================
--- trunk/src/input/input_manager.cxx   2004-01-10 15:10:45 UTC (rev 328)
+++ trunk/src/input/input_manager.cxx   2004-01-10 15:48:59 UTC (rev 329)
@@ -17,6 +17,7 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include <iostream>
 #include <assert.h>
 #include <stdexcept>
 #include <sstream>
@@ -41,6 +42,7 @@
 void
 InputManager::init(const std::string& filename)
 {
+  std::cout << "InputManager::init(" << filename << ")" << std::endl;
   SCM port = scm_open_file(gh_str02scm(filename.c_str()),
                            gh_str02scm("r"));
   SCM lst  = scm_read(port);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]