diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/AndroidManifest.xml.template | 2 | ||||
-rw-r--r-- | platform/windows/joystick.h | 3 | ||||
-rw-r--r-- | platform/x11/joystick_linux.cpp | 13 | ||||
-rw-r--r-- | platform/x11/joystick_linux.h | 1 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 18 |
5 files changed, 31 insertions, 6 deletions
diff --git a/platform/android/AndroidManifest.xml.template b/platform/android/AndroidManifest.xml.template index c95c86c060..02645aff7f 100644 --- a/platform/android/AndroidManifest.xml.template +++ b/platform/android/AndroidManifest.xml.template @@ -3,7 +3,7 @@ package="com.godot.game" android:versionCode="1" android:versionName="1.0" - android:installLocation="preferExternal" + android:installLocation="auto" > <supports-screens android:smallScreens="true" android:normalScreens="true" diff --git a/platform/windows/joystick.h b/platform/windows/joystick.h index ad62059a73..332e86fbb8 100644 --- a/platform/windows/joystick.h +++ b/platform/windows/joystick.h @@ -44,6 +44,9 @@ if(x != NULL) \ } #endif +#ifndef XUSER_MAX_COUNT +#define XUSER_MAX_COUNT 4 +#endif class joystick_windows { diff --git a/platform/x11/joystick_linux.cpp b/platform/x11/joystick_linux.cpp index 050fdac2b8..6eb3671bc0 100644 --- a/platform/x11/joystick_linux.cpp +++ b/platform/x11/joystick_linux.cpp @@ -52,8 +52,13 @@ joystick_linux::Joystick::Joystick() { void joystick_linux::Joystick::reset() { dpad = 0; fd = -1; + + InputDefault::JoyAxis jx; + jx.min = -1; + jx.value = 0.0f; for (int i=0; i < MAX_ABS; i++) { abs_map[i] = -1; + curr_axis[i] = jx; } } @@ -390,7 +395,7 @@ uint32_t joystick_linux::process_joysticks(uint32_t p_event_id) { default: if (joy->abs_map[ev.code] != -1) { InputDefault::JoyAxis value = axis_correct(libevdev_get_abs_info(dev, ev.code), ev.value); - p_event_id = input->joy_axis(p_event_id, i, joy->abs_map[ev.code], value); + joy->curr_axis[joy->abs_map[ev.code]] = value; } break; } @@ -398,6 +403,12 @@ uint32_t joystick_linux::process_joysticks(uint32_t p_event_id) { } rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev); } + for (int j = 0; j < MAX_ABS; j++) { + int index = joy->abs_map[j]; + if (index != -1) { + p_event_id = input->joy_axis(p_event_id, i, index, joy->curr_axis[index]); + } + } } joy_mutex->unlock(); return p_event_id; diff --git a/platform/x11/joystick_linux.h b/platform/x11/joystick_linux.h index 9d22a6c754..ee9bd0352a 100644 --- a/platform/x11/joystick_linux.h +++ b/platform/x11/joystick_linux.h @@ -54,6 +54,7 @@ private: }; struct Joystick { + InputDefault::JoyAxis curr_axis[MAX_ABS]; int key_map[MAX_KEY - BT_MISC]; int abs_map[MAX_ABS]; int dpad; diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 0887fd9df2..437e41eead 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -447,6 +447,9 @@ void OS_X11::finalize() { // memdelete(debugger_connection_console); //} +#ifdef JOYDEV_ENABLED + memdelete(joystick); +#endif memdelete(input); memdelete(sample_manager); @@ -463,9 +466,6 @@ void OS_X11::finalize() { physics_2d_server->finish(); memdelete(physics_2d_server); -#ifdef JOYDEV_ENABLED - memdelete(joystick); -#endif XUnmapWindow( x11_display, x11_window ); XDestroyWindow( x11_display, x11_window ); @@ -619,6 +619,7 @@ void OS_X11::set_wm_fullscreen(bool p_enabled) { xev.xclient.data.l[2] = 0; XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); + } int OS_X11::get_screen_count() const { @@ -887,7 +888,16 @@ void OS_X11::set_window_maximized(bool p_enabled) { XGetWindowAttributes(x11_display,DefaultRootWindow(x11_display),&xwa); current_videomode.width = xwa.width; current_videomode.height = xwa.height; -*/ +//*/ + +// current_videomode.width = wm_max_horz; +// current_videomode.height = wm_max_vert; + + //Size2 ss = get_screen_size(get_current_screen()); + //current_videomode.width=ss.width; + //current_videomode.height=ss.height; + + maximized = p_enabled; } |