Skip to content

Commit 28bb26c

Browse files
author
bob
committed
cosmetic pygame log spam removed
1 parent 5933feb commit 28bb26c

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

pythonforandroid/recipes/pygame/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def prebuild_armeabi(self):
3434
join(self.get_build_dir('armeabi'), 'Setup'))
3535
self.apply_patch(join('patches', 'fix-surface-access.patch'))
3636
self.apply_patch(join('patches', 'fix-array-surface.patch'))
37+
self.apply_patch(join('patches', 'fix-sdl-spam-log.patch'))
3738
shprint(sh.touch, join(self.get_build_container_dir('armeabi'), '.patched'))
3839

3940
def build_armeabi(self):
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
--- pygame-1.9.1release/src/joystick.c.orig
2+
+++ pygame-1.9.1release/src/joystick.c
3+
@@ -201,7 +201,7 @@ joy_get_axis (PyObject* self, PyObject* args)
4+
}
5+
6+
value = SDL_JoystickGetAxis (joy, axis);
7+
- printf("SDL_JoystickGetAxis value:%d:\n", value);
8+
+/* printf("SDL_JoystickGetAxis value:%d:\n", value); */
9+
10+
11+
return PyFloat_FromDouble (value / 32768.0);
12+
@@ -241,7 +241,7 @@ joy_get_button (PyObject* self, PyObject* args)
13+
}
14+
15+
value = SDL_JoystickGetButton (joy, _index);
16+
- printf("SDL_JoystickGetButton value:%d:\n", value);
17+
+/* printf("SDL_JoystickGetButton value:%d:\n", value); */
18+
19+
return PyInt_FromLong (value);
20+
}
21+
@@ -277,7 +277,7 @@ joy_get_ball (PyObject* self, PyObject* args)
22+
return RAISE (PyExc_SDLError, "Joystick not initialized");
23+
}
24+
value = SDL_JoystickNumBalls (joy);
25+
- printf("SDL_JoystickNumBalls value:%d:\n", value);
26+
+/* printf("SDL_JoystickNumBalls value:%d:\n", value); */
27+
28+
if (_index < 0 || _index >= value) {
29+
return RAISE (PyExc_SDLError, "Invalid joystick trackball");
30+
@@ -300,7 +300,7 @@ joy_get_numhats (PyObject* self)
31+
}
32+
33+
value = SDL_JoystickNumHats (joy);
34+
- printf("SDL_JoystickNumHats value:%d:\n", value);
35+
+/* printf("SDL_JoystickNumHats value:%d:\n", value); */
36+
37+
return PyInt_FromLong (value);
38+
}
39+
@@ -327,7 +327,7 @@ joy_get_hat (PyObject* self, PyObject* args)
40+
41+
px = py = 0;
42+
value = SDL_JoystickGetHat (joy, _index);
43+
- printf("SDL_JoystickGetHat value:%d:\n", value);
44+
+/* printf("SDL_JoystickGetHat value:%d:\n", value); */
45+
46+
if (value & SDL_HAT_UP) {
47+
py = 1;

0 commit comments

Comments
 (0)