summaryrefslogtreecommitdiffstats
path: root/devel/clanlib-devel/files/patch-ac
blob: f07d4965963009add6017e9b17041b39d6297d6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
--- Sources/Core/Input/X11/joystick_linux.cpp.orig	Wed May 10 15:54:52 2000
+++ Sources/Core/Input/X11/joystick_linux.cpp	Wed May 10 15:56:52 2000
@@ -24,33 +24,33 @@
 #include <API/Core/Input/inputbutton.h>
 #include <Core/Input/X11/joystick_linux.h>
 
-#include "joystick_linux.h"
+/*#include "joystick_linux.h"*/
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+#if 1
 
 CL_LinuxJoystick::CL_LinuxJoystick()
 {
-	fd = -1;
+/*	fd = -1;
 	num_buttons = 0;
 	num_axes = 0;
 	axes = NULL;
-	buttons = NULL;
+	buttons = NULL;*/
 }
 
 CL_LinuxJoystick::~CL_LinuxJoystick()
 {
-	if (fd != -1)
+/*	if (fd != -1)
 	{
 		close(fd);
 	}
 	
 	delete[] axes;
-	delete[] buttons;
+	delete[] buttons;*/
 }
 
 bool CL_LinuxJoystick::init(int number)
 {
-	cl_assert(fd == -1); // do not call init twice!
+/*	cl_assert(fd == -1); // do not call init twice!
 
 	char devname[10];
 	sprintf( devname, "/dev/js%d", number );
@@ -58,20 +58,20 @@
 	if (fd == -1) return false; // no joystick available
 
 	ioctl( fd, JSIOCGBUTTONS, &num_buttons );
-	ioctl( fd, JSIOCGAXES, &num_axes );
+	ioctl( fd, JSIOCGAXES, &num_axes );*/
 /*
 	cout << "Number of axes:     " << num_axes << endl;
 	cout << "Number of buttons:  " << num_buttons << endl;
 */
-	axes = new CL_LinuxJoystick_Axis[num_axes];
-	buttons = new CL_LinuxJoystick_Button[num_buttons];
+/*	axes = new CL_LinuxJoystick_Axis[num_axes];
+	buttons = new CL_LinuxJoystick_Button[num_buttons];*/
 
 	return true;
 }
 
 void CL_LinuxJoystick::keep_alive()
 {	
-	cl_assert(fd != -1); // init _MUST_ be called before update!
+/*	cl_assert(fd != -1); // init _MUST_ be called before update!
 	
 	while (read( fd, &jev, sizeof(js_event) ) != -1)
 	{
@@ -85,23 +85,23 @@
 			buttons[jev.number].set_value(jev.value);
 			break;
 		}
-	}
+	}*/
 }
 
 CL_InputAxis *CL_LinuxJoystick::get_axis(int num)
 {
-	cl_assert(num >= 0); // disallow negative values
+/*	cl_assert(num >= 0); // disallow negative values
 
 	if (num >= num_axes) return NULL;
-	return &axes[num];
+	return &axes[num];*/
 }
 
 CL_InputButton *CL_LinuxJoystick::get_button(int num)
 {
-	cl_assert(num >= 0); // disallow negative values
+/*	cl_assert(num >= 0); // disallow negative values
 
 	if (num >= num_buttons) return NULL;
-	return &buttons[num];
+	return &buttons[num];*/
 }
 
 #endif
OpenPOWER on IntegriCloud