Forráskód Böngészése

-Made some icon data types smaller so they take up less space
-Fixed sample import plugin, makes samples sound strange in smp when limited hz

Juan Linietsky 9 éve
szülő
commit
db43e94175

+ 81 - 0
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;
+	}
 	{
 
 

+ 1 - 0
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: {

+ 2 - 0
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: {
 

BIN
tools/editor/icons/icon_array_data.png


BIN
tools/editor/icons/icon_array_float.png


BIN
tools/editor/icons/icon_array_int.png


BIN
tools/editor/icons/icon_array_string.png


BIN
tools/editor/icons/icon_array_variant.png


BIN
tools/editor/icons/icon_bool.png


BIN
tools/editor/icons/icon_color.png


BIN
tools/editor/icons/icon_integer.png


BIN
tools/editor/icons/icon_quat.png


BIN
tools/editor/icons/icon_real.png


BIN
tools/editor/icons/icon_rect2.png


BIN
tools/editor/icons/icon_rect3.png


BIN
tools/editor/icons/icon_string.png


BIN
tools/editor/icons/icon_vector.png


BIN
tools/editor/icons/icon_vector2.png


+ 1 - 1
tools/editor/io_plugins/editor_sample_import_plugin.cpp

@@ -481,7 +481,7 @@ 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 y0=data[MAX(0,ipos-1)];
 				float y1=data[ipos];
 				float y2=data[MIN(len-1,ipos+1)];
 				float y3=data[MIN(len-1,ipos+2)];