X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=freeglut-1.3%2Ffreeglut_joystick.c;h=a47d4910e4d40482a7f462e916ec03dd12a79b8b;hb=fd025d3915f90c5af286ade32f25a0922644b177;hp=8619b795ac94eb0bafb1ae0ed2f0084dc74d7e5d;hpb=c41ee8f7e365eabcc5391cb953c9c81af34c6bb6;p=freeglut diff --git a/freeglut-1.3/freeglut_joystick.c b/freeglut-1.3/freeglut_joystick.c index 8619b79..a47d491 100644 --- a/freeglut-1.3/freeglut_joystick.c +++ b/freeglut-1.3/freeglut_joystick.c @@ -6,10 +6,6 @@ * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. * Written by Steve Baker, * - * 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. * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation @@ -44,7 +40,7 @@ #define G_LOG_DOMAIN "freeglut-joystick" #include "../include/GL/freeglut.h" -#include "../include/GL/freeglut_internal.h" +#include "freeglut_internal.h" /* * PWO: I don't like it at all. It's a mess. Could it be cleared? @@ -412,12 +408,12 @@ static void fghJoystickOpen( SFG_Joystick* joy ) return; # ifdef __FreeBSD__ - fghJoystickRawRead( buttons, axes ); + fghJoystickRawRead(joy, buttons, axes ); joy->error = axes[ 0 ] < -1000000000.0f; if( joy->error ) return ; - sprintf( joyfname, "%s/.joy%drc", g_getenv( "HOME" ), id ); + sprintf( joyfname, "%s/.joy%drc", g_getenv( "HOME" ), joy->id ); joyfile = fopen( joyfname, "r" ); joy->error = (joyfile == NULL); @@ -438,8 +434,8 @@ static void fghJoystickOpen( SFG_Joystick* joy ) for( i=0 ; i<_JS_MAX_AXES ; i++ ) { - dead_band[ i ] = 0.0f; - saturate [ i ] = 1.0f; + joy->dead_band[ i ] = 0.0f; + joy->saturate [ i ] = 1.0f; } # else @@ -466,7 +462,7 @@ static void fghJoystickOpen( SFG_Joystick* joy ) do { - fghJoystickRawRead( joy, NULL, joy->center ) + fghJoystickRawRead( joy, NULL, joy->center ); counter++; } while( !joy->error && counter < 100 && joy->center[ 0 ] == 512.0f && joy->center[ 1 ] == 512.0f ); @@ -544,6 +540,7 @@ void fgJoystickClose( void ) #endif free ( fgJoystick ) ; + fgJoystick = NULL ; /* show joystick has been deinitialized */ } /*