[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Feuerkraft-CVS] rev 324 - in trunk/src: . input
From: |
Ingo Ruhnke |
Subject: |
[Feuerkraft-CVS] rev 324 - in trunk/src: . input |
Date: |
Thu, 11 Dec 2003 12:43:15 +0100 |
Author: grumbel
Date: 2003-12-11 12:43:15 +0100 (Thu, 11 Dec 2003)
New Revision: 324
Added:
trunk/src/controller_def.cxx
trunk/src/controller_def.hxx
Removed:
trunk/src/input/controller_def.cxx
trunk/src/input/controller_def.hxx
Modified:
trunk/src/Makefile.am
trunk/src/input/Makefile.am
trunk/src/input/controller.hxx
trunk/src/input/input_manager.cxx
trunk/src/input/input_manager_custom.cxx
Log:
- made the lib a bit more generic
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am 2003-12-11 02:00:33 UTC (rev 323)
+++ trunk/src/Makefile.am 2003-12-11 11:43:15 UTC (rev 324)
@@ -30,6 +30,8 @@
command_line_arguments.cxx \
color.hxx \
color.cxx \
+controller_def.cxx \
+controller_def.hxx \
communication_dialog.hxx \
communication_dialog.cxx \
collision_manager.hxx \
Copied: trunk/src/controller_def.cxx (from rev 321,
trunk/src/input/controller_def.cxx)
Copied: trunk/src/controller_def.hxx (from rev 321,
trunk/src/input/controller_def.hxx)
Modified: trunk/src/input/Makefile.am
===================================================================
--- trunk/src/input/Makefile.am 2003-12-11 02:00:33 UTC (rev 323)
+++ trunk/src/input/Makefile.am 2003-12-11 11:43:15 UTC (rev 324)
@@ -1,5 +1,11 @@
noinst_LIBRARIES = libfeuerkraft_input.a
+libfeuerkraft_input_a_LIBDADD = \
+ @WINDSTILLE_LIBS@
+
+libfeuerkraft_input_a_CPPFLAGS = \
+ @WINDSTILLE_CFLAGS@
+
libfeuerkraft_input_a_SOURCES = \
controller.hxx \
controller.cxx \
@@ -25,8 +31,6 @@
axis_factory.hxx \
axis_factory.cxx \
input_recorder.hxx \
- input_recorder.cxx \
- controller_def.cxx \
- controller_def.hxx
+ input_recorder.cxx
# EOF #
Modified: trunk/src/input/controller.hxx
===================================================================
--- trunk/src/input/controller.hxx 2003-12-11 02:00:33 UTC (rev 323)
+++ trunk/src/input/controller.hxx 2003-12-11 11:43:15 UTC (rev 324)
@@ -21,7 +21,7 @@
#define HEADER_CONTROLLER_HXX
#include <vector>
-#include "controller_def.hxx"
+#include "../controller_def.hxx"
#include "input_event.hxx"
/** The Controller class presents the current state of the controller
Deleted: trunk/src/input/controller_def.cxx
===================================================================
--- trunk/src/input/controller_def.cxx 2003-12-11 02:00:33 UTC (rev 323)
+++ trunk/src/input/controller_def.cxx 2003-12-11 11:43:15 UTC (rev 324)
@@ -1,96 +0,0 @@
-// $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 "controller_def.hxx"
-
-int
-ControllerDef::get_button_count()
-{
- return 4;
-}
-
-int
-ControllerDef::get_axis_count()
-{
- return 3;
-}
-
-std::string
-ControllerDef::button_id2name(int id)
-{
- switch (id)
- {
- case PRIMARY_FIRE_BUTTON:
- return "primary-button";
- case SECONDARY_FIRE_BUTTON:
- return "secondary-button";
- case USE_BUTTON:
- return "use-button";
- case MENU_BUTTON:
- return "menu-button";
- default:
- return "unknown";
- }
-}
-
-int
-ControllerDef::button_name2id(const std::string& name)
-{
- if (name == "primary-button")
- return PRIMARY_FIRE_BUTTON;
- else if (name == "secondary-button")
- return SECONDARY_FIRE_BUTTON;
- else if (name == "use-button")
- return USE_BUTTON;
- else if (name == "menu-button")
- return MENU_BUTTON;
- else
- return -1;
-}
-
-std::string
-ControllerDef::axis_id2name(int id)
-{
- switch (id)
- {
- case ORIENTATION_AXIS:
- return "orientation-axis";
- case ACCELERATE_AXIS:
- return "accelerate-axis";
- case STRAFE_AXIS:
- return "strafe-axis";
- default:
- return "unknown";
- }
-}
-
-int
-ControllerDef::axis_name2id(const std::string& name)
-{
- if (name == "orientation-axis")
- return ORIENTATION_AXIS;
- else if (name == "accelerate-axis")
- return ACCELERATE_AXIS;
- else if (name == "strafe-axis")
- return STRAFE_AXIS;
- else
- return -1;
-}
-
-/* EOF */
Deleted: trunk/src/input/controller_def.hxx
===================================================================
--- trunk/src/input/controller_def.hxx 2003-12-11 02:00:33 UTC (rev 323)
+++ trunk/src/input/controller_def.hxx 2003-12-11 11:43:15 UTC (rev 324)
@@ -1,45 +0,0 @@
-// $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.
-
-#ifndef HEADER_CONTROLLER_DEF_HXX
-#define HEADER_CONTROLLER_DEF_HXX
-
-#include <string>
-
-enum AxisName { ORIENTATION_AXIS, ACCELERATE_AXIS, STRAFE_AXIS };
-enum ButtonName { PRIMARY_FIRE_BUTTON, SECONDARY_FIRE_BUTTON, USE_BUTTON,
MENU_BUTTON };
-
-/** */
-class ControllerDef
-{
-private:
-public:
- static int get_button_count();
- static int get_axis_count();
-
- static std::string button_id2name(int id);
- static int button_name2id(const std::string& name);
-
- static std::string axis_id2name(int id);
- static int axis_name2id(const std::string& name);
-};
-
-#endif
-
-/* EOF */
Modified: trunk/src/input/input_manager.cxx
===================================================================
--- trunk/src/input/input_manager.cxx 2003-12-11 02:00:33 UTC (rev 323)
+++ trunk/src/input/input_manager.cxx 2003-12-11 11:43:15 UTC (rev 324)
@@ -22,14 +22,12 @@
#include <stdexcept>
#include <sstream>
#include <ClanLib/Display/joystick.h>
-#include "../command_line_arguments.hxx"
#include "input_manager_custom.hxx"
#include "input_manager_player.hxx"
#include "input_manager_impl.hxx"
#include "input_recorder.hxx"
#include "input_manager.hxx"
-extern CommandLineArguments* args;
InputManagerImpl* InputManager::impl = 0;
InputRecorder* InputManager::recorder = 0;
@@ -44,8 +42,8 @@
{
if (!filename.empty())
{
- std::cout << "Reading: " << args->controller_file << std::endl;
- SCM port = scm_open_file(gh_str02scm(args->controller_file.c_str()),
+ std::cout << "InputManager: Reading: " << filename << std::endl;
+ SCM port = scm_open_file(gh_str02scm(filename.c_str()),
gh_str02scm("r"));
SCM lst = scm_read(port);
@@ -59,7 +57,7 @@
}
else
{
- std::cout << "Error: not a valid controller file: " <<
args->controller_file << std::endl;
+ std::cout << "Error: not a valid controller file: " << filename <<
std::endl;
}
scm_close_port(port);
}
Modified: trunk/src/input/input_manager_custom.cxx
===================================================================
--- trunk/src/input/input_manager_custom.cxx 2003-12-11 02:00:33 UTC (rev
323)
+++ trunk/src/input/input_manager_custom.cxx 2003-12-11 11:43:15 UTC (rev
324)
@@ -25,11 +25,11 @@
#include "../guile.hxx"
#include "../assert.hxx"
+#include "../controller_def.hxx"
#include "input_button_input_device.hxx"
#include "input_axis_input_device.hxx"
#include "button_factory.hxx"
#include "axis_factory.hxx"
-#include "controller_def.hxx"
#include "input_manager_custom.hxx"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Feuerkraft-CVS] rev 324 - in trunk/src: . input,
Ingo Ruhnke <=