diff options
Diffstat (limited to 'platform')
48 files changed, 127 insertions, 204 deletions
diff --git a/platform/android/build.gradle.template b/platform/android/build.gradle.template index 24aab8e01f..ec5bbb6630 100644 --- a/platform/android/build.gradle.template +++ b/platform/android/build.gradle.template @@ -12,6 +12,7 @@ apply plugin: 'com.android.application' allprojects { repositories { + jcenter() mavenCentral() $$GRADLE_REPOSITORY_URLS$$ } diff --git a/platform/android/detect.py b/platform/android/detect.py index d1b33fe649..0e78a4618d 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -168,9 +168,7 @@ def configure(env): env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include"]) env.Append(CPPFLAGS=string.split( - '-Wno-invalid-command-line-argument -Wno-unused-command-line-argument')) - env.Append(CPPFLAGS=string.split( - '-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing -Wa,--noexecstack')) + '-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing')) env.Append(CPPFLAGS=string.split('-DANDROID -DNO_STATVFS -DGLES2_ENABLED')) env['neon_enabled'] = False diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index eeb8c886ca..2342829965 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -2725,7 +2725,7 @@ class EditorExportAndroid : public EditorExportPlatform { Vector<String> string_table; - String version_name = p_preset->get("version/name"); + String package_name = p_preset->get("package/name"); //printf("stirng block len: %i\n",string_block_len); //printf("stirng count: %i\n",string_count); @@ -2742,7 +2742,7 @@ class EditorExportAndroid : public EditorExportPlatform { if (str == "godot-project-name") { //project name - str = get_project_name(version_name); + str = get_project_name(package_name); } else { @@ -2751,7 +2751,7 @@ class EditorExportAndroid : public EditorExportPlatform { if (GlobalConfig::get_singleton()->has(prop)) { str = GlobalConfig::get_singleton()->get(prop); } else { - str = get_project_name(version_name); + str = get_project_name(package_name); } } } diff --git a/platform/android/java/src/com/android/vending/licensing/Obfuscator.java b/platform/android/java/src/com/android/vending/licensing/Obfuscator.java index b5d510d72d..88891728e6 100644 --- a/platform/android/java/src/com/android/vending/licensing/Obfuscator.java +++ b/platform/android/java/src/com/android/vending/licensing/Obfuscator.java @@ -20,7 +20,7 @@ package com.google.android.vending.licensing; * Interface used as part of a {@link Policy} to allow application authors to obfuscate * licensing data that will be stored into a SharedPreferences file. * <p> - * Any transformation scheme must be reversable. Implementing classes may optionally implement an + * Any transformation scheme must be reversible. Implementing classes may optionally implement an * integrity check to further prevent modification to preference data. Implementing classes * should use device-specific information as a key in the obfuscation algorithm to prevent * obfuscated preferences from being shared among devices. diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index f970cf1140..0cec0c5773 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -340,7 +340,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC r = is.read(len); if (r<4) { - Log.d("GODOT", "**ERROR** Wrong cmdline param lenght.\n"); + Log.d("GODOT", "**ERROR** Wrong cmdline param length.\n"); return new String[0]; } int strlen=((int)(len[3]&0xFF)<<24) | ((int)(len[2]&0xFF)<<16) | ((int)(len[1]&0xFF)<<8) | ((int)(len[0]&0xFF)); diff --git a/platform/android/java/src/org/godotengine/godot/GodotIO.java b/platform/android/java/src/org/godotengine/godot/GodotIO.java index 33c1c03ace..d6ceef8768 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotIO.java +++ b/platform/android/java/src/org/godotengine/godot/GodotIO.java @@ -469,7 +469,7 @@ public class GodotIO { } ///////////////////////// - // MISCELANEOUS OS IO + // MISCELLANEOUS OS IO ///////////////////////// diff --git a/platform/android/java_class_wrapper.h b/platform/android/java_class_wrapper.h index dcc9973446..12ef92c45b 100644 --- a/platform/android/java_class_wrapper.h +++ b/platform/android/java_class_wrapper.h @@ -68,9 +68,9 @@ class JavaClass : public Reference { jmethodID method; }; - _FORCE_INLINE_ static void _convert_to_variant_type(int p_sig, Variant::Type &r_type, float &likelyhood) { + _FORCE_INLINE_ static void _convert_to_variant_type(int p_sig, Variant::Type &r_type, float &likelihood) { - likelyhood = 1.0; + likelihood = 1.0; r_type = Variant::NIL; switch (p_sig) { @@ -81,37 +81,37 @@ class JavaClass : public Reference { case ARG_TYPE_BYTE | ARG_NUMBER_CLASS_BIT: case ARG_TYPE_BYTE: r_type = Variant::INT; - likelyhood = 0.1; + likelihood = 0.1; break; case ARG_TYPE_CHAR | ARG_NUMBER_CLASS_BIT: case ARG_TYPE_CHAR: r_type = Variant::INT; - likelyhood = 0.2; + likelihood = 0.2; break; case ARG_TYPE_SHORT | ARG_NUMBER_CLASS_BIT: case ARG_TYPE_SHORT: r_type = Variant::INT; - likelyhood = 0.3; + likelihood = 0.3; break; case ARG_TYPE_INT | ARG_NUMBER_CLASS_BIT: case ARG_TYPE_INT: r_type = Variant::INT; - likelyhood = 1.0; + likelihood = 1.0; break; case ARG_TYPE_LONG | ARG_NUMBER_CLASS_BIT: case ARG_TYPE_LONG: r_type = Variant::INT; - likelyhood = 0.5; + likelihood = 0.5; break; case ARG_TYPE_FLOAT | ARG_NUMBER_CLASS_BIT: case ARG_TYPE_FLOAT: r_type = Variant::REAL; - likelyhood = 1.0; + likelihood = 1.0; break; case ARG_TYPE_DOUBLE | ARG_NUMBER_CLASS_BIT: case ARG_TYPE_DOUBLE: r_type = Variant::REAL; - likelyhood = 0.5; + likelihood = 0.5; break; case ARG_TYPE_STRING: r_type = Variant::STRING; break; case ARG_TYPE_CLASS: r_type = Variant::OBJECT; break; @@ -119,31 +119,31 @@ class JavaClass : public Reference { case ARG_ARRAY_BIT | ARG_TYPE_BOOLEAN: r_type = Variant::ARRAY; break; case ARG_ARRAY_BIT | ARG_TYPE_BYTE: r_type = Variant::POOL_BYTE_ARRAY; - likelyhood = 1.0; + likelihood = 1.0; break; case ARG_ARRAY_BIT | ARG_TYPE_CHAR: r_type = Variant::POOL_BYTE_ARRAY; - likelyhood = 0.5; + likelihood = 0.5; break; case ARG_ARRAY_BIT | ARG_TYPE_SHORT: r_type = Variant::POOL_INT_ARRAY; - likelyhood = 0.3; + likelihood = 0.3; break; case ARG_ARRAY_BIT | ARG_TYPE_INT: r_type = Variant::POOL_INT_ARRAY; - likelyhood = 1.0; + likelihood = 1.0; break; case ARG_ARRAY_BIT | ARG_TYPE_LONG: r_type = Variant::POOL_INT_ARRAY; - likelyhood = 0.5; + likelihood = 0.5; break; case ARG_ARRAY_BIT | ARG_TYPE_FLOAT: r_type = Variant::POOL_REAL_ARRAY; - likelyhood = 1.0; + likelihood = 1.0; break; case ARG_ARRAY_BIT | ARG_TYPE_DOUBLE: r_type = Variant::POOL_REAL_ARRAY; - likelyhood = 0.5; + likelihood = 0.5; break; case ARG_ARRAY_BIT | ARG_TYPE_STRING: r_type = Variant::POOL_STRING_ARRAY; break; case ARG_ARRAY_BIT | ARG_TYPE_CLASS: r_type = Variant::ARRAY; break; diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 7f5893dbdf..06ef581813 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -881,7 +881,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en __android_log_print(ANDROID_LOG_INFO, "godot", "*****SETUP OK"); - //video driver is determined here, because once initialized, it cant be changed + //video driver is determined here, because once initialized, it can't be changed String vd = GlobalConfig::get_singleton()->get("display/driver"); env->CallVoidMethod(_godot_instance, _on_video_init, (jboolean) true); diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 1484ccfb8c..77536448e4 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -129,7 +129,7 @@ void OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int RasterizerGLES3::make_current(); visual_server = memnew(VisualServerRaster); -/* if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { + /* if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { visual_server = memnew(VisualServerWrapMT(visual_server, false)); };*/ @@ -343,16 +343,16 @@ void OS_Android::process_joy_event(OS_Android::JoypadEvent p_event) { switch (p_event.type) { case JOY_EVENT_BUTTON: - last_id = input->joy_button(last_id, p_event.device, p_event.index, p_event.pressed); + input->joy_button(p_event.device, p_event.index, p_event.pressed); break; case JOY_EVENT_AXIS: InputDefault::JoyAxis value; value.min = -1; value.value = p_event.value; - last_id = input->joy_axis(last_id, p_event.device, p_event.index, value); + input->joy_axis(p_event.device, p_event.index, value); break; case JOY_EVENT_HAT: - last_id = input->joy_hat(last_id, p_event.device, p_event.hat); + input->joy_hat(p_event.device, p_event.hat); break; default: return; @@ -361,7 +361,6 @@ void OS_Android::process_joy_event(OS_Android::JoypadEvent p_event) { void OS_Android::process_event(InputEvent p_event) { - p_event.ID = last_id++; input->parse_input_event(p_event); } @@ -376,7 +375,6 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> //end all if exist InputEvent ev; ev.type = InputEvent::MOUSE_BUTTON; - ev.ID = last_id++; ev.mouse_button.button_index = BUTTON_LEFT; ev.mouse_button.button_mask = BUTTON_MASK_LEFT; ev.mouse_button.pressed = false; @@ -390,7 +388,6 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> InputEvent ev; ev.type = InputEvent::SCREEN_TOUCH; - ev.ID = last_id++; ev.screen_touch.index = touch[i].id; ev.screen_touch.pressed = false; ev.screen_touch.x = touch[i].pos.x; @@ -409,7 +406,6 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> //send mouse InputEvent ev; ev.type = InputEvent::MOUSE_BUTTON; - ev.ID = last_id++; ev.mouse_button.button_index = BUTTON_LEFT; ev.mouse_button.button_mask = BUTTON_MASK_LEFT; ev.mouse_button.pressed = true; @@ -417,7 +413,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ev.mouse_button.y = touch[0].pos.y; ev.mouse_button.global_x = touch[0].pos.x; ev.mouse_button.global_y = touch[0].pos.y; - input->set_mouse_pos(Point2(touch[0].pos.x,touch[0].pos.y)); + input->set_mouse_pos(Point2(touch[0].pos.x, touch[0].pos.y)); last_mouse = touch[0].pos; input->parse_input_event(ev); } @@ -427,7 +423,6 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> InputEvent ev; ev.type = InputEvent::SCREEN_TOUCH; - ev.ID = last_id++; ev.screen_touch.index = touch[i].id; ev.screen_touch.pressed = true; ev.screen_touch.x = touch[i].pos.x; @@ -442,7 +437,6 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> //send mouse, should look for point 0? InputEvent ev; ev.type = InputEvent::MOUSE_MOTION; - ev.ID = last_id++; ev.mouse_motion.button_mask = BUTTON_MASK_LEFT; ev.mouse_motion.x = p_points[0].pos.x; ev.mouse_motion.y = p_points[0].pos.y; @@ -475,7 +469,6 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> InputEvent ev; ev.type = InputEvent::SCREEN_DRAG; - ev.ID = last_id++; ev.screen_drag.index = touch[i].id; ev.screen_drag.x = p_points[idx].pos.x; ev.screen_drag.y = p_points[idx].pos.y; @@ -492,7 +485,6 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> //end all if exist InputEvent ev; ev.type = InputEvent::MOUSE_BUTTON; - ev.ID = last_id++; ev.mouse_button.button_index = BUTTON_LEFT; ev.mouse_button.button_mask = BUTTON_MASK_LEFT; ev.mouse_button.pressed = false; @@ -500,14 +492,13 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ev.mouse_button.y = touch[0].pos.y; ev.mouse_button.global_x = touch[0].pos.x; ev.mouse_button.global_y = touch[0].pos.y; - input->set_mouse_pos(Point2(touch[0].pos.x,touch[0].pos.y)); + input->set_mouse_pos(Point2(touch[0].pos.x, touch[0].pos.y)); input->parse_input_event(ev); for (int i = 0; i < touch.size(); i++) { InputEvent ev; ev.type = InputEvent::SCREEN_TOUCH; - ev.ID = last_id++; ev.screen_touch.index = touch[i].id; ev.screen_touch.pressed = false; ev.screen_touch.x = touch[i].pos.x; @@ -527,7 +518,6 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> InputEvent ev; ev.type = InputEvent::SCREEN_TOUCH; - ev.ID = last_id++; ev.screen_touch.index = tp.id; ev.screen_touch.pressed = true; ev.screen_touch.x = tp.pos.x; @@ -542,7 +532,6 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> InputEvent ev; ev.type = InputEvent::SCREEN_TOUCH; - ev.ID = last_id++; ev.screen_touch.index = touch[i].id; ev.screen_touch.pressed = false; ev.screen_touch.x = touch[i].pos.x; @@ -627,8 +616,8 @@ void OS_Android::reload_gfx() { if (gfx_init_func) gfx_init_func(gfx_init_ud, use_gl2); -// if (rasterizer) -// rasterizer->reload_vram(); + //if (rasterizer) + // rasterizer->reload_vram(); } Error OS_Android::shell_open(String p_uri) { @@ -746,9 +735,9 @@ void OS_Android::native_video_stop() { void OS_Android::set_context_is_16_bits(bool p_is_16) { -// use_16bits_fbo = p_is_16; -// if (rasterizer) -// rasterizer->set_force_16_bits_fbo(p_is_16); + //use_16bits_fbo = p_is_16; + //if (rasterizer) + // rasterizer->set_force_16_bits_fbo(p_is_16); } void OS_Android::joy_connection_changed(int p_device, bool p_connected, String p_name) { @@ -774,9 +763,8 @@ OS_Android::OS_Android(GFXInitFunc p_gfx_init_func, void *p_gfx_init_ud, OpenURI gfx_init_func = p_gfx_init_func; gfx_init_ud = p_gfx_init_ud; main_loop = NULL; - last_id = 1; gl_extensions = NULL; -// rasterizer = NULL; + //rasterizer = NULL; use_gl2 = false; open_uri_func = p_open_uri_func; diff --git a/platform/android/os_android.h b/platform/android/os_android.h index ad438d8626..28abbf934d 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -94,7 +94,6 @@ private: Vector<TouchPos> touch; Point2 last_mouse; - unsigned int last_id; GFXInitFunc gfx_init_func; void *gfx_init_ud; diff --git a/platform/bb10/os_bb10.cpp b/platform/bb10/os_bb10.cpp index 80e846d3cd..c8d5b82a98 100644 --- a/platform/bb10/os_bb10.cpp +++ b/platform/bb10/os_bb10.cpp @@ -282,7 +282,6 @@ void OSBB10::handle_screen_event(bps_event_t *event) { InputEvent ievent; ievent.type = InputEvent::SCREEN_TOUCH; - ievent.ID = ++last_id; ievent.device = 0; ievent.screen_touch.pressed = (screen_val == SCREEN_EVENT_MTOUCH_TOUCH); ievent.screen_touch.x = pos[0]; @@ -301,7 +300,6 @@ void OSBB10::handle_screen_event(bps_event_t *event) { InputEvent ievent; ievent.type = InputEvent::MOUSE_BUTTON; - ievent.ID = ++last_id; ievent.device = 0; ievent.mouse_button.pressed = (screen_val == SCREEN_EVENT_MTOUCH_TOUCH); ievent.mouse_button.button_index = BUTTON_LEFT; @@ -318,7 +316,6 @@ void OSBB10::handle_screen_event(bps_event_t *event) { InputEvent ievent; ievent.type = InputEvent::SCREEN_DRAG; - ievent.ID = ++last_id; ievent.device = 0; ievent.screen_drag.x = pos[0]; ievent.screen_drag.y = pos[1]; @@ -347,7 +344,6 @@ void OSBB10::handle_screen_event(bps_event_t *event) { InputEvent ievent; ievent.type = InputEvent::MOUSE_MOTION; - ievent.ID = ++last_id; ievent.device = 0; ievent.mouse_motion.x = ievent.mouse_motion.global_x = mpos.x; ievent.mouse_motion.y = ievent.mouse_motion.global_y = mpos.y; @@ -366,7 +362,6 @@ void OSBB10::handle_screen_event(bps_event_t *event) { InputEvent ievent; ievent.type = InputEvent::KEY; - ievent.ID = ++last_id; ievent.device = 0; int val = 0; screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_KEY_SCAN, &val); @@ -595,7 +590,6 @@ int OSBB10::get_power_percent_left() { OSBB10::OSBB10() { main_loop = NULL; - last_id = 1; minimized = false; fullscreen = true; flip_accelerometer = true; diff --git a/platform/bb10/os_bb10.h b/platform/bb10/os_bb10.h index 313f9c9e6b..30978d2f60 100644 --- a/platform/bb10/os_bb10.h +++ b/platform/bb10/os_bb10.h @@ -48,8 +48,6 @@ class OSBB10 : public OS_Unix { - unsigned int last_id; - screen_context_t screen_cxt; float fullscreen_mixer_volume; float fullscreen_stream_volume; diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py index 71202a9a49..54e227cd19 100644 --- a/platform/haiku/detect.py +++ b/platform/haiku/detect.py @@ -53,7 +53,7 @@ def configure(env): elif (env["target"] == "release_debug"): env.Append(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED']) elif (env["target"] == "debug"): - env.Append(CCFLAGS=['-g2', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) + env.Append(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) # env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) env.Append(CPPFLAGS=['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np diff --git a/platform/haiku/haiku_direct_window.cpp b/platform/haiku/haiku_direct_window.cpp index bc2dbb9b8f..f64fb706c1 100644 --- a/platform/haiku/haiku_direct_window.cpp +++ b/platform/haiku/haiku_direct_window.cpp @@ -151,7 +151,6 @@ void HaikuDirectWindow::HandleMouseButton(BMessage *message) { */ InputEvent mouse_event; - mouse_event.ID = ++event_id; mouse_event.type = InputEvent::MOUSE_BUTTON; mouse_event.device = 0; @@ -208,7 +207,6 @@ void HaikuDirectWindow::HandleMouseMoved(BMessage *message) { Point2i rel = pos - last_mouse_position; InputEvent motion_event; - motion_event.ID = ++event_id; motion_event.type = InputEvent::MOUSE_MOTION; motion_event.device = 0; @@ -237,7 +235,6 @@ void HaikuDirectWindow::HandleMouseWheelChanged(BMessage *message) { } InputEvent mouse_event; - mouse_event.ID = ++event_id; mouse_event.type = InputEvent::MOUSE_BUTTON; mouse_event.device = 0; @@ -252,7 +249,6 @@ void HaikuDirectWindow::HandleMouseWheelChanged(BMessage *message) { mouse_event.mouse_button.pressed = true; input->parse_input_event(mouse_event); - mouse_event.ID = ++event_id; mouse_event.mouse_button.pressed = false; input->parse_input_event(mouse_event); } @@ -275,7 +271,6 @@ void HaikuDirectWindow::HandleKeyboardEvent(BMessage *message) { } InputEvent event; - event.ID = ++event_id; event.type = InputEvent::KEY; event.device = 0; event.key.mod = GetKeyModifierState(modifiers); @@ -289,7 +284,7 @@ void HaikuDirectWindow::HandleKeyboardEvent(BMessage *message) { event.key.unicode = BUnicodeChar::FromUTF8(&bytes); } - //make it consistent accross platforms. + //make it consistent across platforms. if (event.key.scancode == KEY_BACKTAB) { event.key.scancode = KEY_TAB; event.key.mod.shift = true; @@ -313,7 +308,6 @@ void HaikuDirectWindow::HandleKeyboardModifierEvent(BMessage *message) { int32 key = old_modifiers ^ modifiers; InputEvent event; - event.ID = ++event_id; event.type = InputEvent::KEY; event.device = 0; event.key.mod = GetKeyModifierState(modifiers); diff --git a/platform/haiku/haiku_direct_window.h b/platform/haiku/haiku_direct_window.h index 7fcea7a6f6..d4fd05e45f 100644 --- a/platform/haiku/haiku_direct_window.h +++ b/platform/haiku/haiku_direct_window.h @@ -43,7 +43,6 @@ class HaikuDirectWindow : public BDirectWindow { private: - unsigned int event_id; Point2i last_mouse_position; bool last_mouse_pos_valid; uint32 last_buttons_state; diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index 00bb4b9fad..e82649692c 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -299,8 +299,8 @@ static int frame_count = 0; if (!motionInitialised) { motionManager = [[CMMotionManager alloc] init]; if (motionManager.deviceMotionAvailable) { - motionManager.deviceMotionUpdateInterval = 1.0/70.0; - [motionManager startDeviceMotionUpdates]; + motionManager.deviceMotionUpdateInterval = 1.0/70.0; + [motionManager startDeviceMotionUpdatesUsingReferenceFrame:CMAttitudeReferenceFrameXMagneticNorthZVertical]; motionInitialised = YES; }; }; diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index fa6082a5a7..248c73982b 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -58,16 +58,16 @@ def configure(env): if (env["ios_sim"] == "yes" or env["arch"] == "x86"): # i386, simulator env["arch"] = "x86" env["bits"] = "32" - env['CCFLAGS'] = string.split('-arch i386 -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -fasm-blocks -Wall -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['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\\\"') elif (env["arch"] == "arm64"): # arm64 env["bits"] = "64" - env['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 -Wno-trigraphs -fpascal-strings -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -fvisibility=hidden -Wno-sign-conversion -MMD -MT dependencies -miphoneos-version-min=7.0 -isysroot $IPHONESDK') + env['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=7.0 -isysroot $IPHONESDK') env.Append(CPPFLAGS=['-DNEED_LONG_INT']) env.Append(CPPFLAGS=['-DLIBYUV_DISABLE_NEON']) else: # armv7 env["arch"] = "arm" env["bits"] = "32" - env['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 -Wno-trigraphs -fpascal-strings -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -isysroot $IPHONESDK -fvisibility=hidden -Wno-sign-conversion -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=7.0 -MMD -MT dependencies -isysroot $IPHONESDK') + env['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=7.0 -MMD -MT dependencies -isysroot $IPHONESDK') if (env["arch"] == "x86"): env['IPHONEPLATFORM'] = 'iPhoneSimulator' @@ -145,17 +145,17 @@ def configure(env): if (env["target"] == "release"): - env.Append(CCFLAGS=['-O3', '-DNS_BLOCK_ASSERTIONS=1', '-Wall', '-gdwarf-2']) # removed -ffast-math + env.Append(CCFLAGS=['-O3', '-DNS_BLOCK_ASSERTIONS=1', '-gdwarf-2']) # removed -ffast-math env.Append(LINKFLAGS=['-O3']) elif env["target"] == "release_debug": - env.Append(CCFLAGS=['-Os', '-DNS_BLOCK_ASSERTIONS=1', '-Wall', '-DDEBUG_ENABLED']) + env.Append(CCFLAGS=['-Os', '-DNS_BLOCK_ASSERTIONS=1', '-DDEBUG_ENABLED']) env.Append(LINKFLAGS=['-Os']) env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ENABLED']) elif (env["target"] == "debug"): - env.Append(CCFLAGS=['-D_DEBUG', '-DDEBUG=1', '-gdwarf-2', '-Wall', '-O0', '-DDEBUG_ENABLED']) + env.Append(CCFLAGS=['-D_DEBUG', '-DDEBUG=1', '-gdwarf-2', '-O0', '-DDEBUG_ENABLED']) env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ENABLED']) elif (env["target"] == "profile"): diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index adc76a622e..6850b6be38 100755 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -331,7 +331,7 @@ static void clear_touches() { glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer); glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer); // This call associates the storage for the current render buffer with the EAGLDrawable (our CAEAGLLayer) - // allowing us to draw into a buffer that will later be rendered to screen whereever the layer is (which corresponds with our view). + // allowing us to draw into a buffer that will later be rendered to screen wherever the layer is (which corresponds with our view). [context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(id<EAGLDrawable>)self.layer]; glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer); diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 57862131f9..576518011f 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -196,7 +196,6 @@ void OSIPhone::key(uint32_t p_key, bool p_pressed) { InputEvent ev; ev.type = InputEvent::KEY; - ev.ID = ++last_event_id; ev.key.echo = false; ev.key.pressed = p_pressed; ev.key.scancode = p_key; @@ -209,7 +208,6 @@ void OSIPhone::mouse_button(int p_idx, int p_x, int p_y, bool p_pressed, bool p_ if (!GLOBAL_DEF("debug/disable_touch", false)) { InputEvent ev; ev.type = InputEvent::SCREEN_TOUCH; - ev.ID = ++last_event_id; ev.screen_touch.index = p_idx; ev.screen_touch.pressed = p_pressed; ev.screen_touch.x = p_x; @@ -225,7 +223,6 @@ void OSIPhone::mouse_button(int p_idx, int p_x, int p_y, bool p_pressed, bool p_ ev.type = InputEvent::MOUSE_BUTTON; ev.device = 0; ev.mouse_button.pointer_index = p_idx; - ev.ID = ++last_event_id; // swaped it for tilted screen //ev.mouse_button.x = ev.mouse_button.global_x = video_mode.height - p_y; @@ -250,7 +247,6 @@ void OSIPhone::mouse_move(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_ InputEvent ev; ev.type = InputEvent::SCREEN_DRAG; - ev.ID = ++last_event_id; ev.screen_drag.index = p_idx; ev.screen_drag.x = p_x; ev.screen_drag.y = p_y; @@ -264,7 +260,6 @@ void OSIPhone::mouse_move(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_ ev.type = InputEvent::MOUSE_MOTION; ev.device = 0; ev.mouse_motion.pointer_index = p_idx; - ev.ID = ++last_event_id; if (true) { // vertical @@ -325,9 +320,8 @@ void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) { InputEvent ev; ev.type = InputEvent::JOYPAD_MOTION; ev.device = 0; - ev.joy_motion.axis = JOY_ANALOG_0_X; + ev.joy_motion.axis = JOY_ANALOG_0; ev.joy_motion.axis_value = (p_x / (float)ACCEL_RANGE); - ev.ID = ++last_event_id; last_accel.x = p_x; queue_event(ev); }; @@ -336,9 +330,8 @@ void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) { InputEvent ev; ev.type = InputEvent::JOYPAD_MOTION; ev.device = 0; - ev.joy_motion.axis = JOY_ANALOG_0_Y; + ev.joy_motion.axis = JOY_ANALOG_1; ev.joy_motion.axis_value = (p_y / (float)ACCEL_RANGE); - ev.ID = ++last_event_id; last_accel.y = p_y; queue_event(ev); }; @@ -347,9 +340,8 @@ void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) { InputEvent ev; ev.type = InputEvent::JOYPAD_MOTION; ev.device = 0; - ev.joy_motion.axis = JOY_ANALOG_1_X; + ev.joy_motion.axis = JOY_ANALOG_2; ev.joy_motion.axis_value = ( (1.0 - p_z) / (float)ACCEL_RANGE); - ev.ID = ++last_event_id; last_accel.z = p_z; queue_event(ev); }; @@ -566,7 +558,6 @@ OSIPhone::OSIPhone(int width, int height) { vm.resizable = false; set_video_mode(vm); event_count = 0; - last_event_id = 0; }; OSIPhone::~OSIPhone() { diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h index 36261a62c2..7557453a02 100644 --- a/platform/iphone/os_iphone.h +++ b/platform/iphone/os_iphone.h @@ -119,7 +119,6 @@ private: InputEvent event_queue[MAX_EVENTS]; int event_count; - int last_event_id; void queue_event(const InputEvent &p_event); String data_dir; diff --git a/platform/iphone/rasterizer_iphone.cpp b/platform/iphone/rasterizer_iphone.cpp index 1a619f4305..14288e4ba0 100644 --- a/platform/iphone/rasterizer_iphone.cpp +++ b/platform/iphone/rasterizer_iphone.cpp @@ -1867,7 +1867,7 @@ void RasterizerIPhone::_setup_light(LightInstance *p_instance, int p_idx) { switch (ld->type) { case VS::LIGHT_DIRECTIONAL: { - /* This doesnt have attenuation */ + /* This doesn't have attenuation */ glMatrixMode(GL_MODELVIEW); glPushMatrix(); @@ -2088,7 +2088,7 @@ void RasterizerIPhone::_render_list_forward(RenderList *p_render_list) { uint64_t prev_light_hash = 0; const Skeleton *prev_skeleton = NULL; const Geometry *prev_geometry = NULL; - const ParamOverrideMap *prev_overrides = NULL; // make it diferent than NULL + const ParamOverrideMap *prev_overrides = NULL; // make it different than NULL Geometry::Type prev_geometry_type = Geometry::GEOMETRY_INVALID; diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index f82eae9ff2..307e47e816 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -77,7 +77,7 @@ def configure(env): # retain function names at the cost of file size, for backtraces and profiling env.Append(LINKFLAGS=['--profiling-funcs']) elif (env["target"] == "debug"): - env.Append(CCFLAGS=['-O1', '-D_DEBUG', '-Wall', '-g', '-DDEBUG_ENABLED']) + env.Append(CCFLAGS=['-O1', '-D_DEBUG', '-g', '-DDEBUG_ENABLED']) env.Append(LINKFLAGS=['-O1', '-g']) # TODO: Move that to opus module's config diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 83072c30aa..08c17e1e9c 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -520,7 +520,6 @@ void OS_JavaScript::main_loop_focusin() { void OS_JavaScript::push_input(const InputEvent &p_ev) { InputEvent ev = p_ev; - ev.ID = last_id++; if (ev.type == InputEvent::MOUSE_MOTION) { input->set_mouse_pos(Point2(ev.mouse_motion.x, ev.mouse_motion.y)); } else if (ev.type == InputEvent::MOUSE_BUTTON) { @@ -540,7 +539,6 @@ void OS_JavaScript::process_touch(int p_what, int p_pointer, const Vector<TouchP //end all if exist InputEvent ev; ev.type = InputEvent::MOUSE_BUTTON; - ev.ID = last_id++; ev.mouse_button.button_index = BUTTON_LEFT; ev.mouse_button.button_mask = BUTTON_MASK_LEFT; ev.mouse_button.pressed = false; @@ -554,7 +552,6 @@ void OS_JavaScript::process_touch(int p_what, int p_pointer, const Vector<TouchP InputEvent ev; ev.type = InputEvent::SCREEN_TOUCH; - ev.ID = last_id++; ev.screen_touch.index = touch[i].id; ev.screen_touch.pressed = false; ev.screen_touch.x = touch[i].pos.x; @@ -573,7 +570,6 @@ void OS_JavaScript::process_touch(int p_what, int p_pointer, const Vector<TouchP //send mouse InputEvent ev; ev.type = InputEvent::MOUSE_BUTTON; - ev.ID = last_id++; ev.mouse_button.button_index = BUTTON_LEFT; ev.mouse_button.button_mask = BUTTON_MASK_LEFT; ev.mouse_button.pressed = true; @@ -590,7 +586,6 @@ void OS_JavaScript::process_touch(int p_what, int p_pointer, const Vector<TouchP InputEvent ev; ev.type = InputEvent::SCREEN_TOUCH; - ev.ID = last_id++; ev.screen_touch.index = touch[i].id; ev.screen_touch.pressed = true; ev.screen_touch.x = touch[i].pos.x; @@ -605,7 +600,6 @@ void OS_JavaScript::process_touch(int p_what, int p_pointer, const Vector<TouchP //send mouse, should look for point 0? InputEvent ev; ev.type = InputEvent::MOUSE_MOTION; - ev.ID = last_id++; ev.mouse_motion.button_mask = BUTTON_MASK_LEFT; ev.mouse_motion.x = p_points[0].pos.x; ev.mouse_motion.y = p_points[0].pos.y; @@ -638,7 +632,6 @@ void OS_JavaScript::process_touch(int p_what, int p_pointer, const Vector<TouchP InputEvent ev; ev.type = InputEvent::SCREEN_DRAG; - ev.ID = last_id++; ev.screen_drag.index = touch[i].id; ev.screen_drag.x = p_points[idx].pos.x; ev.screen_drag.y = p_points[idx].pos.y; @@ -655,7 +648,6 @@ void OS_JavaScript::process_touch(int p_what, int p_pointer, const Vector<TouchP //end all if exist InputEvent ev; ev.type = InputEvent::MOUSE_BUTTON; - ev.ID = last_id++; ev.mouse_button.button_index = BUTTON_LEFT; ev.mouse_button.button_mask = BUTTON_MASK_LEFT; ev.mouse_button.pressed = false; @@ -669,7 +661,6 @@ void OS_JavaScript::process_touch(int p_what, int p_pointer, const Vector<TouchP InputEvent ev; ev.type = InputEvent::SCREEN_TOUCH; - ev.ID = last_id++; ev.screen_touch.index = touch[i].id; ev.screen_touch.pressed = false; ev.screen_touch.x = touch[i].pos.x; @@ -689,7 +680,6 @@ void OS_JavaScript::process_touch(int p_what, int p_pointer, const Vector<TouchP InputEvent ev; ev.type = InputEvent::SCREEN_TOUCH; - ev.ID = last_id++; ev.screen_touch.index = tp.id; ev.screen_touch.pressed = true; ev.screen_touch.x = tp.pos.x; @@ -704,7 +694,6 @@ void OS_JavaScript::process_touch(int p_what, int p_pointer, const Vector<TouchP InputEvent ev; ev.type = InputEvent::SCREEN_TOUCH; - ev.ID = last_id++; ev.screen_touch.index = touch[i].id; ev.screen_touch.pressed = false; ev.screen_touch.x = touch[i].pos.x; @@ -790,9 +779,9 @@ void OS_JavaScript::process_joypads() { InputDefault::JoyAxis jx; jx.min = 0; jx.value = value; - last_id = input->joy_axis(last_id, i, j, jx); + input->joy_axis(i, j, jx); } else { - last_id = input->joy_button(last_id, i, j, value); + input->joy_button(i, j, value); } } for (int j = 0; j < num_axes; j++) { @@ -800,7 +789,7 @@ void OS_JavaScript::process_joypads() { InputDefault::JoyAxis jx; jx.min = -1; jx.value = state.axis[j]; - last_id = input->joy_axis(last_id, i, j, jx); + input->joy_axis(i, j, jx); } } } @@ -844,7 +833,6 @@ OS_JavaScript::OS_JavaScript(GFXInitFunc p_gfx_init_func, void *p_gfx_init_ud, G gfx_init_ud = p_gfx_init_ud; last_button_mask = 0; main_loop = NULL; - last_id = 1; gl_extensions = NULL; window_maximized = false; diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h index b16918b2da..d21834b3dc 100644 --- a/platform/javascript/os_javascript.h +++ b/platform/javascript/os_javascript.h @@ -58,7 +58,6 @@ private: Vector<TouchPos> touch; Point2 last_mouse; int last_button_mask; - unsigned int last_id; GFXInitFunc gfx_init_func; void *gfx_init_ud; diff --git a/platform/osx/detect.py b/platform/osx/detect.py index b59dfe1afb..39ee33ae82 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -51,7 +51,7 @@ def configure(env): elif (env["target"] == "debug"): - env.Append(CCFLAGS=['-g3', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) + env.Append(CCFLAGS=['-g3', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) if (not os.environ.has_key("OSXCROSS_ROOT")): # regular native build diff --git a/platform/osx/joypad_osx.cpp b/platform/osx/joypad_osx.cpp index c2b0e1f052..7b77f3bb68 100644 --- a/platform/osx/joypad_osx.cpp +++ b/platform/osx/joypad_osx.cpp @@ -458,7 +458,7 @@ static const InputDefault::JoyAxis axis_correct(int p_value, int p_min, int p_ma return jx; } -uint32_t JoypadOSX::process_joypads(uint32_t p_last_id) { +void JoypadOSX::process_joypads() { poll_joypads(); for (int i = 0; i < device_list.size(); i++) { @@ -467,17 +467,17 @@ uint32_t JoypadOSX::process_joypads(uint32_t p_last_id) { for (int j = 0; j < joy.axis_elements.size(); j++) { rec_element &elem = joy.axis_elements[j]; int value = joy.get_hid_element_state(&elem); - p_last_id = input->joy_axis(p_last_id, joy.id, j, axis_correct(value, elem.min, elem.max)); + input->joy_axis(joy.id, j, axis_correct(value, elem.min, elem.max)); } for (int j = 0; j < joy.button_elements.size(); j++) { int value = joy.get_hid_element_state(&joy.button_elements[j]); - p_last_id = input->joy_button(p_last_id, joy.id, j, (value >= 1)); + input->joy_button(joy.id, j, (value >= 1)); } for (int j = 0; j < joy.hat_elements.size(); j++) { rec_element &elem = joy.hat_elements[j]; int value = joy.get_hid_element_state(&elem); int hat_value = process_hat_value(elem.min, elem.max, value); - p_last_id = input->joy_hat(p_last_id, joy.id, hat_value); + input->joy_hat(joy.id, hat_value); } if (joy.ffservice) { @@ -494,7 +494,6 @@ uint32_t JoypadOSX::process_joypads(uint32_t p_last_id) { } } } - return p_last_id; } void JoypadOSX::joypad_vibration_start(int p_id, float p_magnitude, float p_duration, uint64_t p_timestamp) { diff --git a/platform/osx/joypad_osx.h b/platform/osx/joypad_osx.h index dabd1b8aec..e565f4f46d 100644 --- a/platform/osx/joypad_osx.h +++ b/platform/osx/joypad_osx.h @@ -110,7 +110,7 @@ private: void joypad_vibration_stop(int p_id, uint64_t p_timestamp); public: - uint32_t process_joypads(uint32_t p_last_id); + void process_joypads(); void _device_added(IOReturn p_res, IOHIDDeviceRef p_device); void _device_removed(int p_id); diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index 2c7ad09b89..8676c86131 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -61,7 +61,6 @@ public: List<String> args; MainLoop *main_loop; - unsigned int event_id; PhysicsServer *physics_server; Physics2DServer *physics_2d_server; @@ -83,7 +82,6 @@ public: // pthread_key_t current; bool mouse_grab; Point2 mouse_pos; - uint32_t last_id; id delegate; id window_delegate; diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 0699978caf..8411bdb114 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1698,7 +1698,6 @@ void OS_OSX::process_events() { void OS_OSX::push_input(const InputEvent& p_event) { InputEvent ev=p_event; - ev.ID=last_id++; //print_line("EV: "+String(ev)); input->parse_input_event(ev); } @@ -1725,7 +1724,7 @@ void OS_OSX::run() { while (!force_quit) { process_events(); // get rid of pending events - last_id = joypad_osx->process_joypads(last_id); + joypad_osx->process_joypads(); if (Main::iteration()==true) break; }; @@ -1822,7 +1821,6 @@ OS_OSX::OS_OSX() { [NSApp setDelegate:delegate]; - last_id=1; cursor_shape=CURSOR_ARROW; current_screen = 0; diff --git a/platform/server/detect.py b/platform/server/detect.py index 8bc85f342d..32f3c55135 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -64,7 +64,7 @@ def configure(env): elif (env["target"] == "debug"): - env.Append(CCFLAGS=['-g2', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) + env.Append(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) # Shared libraries, when requested diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index a9b26056fc..bef19d80ae 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -1032,7 +1032,7 @@ void AppxPackager::finish() { Error err = read_cert_file(certificate_path, certificate_pass, &cert_file); if (err != OK) { - EditorNode::add_io_error(TTR("Couldn't read the certficate file. Are the path and password both correct?")); + EditorNode::add_io_error(TTR("Couldn't read the certificate file. Are the path and password both correct?")); package->close(); memdelete(package); package = NULL; diff --git a/platform/uwp/joypad_uwp.cpp b/platform/uwp/joypad_uwp.cpp index dd57ed94ae..7860994a79 100644 --- a/platform/uwp/joypad_uwp.cpp +++ b/platform/uwp/joypad_uwp.cpp @@ -40,7 +40,7 @@ void JoypadUWP::register_events() { ref new EventHandler<Gamepad ^>(this, &JoypadUWP::OnGamepadRemoved); } -uint32_t JoypadUWP::process_controllers(uint32_t p_last_id) { +void JoypadUWP::process_controllers() { for (int i = 0; i < MAX_CONTROLLERS; i++) { @@ -55,23 +55,21 @@ uint32_t JoypadUWP::process_controllers(uint32_t p_last_id) { int button_mask = (int)GamepadButtons::Menu; for (int j = 0; j < 14; j++) { - p_last_id = input->joy_button(p_last_id, controllers[i].id, j, (int)reading.Buttons & button_mask); + input->joy_button(controllers[i].id, j, (int)reading.Buttons & button_mask); button_mask *= 2; } - p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_0, axis_correct(reading.LeftThumbstickX)); - p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_1, axis_correct(reading.LeftThumbstickY, true)); - p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_2, axis_correct(reading.RightThumbstickX)); - p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_3, axis_correct(reading.RightThumbstickY, true)); - p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_4, axis_correct(reading.LeftTrigger, false, true)); - p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_5, axis_correct(reading.RightTrigger, false, true)); + input->joy_axis(controllers[i].id, JOY_AXIS_0, axis_correct(reading.LeftThumbstickX)); + input->joy_axis(controllers[i].id, JOY_AXIS_1, axis_correct(reading.LeftThumbstickY, true)); + input->joy_axis(controllers[i].id, JOY_AXIS_2, axis_correct(reading.RightThumbstickX)); + input->joy_axis(controllers[i].id, JOY_AXIS_3, axis_correct(reading.RightThumbstickY, true)); + input->joy_axis(controllers[i].id, JOY_AXIS_4, axis_correct(reading.LeftTrigger, false, true)); + input->joy_axis(controllers[i].id, JOY_AXIS_5, axis_correct(reading.RightTrigger, false, true)); break; } } } - - return p_last_id; } JoypadUWP::JoypadUWP() { diff --git a/platform/uwp/joypad_uwp.h b/platform/uwp/joypad_uwp.h index e5a961e70e..a2572eae3d 100644 --- a/platform/uwp/joypad_uwp.h +++ b/platform/uwp/joypad_uwp.h @@ -37,7 +37,7 @@ ref class JoypadUWP sealed { /* clang-format off */ internal: void register_events(); - uint32_t process_controllers(uint32_t p_last_id); + void process_controllers(); /* clang-format on */ JoypadUWP(); diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index 19ed2b57a3..907156d280 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -344,15 +344,12 @@ String OSUWP::get_clipboard() const { void OSUWP::input_event(InputEvent &p_event) { - p_event.ID = ++last_id; - input->parse_input_event(p_event); if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.pressed && p_event.mouse_button.button_index > 3) { //send release for mouse wheel p_event.mouse_button.pressed = false; - p_event.ID = ++last_id; input->parse_input_event(p_event); } }; @@ -680,7 +677,7 @@ uint64_t OSUWP::get_ticks_usec() const { void OSUWP::process_events() { - last_id = joypad->process_controllers(last_id); + joypad->process_controllers(); process_key_events(); } @@ -907,7 +904,6 @@ OSUWP::OSUWP() { pressrc = 0; old_invalid = true; - last_id = 0; mouse_mode = MOUSE_MODE_VISIBLE; #ifdef STDOUT_FILE stdo = fopen("stdout.txt", "wb"); diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index ebbb8af39c..95b834acc4 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -92,7 +92,6 @@ private: bool outside; int old_x, old_y; Point2i center; - unsigned int last_id; VisualServer *visual_server; Rasterizer *rasterizer; PhysicsServer *physics_server; diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp index d737502bf5..449ac264a6 100644 --- a/platform/windows/context_gl_win.cpp +++ b/platform/windows/context_gl_win.cpp @@ -169,7 +169,7 @@ Error ContextGL_Win::initialize() { if (wglCreateContextAttribsARB == NULL) //OpenGL 3.0 is not supported { - MessageBox(NULL, "Cannot get Proc Adress for CreateContextAttribs", "ERROR", MB_OK | MB_ICONEXCLAMATION); + MessageBox(NULL, "Cannot get Proc Address for CreateContextAttribs", "ERROR", MB_OK | MB_ICONEXCLAMATION); wglDeleteContext(hRC); return ERR_CANT_CREATE; } diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 382783d6bc..6080c6f1dc 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -283,7 +283,7 @@ def configure(env): + " will be executed and inform you.") sys.exit() - # Forcing bits argument because MSVC does not have a flag to set this through SCons... it's different compilers (cl.exe's) called from the propper command prompt + # Forcing bits argument because MSVC does not have a flag to set this through SCons... it's different compilers (cl.exe's) called from the proper command prompt # that decide the architecture that is build for. Scons can only detect the os.getenviron (because vsvarsall.bat sets a lot of stuff for cl.exe to work with) env["bits"] = "32" env["x86_libtheora_opt_vc"] = True @@ -361,7 +361,7 @@ def configure(env): elif (env["target"] == "debug"): - env.Append(CCFLAGS=['-g', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) + env.Append(CCFLAGS=['-g', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) env["CC"] = mingw_prefix + "gcc" env['AS'] = mingw_prefix + "as" diff --git a/platform/windows/joypad.cpp b/platform/windows/joypad.cpp index 2472940ef3..86f7033d40 100644 --- a/platform/windows/joypad.cpp +++ b/platform/windows/joypad.cpp @@ -319,7 +319,7 @@ void JoypadWindows::probe_joypads() { } } -unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) { +void JoypadWindows::process_joypads() { HRESULT hr; @@ -337,16 +337,16 @@ unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) { int button_mask = XINPUT_GAMEPAD_DPAD_UP; for (int i = 0; i <= 16; i++) { - p_last_id = input->joy_button(p_last_id, joy.id, i, joy.state.Gamepad.wButtons & button_mask); + input->joy_button(joy.id, i, joy.state.Gamepad.wButtons & button_mask); button_mask = button_mask * 2; } - p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_0, axis_correct(joy.state.Gamepad.sThumbLX, true)); - p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_1, axis_correct(joy.state.Gamepad.sThumbLY, true, false, true)); - p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_2, axis_correct(joy.state.Gamepad.sThumbRX, true)); - p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_3, axis_correct(joy.state.Gamepad.sThumbRY, true, false, true)); - p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_4, axis_correct(joy.state.Gamepad.bLeftTrigger, true, true)); - p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_5, axis_correct(joy.state.Gamepad.bRightTrigger, true, true)); + input->joy_axis(joy.id, JOY_AXIS_0, axis_correct(joy.state.Gamepad.sThumbLX, true)); + input->joy_axis(joy.id, JOY_AXIS_1, axis_correct(joy.state.Gamepad.sThumbLY, true, false, true)); + input->joy_axis(joy.id, JOY_AXIS_2, axis_correct(joy.state.Gamepad.sThumbRX, true)); + input->joy_axis(joy.id, JOY_AXIS_3, axis_correct(joy.state.Gamepad.sThumbRY, true, false, true)); + input->joy_axis(joy.id, JOY_AXIS_4, axis_correct(joy.state.Gamepad.bLeftTrigger, true, true)); + input->joy_axis(joy.id, JOY_AXIS_5, axis_correct(joy.state.Gamepad.bRightTrigger, true, true)); joy.last_packet = joy.state.dwPacketNumber; } uint64_t timestamp = input->get_joy_vibration_timestamp(joy.id); @@ -384,7 +384,7 @@ unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) { continue; } - p_last_id = post_hat(p_last_id, joy->id, js.rgdwPOV[0]); + post_hat(joy->id, js.rgdwPOV[0]); for (int j = 0; j < 128; j++) { @@ -392,14 +392,14 @@ unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) { if (!joy->last_buttons[j]) { - p_last_id = input->joy_button(p_last_id, joy->id, j, true); + input->joy_button(joy->id, j, true); joy->last_buttons[j] = true; } } else { if (joy->last_buttons[j]) { - p_last_id = input->joy_button(p_last_id, joy->id, j, false); + input->joy_button(joy->id, j, false); joy->last_buttons[j] = false; } } @@ -414,16 +414,16 @@ unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) { for (int k = 0; k < count; k++) { if (joy->joy_axis[j] == axes[k]) { - p_last_id = input->joy_axis(p_last_id, joy->id, j, axis_correct(values[k])); + input->joy_axis(joy->id, j, axis_correct(values[k])); break; }; }; }; } - return p_last_id; + return; } -unsigned int JoypadWindows::post_hat(unsigned int p_last_id, int p_device, DWORD p_dpad) { +void JoypadWindows::post_hat(int p_device, DWORD p_dpad) { int dpad_val = 0; @@ -462,7 +462,7 @@ unsigned int JoypadWindows::post_hat(unsigned int p_last_id, int p_device, DWORD dpad_val = (InputDefault::HAT_MASK_LEFT | InputDefault::HAT_MASK_UP); } - return input->joy_hat(p_last_id, p_device, dpad_val); + input->joy_hat(p_device, dpad_val); }; InputDefault::JoyAxis JoypadWindows::axis_correct(int p_val, bool p_xinput, bool p_trigger, bool p_negate) const { diff --git a/platform/windows/joypad.h b/platform/windows/joypad.h index 7e4f6ff328..9e6aa41a34 100644 --- a/platform/windows/joypad.h +++ b/platform/windows/joypad.h @@ -53,7 +53,7 @@ public: ~JoypadWindows(); void probe_joypads(); - unsigned int process_joypads(unsigned int p_last_id); + void process_joypads(); private: enum { @@ -130,7 +130,7 @@ private: void load_xinput(); void unload_xinput(); - unsigned int post_hat(unsigned int p_last_id, int p_device, DWORD p_dpad); + void post_hat(int p_device, DWORD p_dpad); bool have_device(const GUID &p_guid); bool is_xinput_device(const GUID *p_guid); diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 2046ae9f44..f1a9ba5598 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -216,7 +216,6 @@ void OS_Windows::_touch_event(bool p_pressed, int p_x, int p_y, int idx) { InputEvent event; event.type = InputEvent::SCREEN_TOUCH; - event.ID = ++last_id; event.screen_touch.index = idx; event.screen_touch.pressed = p_pressed; @@ -233,7 +232,6 @@ void OS_Windows::_drag_event(int p_x, int p_y, int idx) { InputEvent event; event.type = InputEvent::SCREEN_DRAG; - event.ID = ++last_id; event.screen_drag.index = idx; event.screen_drag.x = p_x; @@ -370,7 +368,6 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) InputEvent event; event.type = InputEvent::MOUSE_MOTION; - event.ID = ++last_id; InputEventMouseMotion &mm = event.mouse_motion; mm.mod.control = (wParam & MK_CONTROL) != 0; @@ -451,7 +448,6 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) InputEvent event; event.type = InputEvent::MOUSE_BUTTON; - event.ID = ++last_id; InputEventMouseButton &mb = event.mouse_button; switch (uMsg) { @@ -582,7 +578,6 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (mb.pressed && mb.button_index > 3) { //send release for mouse wheel mb.pressed = false; - event.ID = ++last_id; input->parse_input_event(event); } } @@ -780,7 +775,6 @@ void OS_Windows::process_key_events() { if ((i == 0 && ke.uMsg == WM_CHAR) || (i > 0 && key_event_buffer[i - 1].uMsg == WM_CHAR)) { InputEvent event; event.type = InputEvent::KEY; - event.ID = ++last_id; InputEventKey &k = event.key; k.mod = ke.mod_state; @@ -805,7 +799,6 @@ void OS_Windows::process_key_events() { InputEvent event; event.type = InputEvent::KEY; - event.ID = ++last_id; InputEventKey &k = event.key; k.mod = ke.mod_state; @@ -1819,7 +1812,7 @@ void OS_Windows::process_events() { MSG msg; - last_id = joypad->process_joypads(last_id); + joypad->process_joypads(); while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) { @@ -2303,7 +2296,6 @@ OS_Windows::OS_Windows(HINSTANCE _hInstance) { hInstance = _hInstance; pressrc = 0; old_invalid = true; - last_id = 0; mouse_mode = MOUSE_MODE_VISIBLE; #ifdef STDOUT_FILE stdo = fopen("stdout.txt", "wb"); diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index e7376d6800..25c3102ee6 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -83,7 +83,6 @@ class OS_Windows : public OS { bool outside; int old_x, old_y; Point2i center; - unsigned int last_id; #if defined(OPENGL_ENABLED) ContextGL_Win *gl_context; #endif diff --git a/platform/windows/packet_peer_udp_winsock.cpp b/platform/windows/packet_peer_udp_winsock.cpp index 2df8addece..d98b64df7c 100644 --- a/platform/windows/packet_peer_udp_winsock.cpp +++ b/platform/windows/packet_peer_udp_winsock.cpp @@ -82,7 +82,7 @@ Error PacketPeerUDPWinsock::put_packet(const uint8_t *p_buffer, int p_buffer_siz struct sockaddr_storage addr; size_t addr_size = _set_sockaddr(&addr, peer_addr, peer_port, sock_type); - _set_blocking(true); + _set_sock_blocking(blocking); errno = 0; int err; @@ -90,7 +90,9 @@ Error PacketPeerUDPWinsock::put_packet(const uint8_t *p_buffer, int p_buffer_siz if (WSAGetLastError() != WSAEWOULDBLOCK) { return FAILED; - }; + } else if (!blocking) { + return ERR_UNAVAILABLE; + } } return OK; @@ -101,15 +103,13 @@ int PacketPeerUDPWinsock::get_max_packet_size() const { return 512; // uhm maybe not } -void PacketPeerUDPWinsock::_set_blocking(bool p_blocking) { - //am no windows expert - //hope this is the right thing +void PacketPeerUDPWinsock::_set_sock_blocking(bool p_blocking) { - if (blocking == p_blocking) + if (sock_blocking == p_blocking) return; - blocking = p_blocking; - unsigned long par = blocking ? 0 : 1; + sock_blocking = p_blocking; + unsigned long par = sock_blocking ? 0 : 1; if (ioctlsocket(sockfd, FIONBIO, &par)) { perror("setting non-block mode"); //close(); @@ -139,8 +139,6 @@ Error PacketPeerUDPWinsock::listen(int p_port, IP_Address p_bind_address, int p_ return ERR_UNAVAILABLE; } - blocking = true; - printf("UDP Connection listening on port %i\n", p_port); rb.resize(nearest_shift(p_recv_buffer_size)); return OK; @@ -166,7 +164,7 @@ Error PacketPeerUDPWinsock::_poll(bool p_wait) { return FAILED; } - _set_blocking(p_wait); + _set_sock_blocking(p_wait); struct sockaddr_storage from = { 0 }; int len = sizeof(struct sockaddr_storage); @@ -252,6 +250,9 @@ int PacketPeerUDPWinsock::_get_socket() { sockfd = _socket_create(sock_type, SOCK_DGRAM, IPPROTO_UDP); + if (sockfd != -1) + _set_sock_blocking(false); + return sockfd; } @@ -273,6 +274,8 @@ PacketPeerUDP *PacketPeerUDPWinsock::_create() { PacketPeerUDPWinsock::PacketPeerUDPWinsock() { + blocking = true; + sock_blocking = true; sockfd = -1; packet_port = 0; queue_count = 0; diff --git a/platform/windows/packet_peer_udp_winsock.h b/platform/windows/packet_peer_udp_winsock.h index 62107364af..6b37aefead 100644 --- a/platform/windows/packet_peer_udp_winsock.h +++ b/platform/windows/packet_peer_udp_winsock.h @@ -45,6 +45,7 @@ class PacketPeerUDPWinsock : public PacketPeerUDP { mutable int packet_port; mutable int queue_count; int sockfd; + bool sock_blocking; IP::Type sock_type; IP_Address peer_addr; @@ -54,8 +55,7 @@ class PacketPeerUDPWinsock : public PacketPeerUDP { static PacketPeerUDP *_create(); - bool blocking; - void _set_blocking(bool p_blocking); + void _set_sock_blocking(bool p_blocking); Error _poll(bool p_wait); diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 89cf639114..34306c8d0f 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -133,7 +133,7 @@ def configure(env): elif (env["target"] == "debug"): - env.Prepend(CCFLAGS=['-g2', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) + env.Prepend(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) env.ParseConfig('pkg-config x11 --cflags --libs') env.ParseConfig('pkg-config xinerama --cflags --libs') @@ -227,7 +227,7 @@ def configure(env): env.Append(LIBS=['dl']) # env.Append(CPPFLAGS=['-DMPC_FIXED_POINT']) -# host compiler is default.. + # host compiler is default.. if (is64 and env["bits"] == "32"): env.Append(CPPFLAGS=['-m32']) diff --git a/platform/x11/joypad_linux.cpp b/platform/x11/joypad_linux.cpp index 62ece58f58..db4a501b4c 100644 --- a/platform/x11/joypad_linux.cpp +++ b/platform/x11/joypad_linux.cpp @@ -454,10 +454,10 @@ InputDefault::JoyAxis JoypadLinux::axis_correct(const input_absinfo *p_abs, int return jx; } -uint32_t JoypadLinux::process_joypads(uint32_t p_event_id) { +void JoypadLinux::process_joypads() { if (joy_mutex->try_lock() != OK) { - return p_event_id; + return; } for (int i = 0; i < JOYPADS_MAX; i++) { @@ -477,11 +477,11 @@ uint32_t JoypadLinux::process_joypads(uint32_t p_event_id) { // ev may be tainted and out of MAX_KEY range, which will cause // joy->key_map[ev.code] to crash if (ev.code < 0 || ev.code >= MAX_KEY) - return p_event_id; + return; switch (ev.type) { case EV_KEY: - p_event_id = input->joy_button(p_event_id, i, joy->key_map[ev.code], ev.value); + input->joy_button(i, joy->key_map[ev.code], ev.value); break; case EV_ABS: @@ -496,7 +496,7 @@ uint32_t JoypadLinux::process_joypads(uint32_t p_event_id) { } else joy->dpad &= ~(InputDefault::HAT_MASK_LEFT | InputDefault::HAT_MASK_RIGHT); - p_event_id = input->joy_hat(p_event_id, i, joy->dpad); + input->joy_hat(i, joy->dpad); break; case ABS_HAT0Y: @@ -508,7 +508,7 @@ uint32_t JoypadLinux::process_joypads(uint32_t p_event_id) { } else joy->dpad &= ~(InputDefault::HAT_MASK_UP | InputDefault::HAT_MASK_DOWN); - p_event_id = input->joy_hat(p_event_id, i, joy->dpad); + input->joy_hat(i, joy->dpad); break; default: @@ -525,7 +525,7 @@ uint32_t JoypadLinux::process_joypads(uint32_t p_event_id) { 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]); + input->joy_axis(i, index, joy->curr_axis[index]); } } if (len == 0 || (len < 0 && errno != EAGAIN)) { @@ -546,6 +546,5 @@ uint32_t JoypadLinux::process_joypads(uint32_t p_event_id) { } } joy_mutex->unlock(); - return p_event_id; } #endif diff --git a/platform/x11/joypad_linux.h b/platform/x11/joypad_linux.h index f90ca9319a..7b8ebf5bc3 100644 --- a/platform/x11/joypad_linux.h +++ b/platform/x11/joypad_linux.h @@ -42,7 +42,7 @@ class JoypadLinux { public: JoypadLinux(InputDefault *in); ~JoypadLinux(); - uint32_t process_joypads(uint32_t p_event_id); + void process_joypads(); private: enum { diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index d7cb69f2b9..6aeab21c7f 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -94,7 +94,6 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au last_button_state = 0; xmbstring = NULL; - event_id = 0; x11_window = 0; last_click_ms = 0; args = OS::get_singleton()->get_cmdline_args(); @@ -1019,7 +1018,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) { // XKeycodeToKeysym to obtain internationalized // input.. WRONG!! // you must use XLookupString (???) which not only wastes - // cycles generating an unnecesary string, but also + // cycles generating an unnecessary string, but also // still works in half the cases. (won't handle deadkeys) // For more complex input methods (deadkeys and more advanced) // you have to use XmbLookupString (??). @@ -1075,7 +1074,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) { /* Phase 4, determine if event must be filtered */ // This seems to be a side-effect of using XIM. - // XEventFilter looks like a core X11 funciton, + // XEventFilter looks like a core X11 function, // but it's actually just used to see if we must // ignore a deadkey, or events XIM determines // must not reach the actual gui. @@ -1143,7 +1142,6 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) { /* Phase 7, send event to Window */ InputEvent event; - event.ID = ++event_id; event.type = InputEvent::KEY; event.device = 0; event.key.mod = state; @@ -1157,7 +1155,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) { event.key.echo = p_echo; if (event.key.scancode == KEY_BACKTAB) { - //make it consistent accross platforms. + //make it consistent across platforms. event.key.scancode = KEY_TAB; event.key.mod.shift = true; } @@ -1334,7 +1332,6 @@ void OS_X11::process_xevents() { } InputEvent mouse_event; - mouse_event.ID = ++event_id; mouse_event.type = InputEvent::MOUSE_BUTTON; mouse_event.device = 0; mouse_event.mouse_button.mod = get_key_modifier_state(event.xbutton.state); @@ -1360,7 +1357,6 @@ void OS_X11::process_xevents() { last_click_ms = 0; last_click_pos = Point2(-100, -100); mouse_event.mouse_button.doubleclick = true; - mouse_event.ID = ++event_id; } else { last_click_ms += diff; @@ -1447,7 +1443,6 @@ void OS_X11::process_xevents() { Point2i rel = pos - last_mouse_pos; InputEvent motion_event; - motion_event.ID = ++event_id; motion_event.type = InputEvent::MOUSE_MOTION; motion_event.device = 0; @@ -1916,7 +1911,7 @@ void OS_X11::run() { process_xevents(); // get rid of pending events #ifdef JOYDEV_ENABLED - event_id = joypad->process_joypads(event_id); + joypad->process_joypads(); #endif if (Main::iteration() == true) break; diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index cbda18c0bc..b5a74c68b8 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -116,7 +116,6 @@ class OS_X11 : public OS_Unix { bool last_mouse_pos_valid; Point2i last_click_pos; uint64_t last_click_ms; - unsigned int event_id; uint32_t last_button_state; PhysicsServer *physics_server; |