summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-09-18 21:32:50 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-09-18 21:32:50 +0000
commit957cee04cbbb829c0d476b1dfb2a19ee74856c5f (patch)
tree94f7df3abce531cf0df6a099f400da4bc650cb2f
parent89dbeaaee05a6ce7adc353f5676df211c1ed83fb (diff)
downloadmana-957cee04cbbb829c0d476b1dfb2a19ee74856c5f.tar.gz
mana-957cee04cbbb829c0d476b1dfb2a19ee74856c5f.tar.bz2
mana-957cee04cbbb829c0d476b1dfb2a19ee74856c5f.tar.xz
mana-957cee04cbbb829c0d476b1dfb2a19ee74856c5f.zip
Increased joypad tolerance which is safer and simplifyed joypad state reset code.
-rw-r--r--ChangeLog2
-rw-r--r--src/game.cpp12
-rw-r--r--src/main.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 3c735ab6..a7780b65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@
* src/game.cpp, src/gui/gui.cpp, src/gui/updatewindow.cpp, src/main.cpp,
src&resources/mapreader.cpp: Applyed biggeruniverse's patch to fix memory
leaks.
+ * src/game.cpp, src/main.cpp: Increased joypad tolerance which is safer
+ and simplifyed joypad state reset code.
2005-09-18 Duane Bailey <nayryeliab@gmail.com>
diff --git a/src/game.cpp b/src/game.cpp
index 95c502c3..7e283bd0 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -429,18 +429,16 @@ void do_input()
Uint8* keys;
keys = SDL_GetKeyState(NULL);
- // Get the state of the joypad buttons
- // TODO: Only 6- buttons joypads are allowed
+ // TODO: Only <= 6 buttons joypads are allowed
bool joy[10];
- for (int i=0; i<10; i++)
- {
- joy[i] = false;
- }
+ memset(joy, 0, 10 * sizeof(bool));
+
+ // Get the state of the joypad axis/buttons
if (joypad != NULL)
{
// TODO: one different value of tolerance is needed for each direction
// This probably means the need for a tuning utility/window
- int tolerance = (int)config.getValue("joytolerance", 10);
+ int tolerance = (int)config.getValue("joytolerance", 100);
SDL_JoystickUpdate();
if (SDL_JoystickGetAxis(joypad, 0) > tolerance)
{
diff --git a/src/main.cpp b/src/main.cpp
index 0f94db54..ad60bbaf 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -192,7 +192,7 @@ void init_engine()
config.setValue("updatehost", "http://themanaworld.org/files");
config.setValue("customcursor", 1);
config.setValue("homeDir", homeDir);
- config.setValue("joytolerance", 10);
+ config.setValue("joytolerance", 100);
// Checking if the configuration file exists... otherwise creates it with
// default options !