diff options
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/android/detect.py | 2 | ||||
| -rw-r--r-- | platform/android/java_glue.cpp | 2 | ||||
| -rw-r--r-- | platform/android/os_android.cpp | 16 | ||||
| -rw-r--r-- | platform/iphone/detect.py | 31 | ||||
| -rw-r--r-- | platform/osx/os_osx.mm | 2 | ||||
| -rw-r--r-- | platform/x11/os_x11.cpp | 9 |
6 files changed, 30 insertions, 32 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py index 8d2ed59f17..ce44ffbf74 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -232,7 +232,7 @@ def configure(env): elif (env["target"] == "debug"): env.Append(LINKFLAGS=['-O0']) env.Append(CPPFLAGS=['-O0', '-D_DEBUG', '-UNDEBUG', '-DDEBUG_ENABLED', - '-DDEBUG_MEMORY_ALLOC', '-g', '-fno-limit-debug-info']) + '-DDEBUG_MEMORY_ENABLED', '-g', '-fno-limit-debug-info']) env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL', '-DMPC_FIXED_POINT']) diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 37f53a2478..d4bd443689 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -1367,7 +1367,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joybutton(JNIEnv *env jevent.device = p_device; jevent.type = OS_Android::JOY_EVENT_BUTTON; jevent.index = p_button; - jevent->is_pressed() = p_pressed; + jevent.pressed = p_pressed; input_mutex->lock(); joy_events.push_back(jevent); diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 6e8b46e252..9010b9e7da 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -344,7 +344,7 @@ void OS_Android::process_joy_event(OS_Android::JoypadEvent p_event) { switch (p_event.type) { case JOY_EVENT_BUTTON: - input->joy_button(p_event.device, p_event.index, p_event->is_pressed()); + input->joy_button(p_event.device, p_event.index, p_event.pressed); break; case JOY_EVENT_AXIS: InputDefault::JoyAxis value; @@ -406,7 +406,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> //send mouse Ref<InputEventMouseButton> ev; ev.instance(); - ev.type = Ref<InputEvent>::MOUSE_BUTTON; + // ev.type = Ref<InputEvent>::MOUSE_BUTTON; ev->set_button_index(BUTTON_LEFT); ev->set_button_mask(BUTTON_MASK_LEFT); ev->set_pressed(true); @@ -424,7 +424,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ev.instance(); ev->set_index(touch[i].id); ev->set_pressed(true); - ev->set_position(touch[i].pos.x); + ev->set_position(touch[i].pos); input->parse_input_event(ev); } @@ -436,8 +436,8 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> Ref<InputEventMouseMotion> ev; ev.instance(); ev->set_button_mask(BUTTON_MASK_LEFT); - ev->set_position(p_points[0].pos.x); - input->set_mouse_position(Point2(ev.mouse_motion.x, ev.mouse_motion.y)); + ev->set_position(p_points[0].pos); + input->set_mouse_position(Point2(ev->get_position().x, ev->get_position().y)); ev->set_speed(input->get_last_mouse_speed()); ev->set_relative(p_points[0].pos - last_mouse); last_mouse = p_points[0].pos; @@ -465,7 +465,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> Ref<InputEventScreenDrag> ev; ev.instance(); ev->set_index(touch[i].id); - ev->set_position(p_points[idx].pos.x); + ev->set_position(p_points[idx].pos); ev->set_relative(p_points[idx].pos - touch[i].pos); input->parse_input_event(ev); touch[i].pos = p_points[idx].pos; @@ -481,8 +481,8 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ev->set_button_index(BUTTON_LEFT); ev->set_button_mask(BUTTON_MASK_LEFT); ev->set_pressed(false); - ev->set_position(touch[0].pos.x); - ev->set_global_position(touch[0].pos.x); + ev->set_position(touch[0].pos); + ev->set_global_position(touch[0].pos); input->set_mouse_position(Point2(touch[0].pos.x, touch[0].pos.y)); input->parse_input_event(ev); diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 2dcd6dd7e5..c20d8e90f4 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -58,15 +58,15 @@ def configure(env): if (env["ios_sim"] == "yes" or env["arch"] == "x86"): # i386, simulator env["arch"] = "x86" env["bits"] = "32" - env.Append(CCFLAGS=string.split('-arch i386 -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -fasm-blocks -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -isysroot $IPHONESDK -mios-simulator-version-min=4.3 -DCUSTOM_MATRIX_TRANSFORM_H=\\\"build/iphone/matrix4_iphone.h\\\" -DCUSTOM_VECTOR3_TRANSFORM_H=\\\"build/iphone/vector3_iphone.h\\\"')) + env.Append(CCFLAGS=string.split('-arch i386 -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -fblocks -fasm-blocks -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -isysroot $IPHONESDK -mios-simulator-version-min=4.3 -DCUSTOM_MATRIX_TRANSFORM_H=\\\"build/iphone/matrix4_iphone.h\\\" -DCUSTOM_VECTOR3_TRANSFORM_H=\\\"build/iphone/vector3_iphone.h\\\"')) elif (env["arch"] == "arm" or env["arch"] == "arm32" or env["arch"] == "armv7" or env["bits"] == "32"): # arm env["arch"] = "arm" env["bits"] = "32" - env.Append(CCFLAGS=string.split('-fno-objc-arc -arch armv7 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -isysroot $IPHONESDK -fvisibility=hidden -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=9.0 -MMD -MT dependencies -isysroot $IPHONESDK')) + env.Append(CCFLAGS=string.split('-fno-objc-arc -arch armv7 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -isysroot $IPHONESDK -fvisibility=hidden -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=9.0 -MMD -MT dependencies')) else: # armv64 env["arch"] = "arm64" env["bits"] = "64" - env.Append(CCFLAGS=string.split('-fno-objc-arc -arch arm64 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fvisibility=hidden -MMD -MT dependencies -miphoneos-version-min=9.0 -isysroot $IPHONESDK')) + env.Append(CCFLAGS=string.split('-fno-objc-arc -arch arm64 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -miphoneos-version-min=9.0 -isysroot $IPHONESDK')) env.Append(CPPFLAGS=['-DNEED_LONG_INT']) env.Append(CPPFLAGS=['-DLIBYUV_DISABLE_NEON']) @@ -91,6 +91,7 @@ def configure(env): '-framework', 'OpenGLES', '-framework', 'QuartzCore', '-framework', 'SystemConfiguration', + '-framework', 'GameController', '-F$IPHONESDK', ]) elif (env["arch"] == "arm64"): @@ -111,6 +112,7 @@ def configure(env): '-framework', 'AVFoundation', '-framework', 'CoreMedia', '-framework', 'CoreMotion', + '-framework', 'GameController', ]) else: env.Append(LINKFLAGS=['-arch', 'armv7', '-Wl,-dead_strip', '-miphoneos-version-min=9.0', @@ -129,10 +131,11 @@ def configure(env): '-framework', 'AVFoundation', '-framework', 'CoreMedia', '-framework', 'CoreMotion', + '-framework', 'GameController', ]) if env['game_center'] == 'yes': - env.Append(CPPFLAGS=['-fblocks', '-DGAME_CENTER_ENABLED']) + env.Append(CPPFLAGS=['-DGAME_CENTER_ENABLED']) env.Append(LINKFLAGS=['-framework', 'GameKit']) if env['store_kit'] == 'yes': @@ -144,26 +147,20 @@ def configure(env): env.Append(CPPPATH=['$IPHONESDK/usr/include', '$IPHONESDK/System/Library/Frameworks/OpenGLES.framework/Headers', '$IPHONESDK/System/Library/Frameworks/AudioUnit.framework/Headers']) - if (env["target"] == "release"): + if (env["target"].startswith("release")): - env.Append(CCFLAGS=['-O3', '-DNS_BLOCK_ASSERTIONS=1', '-gdwarf-2']) # removed -ffast-math - env.Append(LINKFLAGS=['-O3']) + env.Append(CPPFLAGS=['-DNDEBUG', '-DNS_BLOCK_ASSERTIONS=1']) + env.Append(CPPFLAGS=['-O2', '-flto', '-ftree-vectorize', '-fomit-frame-pointer', '-ffast-math', '-funsafe-math-optimizations']) + env.Append(LINKFLAGS=['-O2', '-flto']) - elif env["target"] == "release_debug": - env.Append(CCFLAGS=['-Os', '-DNS_BLOCK_ASSERTIONS=1', '-DDEBUG_ENABLED']) - env.Append(LINKFLAGS=['-Os']) - env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ENABLED']) + if env["target"] == "release_debug": + env.Append(CPPFLAGS=['-DDEBUG_ENABLED']) elif (env["target"] == "debug"): - env.Append(CCFLAGS=['-D_DEBUG', '-DDEBUG=1', '-gdwarf-2', '-O0', '-DDEBUG_ENABLED']) + env.Append(CPPFLAGS=['-D_DEBUG', '-DDEBUG=1', '-gdwarf-2', '-O0', '-DDEBUG_ENABLED']) env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ENABLED']) - elif (env["target"] == "profile"): - - env.Append(CCFLAGS=['-g', '-pg', '-Os']) - env.Append(LINKFLAGS=['-pg']) - if (env["ios_sim"] == "yes"): # TODO: Check if needed? env['ENV']['MACOSX_DEPLOYMENT_TARGET'] = '10.6' env['ENV']['CODESIGN_ALLOCATE'] = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate' diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index cb37f18090..54b1802250 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -365,7 +365,7 @@ static int button_mask = 0; - (void)rightMouseUp:(NSEvent *)event { - button_mask |= BUTTON_MASK_RIGHT; + button_mask &= ~BUTTON_MASK_RIGHT; Ref<InputEventMouseButton> mb; mb.instance(); diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 8ac37c965b..2eebc96d2c 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -34,6 +34,7 @@ #include "print_string.h" #include "servers/physics/physics_server_sw.h" #include "servers/visual/visual_server_raster.h" +#include "servers/visual/visual_server_wrap_mt.h" #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -206,12 +207,12 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au #endif visual_server = memnew(VisualServerRaster); -#if 0 - if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) { - visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); + if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { + + visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD)); } -#endif + // borderless fullscreen window mode if (current_videomode.fullscreen) { // needed for lxde/openbox, possibly others |