feuerkraft-cvs
[Top][All Lists]
Advanced

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

[Feuerkraft-CVS] rev 313 - trunk/src/input


From: Ingo Ruhnke
Subject: [Feuerkraft-CVS] rev 313 - trunk/src/input
Date: Tue, 09 Dec 2003 01:01:15 +0100

Author: grumbel
Date: 2003-12-09 01:01:14 +0100 (Tue, 09 Dec 2003)
New Revision: 313

Added:
   trunk/src/input/input_manager_impl.cxx
Log:
- added a customizable input manager

Added: trunk/src/input/input_manager_impl.cxx
===================================================================
--- trunk/src/input/input_manager_impl.cxx      2003-12-09 00:00:42 UTC (rev 
312)
+++ trunk/src/input/input_manager_impl.cxx      2003-12-09 00:01:14 UTC (rev 
313)
@@ -0,0 +1,61 @@
+//  $Id$
+//
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+#include "input_manager_impl.hxx"
+
+InputEventLst
+InputManagerImpl::get_events()
+{
+  return events;
+}
+
+Controller
+InputManagerImpl::get_controller()
+{
+  controller.events = events;
+  return controller;
+}
+
+void
+InputManagerImpl::add_axis_event(AxisName name, float pos)
+{
+  InputEvent event;
+  event.type = AXIS_EVENT;
+  event.axis.name = name;
+  event.axis.pos  = pos;
+  events.push_back(event);
+}
+
+void
+InputManagerImpl::add_button_event(ButtonName name, bool down)
+{
+  InputEvent event;
+  event.type = BUTTON_EVENT;
+  event.button.name = name;
+  event.button.down = down;
+  events.push_back(event);
+}
+
+void
+InputManagerImpl::clear()
+{
+  events.clear();
+}
+
+/* EOF */





reply via email to

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