diff options
22 files changed, 93 insertions, 9 deletions
diff --git a/bin/tests/test_math.cpp b/bin/tests/test_math.cpp index b5041b265f..05acd5c1ec 100644 --- a/bin/tests/test_math.cpp +++ b/bin/tests/test_math.cpp @@ -75,9 +75,90 @@ fix: 0, 0, 100, 100 } +uint32_t ihash( uint32_t a) +{ + a = (a+0x7ed55d16) + (a<<12); + a = (a^0xc761c23c) ^ (a>>19); + a = (a+0x165667b1) + (a<<5); + a = (a+0xd3a2646c) ^ (a<<9); + a = (a+0xfd7046c5) + (a<<3); + a = (a^0xb55a4f09) ^ (a>>16); + return a; +} + +uint32_t ihash2( uint32_t a) { + a = (a ^ 61) ^ (a >> 16); + a = a + (a << 3); + a = a ^ (a >> 4); + a = a * 0x27d4eb2d; + a = a ^ (a >> 15); + return a; +} + +uint32_t ihash3( uint32_t a) +{ + a = (a+0x479ab41d) + (a<<8); + a = (a^0xe4aa10ce) ^ (a>>5); + a = (a+0x9942f0a6) - (a<<14); + a = (a^0x5aedd67d) ^ (a>>3); + a = (a+0x17bea992) + (a<<7); + return a; +} MainLoop* test() { + + { + + Vector<int32_t> hashes; + List<StringName> tl; + ObjectTypeDB::get_type_list(&tl); + + + for (List<StringName>::Element *E=tl.front();E;E=E->next()) { + + Vector<uint8_t> m5b = E->get().operator String().md5_buffer(); + uint32_t *ub = (uint32_t*)m5b.ptr(); + //hashes.push_back(ihash(ihash2(ihash3(*ub)))); + hashes.push_back(hashes.size()); + //hashes.push_back(E->get().hash()); + + } + + //hashes.resize(50); + + for(int i=nearest_shift(hashes.size());i<20;i++) { + + bool success=true; + for(int s=0;s<10000;s++) { + Set<uint32_t> existing; + success=true; + + for(int j=0;j<hashes.size();j++) { + + uint32_t eh = ihash2(ihash3(hashes[j]+ihash(s)+s))&((1<<i)-1); + if (existing.has(eh)) { + success=false; + break; + } + existing.insert(eh); + } + + if (success) { + print_line("success at "+itos(i)+"/"+itos(nearest_shift(hashes.size()))+" shift "+itos(s)); + break; + } + } + if (success) + break; + } + + print_line("DONE"); + + + + return NULL; + } { diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index 2f39567a7e..3022a56e2a 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -107,13 +107,13 @@ InputEvent::operator String() const { } break; case JOYSTICK_MOTION: { - str+= "Event: JoyMotion "; + str+= "Event: JoystickMotion "; str=str+"Axis: "+itos(joy_motion.axis)+" Value: " +rtos(joy_motion.axis_value); return str; } break; case JOYSTICK_BUTTON: { - str+= "Event: JoyButton "; + str+= "Event: JoystickButton "; str=str+"Pressed: "+itos(joy_button.pressed)+" Index: " +itos(joy_button.button_index)+" pressure "+rtos(joy_button.pressure); return str; diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index 8dfb55a6b6..b4e5c04c95 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -2324,8 +2324,8 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base "# Key", "# MouseMotion", "# MouseButton", - "# JoyMotion", - "# JoyButton", + "# JoystickMotion", + "# JoystickButton", "# ScreenTouch", "# ScreenDrag", "# Action" diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 344fc5ecde..0bc54b3d43 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -211,6 +211,7 @@ void AnimationPlayer::_notification(int p_what) { if (!get_tree()->is_editor_hint() && animation_set.has(autoplay)) { play(autoplay); + set_autoplay(""); //this line is the fix for autoplay issues with animatio } } break; case NOTIFICATION_PROCESS: { diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp index fd18803394..c1799ec12c 100644 --- a/scene/audio/stream_player.cpp +++ b/scene/audio/stream_player.cpp @@ -106,8 +106,10 @@ void StreamPlayer::_notification(int p_what) { resume_pos=-1; } else if (autoplay) { play(); + autoplay = false; //this line fix autoplay issues } } + } break; case NOTIFICATION_EXIT_TREE: { diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp index 11e4797747..3836fa710b 100644 --- a/tools/doc/doc_data.cpp +++ b/tools/doc/doc_data.cpp @@ -433,7 +433,7 @@ void DocData::generate(bool p_basic_types) { if (i==Variant::INPUT_EVENT) { static const char* ie_type[InputEvent::TYPE_MAX]={ - "","Key","MouseMotion","MouseButton","JoyMotion","JoyButton","ScreenTouch","ScreenDrag","Action" + "","Key","MouseMotion","MouseButton","JoystickMotion","JoystickButton","ScreenTouch","ScreenDrag","Action" }; cname+=ie_type[j]; } diff --git a/tools/editor/icons/icon_array_data.png b/tools/editor/icons/icon_array_data.png Binary files differindex 494d4c71a8..447acaab2b 100644 --- a/tools/editor/icons/icon_array_data.png +++ b/tools/editor/icons/icon_array_data.png diff --git a/tools/editor/icons/icon_array_float.png b/tools/editor/icons/icon_array_float.png Binary files differindex 558be932dc..d1b78b4c3e 100644 --- a/tools/editor/icons/icon_array_float.png +++ b/tools/editor/icons/icon_array_float.png diff --git a/tools/editor/icons/icon_array_int.png b/tools/editor/icons/icon_array_int.png Binary files differindex 74925553d9..2c4ec5bafb 100644 --- a/tools/editor/icons/icon_array_int.png +++ b/tools/editor/icons/icon_array_int.png diff --git a/tools/editor/icons/icon_array_string.png b/tools/editor/icons/icon_array_string.png Binary files differindex 2aeded63df..a2e3f11c35 100644 --- a/tools/editor/icons/icon_array_string.png +++ b/tools/editor/icons/icon_array_string.png diff --git a/tools/editor/icons/icon_array_variant.png b/tools/editor/icons/icon_array_variant.png Binary files differindex 34cb83cadd..ab294898ad 100644 --- a/tools/editor/icons/icon_array_variant.png +++ b/tools/editor/icons/icon_array_variant.png diff --git a/tools/editor/icons/icon_bool.png b/tools/editor/icons/icon_bool.png Binary files differindex 3381033b00..80b3a9deb7 100644 --- a/tools/editor/icons/icon_bool.png +++ b/tools/editor/icons/icon_bool.png diff --git a/tools/editor/icons/icon_color.png b/tools/editor/icons/icon_color.png Binary files differindex 08547caa28..3ab87c98ea 100644 --- a/tools/editor/icons/icon_color.png +++ b/tools/editor/icons/icon_color.png diff --git a/tools/editor/icons/icon_integer.png b/tools/editor/icons/icon_integer.png Binary files differindex 32c8d9885b..b49390aeb1 100644 --- a/tools/editor/icons/icon_integer.png +++ b/tools/editor/icons/icon_integer.png diff --git a/tools/editor/icons/icon_quat.png b/tools/editor/icons/icon_quat.png Binary files differindex ebb8719d33..f09d2fcaba 100644 --- a/tools/editor/icons/icon_quat.png +++ b/tools/editor/icons/icon_quat.png diff --git a/tools/editor/icons/icon_real.png b/tools/editor/icons/icon_real.png Binary files differindex 80fbf7017c..7f5bf08ede 100644 --- a/tools/editor/icons/icon_real.png +++ b/tools/editor/icons/icon_real.png diff --git a/tools/editor/icons/icon_rect2.png b/tools/editor/icons/icon_rect2.png Binary files differindex e9293b5fad..cf3cfe3b22 100644 --- a/tools/editor/icons/icon_rect2.png +++ b/tools/editor/icons/icon_rect2.png diff --git a/tools/editor/icons/icon_rect3.png b/tools/editor/icons/icon_rect3.png Binary files differindex e1e81f84e7..8eacfff207 100644 --- a/tools/editor/icons/icon_rect3.png +++ b/tools/editor/icons/icon_rect3.png diff --git a/tools/editor/icons/icon_string.png b/tools/editor/icons/icon_string.png Binary files differindex 48bf753c40..4a747f7c62 100644 --- a/tools/editor/icons/icon_string.png +++ b/tools/editor/icons/icon_string.png diff --git a/tools/editor/icons/icon_vector.png b/tools/editor/icons/icon_vector.png Binary files differindex 0ee33ba0b7..0bda8ff7c0 100644 --- a/tools/editor/icons/icon_vector.png +++ b/tools/editor/icons/icon_vector.png diff --git a/tools/editor/icons/icon_vector2.png b/tools/editor/icons/icon_vector2.png Binary files differindex 5920109a55..5bfd08f52a 100644 --- a/tools/editor/icons/icon_vector2.png +++ b/tools/editor/icons/icon_vector2.png diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.cpp b/tools/editor/io_plugins/editor_sample_import_plugin.cpp index b81c88c817..5408e43e1a 100644 --- a/tools/editor/io_plugins/editor_sample_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_sample_import_plugin.cpp @@ -481,10 +481,10 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI float mu = pos-Math::floor(pos); int ipos = int(Math::floor(pos)); - float y0=data[MAX(0,ipos-i)]; - float y1=data[ipos]; - float y2=data[MIN(len-1,ipos+1)]; - float y3=data[MIN(len-1,ipos+2)]; + float y0=data[MAX(0,ipos-1)*chans+c]; + float y1=data[ipos*chans+c]; + float y2=data[MIN(len-1,ipos+1)*chans+c]; + float y3=data[MIN(len-1,ipos+2)*chans+c]; float mu2 = mu*mu; float a0 = y3 - y2 - y0 + y1; |