diff options
1547 files changed, 11575 insertions, 17124 deletions
diff --git a/LICENSE.md b/LICENSE.md index ca0a9702f7..2f78f0e37d 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,7 +1,7 @@ GODOT ENGINE http://www.godotengine.org ********************************************************************** - Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. + Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/SConstruct b/SConstruct index 95ad0010a2..b047e961f2 100644 --- a/SConstruct +++ b/SConstruct @@ -66,20 +66,27 @@ env_base=Environment(tools=custom_tools,ENV = {'PATH' : os.environ['PATH']}); #env_base=Environment(tools=custom_tools); env_base.global_defaults=global_defaults -env_base.android_source_modules=[] -env_base.android_source_files=[] -env_base.android_module_libraries=[] +env_base.android_maven_repos=[] +env_base.android_dependencies=[] +env_base.android_java_dirs=[] +env_base.android_res_dirs=[] +env_base.android_aidl_dirs=[] +env_base.android_jni_dirs=[] env_base.android_manifest_chunk="" env_base.android_permission_chunk="" env_base.android_appattributes_chunk="" env_base.disabled_modules=[] -env_base.__class__.android_module_source = methods.android_module_source -env_base.__class__.android_module_library = methods.android_module_library -env_base.__class__.android_module_file = methods.android_module_file -env_base.__class__.android_module_manifest = methods.android_module_manifest -env_base.__class__.android_module_permission = methods.android_module_permission -env_base.__class__.android_module_attribute = methods.android_module_attribute + +env_base.__class__.android_add_maven_repository=methods.android_add_maven_repository +env_base.__class__.android_add_dependency=methods.android_add_dependency +env_base.__class__.android_add_java_dir=methods.android_add_java_dir +env_base.__class__.android_add_res_dir=methods.android_add_res_dir +env_base.__class__.android_add_aidl_dir=methods.android_add_aidl_dir +env_base.__class__.android_add_jni_dir=methods.android_add_jni_dir +env_base.__class__.android_add_to_manifest = methods.android_add_to_manifest +env_base.__class__.android_add_to_permissions = methods.android_add_to_permissions +env_base.__class__.android_add_to_attributes = methods.android_add_to_attributes env_base.__class__.disable_module = methods.disable_module env_base.__class__.add_source_files = methods.add_source_files diff --git a/bin/tests/test_containers.cpp b/bin/tests/test_containers.cpp index db877fcc1c..f8cc8ccd41 100644 --- a/bin/tests/test_containers.cpp +++ b/bin/tests/test_containers.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_containers.h b/bin/tests/test_containers.h index 3bfdef301b..72d5c0ff7a 100644 --- a/bin/tests/test_containers.h +++ b/bin/tests/test_containers.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_detailer.cpp b/bin/tests/test_detailer.cpp index ce318632dd..616356077e 100644 --- a/bin/tests/test_detailer.cpp +++ b/bin/tests/test_detailer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_detailer.h b/bin/tests/test_detailer.h index a410f6a67a..597e088caf 100644 --- a/bin/tests/test_detailer.h +++ b/bin/tests/test_detailer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_gdscript.cpp b/bin/tests/test_gdscript.cpp index 68209ecb54..683191fba2 100644 --- a/bin/tests/test_gdscript.cpp +++ b/bin/tests/test_gdscript.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_gdscript.h b/bin/tests/test_gdscript.h index f599b9c9e1..225654e2a8 100644 --- a/bin/tests/test_gdscript.h +++ b/bin/tests/test_gdscript.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_gui.cpp b/bin/tests/test_gui.cpp index c404623872..cba488a3da 100644 --- a/bin/tests/test_gui.cpp +++ b/bin/tests/test_gui.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_gui.h b/bin/tests/test_gui.h index 556b45462a..5526320b0c 100644 --- a/bin/tests/test_gui.h +++ b/bin/tests/test_gui.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_image.cpp b/bin/tests/test_image.cpp index b378755dfe..bf9851cf01 100644 --- a/bin/tests/test_image.cpp +++ b/bin/tests/test_image.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_image.h b/bin/tests/test_image.h index 8812658464..09b33e799e 100644 --- a/bin/tests/test_image.h +++ b/bin/tests/test_image.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_io.cpp b/bin/tests/test_io.cpp index 4c211a1b0d..a1eb2be19b 100644 --- a/bin/tests/test_io.cpp +++ b/bin/tests/test_io.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_io.h b/bin/tests/test_io.h index 27a5118cf0..c839590ab9 100644 --- a/bin/tests/test_io.h +++ b/bin/tests/test_io.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_main.cpp b/bin/tests/test_main.cpp index 5567145aa0..8143a95d66 100644 --- a/bin/tests/test_main.cpp +++ b/bin/tests/test_main.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_main.h b/bin/tests/test_main.h index d1898387eb..c8d571a7dd 100644 --- a/bin/tests/test_main.h +++ b/bin/tests/test_main.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_math.cpp b/bin/tests/test_math.cpp index d340515c65..b5041b265f 100644 --- a/bin/tests/test_math.cpp +++ b/bin/tests/test_math.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_math.h b/bin/tests/test_math.h index 3209ebcef6..492c3a1837 100644 --- a/bin/tests/test_math.h +++ b/bin/tests/test_math.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_misc.cpp b/bin/tests/test_misc.cpp index d6ea193853..68564c62b0 100644 --- a/bin/tests/test_misc.cpp +++ b/bin/tests/test_misc.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_misc.h b/bin/tests/test_misc.h index ac751e5cc9..55608f6a0e 100644 --- a/bin/tests/test_misc.h +++ b/bin/tests/test_misc.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_particles.cpp b/bin/tests/test_particles.cpp index 18b52444d8..bafd78eda0 100644 --- a/bin/tests/test_particles.cpp +++ b/bin/tests/test_particles.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_particles.h b/bin/tests/test_particles.h index e5e3cfab15..e95637a4e6 100644 --- a/bin/tests/test_particles.h +++ b/bin/tests/test_particles.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_physics.cpp b/bin/tests/test_physics.cpp index e3fd96ff9d..ce96f37f3f 100644 --- a/bin/tests/test_physics.cpp +++ b/bin/tests/test_physics.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_physics.h b/bin/tests/test_physics.h index f62806bf5e..5b6a54f2d4 100644 --- a/bin/tests/test_physics.h +++ b/bin/tests/test_physics.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_physics_2d.cpp b/bin/tests/test_physics_2d.cpp index 70a7d868be..c5fb734999 100644 --- a/bin/tests/test_physics_2d.cpp +++ b/bin/tests/test_physics_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_physics_2d.h b/bin/tests/test_physics_2d.h index eadd5ebcb4..e2eb1f4023 100644 --- a/bin/tests/test_physics_2d.h +++ b/bin/tests/test_physics_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_python.cpp b/bin/tests/test_python.cpp index a89e4a7eee..575caf2513 100644 --- a/bin/tests/test_python.cpp +++ b/bin/tests/test_python.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_python.h b/bin/tests/test_python.h index 9dafbd545d..77e9603fe2 100644 --- a/bin/tests/test_python.h +++ b/bin/tests/test_python.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_render.cpp b/bin/tests/test_render.cpp index 97a52b16c1..568699e5e6 100644 --- a/bin/tests/test_render.cpp +++ b/bin/tests/test_render.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_render.h b/bin/tests/test_render.h index dc71a32978..6993e75b9f 100644 --- a/bin/tests/test_render.h +++ b/bin/tests/test_render.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_shader_lang.cpp b/bin/tests/test_shader_lang.cpp index df826e489d..e55ad3074f 100644 --- a/bin/tests/test_shader_lang.cpp +++ b/bin/tests/test_shader_lang.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_shader_lang.h b/bin/tests/test_shader_lang.h index 85d379bc43..f129fb224a 100644 --- a/bin/tests/test_shader_lang.h +++ b/bin/tests/test_shader_lang.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_sound.cpp b/bin/tests/test_sound.cpp index 63c6edd9c9..44cc117e02 100644 --- a/bin/tests/test_sound.cpp +++ b/bin/tests/test_sound.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_sound.h b/bin/tests/test_sound.h index 32b66c8bba..91b87a2261 100644 --- a/bin/tests/test_sound.h +++ b/bin/tests/test_sound.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_string.cpp b/bin/tests/test_string.cpp index 93b1835b78..fe7bf4d9cf 100644 --- a/bin/tests/test_string.cpp +++ b/bin/tests/test_string.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/test_string.h b/bin/tests/test_string.h index b04eccb005..7b3cd9a019 100644 --- a/bin/tests/test_string.h +++ b/bin/tests/test_string.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/allocators.h b/core/allocators.h index 16e516e87b..4a5fd7a119 100644 --- a/core/allocators.h +++ b/core/allocators.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/array.cpp b/core/array.cpp index 41af460d83..fef0fcbb40 100644 --- a/core/array.cpp +++ b/core/array.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/array.h b/core/array.h index c29b4355ca..ecb91b69dc 100644 --- a/core/array.h +++ b/core/array.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/balloon_allocator.h b/core/balloon_allocator.h index 177c744669..eb6632bb37 100644 --- a/core/balloon_allocator.h +++ b/core/balloon_allocator.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 438db5d518..f951237971 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -62,8 +62,8 @@ void _ResourceLoader::_bind_methods() { ObjectTypeDB::bind_method(_MD("load:Resource","path","type_hint", "p_no_cache"),&_ResourceLoader::load,DEFVAL(""), DEFVAL(false)); ObjectTypeDB::bind_method(_MD("get_recognized_extensions_for_type","type"),&_ResourceLoader::get_recognized_extensions_for_type); ObjectTypeDB::bind_method(_MD("set_abort_on_missing_resources","abort"),&_ResourceLoader::set_abort_on_missing_resources); - ObjectTypeDB::bind_method(_MD("get_dependencies"),&_ResourceLoader::get_dependencies); - ObjectTypeDB::bind_method(_MD("has"),&_ResourceLoader::has); + ObjectTypeDB::bind_method(_MD("get_dependencies","path"),&_ResourceLoader::get_dependencies); + ObjectTypeDB::bind_method(_MD("has","path"),&_ResourceLoader::has); } _ResourceLoader::_ResourceLoader() { @@ -96,7 +96,7 @@ _ResourceSaver *_ResourceSaver::singleton=NULL; void _ResourceSaver::_bind_methods() { - ObjectTypeDB::bind_method(_MD("save","path","resource:Resource"),&_ResourceSaver::save, DEFVAL(0)); + ObjectTypeDB::bind_method(_MD("save","path","resource:Resource","flags"),&_ResourceSaver::save,DEFVAL(0)); ObjectTypeDB::bind_method(_MD("get_recognized_extensions","type"),&_ResourceSaver::get_recognized_extensions); BIND_CONSTANT(FLAG_RELATIVE_PATHS); @@ -494,8 +494,8 @@ uint64_t _OS::get_unix_time() const { return OS::get_singleton()->get_unix_time(); }; -uint64_t _OS::get_system_time_msec() const { - return OS::get_singleton()->get_system_time_msec(); +uint64_t _OS::get_system_time_secs() const { + return OS::get_singleton()->get_system_time_secs(); } void _OS::delay_usec(uint32_t p_usec) const { @@ -810,9 +810,9 @@ void _OS::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_time","utc"),&_OS::get_time,DEFVAL(false)); ObjectTypeDB::bind_method(_MD("get_time_zone_info"),&_OS::get_time_zone_info); ObjectTypeDB::bind_method(_MD("get_unix_time"),&_OS::get_unix_time); - ObjectTypeDB::bind_method(_MD("get_system_time_msec"), &_OS::get_system_time_msec); + ObjectTypeDB::bind_method(_MD("get_system_time_secs"), &_OS::get_system_time_secs); - ObjectTypeDB::bind_method(_MD("set_icon"),&_OS::set_icon); + ObjectTypeDB::bind_method(_MD("set_icon","icon"),&_OS::set_icon); ObjectTypeDB::bind_method(_MD("delay_usec","usec"),&_OS::delay_usec); ObjectTypeDB::bind_method(_MD("delay_msec","msec"),&_OS::delay_msec); @@ -851,9 +851,9 @@ void _OS::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_frames_per_second"),&_OS::get_frames_per_second); ObjectTypeDB::bind_method(_MD("print_all_textures_by_size"),&_OS::print_all_textures_by_size); - ObjectTypeDB::bind_method(_MD("print_resources_by_type"),&_OS::print_resources_by_type); + ObjectTypeDB::bind_method(_MD("print_resources_by_type","types"),&_OS::print_resources_by_type); - ObjectTypeDB::bind_method(_MD("native_video_play"),&_OS::native_video_play); + ObjectTypeDB::bind_method(_MD("native_video_play","path","volume","audio_track","subtitle_track"),&_OS::native_video_play); ObjectTypeDB::bind_method(_MD("native_video_is_playing"),&_OS::native_video_is_playing); ObjectTypeDB::bind_method(_MD("native_video_stop"),&_OS::native_video_stop); ObjectTypeDB::bind_method(_MD("native_video_pause"),&_OS::native_video_pause); @@ -1509,6 +1509,7 @@ void _File::_bind_methods() { BIND_CONSTANT( READ ); BIND_CONSTANT( WRITE ); BIND_CONSTANT( READ_WRITE ); + BIND_CONSTANT( WRITE_READ ); } _File::_File(){ diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 172f33dac5..62572d7761 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -208,7 +208,7 @@ public: Dictionary get_time(bool utc) const; Dictionary get_time_zone_info() const; uint64_t get_unix_time() const; - uint64_t get_system_time_msec() const; + uint64_t get_system_time_secs() const; int get_static_memory_usage() const; int get_static_memory_peak_usage() const; @@ -329,6 +329,7 @@ public: READ=1, WRITE=2, READ_WRITE=3, + WRITE_READ=7, }; Error open_encrypted(const String& p_path, int p_mode_flags,const Vector<uint8_t>& p_key); diff --git a/core/color.cpp b/core/color.cpp index 32f3df6d4b..c53de360bc 100644 --- a/core/color.cpp +++ b/core/color.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/color.h b/core/color.h index d5d5a4ea09..d0a1e8835c 100644 --- a/core/color.h +++ b/core/color.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/command_queue_mt.cpp b/core/command_queue_mt.cpp index f28617b33c..a2507b1378 100644 --- a/core/command_queue_mt.cpp +++ b/core/command_queue_mt.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/command_queue_mt.h b/core/command_queue_mt.h index 113199869b..4fd33e3a55 100644 --- a/core/command_queue_mt.h +++ b/core/command_queue_mt.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -983,7 +983,7 @@ public: void flush_all() { - ERR_FAIL_COND(sync); + //ERR_FAIL_COND(sync); lock(); while (true) { bool exit = !flush_one(); diff --git a/core/compressed_translation.cpp b/core/compressed_translation.cpp index 45fd4b5080..b104b8062a 100644 --- a/core/compressed_translation.cpp +++ b/core/compressed_translation.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -410,15 +410,15 @@ bool PHashTranslation::_set(const StringName& p_name, const Variant& p_value) { String name = p_name.operator String(); if (name=="hash_table") { hash_table=p_value; - print_line("translation: loaded hash table of size: "+itos(hash_table.size())); + //print_line("translation: loaded hash table of size: "+itos(hash_table.size())); } else if (name=="bucket_table") { bucket_table=p_value; - print_line("translation: loaded bucket table of size: "+itos(bucket_table.size())); + //print_line("translation: loaded bucket table of size: "+itos(bucket_table.size())); } else if (name=="strings") { strings=p_value; - print_line("translation: loaded string table of size: "+itos(strings.size())); + //print_line("translation: loaded string table of size: "+itos(strings.size())); } else if (name=="load_from") { - print_line("generating"); + //print_line("generating"); generate(p_value); } else return false; diff --git a/core/compressed_translation.h b/core/compressed_translation.h index c41e2afb53..a1406ce1b2 100644 --- a/core/compressed_translation.h +++ b/core/compressed_translation.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp index d0cd19768f..8605b9131b 100644 --- a/core/core_string_names.cpp +++ b/core/core_string_names.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/core_string_names.h b/core/core_string_names.h index 8bda1f3f79..ef9e846c47 100644 --- a/core/core_string_names.h +++ b/core/core_string_names.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/dictionary.cpp b/core/dictionary.cpp index c544573629..a013c21b29 100644 --- a/core/dictionary.cpp +++ b/core/dictionary.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/dictionary.h b/core/dictionary.h index 8cbabfc65d..145e7e5c84 100644 --- a/core/dictionary.h +++ b/core/dictionary.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/dvector.cpp b/core/dvector.cpp index 60aa2e079f..fa06399139 100644 --- a/core/dvector.cpp +++ b/core/dvector.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/dvector.h b/core/dvector.h index 2c75bbf9eb..17431b33a6 100644 --- a/core/dvector.h +++ b/core/dvector.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/error_list.h b/core/error_list.h index 92c417154c..cb531f527f 100644 --- a/core/error_list.h +++ b/core/error_list.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/error_macros.cpp b/core/error_macros.cpp index 53bce56626..03e5ba37da 100644 --- a/core/error_macros.cpp +++ b/core/error_macros.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/error_macros.h b/core/error_macros.h index cc88686301..cafbf0c16e 100644 --- a/core/error_macros.h +++ b/core/error_macros.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/event_queue.cpp b/core/event_queue.cpp index 1afd686f86..088e80b266 100644 --- a/core/event_queue.cpp +++ b/core/event_queue.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/event_queue.h b/core/event_queue.h index 51ed7373eb..af0a4df2b8 100644 --- a/core/event_queue.h +++ b/core/event_queue.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/fpstr.cpp b/core/fpstr.cpp index 20b527d88b..76046d0b99 100644 --- a/core/fpstr.cpp +++ b/core/fpstr.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/fpstr.h b/core/fpstr.h index c8ff80806e..d3d02733b3 100644 --- a/core/fpstr.h +++ b/core/fpstr.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/global_constants.cpp b/core/global_constants.cpp index 9fb45c672a..92e50a8b96 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -402,6 +402,9 @@ static _GlobalConstant _global_constants[]={ BIND_GLOBAL_CONSTANT( JOY_ANALOG_2_X ), BIND_GLOBAL_CONSTANT( JOY_ANALOG_2_Y ), + BIND_GLOBAL_CONSTANT( JOY_ANALOG_L2 ), + BIND_GLOBAL_CONSTANT( JOY_ANALOG_R2 ), + // error list diff --git a/core/global_constants.h b/core/global_constants.h index 77cd3724c6..f7f6677482 100644 --- a/core/global_constants.h +++ b/core/global_constants.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/globals.cpp b/core/globals.cpp index eed37c2308..1e60854f28 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -137,7 +137,7 @@ bool Globals::_set(const StringName& p_name, const Variant& p_value) { props[p_name].order=last_order++; } } else { - props[p_name]=VariantContainer(p_value,last_order++ + registering_order?0:NO_ORDER_BASE); + props[p_name]=VariantContainer(p_value,last_order++ + (registering_order?0:NO_ORDER_BASE)); } } @@ -304,6 +304,7 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) { return OK; } + if (OS::get_singleton()->get_resource_dir()!="") { //OS will call Globals->get_resource_path which will be empty if not overriden! //if the OS would rather use somewhere else, then it will not be empty. @@ -637,7 +638,9 @@ static Variant _decode_variant(const String& p_string) { InputEvent ie; ie.type=InputEvent::JOYSTICK_MOTION; ie.device=params[0].to_int(); - ie.joy_motion.axis=params[1].to_int(); + int axis = params[1].to_int();; + ie.joy_motion.axis=axis>>1; + ie.joy_motion.axis_value=axis&1?1:-1; return ie; } @@ -1028,7 +1031,7 @@ static String _encode_variant(const Variant& p_variant) { } break; case InputEvent::JOYSTICK_MOTION: { - return "jaxis("+itos(ev.device)+", "+itos(ev.joy_motion.axis)+")"; + return "jaxis("+itos(ev.device)+", "+itos(ev.joy_motion.axis * 2 + (ev.joy_motion.axis_value<0?0:1))+")"; } break; default: { @@ -1390,11 +1393,11 @@ void Globals::_bind_methods() { ObjectTypeDB::bind_method(_MD("localize_path","path"),&Globals::localize_path); ObjectTypeDB::bind_method(_MD("globalize_path","path"),&Globals::globalize_path); ObjectTypeDB::bind_method(_MD("save"),&Globals::save); - ObjectTypeDB::bind_method(_MD("has_singleton"),&Globals::has_singleton); - ObjectTypeDB::bind_method(_MD("get_singleton"),&Globals::get_singleton_object); - ObjectTypeDB::bind_method(_MD("load_resource_pack"),&Globals::_load_resource_pack); + ObjectTypeDB::bind_method(_MD("has_singleton","name"),&Globals::has_singleton); + ObjectTypeDB::bind_method(_MD("get_singleton","name"),&Globals::get_singleton_object); + ObjectTypeDB::bind_method(_MD("load_resource_pack","pack"),&Globals::_load_resource_pack); - ObjectTypeDB::bind_method(_MD("save_custom"),&Globals::_save_custom_bnd); + ObjectTypeDB::bind_method(_MD("save_custom","file"),&Globals::_save_custom_bnd); } diff --git a/core/globals.h b/core/globals.h index bfa400988f..8951f5fbd2 100644 --- a/core/globals.h +++ b/core/globals.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/hash_map.h b/core/hash_map.h index eea6d1a153..33eb25652c 100644 --- a/core/hash_map.h +++ b/core/hash_map.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/hashfuncs.h b/core/hashfuncs.h index b12950f160..c2ed5bd679 100644 --- a/core/hashfuncs.h +++ b/core/hashfuncs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/image.cpp b/core/image.cpp index eadb7ecc8b..798fc41f40 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/image.h b/core/image.h index a155823af7..aea5dc6438 100644 --- a/core/image.h +++ b/core/image.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/image_quantize.cpp b/core/image_quantize.cpp index a14e0ab72e..b8d4658fda 100644 --- a/core/image_quantize.cpp +++ b/core/image_quantize.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/input_map.cpp b/core/input_map.cpp index 24151c59c9..d4560a1e1b 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -204,6 +204,64 @@ bool InputMap::event_is_action(const InputEvent& p_event, const StringName& p_ac return _find_event(E->get().inputs,p_event)!=NULL; } +bool InputMap::event_is_joy_motion_action_pressed(const InputEvent& p_event) const { + + ERR_FAIL_COND_V(p_event.type!=InputEvent::JOYSTICK_MOTION,false); + bool pressed=false; + + //this could be optimized by having a separate list of joymotions? + + for (Map<StringName, Action>::Element *A=input_map.front();A;A=A->next()) { + + for (List<InputEvent>::Element *E=A->get().inputs.front();E;E=E->next()) { + + const InputEvent& e=E->get(); + if(e.type!=p_event.type) + continue; + if (e.type!=InputEvent::KEY && e.device!=p_event.device) + continue; + + switch(p_event.type) { + + case InputEvent::KEY: { + + if (e.key.scancode==p_event.key.scancode && e.key.mod == p_event.key.mod) + return e.key.pressed; + + } break; + case InputEvent::JOYSTICK_BUTTON: { + + if (e.joy_button.button_index==p_event.joy_button.button_index) { + return e.joy_button.pressed; + } + + } break; + case InputEvent::MOUSE_BUTTON: { + + if (e.mouse_button.button_index==p_event.mouse_button.button_index) { + return e.mouse_button.pressed; + } + + } break; + case InputEvent::JOYSTICK_MOTION: { + + if (e.joy_motion.axis==p_event.joy_motion.axis) { + if ( + (e.joy_motion.axis_value * p_event.joy_motion.axis_value >0) && //same axis + ABS(e.joy_motion.axis_value)>0.5 && ABS(p_event.joy_motion.axis_value)>0.5 ) + pressed=true; + } + + } break; + } + + } + } + + return pressed; + +} + void InputMap::load_from_globals() { input_map.clear();; diff --git a/core/input_map.h b/core/input_map.h index c5b21b1457..5cd1e41922 100644 --- a/core/input_map.h +++ b/core/input_map.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -68,6 +68,7 @@ public: const List<InputEvent> *get_action_list(const StringName& p_action); bool event_is_action(const InputEvent& p_event, const StringName& p_action) const; + bool event_is_joy_motion_action_pressed(const InputEvent& p_event) const; void load_from_globals(); diff --git a/core/int_types.h b/core/int_types.h index 231196b808..7d7c4b16b0 100644 --- a/core/int_types.h +++ b/core/int_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/compression.cpp b/core/io/compression.cpp index 729b7bec52..a17e358cbb 100644 --- a/core/io/compression.cpp +++ b/core/io/compression.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/compression.h b/core/io/compression.h index 106a3f0201..07a293c940 100644 --- a/core/io/compression.h +++ b/core/io/compression.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index 75388f514a..fd20ec9404 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,6 +29,7 @@ #include "config_file.h" #include "os/keyboard.h" #include "os/file_access.h" +#include "variant_parser.h" StringArray ConfigFile::_get_sections() const { @@ -83,10 +84,10 @@ void ConfigFile::set_value(const String& p_section, const String& p_key, const V } } -Variant ConfigFile::get_value(const String& p_section, const String& p_key) const{ +Variant ConfigFile::get_value(const String& p_section, const String& p_key, Variant p_default) const { - ERR_FAIL_COND_V(!values.has(p_section),Variant()); - ERR_FAIL_COND_V(!values[p_section].has(p_key),Variant()); + ERR_FAIL_COND_V(!values.has(p_section),p_default); + ERR_FAIL_COND_V(!values[p_section].has(p_key),p_default); return values[p_section][p_key]; } @@ -118,151 +119,6 @@ void ConfigFile::get_section_keys(const String& p_section,List<String> *r_keys) } -static String _encode_variant(const Variant& p_variant) { - - switch(p_variant.get_type()) { - - case Variant::BOOL: { - bool val = p_variant; - return (val?"true":"false"); - } break; - case Variant::INT: { - int val = p_variant; - return itos(val); - } break; - case Variant::REAL: { - float val = p_variant; - return rtos(val)+(val==int(val)?".0":""); - } break; - case Variant::STRING: { - String val = p_variant; - return "\""+val.xml_escape()+"\""; - } break; - case Variant::COLOR: { - - Color val = p_variant; - return "#"+val.to_html(); - } break; - case Variant::STRING_ARRAY: - case Variant::INT_ARRAY: - case Variant::REAL_ARRAY: - case Variant::ARRAY: { - Array arr = p_variant; - String str="["; - for(int i=0;i<arr.size();i++) { - - if (i>0) - str+=", "; - str+=_encode_variant(arr[i]); - } - str+="]"; - return str; - } break; - case Variant::DICTIONARY: { - Dictionary d = p_variant; - String str="{"; - List<Variant> keys; - d.get_key_list(&keys); - for(List<Variant>::Element *E=keys.front();E;E=E->next()) { - - if (E!=keys.front()) - str+=", "; - str+=_encode_variant(E->get()); - str+=":"; - str+=_encode_variant(d[E->get()]); - - } - str+="}"; - return str; - } break; - case Variant::IMAGE: { - String str="img("; - - Image img=p_variant; - if (!img.empty()) { - - String format; - switch(img.get_format()) { - - case Image::FORMAT_GRAYSCALE: format="grayscale"; break; - case Image::FORMAT_INTENSITY: format="intensity"; break; - case Image::FORMAT_GRAYSCALE_ALPHA: format="grayscale_alpha"; break; - case Image::FORMAT_RGB: format="rgb"; break; - case Image::FORMAT_RGBA: format="rgba"; break; - case Image::FORMAT_INDEXED : format="indexed"; break; - case Image::FORMAT_INDEXED_ALPHA: format="indexed_alpha"; break; - case Image::FORMAT_BC1: format="bc1"; break; - case Image::FORMAT_BC2: format="bc2"; break; - case Image::FORMAT_BC3: format="bc3"; break; - case Image::FORMAT_BC4: format="bc4"; break; - case Image::FORMAT_BC5: format="bc5"; break; - case Image::FORMAT_CUSTOM: format="custom custom_size="+itos(img.get_data().size())+""; break; - default: {} - } - - str+=format+", "; - str+=itos(img.get_mipmaps())+", "; - str+=itos(img.get_width())+", "; - str+=itos(img.get_height())+", "; - DVector<uint8_t> data = img.get_data(); - int ds=data.size(); - DVector<uint8_t>::Read r = data.read(); - for(int i=0;i<ds;i++) { - uint8_t byte = r[i]; - const char hex[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; - char bstr[3]={ hex[byte>>4], hex[byte&0xF], 0}; - str+=bstr; - } - } - str+=")"; - return str; - } break; - case Variant::INPUT_EVENT: { - - InputEvent ev = p_variant; - - switch(ev.type) { - - case InputEvent::KEY: { - - String mods; - if (ev.key.mod.control) - mods+="C"; - if (ev.key.mod.shift) - mods+="S"; - if (ev.key.mod.alt) - mods+="A"; - if (ev.key.mod.meta) - mods+="M"; - if (mods!="") - mods=", "+mods; - - return "key("+keycode_get_string(ev.key.scancode)+mods+")"; - } break; - case InputEvent::MOUSE_BUTTON: { - - return "mbutton("+itos(ev.device)+", "+itos(ev.mouse_button.button_index)+")"; - } break; - case InputEvent::JOYSTICK_BUTTON: { - - return "jbutton("+itos(ev.device)+", "+itos(ev.joy_button.button_index)+")"; - } break; - case InputEvent::JOYSTICK_MOTION: { - - return "jaxis("+itos(ev.device)+", "+itos(ev.joy_motion.axis)+")"; - } break; - default: { - - return "nil"; - } break; - - } - } break; - default: {} - } - - return "nil"; //don't know wha to do with this -} Error ConfigFile::save(const String& p_path){ @@ -271,6 +127,8 @@ Error ConfigFile::save(const String& p_path){ FileAccess *file = FileAccess::open(p_path,FileAccess::WRITE,&err); if (err) { + if (file) + memdelete(file); return err; } @@ -283,7 +141,9 @@ Error ConfigFile::save(const String& p_path){ for(Map<String, Variant>::Element *F=E->get().front();F;F=F->next()) { - file->store_string(F->key()+"="+_encode_variant(F->get())+"\n"); + String vstr; + VariantWriter::write_to_string(F->get(),vstr); + file->store_string(F->key()+"="+vstr+"\n"); } } @@ -292,432 +152,49 @@ Error ConfigFile::save(const String& p_path){ return OK; } -static Vector<String> _decode_params(const String& p_string) { - - int begin=p_string.find("("); - ERR_FAIL_COND_V(begin==-1,Vector<String>()); - begin++; - int end=p_string.find(")"); - ERR_FAIL_COND_V(end<begin,Vector<String>()); - return p_string.substr(begin,end-begin).split(","); -} - -static String _get_chunk(const String& str,int &pos, int close_pos) { - - - enum { - MIN_COMMA, - MIN_COLON, - MIN_CLOSE, - MIN_QUOTE, - MIN_PARENTHESIS, - MIN_CURLY_OPEN, - MIN_OPEN - }; - - int min_pos=close_pos; - int min_what=MIN_CLOSE; - -#define TEST_MIN(m_how,m_what) \ -{\ -int res = str.find(m_how,pos);\ -if (res!=-1 && res < min_pos) {\ - min_pos=res;\ - min_what=m_what;\ -}\ -}\ - - - TEST_MIN(",",MIN_COMMA); - TEST_MIN("[",MIN_OPEN); - TEST_MIN("{",MIN_CURLY_OPEN); - TEST_MIN("(",MIN_PARENTHESIS); - TEST_MIN("\"",MIN_QUOTE); - - int end=min_pos; - - - switch(min_what) { - - case MIN_COMMA: { - } break; - case MIN_CLOSE: { - //end because it's done - } break; - case MIN_QUOTE: { - end=str.find("\"",min_pos+1)+1; - ERR_FAIL_COND_V(end==-1,Variant()); - - } break; - case MIN_PARENTHESIS: { - - end=str.find(")",min_pos+1)+1; - ERR_FAIL_COND_V(end==-1,Variant()); - - } break; - case MIN_OPEN: { - int level=1; - end++; - while(end<close_pos) { - - if (str[end]=='[') - level++; - if (str[end]==']') { - level--; - if (level==0) - break; - } - end++; - } - ERR_FAIL_COND_V(level!=0,Variant()); - end++; - } break; - case MIN_CURLY_OPEN: { - int level=1; - end++; - while(end<close_pos) { - - if (str[end]=='{') - level++; - if (str[end]=='}') { - level--; - if (level==0) - break; - } - end++; - } - ERR_FAIL_COND_V(level!=0,Variant()); - end++; - } break; - - } - - String ret = str.substr(pos,end-pos); - - pos=end; - while(pos<close_pos) { - if (str[pos]!=',' && str[pos]!=' ' && str[pos]!=':') - break; - pos++; - } - - return ret; - -} - - -static Variant _decode_variant(const String& p_string) { - - - String str = p_string.strip_edges(); - - if (str.nocasecmp_to("true")==0) - return Variant(true); - if (str.nocasecmp_to("false")==0) - return Variant(false); - if (str.nocasecmp_to("nil")==0) - return Variant(); - if (str.is_valid_float()) { - if (str.find(".")==-1) - return str.to_int(); - else - return str.to_double(); - - } - if (str.begins_with("#")) { //string - return Color::html(str); - } - if (str.begins_with("\"")) { //string - int end = str.find_last("\""); - ERR_FAIL_COND_V(end==0,Variant()); - return str.substr(1,end-1).xml_unescape(); - - } - - if (str.begins_with("[")) { //array - - int close_pos = str.find_last("]"); - ERR_FAIL_COND_V(close_pos==-1,Variant()); - Array array; - - int pos=1; - - while(pos<close_pos) { - - String s = _get_chunk(str,pos,close_pos); - array.push_back(_decode_variant(s)); - } - return array; - - } - - if (str.begins_with("{")) { //array - - int close_pos = str.find_last("}"); - ERR_FAIL_COND_V(close_pos==-1,Variant()); - Dictionary d; - - int pos=1; - - while(pos<close_pos) { - - String key = _get_chunk(str,pos,close_pos); - String data = _get_chunk(str,pos,close_pos); - d[_decode_variant(key)]=_decode_variant(data); - } - return d; - - } - if (str.begins_with("key")) { - Vector<String> params = _decode_params(p_string); - ERR_FAIL_COND_V(params.size()!=1 && params.size()!=2,Variant()); - int scode=0; - - if (params[0].is_numeric()) { - scode=params[0].to_int(); - if (scode < 10) { - scode=KEY_0+scode; - } - } else - scode=find_keycode(params[0]); - - InputEvent ie; - ie.type=InputEvent::KEY; - ie.key.scancode=scode; - - if (params.size()==2) { - String mods=params[1]; - if (mods.findn("C")!=-1) - ie.key.mod.control=true; - if (mods.findn("A")!=-1) - ie.key.mod.alt=true; - if (mods.findn("S")!=-1) - ie.key.mod.shift=true; - if (mods.findn("M")!=-1) - ie.key.mod.meta=true; - } - return ie; - - } - - if (str.begins_with("mbutton")) { - Vector<String> params = _decode_params(p_string); - ERR_FAIL_COND_V(params.size()!=2,Variant()); - - InputEvent ie; - ie.type=InputEvent::MOUSE_BUTTON; - ie.device=params[0].to_int(); - ie.mouse_button.button_index=params[1].to_int(); - - return ie; - } - - if (str.begins_with("jbutton")) { - Vector<String> params = _decode_params(p_string); - ERR_FAIL_COND_V(params.size()!=2,Variant()); - - InputEvent ie; - ie.type=InputEvent::JOYSTICK_BUTTON; - ie.device=params[0].to_int(); - ie.joy_button.button_index=params[1].to_int(); - - return ie; - } - - if (str.begins_with("jaxis")) { - Vector<String> params = _decode_params(p_string); - ERR_FAIL_COND_V(params.size()!=2,Variant()); - - InputEvent ie; - ie.type=InputEvent::JOYSTICK_MOTION; - ie.device=params[0].to_int(); - ie.joy_motion.axis=params[1].to_int(); - - return ie; - } - if (str.begins_with("img")) { - Vector<String> params = _decode_params(p_string); - if (params.size()==0) { - return Image(); - } - - ERR_FAIL_COND_V(params.size()!=5,Image()); - - String format=params[0].strip_edges(); - - Image::Format imgformat; - - if (format=="grayscale") { - imgformat=Image::FORMAT_GRAYSCALE; - } else if (format=="intensity") { - imgformat=Image::FORMAT_INTENSITY; - } else if (format=="grayscale_alpha") { - imgformat=Image::FORMAT_GRAYSCALE_ALPHA; - } else if (format=="rgb") { - imgformat=Image::FORMAT_RGB; - } else if (format=="rgba") { - imgformat=Image::FORMAT_RGBA; - } else if (format=="indexed") { - imgformat=Image::FORMAT_INDEXED; - } else if (format=="indexed_alpha") { - imgformat=Image::FORMAT_INDEXED_ALPHA; - } else if (format=="bc1") { - imgformat=Image::FORMAT_BC1; - } else if (format=="bc2") { - imgformat=Image::FORMAT_BC2; - } else if (format=="bc3") { - imgformat=Image::FORMAT_BC3; - } else if (format=="bc4") { - imgformat=Image::FORMAT_BC4; - } else if (format=="bc5") { - imgformat=Image::FORMAT_BC5; - } else if (format=="custom") { - imgformat=Image::FORMAT_CUSTOM; - } else { - - ERR_FAIL_V( Image() ); - } - - int mipmaps=params[1].to_int(); - int w=params[2].to_int(); - int h=params[3].to_int(); - - if (w == 0 && h == 0) { - //r_v = Image(w, h, imgformat); - return Image(); - }; - - - String data=params[4]; - int datasize=data.length()/2; - DVector<uint8_t> pixels; - pixels.resize(datasize); - DVector<uint8_t>::Write wb = pixels.write(); - const CharType *cptr=data.c_str(); - - int idx=0; - uint8_t byte; - while( idx<datasize*2) { - - CharType c=*(cptr++); - - ERR_FAIL_COND_V(c=='<',ERR_FILE_CORRUPT); - - if ( (c>='0' && c<='9') || (c>='A' && c<='F') || (c>='a' && c<='f') ) { - - if (idx&1) { - - byte|=HEX2CHR(c); - wb[idx>>1]=byte; - } else { - - byte=HEX2CHR(c)<<4; - } - - idx++; - } - - } - - wb = DVector<uint8_t>::Write(); - - return Image(w,h,mipmaps,imgformat,pixels); - } - - if (str.find(",")!=-1) { //vector2 or vector3 - Vector<float> farr = str.split_floats(",",true); - if (farr.size()==2) { - return Point2(farr[0],farr[1]); - } - if (farr.size()==3) { - return Vector3(farr[0],farr[1],farr[2]); - } - ERR_FAIL_V(Variant()); - } - - - return Variant(); -} Error ConfigFile::load(const String& p_path) { Error err; FileAccess *f= FileAccess::open(p_path,FileAccess::READ,&err); - if (err!=OK) { - - return err; - } - - - String line; - String section; - String subpath; - - int line_count = 0; - - while(!f->eof_reached()) { - - String line = f->get_line().strip_edges(); - line_count++; - - if (line=="") - continue; - - // find comments - - { + if (!f) + return ERR_CANT_OPEN; - int pos=0; - while (true) { - int ret = line.find(";",pos); - if (ret==-1) - break; + VariantParser::StreamFile stream; + stream.f=f; - int qc=0; - for(int i=0;i<ret;i++) { + String assign; + Variant value; + VariantParser::Tag next_tag; - if (line[i]=='"') - qc++; - } + int lines=0; + String error_text; - if ( !(qc&1) ) { - //not inside string, real comment - line=line.substr(0,ret); - break; - - } + String section; - pos=ret+1; + while(true) { + assign=Variant(); + next_tag.fields.clear(); + next_tag.name=String(); - } + err = VariantParser::parse_tag_assign_eof(&stream,lines,error_text,next_tag,assign,value,NULL,true); + if (err==ERR_FILE_EOF) { + memdelete(f); + return OK; + } + else if (err!=OK) { + ERR_PRINTS("ConfgFile::load - "+p_path+":"+itos(lines)+" error: "+error_text); + memdelete(f); + return err; } - if (line.begins_with("[")) { - - int end = line.find_last("]"); - ERR_CONTINUE(end!=line.length()-1); - - section=line.substr(1,line.length()-2); - - } else if (line.find("=")!=-1) { - - - int eqpos = line.find("="); - String var=line.substr(0,eqpos).strip_edges(); - String value=line.substr(eqpos+1,line.length()).strip_edges(); - - Variant val = _decode_variant(value); - - set_value(section,var,val); - - } else { - - if (line.length() > 0) { - ERR_PRINT(String("Syntax error on line "+itos(line_count)+" of file "+p_path).ascii().get_data()); - }; - }; + if (assign!=String()) { + set_value(section,assign,value); + } else if (next_tag.name!=String()) { + section=next_tag.name; + } } memdelete(f); @@ -730,13 +207,13 @@ Error ConfigFile::load(const String& p_path) { void ConfigFile::_bind_methods(){ ObjectTypeDB::bind_method(_MD("set_value","section","key","value"),&ConfigFile::set_value); - ObjectTypeDB::bind_method(_MD("get_value","section","key"),&ConfigFile::get_value); + ObjectTypeDB::bind_method(_MD("get_value","section","key","default"),&ConfigFile::get_value,DEFVAL(Variant())); ObjectTypeDB::bind_method(_MD("has_section","section"),&ConfigFile::has_section); ObjectTypeDB::bind_method(_MD("has_section_key","section","key"),&ConfigFile::has_section_key); ObjectTypeDB::bind_method(_MD("get_sections"),&ConfigFile::_get_sections); - ObjectTypeDB::bind_method(_MD("get_section_keys"),&ConfigFile::_get_section_keys); + ObjectTypeDB::bind_method(_MD("get_section_keys","section"),&ConfigFile::_get_section_keys); ObjectTypeDB::bind_method(_MD("load:Error","path"),&ConfigFile::load); ObjectTypeDB::bind_method(_MD("save:Error","path"),&ConfigFile::save); diff --git a/core/io/config_file.h b/core/io/config_file.h index 608f143fb1..4708fefeaa 100644 --- a/core/io/config_file.h +++ b/core/io/config_file.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -46,7 +46,7 @@ protected: public: void set_value(const String& p_section, const String& p_key, const Variant& p_value); - Variant get_value(const String& p_section, const String& p_key) const; + Variant get_value(const String& p_section, const String& p_key, Variant p_default=Variant()) const; bool has_section(const String& p_section) const; bool has_section_key(const String& p_section,const String& p_key) const; diff --git a/core/io/file_access_buffered.cpp b/core/io/file_access_buffered.cpp index ab17cb8118..b38fda3686 100644 --- a/core/io/file_access_buffered.cpp +++ b/core/io/file_access_buffered.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_buffered.h b/core/io/file_access_buffered.h index e6de203cda..9d405e15f7 100644 --- a/core/io/file_access_buffered.h +++ b/core/io/file_access_buffered.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_buffered_fa.h b/core/io/file_access_buffered_fa.h index d36c4843e4..afa79db06f 100644 --- a/core/io/file_access_buffered_fa.h +++ b/core/io/file_access_buffered_fa.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp index 1d06dc8c4b..2547d2d065 100644 --- a/core/io/file_access_compressed.cpp +++ b/core/io/file_access_compressed.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_compressed.h b/core/io/file_access_compressed.h index 69a03fa14f..f9e7cd98bd 100644 --- a/core/io/file_access_compressed.h +++ b/core/io/file_access_compressed.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp index 83da55fc61..2cc52a9e2d 100644 --- a/core/io/file_access_memory.cpp +++ b/core/io/file_access_memory.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_memory.h b/core/io/file_access_memory.h index 8c58a8a8ce..287f3dfe04 100644 --- a/core/io/file_access_memory.h +++ b/core/io/file_access_memory.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index 850e055129..10667a4187 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_network.h b/core/io/file_access_network.h index 2190cdb0ea..0073209ab8 100644 --- a/core/io/file_access_network.h +++ b/core/io/file_access_network.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index 339a6d0528..5c8c741f28 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h index 5bf5ad012c..f5dae6d51d 100644 --- a/core/io/file_access_pack.h +++ b/core/io/file_access_pack.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp index ab2eb3b3f2..41f43bf54d 100644 --- a/core/io/file_access_zip.cpp +++ b/core/io/file_access_zip.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h index 88272e6cfc..0a927b72f2 100644 --- a/core/io/file_access_zip.h +++ b/core/io/file_access_zip.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 58092efd4b..19a7286dcf 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -248,7 +248,7 @@ Error HTTPClient::poll(){ status=STATUS_SSL_HANDSHAKE_ERROR; return ERR_CANT_CONNECT; } - print_line("SSL! TURNED ON!"); + //print_line("SSL! TURNED ON!"); connection=ssl; } status=STATUS_CONNECTED; @@ -295,7 +295,7 @@ Error HTTPClient::poll(){ response_str.push_back(0); String response; response.parse_utf8((const char*)response_str.ptr()); - print_line("END OF RESPONSE? :\n"+response+"\n------"); + //print_line("END OF RESPONSE? :\n"+response+"\n------"); Vector<String> responses = response.split("\n"); body_size=0; chunked=false; @@ -307,16 +307,17 @@ Error HTTPClient::poll(){ for(int i=0;i<responses.size();i++) { String s = responses[i].strip_edges(); + s = s.to_lower(); if (s.length()==0) continue; - if (s.begins_with("Content-Length:")) { + if (s.begins_with("content-length:")) { body_size = s.substr(s.find(":")+1,s.length()).strip_edges().to_int(); body_left=body_size; } - if (s.begins_with("Transfer-Encoding:")) { + if (s.begins_with("transfer-encoding:")) { String encoding = s.substr(s.find(":")+1,s.length()).strip_edges(); - print_line("TRANSFER ENCODING: "+encoding); + //print_line("TRANSFER ENCODING: "+encoding); if (encoding=="chunked") { chunked=true; } diff --git a/core/io/http_client.h b/core/io/http_client.h index b103dc43fc..e138681396 100644 --- a/core/io/http_client.h +++ b/core/io/http_client.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/image_loader.cpp b/core/io/image_loader.cpp index 2db6e00f0a..aa641f00b4 100644 --- a/core/io/image_loader.cpp +++ b/core/io/image_loader.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/image_loader.h b/core/io/image_loader.h index ff972696ea..3cc6c6cf43 100644 --- a/core/io/image_loader.h +++ b/core/io/image_loader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/ip.cpp b/core/io/ip.cpp index 523f9f472b..b8bd00c2fb 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/ip.h b/core/io/ip.h index 6f50a190e6..38c86e7ba3 100644 --- a/core/io/ip.h +++ b/core/io/ip.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/ip_address.cpp b/core/io/ip_address.cpp index ed5a45c9ef..7a51bce7c6 100644 --- a/core/io/ip_address.cpp +++ b/core/io/ip_address.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/ip_address.h b/core/io/ip_address.h index e55f45a2d7..1292311729 100644 --- a/core/io/ip_address.h +++ b/core/io/ip_address.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/json.cpp b/core/io/json.cpp index 22c99d0465..f9a8638d06 100644 --- a/core/io/json.cpp +++ b/core/io/json.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -86,7 +86,7 @@ String JSON::_print_var(const Variant& p_var) { s+="}"; return s; }; - default: return "\""+String(p_var).c_escape()+"\""; + default: return "\""+String(p_var).json_escape()+"\""; } @@ -288,7 +288,7 @@ Error JSON::_parse_value(Variant &value,Token& token,const CharType *p_str,int & if (token.type==TK_CURLY_BRACKET_OPEN) { - Dictionary d; + Dictionary d(true); Error err = _parse_object(d,p_str,index,p_len,line,r_err_str); if (err) return err; @@ -296,7 +296,7 @@ Error JSON::_parse_value(Variant &value,Token& token,const CharType *p_str,int & return OK; } else if (token.type==TK_BRACKET_OPEN) { - Array a; + Array a(true); Error err = _parse_array(a,p_str,index,p_len,line,r_err_str); if (err) return err; diff --git a/core/io/json.h b/core/io/json.h index 78b6303451..a2803269cb 100644 --- a/core/io/json.h +++ b/core/io/json.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 62ccd81489..4dccf21d2d 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/marshalls.h b/core/io/marshalls.h index df673debf5..7a5b16e8af 100644 --- a/core/io/marshalls.h +++ b/core/io/marshalls.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index fc9e51f000..6cb3daa7ac 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/packet_peer.h b/core/io/packet_peer.h index 76d1eb22b5..b29fc22af0 100644 --- a/core/io/packet_peer.h +++ b/core/io/packet_peer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 9a3a191b3b..c008c3f9a4 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -725,7 +725,8 @@ Error ResourceInteractiveLoaderBinary::poll(){ } } else { - path=res_path; + if (!ResourceCache::has(res_path)) + path=res_path; } uint64_t offset = internal_resources[s].offset; diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h index 8bf20bc574..b8be3080b8 100644 --- a/core/io/resource_format_binary.h +++ b/core/io/resource_format_binary.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/resource_format_xml.cpp b/core/io/resource_format_xml.cpp index 48917a19ea..8c8d79948a 100644 --- a/core/io/resource_format_xml.cpp +++ b/core/io/resource_format_xml.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1570,7 +1570,9 @@ Error ResourceInteractiveLoaderXML::poll() { if (main) { f->close(); resource=res; - resource->set_path(res_path); + if (!ResourceCache::has(res_path)) { + resource->set_path(res_path); + } error=ERR_FILE_EOF; return error; diff --git a/core/io/resource_format_xml.h b/core/io/resource_format_xml.h index 77987c6a5b..94c81a4111 100644 --- a/core/io/resource_format_xml.h +++ b/core/io/resource_format_xml.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 3862790b02..67208b5960 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h index 00a05dcb43..fe58303066 100644 --- a/core/io/resource_loader.h +++ b/core/io/resource_loader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index fdb9a53f0d..51020a0285 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/resource_saver.h b/core/io/resource_saver.h index 8382b65290..7bc96c1087 100644 --- a/core/io/resource_saver.h +++ b/core/io/resource_saver.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index 1b39286bf7..2a9dff86f8 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/stream_peer.h b/core/io/stream_peer.h index 2bb8f731b2..970e6695a5 100644 --- a/core/io/stream_peer.h +++ b/core/io/stream_peer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp index c2343790ea..fbb0c69cb7 100644 --- a/core/io/stream_peer_tcp.cpp +++ b/core/io/stream_peer_tcp.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/stream_peer_tcp.h b/core/io/stream_peer_tcp.h index 0e37303516..4c58e7e149 100644 --- a/core/io/stream_peer_tcp.h +++ b/core/io/stream_peer_tcp.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp index 803df87086..274d20a48a 100644 --- a/core/io/tcp_server.cpp +++ b/core/io/tcp_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/tcp_server.h b/core/io/tcp_server.h index b59f3293d7..512a7e640a 100644 --- a/core/io/tcp_server.h +++ b/core/io/tcp_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index 020d168208..fe101a8676 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/translation_loader_po.h b/core/io/translation_loader_po.h index e07ae15e28..a569674d80 100644 --- a/core/io/translation_loader_po.h +++ b/core/io/translation_loader_po.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp index 1ff458f325..e6a90412c1 100644 --- a/core/io/xml_parser.cpp +++ b/core/io/xml_parser.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -385,15 +385,15 @@ void XMLParser::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_node_data"),&XMLParser::get_node_data); ObjectTypeDB::bind_method(_MD("get_node_offset"),&XMLParser::get_node_offset); ObjectTypeDB::bind_method(_MD("get_attribute_count"),&XMLParser::get_attribute_count); - ObjectTypeDB::bind_method(_MD("get_attribute_name"),&XMLParser::get_attribute_name); - ObjectTypeDB::bind_method(_MD("get_attribute_value"),(String (XMLParser::*)(int) const) &XMLParser::get_attribute_value); - ObjectTypeDB::bind_method(_MD("has_attribute"),&XMLParser::has_attribute); - ObjectTypeDB::bind_method(_MD("get_named_attribute_value"), (String (XMLParser::*)(const String&) const) &XMLParser::get_attribute_value); - ObjectTypeDB::bind_method(_MD("get_named_attribute_value_safe"), &XMLParser::get_attribute_value_safe); + ObjectTypeDB::bind_method(_MD("get_attribute_name","idx"),&XMLParser::get_attribute_name); + ObjectTypeDB::bind_method(_MD("get_attribute_value","idx"),(String (XMLParser::*)(int) const) &XMLParser::get_attribute_value); + ObjectTypeDB::bind_method(_MD("has_attribute","name"),&XMLParser::has_attribute); + ObjectTypeDB::bind_method(_MD("get_named_attribute_value","name"), (String (XMLParser::*)(const String&) const) &XMLParser::get_attribute_value); + ObjectTypeDB::bind_method(_MD("get_named_attribute_value_safe","name"), &XMLParser::get_attribute_value_safe); ObjectTypeDB::bind_method(_MD("is_empty"),&XMLParser::is_empty); ObjectTypeDB::bind_method(_MD("get_current_line"),&XMLParser::get_current_line); ObjectTypeDB::bind_method(_MD("skip_section"),&XMLParser::skip_section); - ObjectTypeDB::bind_method(_MD("seek"),&XMLParser::seek); + ObjectTypeDB::bind_method(_MD("seek","pos"),&XMLParser::seek); ObjectTypeDB::bind_method(_MD("open","file"),&XMLParser::open); ObjectTypeDB::bind_method(_MD("open_buffer","buffer"),&XMLParser::open_buffer); diff --git a/core/io/xml_parser.h b/core/io/xml_parser.h index 418a8efa70..e0ec3ec770 100644 --- a/core/io/xml_parser.h +++ b/core/io/xml_parser.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/zip_io.h b/core/io/zip_io.h index dd3c371a4a..355003d947 100644 --- a/core/io/zip_io.h +++ b/core/io/zip_io.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/list.h b/core/list.h index 018abca940..fbeb653da4 100644 --- a/core/list.h +++ b/core/list.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/map.h b/core/map.h index e45c833bcb..35dc73df48 100644 --- a/core/map.h +++ b/core/map.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/aabb.cpp b/core/math/aabb.cpp index 435df66aab..6d8a5a72f0 100644 --- a/core/math/aabb.cpp +++ b/core/math/aabb.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/aabb.h b/core/math/aabb.h index 4781e5c263..7c9c3081ac 100644 --- a/core/math/aabb.h +++ b/core/math/aabb.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/bezier_curve.cpp b/core/math/bezier_curve.cpp index c9467a77e4..37cf16504c 100644 --- a/core/math/bezier_curve.cpp +++ b/core/math/bezier_curve.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/bezier_curve.h b/core/math/bezier_curve.h index de14d68987..25df9dfda8 100644 --- a/core/math/bezier_curve.h +++ b/core/math/bezier_curve.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/bsp_tree.cpp b/core/math/bsp_tree.cpp index d71b7551d9..0c07b733f0 100644 --- a/core/math/bsp_tree.cpp +++ b/core/math/bsp_tree.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/bsp_tree.h b/core/math/bsp_tree.h index b980d9590b..a7145f9ff1 100644 --- a/core/math/bsp_tree.h +++ b/core/math/bsp_tree.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index f1afa33a4b..61c8b78e0a 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/camera_matrix.h b/core/math/camera_matrix.h index 52b84f4870..27500a545e 100644 --- a/core/math/camera_matrix.h +++ b/core/math/camera_matrix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/face3.cpp b/core/math/face3.cpp index 354372df74..e1af91f28e 100644 --- a/core/math/face3.cpp +++ b/core/math/face3.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/face3.h b/core/math/face3.h index eccbc78122..c36fdd1332 100644 --- a/core/math/face3.h +++ b/core/math/face3.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/geometry.cpp b/core/math/geometry.cpp index 14adde74e7..2905d26fe5 100644 --- a/core/math/geometry.cpp +++ b/core/math/geometry.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/geometry.h b/core/math/geometry.h index 8214895676..8370990d6e 100644 --- a/core/math/geometry.h +++ b/core/math/geometry.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp index ce03f089e5..a485125cb4 100644 --- a/core/math/math_2d.cpp +++ b/core/math/math_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -187,7 +187,6 @@ Vector2 Vector2::snapped(const Vector2& p_by) const { Vector2 Vector2::clamped(real_t p_len) const { - return *this; real_t l = length(); Vector2 v = *this; if (l>0 && p_len<l) { diff --git a/core/math/math_2d.h b/core/math/math_2d.h index 3d40e24091..1171364671 100644 --- a/core/math/math_2d.h +++ b/core/math/math_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/math_defs.cpp b/core/math/math_defs.cpp index 51aaa6800e..70963bd71d 100644 --- a/core/math/math_defs.cpp +++ b/core/math/math_defs.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/math_defs.h b/core/math/math_defs.h index 7cb6c7f499..eb85039ca3 100644 --- a/core/math/math_defs.h +++ b/core/math/math_defs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp index 3c94ac5bc7..20d9db3375 100644 --- a/core/math/math_funcs.cpp +++ b/core/math/math_funcs.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -207,9 +207,15 @@ double Math::ceil(double p_x) { int Math::decimals(double p_step) { int max=4; + double llimit = Math::pow(0.1,max); + double ulimit = 1.0-llimit; int i=0; - while( (p_step - Math::floor(p_step)) != 0.0 && max) { - + while( max) { + + float d = absf(p_step) - Math::floor(absf(p_step)); + + if (d<llimit || d>ulimit) + break; p_step*=10.0; max--; i++; diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index ec089ebc8b..62890b0371 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/matrix3.cpp b/core/math/matrix3.cpp index 10f1461fdc..f51da80a83 100644 --- a/core/math/matrix3.cpp +++ b/core/math/matrix3.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/matrix3.h b/core/math/matrix3.h index 98feb2dbbd..291934b8eb 100644 --- a/core/math/matrix3.h +++ b/core/math/matrix3.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/octree.h b/core/math/octree.h index 84de388178..b51c4bcba7 100644 --- a/core/math/octree.h +++ b/core/math/octree.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/plane.cpp b/core/math/plane.cpp index f9395a002a..d17ce01bec 100644 --- a/core/math/plane.cpp +++ b/core/math/plane.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/plane.h b/core/math/plane.h index 604b880266..d20e63dc47 100644 --- a/core/math/plane.h +++ b/core/math/plane.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/quat.cpp b/core/math/quat.cpp index e0c4b0793c..ebc5ec4e65 100644 --- a/core/math/quat.cpp +++ b/core/math/quat.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/quat.h b/core/math/quat.h index f161e35074..738b6946c7 100644 --- a/core/math/quat.h +++ b/core/math/quat.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp index 80ae0f04e1..956824d3d0 100644 --- a/core/math/quick_hull.cpp +++ b/core/math/quick_hull.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/quick_hull.h b/core/math/quick_hull.h index cb486a0b6f..8c009b907d 100644 --- a/core/math/quick_hull.h +++ b/core/math/quick_hull.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/transform.cpp b/core/math/transform.cpp index a6f4f626cc..8371f7e34b 100644 --- a/core/math/transform.cpp +++ b/core/math/transform.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/transform.h b/core/math/transform.h index a992843d70..bd1247084d 100644 --- a/core/math/transform.h +++ b/core/math/transform.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/triangle_mesh.cpp b/core/math/triangle_mesh.cpp index 70cb639fc2..adb9861092 100644 --- a/core/math/triangle_mesh.cpp +++ b/core/math/triangle_mesh.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/triangle_mesh.h b/core/math/triangle_mesh.h index 87d8ce8e6c..b5e8f79cde 100644 --- a/core/math/triangle_mesh.h +++ b/core/math/triangle_mesh.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/triangulate.cpp b/core/math/triangulate.cpp index b13e13c47d..27b7c86675 100644 --- a/core/math/triangulate.cpp +++ b/core/math/triangulate.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/triangulate.h b/core/math/triangulate.h index 927b7efb8d..7dcc91b2fd 100644 --- a/core/math/triangulate.h +++ b/core/math/triangulate.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp index a3877eb9ff..8afd73f482 100644 --- a/core/math/vector3.cpp +++ b/core/math/vector3.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/vector3.h b/core/math/vector3.h index 8a3cca8f33..528c4d37b3 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/message_queue.cpp b/core/message_queue.cpp index 489939ee65..c69021f4f0 100644 --- a/core/message_queue.cpp +++ b/core/message_queue.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -28,7 +28,7 @@ /*************************************************************************/ #include "message_queue.h" #include "globals.h" - +#include "script_language.h" MessageQueue *MessageQueue::singleton=NULL; MessageQueue *MessageQueue::get_singleton() { @@ -36,26 +36,11 @@ MessageQueue *MessageQueue::get_singleton() { return singleton; } -Error MessageQueue::push_call(ObjectID p_id, const StringName& p_method, VARIANT_ARG_DECLARE) { +Error MessageQueue::push_call(ObjectID p_id,const StringName& p_method,const Variant** p_args,int p_argcount,bool p_show_error) { _THREAD_SAFE_METHOD_ - uint8_t room_needed=sizeof(Message); - int args=0; - if (p_arg5.get_type()!=Variant::NIL) - args=5; - else if (p_arg4.get_type()!=Variant::NIL) - args=4; - else if (p_arg3.get_type()!=Variant::NIL) - args=3; - else if (p_arg2.get_type()!=Variant::NIL) - args=2; - else if (p_arg1.get_type()!=Variant::NIL) - args=1; - else - args=0; - - room_needed+=sizeof(Variant)*args; + int room_needed=sizeof(Message)+sizeof(Variant)*p_argcount; if ((buffer_end+room_needed) >= buffer_size) { String type; @@ -65,53 +50,43 @@ Error MessageQueue::push_call(ObjectID p_id, const StringName& p_method, VARIANT statistics(); } + ERR_FAIL_COND_V( (buffer_end+room_needed) >= buffer_size , ERR_OUT_OF_MEMORY ); Message * msg = memnew_placement( &buffer[ buffer_end ], Message ); - msg->args=args; + msg->args=p_argcount; msg->instance_ID=p_id; msg->target=p_method; msg->type=TYPE_CALL; - buffer_end+=sizeof(Message); + if (p_show_error) + msg->type|=FLAG_SHOW_ERROR; + buffer_end+=sizeof(Message); - if (args>=1) { + for(int i=0;i<p_argcount;i++) { Variant * v = memnew_placement( &buffer[ buffer_end ], Variant ); buffer_end+=sizeof(Variant); - *v=p_arg1; - } - - if (args>=2) { + *v=*p_args[i]; - Variant * v = memnew_placement( &buffer[ buffer_end ], Variant ); - buffer_end+=sizeof(Variant); - *v=p_arg2; } - if (args>=3) { + return OK; +} - Variant * v = memnew_placement( &buffer[ buffer_end ], Variant ); - buffer_end+=sizeof(Variant); - *v=p_arg3; +Error MessageQueue::push_call(ObjectID p_id, const StringName& p_method, VARIANT_ARG_DECLARE) { - } + VARIANT_ARGPTRS; - if (args>=4) { + int argc=0; - Variant * v = memnew_placement( &buffer[ buffer_end ], Variant ); - buffer_end+=sizeof(Variant); - *v=p_arg4; + for(int i=0;i<VARIANT_ARG_MAX;i++) { + if (argptr[i]->get_type()==Variant::NIL) + break; + argc++; } - if (args>=5) { + return push_call(p_id,p_method,argptr,argc,false); - Variant * v = memnew_placement( &buffer[ buffer_end ], Variant ); - buffer_end+=sizeof(Variant); - *v=p_arg5; - } - - - return OK; } Error MessageQueue::push_set(ObjectID p_id, const StringName& p_prop, const Variant& p_value) { @@ -212,7 +187,7 @@ void MessageQueue::statistics() { if (target!=NULL) { - switch(message->type) { + switch(message->type&FLAG_MASK) { case TYPE_CALL: { @@ -251,7 +226,7 @@ void MessageQueue::statistics() { read_pos+=sizeof(Message); - if (message->type!=TYPE_NOTIFICATION) + if ((message->type&FLAG_MASK)!=TYPE_NOTIFICATION) read_pos+=sizeof(Variant)*message->args; } @@ -322,6 +297,26 @@ int MessageQueue::get_max_buffer_usage() const { return buffer_max_used; } + +void MessageQueue::_call_function(Object* p_target, const StringName& p_func, const Variant *p_args, int p_argcount,bool p_show_error) { + + const Variant **argptrs=NULL; + if (p_argcount) { + argptrs = (const Variant**)alloca(sizeof(Variant*)*p_argcount); + for(int i=0;i<p_argcount;i++) { + argptrs[i]=&p_args[i]; + } + } + + Variant::CallError ce; + p_target->call(p_func,argptrs,p_argcount,ce); + if (p_show_error && ce.error!=Variant::CallError::CALL_OK) { + + ERR_PRINTS("Error calling deferred method: "+Variant::get_call_error_text(p_target,p_func,argptrs,p_argcount,ce)); + + } +} + void MessageQueue::flush() { @@ -347,7 +342,7 @@ void MessageQueue::flush() { if (target!=NULL) { - switch(message->type) { + switch(message->type&FLAG_MASK) { case TYPE_CALL: { Variant *args= (Variant*)(message+1); @@ -355,12 +350,7 @@ void MessageQueue::flush() { // messages don't expect a return value - target->call( message->target, - (message->args>=1) ? args[0] : Variant(), - (message->args>=2) ? args[1] : Variant(), - (message->args>=3) ? args[2] : Variant(), - (message->args>=4) ? args[3] : Variant(), - (message->args>=5) ? args[4] : Variant() ); + _call_function(target,message->target,args,message->args,message->type&FLAG_SHOW_ERROR); for(int i=0;i<message->args;i++) { args[i].~Variant(); @@ -386,7 +376,7 @@ void MessageQueue::flush() { } uint32_t advance = sizeof(Message); - if (message->type!=TYPE_NOTIFICATION) + if ((message->type&FLAG_MASK)!=TYPE_NOTIFICATION) advance+=sizeof(Variant)*message->args; message->~Message(); @@ -423,14 +413,14 @@ MessageQueue::~MessageQueue() { Message *message = (Message*)&buffer[ read_pos ]; Variant *args= (Variant*)(message+1); int argc = message->args; - if (message->type!=TYPE_NOTIFICATION) { + if ((message->type&FLAG_MASK)!=TYPE_NOTIFICATION) { for (int i=0;i<argc;i++) args[i].~Variant(); } message->~Message(); read_pos+=sizeof(Message); - if (message->type!=TYPE_NOTIFICATION) + if ((message->type&FLAG_MASK)!=TYPE_NOTIFICATION) read_pos+=sizeof(Variant)*message->args; } diff --git a/core/message_queue.h b/core/message_queue.h index 5cee21847b..6a3ec79732 100644 --- a/core/message_queue.h +++ b/core/message_queue.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -46,7 +46,10 @@ class MessageQueue { enum { TYPE_CALL, TYPE_NOTIFICATION, - TYPE_SET + TYPE_SET, + FLAG_SHOW_ERROR=1<<14, + FLAG_MASK=FLAG_SHOW_ERROR-1 + }; struct Message { @@ -65,12 +68,14 @@ class MessageQueue { uint32_t buffer_max_used; uint32_t buffer_size; + void _call_function(Object* p_target,const StringName& p_func,const Variant *p_args,int p_argcount,bool p_show_error); static MessageQueue *singleton; public: static MessageQueue *get_singleton(); + Error push_call(ObjectID p_id,const StringName& p_method,const Variant** p_args,int p_argcount,bool p_show_error=false); Error push_call(ObjectID p_id, const StringName& p_method, VARIANT_ARG_LIST); Error push_notification(ObjectID p_id, int p_notification); Error push_set(ObjectID p_id, const StringName& p_prop, const Variant& p_value); diff --git a/core/method_bind.cpp b/core/method_bind.cpp index ce57380434..b41fa33887 100644 --- a/core/method_bind.cpp +++ b/core/method_bind.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/method_bind.h b/core/method_bind.h index 85c1084f80..4c2598e50c 100644 --- a/core/method_bind.h +++ b/core/method_bind.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/multi_bucket_array.h b/core/multi_bucket_array.h index d85c9de583..98033e40f6 100644 --- a/core/multi_bucket_array.h +++ b/core/multi_bucket_array.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/object.cpp b/core/object.cpp index 9fdd11eb2e..c92fc35b24 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -512,17 +512,10 @@ Variant Object::_call_deferred_bind(const Variant** p_args, int p_argcount, Vari r_error.error=Variant::CallError::CALL_OK; - StringName signal = *p_args[0]; - - Variant v[VARIANT_ARG_MAX]; - - - for(int i=0;i<MIN(5,p_argcount-1);i++) { + StringName method = *p_args[0]; - v[i]=*p_args[i+1]; - } + MessageQueue::get_singleton()->push_call(get_instance_ID(),method,&p_args[1],p_argcount-1); - call_deferred(signal,v[0],v[1],v[2],v[3],v[4]); return Variant(); } @@ -839,6 +832,8 @@ void Object::call_multilevel(const StringName& p_name, VARIANT_ARG_DECLARE) { Variant Object::call(const StringName& p_method,const Variant** p_args,int p_argcount,Variant::CallError &r_error) { + r_error.error=Variant::CallError::CALL_OK; + if (p_method==CoreStringNames::get_singleton()->_free) { //free must be here, before anything, always ready #ifdef DEBUG_ENABLED @@ -1011,6 +1006,27 @@ Array Object::_get_property_list_bind() const { return convert_property_list(&lpi); } + +static Dictionary _get_dict_from_method(const MethodInfo &mi) { + + Dictionary d; + d["name"]=mi.name; + d["args"]=convert_property_list(&mi.arguments); + Array da; + for(int i=0;i<mi.default_arguments.size();i++) + da.push_back(mi.default_arguments[i]); + d["default_args"]=da; + d["flags"]=mi.flags; + d["id"]=mi.id; + Dictionary r; + r["type"]=mi.return_val.type; + r["hint"]=mi.return_val.hint; + r["hint_string"]=mi.return_val.hint_string; + d["return_type"]=r; + return d; + +} + Array Object::_get_method_list_bind() const { List<MethodInfo> ml; @@ -1019,20 +1035,7 @@ Array Object::_get_method_list_bind() const { for(List<MethodInfo>::Element *E=ml.front();E;E=E->next()) { - Dictionary d; - d["name"]=E->get().name; - d["args"]=convert_property_list(&E->get().arguments); - Array da; - for(int i=0;i<E->get().default_arguments.size();i++) - da.push_back(E->get().default_arguments[i]); - d["default_args"]=da; - d["flags"]=E->get().flags; - d["id"]=E->get().id; - Dictionary r; - r["type"]=E->get().return_val.type; - r["hint"]=E->get().return_val.hint; - r["hint_string"]=E->get().return_val.hint_string; - d["return_type"]=r; + Dictionary d = _get_dict_from_method(E->get()); //va.push_back(d); ret.push_back(d); } @@ -1122,21 +1125,22 @@ Variant Object::_emit_signal(const Variant** p_args, int p_argcount, Variant::Ca StringName signal = *p_args[0]; - Variant v[VARIANT_ARG_MAX]; - - for(int i=0;i<MIN(5,p_argcount-1);i++) { + const Variant**args=NULL; - v[i]=*p_args[i+1]; + int argc=p_argcount-1; + if (argc) { + args=&p_args[1]; } - emit_signal(signal,v[0],v[1],v[2],v[3],v[4]); + emit_signal(signal,args,argc); + return Variant(); -} +} -void Object::emit_signal(const StringName& p_name,VARIANT_ARG_DECLARE) { +void Object::emit_signal(const StringName& p_name,const Variant** p_args,int p_argcount) { if (_block_signals) return; //no emit, signals blocked @@ -1159,10 +1163,12 @@ void Object::emit_signal(const StringName& p_name,VARIANT_ARG_DECLARE) { OBJ_DEBUG_LOCK + Vector<const Variant*> bind_mem; + + for(int i=0;i<ssize;i++) { const Connection &c = slot_map.getv(i).conn; - VARIANT_ARGPTRS Object *target; #ifdef DEBUG_ENABLED @@ -1173,21 +1179,37 @@ void Object::emit_signal(const StringName& p_name,VARIANT_ARG_DECLARE) { #endif - int bind_count=c.binds.size(); - int bind=0; + const Variant **args=p_args; + int argc=p_argcount; - for(int i=0;bind < bind_count && i<VARIANT_ARG_MAX;i++) { + if (c.binds.size()) { + //handle binds + bind_mem.resize(p_argcount+c.binds.size()); - if (argptr[i]->get_type()==Variant::NIL) { - argptr[i]=&c.binds[bind]; - bind++; + for(int j=0;j<p_argcount;j++) { + bind_mem[j]=p_args[j]; + } + for(int j=0;j<c.binds.size();j++) { + bind_mem[p_argcount+j]=&c.binds[j]; } + + args=bind_mem.ptr(); + argc=bind_mem.size(); } if (c.flags&CONNECT_DEFERRED) { - MessageQueue::get_singleton()->push_call(target->get_instance_ID(),c.method,VARIANT_ARGPTRS_PASS); + MessageQueue::get_singleton()->push_call(target->get_instance_ID(),c.method,args,argc,true); } else { - target->call( c.method, VARIANT_ARGPTRS_PASS ); + Variant::CallError ce; + target->call( c.method, args, argc,ce ); + if (ce.error!=Variant::CallError::CALL_OK) { + + if (ce.error==Variant::CallError::CALL_ERROR_INVALID_METHOD && !ObjectTypeDB::type_exists( target->get_type_name() ) ) { + //most likely object is not initialized yet, do not throw error. + } else { + ERR_PRINTS("Error calling method from signal '"+String(p_name)+"': "+Variant::get_call_error_text(target,c.method,args,argc,ce)); + } + } } if (c.flags&CONNECT_ONESHOT) { @@ -1200,57 +1222,29 @@ void Object::emit_signal(const StringName& p_name,VARIANT_ARG_DECLARE) { } -#if 0 - - //old (deprecated and dangerous code) - s->lock++; - for( Map<Signal::Target,Signal::Slot>::Element *E = s->slot_map.front();E;E=E->next() ) { - - const Signal::Target& t = E->key(); - const Signal::Slot& s = E->get(); - const Connection &c = s.cE->get(); - VARIANT_ARGPTRS + while (!disconnect_data.empty()) { - int bind_count=c.binds.size(); - int bind=0; + const _ObjectSignalDisconnectData &dd = disconnect_data.front()->get(); + disconnect(dd.signal,dd.target,dd.method); + disconnect_data.pop_front(); + } - for(int i=0;bind < bind_count && i<VARIANT_ARG_MAX;i++) { +} - if (argptr[i]->get_type()==Variant::NIL) { - argptr[i]=&c.binds[bind]; - bind++; - } - } +void Object::emit_signal(const StringName& p_name,VARIANT_ARG_DECLARE) { - if (c.flags&CONNECT_DEFERRED) { - MessageQueue::get_singleton()->push_call(t._id,t.method,VARIANT_ARGPTRS_PASS); - } else { - Object *obj = ObjectDB::get_instance(t._id); - ERR_CONTINUE(!obj); //yeah this should always be here - obj->call( t.method, VARIANT_ARGPTRS_PASS ); - } + VARIANT_ARGPTRS; - if (c.flags&CONNECT_ONESHOT) { - _ObjectSignalDisconnectData dd; - dd.signal=p_name; - dd.target=ObjectDB::get_instance(t._id); - dd.method=t.method; - disconnect_data.push_back(dd); - } + int argc=0; + for(int i=0;i<VARIANT_ARG_MAX;i++) { + if (argptr[i]->get_type()==Variant::NIL) + break; + argc++; } - - - s->lock--; -#endif - while (!disconnect_data.empty()) { - - const _ObjectSignalDisconnectData &dd = disconnect_data.front()->get(); - disconnect(dd.signal,dd.target,dd.method); - disconnect_data.pop_front(); - } + emit_signal(p_name,argptr,argc); } @@ -1299,11 +1293,39 @@ void Object::_emit_signal(const StringName& p_name,const Array& p_pargs){ #endif Array Object::_get_signal_list() const{ - return Array(); + List<MethodInfo> signal_list; + get_signal_list(&signal_list); + + Array ret; + for (List<MethodInfo>::Element *E=signal_list.front();E;E=E->next()) { + + ret.push_back(_get_dict_from_method(E->get())); + } + + return ret; } Array Object::_get_signal_connection_list(const String& p_signal) const{ - return Array(); + List<Connection> conns; + get_all_signal_connections(&conns); + + Array ret; + + for (List<Connection>::Element *E=conns.front();E;E=E->next()) { + + Connection &c=E->get(); + Dictionary rc; + rc["signal"]=c.signal; + rc["method"]=c.method; + rc["source"]=c.source; + rc["target"]=c.target; + rc["binds"]=c.binds; + rc["flags"]=c.flags; + ret.push_back(rc); + } + + return ret; + } @@ -1550,7 +1572,7 @@ void Object::_bind_methods() { ObjectTypeDB::bind_method(_MD("get","property"),&Object::_get_bind); ObjectTypeDB::bind_method(_MD("get_property_list"),&Object::_get_property_list_bind); ObjectTypeDB::bind_method(_MD("get_method_list"),&Object::_get_method_list_bind); - ObjectTypeDB::bind_method(_MD("notification","what"),&Object::notification,DEFVAL(false)); + ObjectTypeDB::bind_method(_MD("notification","what","reversed"),&Object::notification,DEFVAL(false)); ObjectTypeDB::bind_method(_MD("get_instance_ID"),&Object::get_instance_ID); ObjectTypeDB::bind_method(_MD("set_script","script:Script"),&Object::set_script); @@ -1615,9 +1637,10 @@ void Object::_bind_methods() { ObjectTypeDB::bind_method(_MD("callv:Variant","method","arg_array"),&Object::callv); - ObjectTypeDB::bind_method(_MD("has_method"),&Object::has_method); + ObjectTypeDB::bind_method(_MD("has_method","method"),&Object::has_method); ObjectTypeDB::bind_method(_MD("get_signal_list"),&Object::_get_signal_list); + ObjectTypeDB::bind_method(_MD("get_signal_connection_list","signal"),&Object::_get_signal_connection_list); ObjectTypeDB::bind_method(_MD("connect","signal","target:Object","method","binds","flags"),&Object::connect,DEFVAL(Array()),DEFVAL(0)); ObjectTypeDB::bind_method(_MD("disconnect","signal","target:Object","method"),&Object::disconnect); diff --git a/core/object.h b/core/object.h index 5b6361796f..dcebf9b2a2 100644 --- a/core/object.h +++ b/core/object.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -593,6 +593,7 @@ public: void add_user_signal(const MethodInfo& p_signal); void emit_signal(const StringName& p_name,VARIANT_ARG_LIST); + void emit_signal(const StringName& p_name, const Variant** p_args, int p_argcount); void get_signal_list(List<MethodInfo> *p_signals ) const; void get_signal_connection_list(const StringName& p_signal,List<Connection> *p_connections) const; void get_all_signal_connections(List<Connection> *p_connections) const; diff --git a/core/object_type_db.cpp b/core/object_type_db.cpp index f8ba0a9b15..dd9304f1f9 100644 --- a/core/object_type_db.cpp +++ b/core/object_type_db.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/object_type_db.h b/core/object_type_db.h index 319e3ec02c..f6caf14be5 100644 --- a/core/object_type_db.h +++ b/core/object_type_db.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/copymem.cpp b/core/os/copymem.cpp index 54baf1e232..234ca50b45 100644 --- a/core/os/copymem.cpp +++ b/core/os/copymem.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/copymem.h b/core/os/copymem.h index a5d640edbf..d7fc46aae4 100644 --- a/core/os/copymem.h +++ b/core/os/copymem.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index d0baae5872..32d66a7408 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/dir_access.h b/core/os/dir_access.h index 8bacc96c60..e97a065998 100644 --- a/core/os/dir_access.h +++ b/core/os/dir_access.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index ef7efd27e1..d82d0b63c5 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/file_access.h b/core/os/file_access.h index 8e34013796..51cf839117 100644 --- a/core/os/file_access.h +++ b/core/os/file_access.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -78,6 +78,7 @@ public: READ=1, WRITE=2, READ_WRITE=3, + WRITE_READ=7, }; virtual void close()=0; ///< close a file diff --git a/core/os/input.cpp b/core/os/input.cpp index 15872d02fd..6e1e618d9a 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -53,8 +53,12 @@ void Input::_bind_methods() { ObjectTypeDB::bind_method(_MD("is_mouse_button_pressed","button"),&Input::is_mouse_button_pressed); ObjectTypeDB::bind_method(_MD("is_joy_button_pressed","device","button"),&Input::is_joy_button_pressed); ObjectTypeDB::bind_method(_MD("is_action_pressed","action"),&Input::is_action_pressed); + ObjectTypeDB::bind_method(_MD("add_joy_mapping","mapping", "update_existing"),&Input::add_joy_mapping, DEFVAL(false)); + ObjectTypeDB::bind_method(_MD("remove_joy_mapping","guid"),&Input::remove_joy_mapping); + ObjectTypeDB::bind_method(_MD("is_joy_known","device"),&Input::is_joy_known); ObjectTypeDB::bind_method(_MD("get_joy_axis","device","axis"),&Input::get_joy_axis); ObjectTypeDB::bind_method(_MD("get_joy_name","device"),&Input::get_joy_name); + ObjectTypeDB::bind_method(_MD("get_joy_guid","device"),&Input::get_joy_guid); ObjectTypeDB::bind_method(_MD("get_accelerometer"),&Input::get_accelerometer); //ObjectTypeDB::bind_method(_MD("get_mouse_pos"),&Input::get_mouse_pos); - this is not the function you want ObjectTypeDB::bind_method(_MD("get_mouse_speed"),&Input::get_mouse_speed); @@ -62,8 +66,8 @@ void Input::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_mouse_mode","mode"),&Input::set_mouse_mode); ObjectTypeDB::bind_method(_MD("get_mouse_mode"),&Input::get_mouse_mode); ObjectTypeDB::bind_method(_MD("warp_mouse_pos","to"),&Input::warp_mouse_pos); - ObjectTypeDB::bind_method(_MD("action_press"),&Input::action_press); - ObjectTypeDB::bind_method(_MD("action_release"),&Input::action_release); + ObjectTypeDB::bind_method(_MD("action_press","action"),&Input::action_press); + ObjectTypeDB::bind_method(_MD("action_release","action"),&Input::action_release); ObjectTypeDB::bind_method(_MD("set_custom_mouse_cursor","image:Texture","hotspot"),&Input::set_custom_mouse_cursor,DEFVAL(Vector2())); BIND_CONSTANT( MOUSE_MODE_VISIBLE ); diff --git a/core/os/input.h b/core/os/input.h index d81ebf4ec3..2dd4496f26 100644 --- a/core/os/input.h +++ b/core/os/input.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -63,7 +63,10 @@ public: virtual float get_joy_axis(int p_device,int p_axis)=0; virtual String get_joy_name(int p_idx)=0; virtual void joy_connection_changed(int p_idx, bool p_connected, String p_name, String p_guid)=0; - + virtual void add_joy_mapping(String p_mapping, bool p_update_existing=false)=0; + virtual void remove_joy_mapping(String p_guid)=0; + virtual bool is_joy_known(int p_device)=0; + virtual String get_joy_guid(int p_device) const=0; virtual Point2 get_mouse_pos() const=0; virtual Point2 get_mouse_speed() const=0; diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index 2bd62927b0..2f39567a7e 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -156,6 +156,7 @@ bool InputEvent::is_pressed() const { case MOUSE_BUTTON: return mouse_button.pressed; case JOYSTICK_BUTTON: return joy_button.pressed; case SCREEN_TOUCH: return screen_touch.pressed; + case JOYSTICK_MOTION: return InputMap::get_singleton()->event_is_joy_motion_action_pressed(*this); case ACTION: return action.pressed; default: {} } diff --git a/core/os/input_event.h b/core/os/input_event.h index 4bb122ebc1..b601adc875 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -143,6 +143,9 @@ enum { JOY_ANALOG_2_X = JOY_AXIS_4, JOY_ANALOG_2_Y = JOY_AXIS_5, + + JOY_ANALOG_L2 = JOY_AXIS_6, + JOY_ANALOG_R2 = JOY_AXIS_7, }; diff --git a/core/os/keyboard.cpp b/core/os/keyboard.cpp index 10e64c3961..633aa06a9a 100644 --- a/core/os/keyboard.cpp +++ b/core/os/keyboard.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/keyboard.h b/core/os/keyboard.h index eaf656dd4d..69e74d1252 100644 --- a/core/os/keyboard.h +++ b/core/os/keyboard.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index c37c281fb9..310bbaa3b8 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/main_loop.h b/core/os/main_loop.h index c5d58120c5..059624dbe4 100644 --- a/core/os/main_loop.h +++ b/core/os/main_loop.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/memory.cpp b/core/os/memory.cpp index 1d9ac4e302..f7f8fef2b7 100644 --- a/core/os/memory.cpp +++ b/core/os/memory.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/memory.h b/core/os/memory.h index 0a35c93fdb..98b973bc06 100644 --- a/core/os/memory.h +++ b/core/os/memory.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/memory_pool_dynamic.cpp b/core/os/memory_pool_dynamic.cpp index d1c41aff84..6be8d0a36d 100644 --- a/core/os/memory_pool_dynamic.cpp +++ b/core/os/memory_pool_dynamic.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/memory_pool_dynamic.h b/core/os/memory_pool_dynamic.h index 00999ee24d..82149bcf5d 100644 --- a/core/os/memory_pool_dynamic.h +++ b/core/os/memory_pool_dynamic.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/memory_pool_dynamic_prealloc.cpp b/core/os/memory_pool_dynamic_prealloc.cpp index c7c25f32d1..f76c2a12b4 100644 --- a/core/os/memory_pool_dynamic_prealloc.cpp +++ b/core/os/memory_pool_dynamic_prealloc.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/memory_pool_dynamic_prealloc.h b/core/os/memory_pool_dynamic_prealloc.h index 3523079bac..d2256c0c98 100644 --- a/core/os/memory_pool_dynamic_prealloc.h +++ b/core/os/memory_pool_dynamic_prealloc.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/memory_pool_dynamic_static.cpp b/core/os/memory_pool_dynamic_static.cpp index 029ef450cd..894066708e 100644 --- a/core/os/memory_pool_dynamic_static.cpp +++ b/core/os/memory_pool_dynamic_static.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/memory_pool_dynamic_static.h b/core/os/memory_pool_dynamic_static.h index a870f3070c..6177c78de7 100644 --- a/core/os/memory_pool_dynamic_static.h +++ b/core/os/memory_pool_dynamic_static.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/memory_pool_static.cpp b/core/os/memory_pool_static.cpp index d3617eac73..321f4d989e 100644 --- a/core/os/memory_pool_static.cpp +++ b/core/os/memory_pool_static.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/memory_pool_static.h b/core/os/memory_pool_static.h index 40bd1aaf0e..2e11b7ded4 100644 --- a/core/os/memory_pool_static.h +++ b/core/os/memory_pool_static.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/mutex.cpp b/core/os/mutex.cpp index be984c080b..9b379009b9 100644 --- a/core/os/mutex.cpp +++ b/core/os/mutex.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/mutex.h b/core/os/mutex.h index ac6d36d635..f16375aa26 100644 --- a/core/os/mutex.h +++ b/core/os/mutex.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/os.cpp b/core/os/os.cpp index 8caf95e4d1..be447d511e 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -50,7 +50,7 @@ uint64_t OS::get_unix_time() const { return 0; }; -uint64_t OS::get_system_time_msec() const { +uint64_t OS::get_system_time_secs() const { return 0; } void OS::debug_break() { @@ -507,6 +507,13 @@ float OS::get_time_scale() const { return _time_scale; } +bool OS::is_joy_known(int p_device) { + return true; +} + +String OS::get_joy_guid(int p_device) const { + return "Default Joystick"; +} OS::OS() { last_error=NULL; diff --git a/core/os/os.h b/core/os/os.h index ab1a07276c..83ea2c2101 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -256,7 +256,7 @@ public: virtual Time get_time(bool local=false) const=0; virtual TimeZoneInfo get_time_zone_info() const=0; virtual uint64_t get_unix_time() const; - virtual uint64_t get_system_time_msec() const; + virtual uint64_t get_system_time_secs() const; virtual void delay_usec(uint32_t p_usec) const=0; virtual uint64_t get_ticks_usec() const=0; @@ -397,6 +397,9 @@ public: _FORCE_INLINE_ bool get_use_pixel_snap() const { return _pixel_snap; } + virtual bool is_joy_known(int p_device); + virtual String get_joy_guid(int p_device)const; + OS(); virtual ~OS(); diff --git a/core/os/pc_joystick_map.h b/core/os/pc_joystick_map.h index 111dc9b3a8..df123c5c1b 100644 --- a/core/os/pc_joystick_map.h +++ b/core/os/pc_joystick_map.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/semaphore.cpp b/core/os/semaphore.cpp index 8cb431d2cc..5fa2d339dc 100644 --- a/core/os/semaphore.cpp +++ b/core/os/semaphore.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/semaphore.h b/core/os/semaphore.h index e8ad9d3c3a..b65542ce35 100644 --- a/core/os/semaphore.h +++ b/core/os/semaphore.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/shell.cpp b/core/os/shell.cpp index 3746dc6804..8737d97fa0 100644 --- a/core/os/shell.cpp +++ b/core/os/shell.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/shell.h b/core/os/shell.h index 7ef5abbdef..805dd70301 100644 --- a/core/os/shell.h +++ b/core/os/shell.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/thread.cpp b/core/os/thread.cpp index 53db62c176..7fb1e969d4 100644 --- a/core/os/thread.cpp +++ b/core/os/thread.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/thread.h b/core/os/thread.h index e3d00b0397..5711561809 100644 --- a/core/os/thread.h +++ b/core/os/thread.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/thread_dummy.cpp b/core/os/thread_dummy.cpp index 4e139f6379..30a0e2696c 100644 --- a/core/os/thread_dummy.cpp +++ b/core/os/thread_dummy.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/thread_dummy.h b/core/os/thread_dummy.h index a83e42ff98..800eef9ef9 100644 --- a/core/os/thread_dummy.h +++ b/core/os/thread_dummy.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/thread_safe.cpp b/core/os/thread_safe.cpp index 9a20db6a9d..f252190504 100644 --- a/core/os/thread_safe.cpp +++ b/core/os/thread_safe.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/thread_safe.h b/core/os/thread_safe.h index 62d2181279..793dd88543 100644 --- a/core/os/thread_safe.h +++ b/core/os/thread_safe.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/packed_data_container.cpp b/core/packed_data_container.cpp index fa17e93aa8..dd736502a3 100644 --- a/core/packed_data_container.cpp +++ b/core/packed_data_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/packed_data_container.h b/core/packed_data_container.h index f4152bbb4d..9183dcb90e 100644 --- a/core/packed_data_container.h +++ b/core/packed_data_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/pair.cpp b/core/pair.cpp index 17076bb379..14bb2d7775 100644 --- a/core/pair.cpp +++ b/core/pair.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/pair.h b/core/pair.h index 83fc837fff..9bffc37f49 100644 --- a/core/pair.h +++ b/core/pair.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/path_db.cpp b/core/path_db.cpp index c6ea25d966..d3521fcb23 100644 --- a/core/path_db.cpp +++ b/core/path_db.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/path_db.h b/core/path_db.h index de84216006..9c9be65d28 100644 --- a/core/path_db.h +++ b/core/path_db.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/path_remap.cpp b/core/path_remap.cpp index 2ef39470a0..d4cb883f41 100644 --- a/core/path_remap.cpp +++ b/core/path_remap.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/path_remap.h b/core/path_remap.h index cb2a045668..66ebe7987b 100644 --- a/core/path_remap.h +++ b/core/path_remap.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp index d7dca45836..23be650fda 100644 --- a/core/pool_allocator.cpp +++ b/core/pool_allocator.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/pool_allocator.h b/core/pool_allocator.h index 4b0f931eb3..2c5920149b 100644 --- a/core/pool_allocator.h +++ b/core/pool_allocator.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/print_string.cpp b/core/print_string.cpp index 42e018f303..e364388b7b 100644 --- a/core/print_string.cpp +++ b/core/print_string.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -66,7 +66,7 @@ void remove_print_handler(PrintHandlerList *p_handler) { l=l->next; } - OS::get_singleton()->print("print hanlder list is %p\n",print_handler_list); + OS::get_singleton()->print("print handler list is %p\n",print_handler_list); ERR_FAIL_COND(l==NULL); _global_unlock(); diff --git a/core/print_string.h b/core/print_string.h index 4ea389b3a1..0aa5b4c8e9 100644 --- a/core/print_string.h +++ b/core/print_string.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/ref_ptr.cpp b/core/ref_ptr.cpp index ddb8054e3b..dee2b9a164 100644 --- a/core/ref_ptr.cpp +++ b/core/ref_ptr.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/ref_ptr.h b/core/ref_ptr.h index d1ee6a3a7d..68788b73cd 100644 --- a/core/ref_ptr.h +++ b/core/ref_ptr.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/reference.cpp b/core/reference.cpp index 509e132b5a..90bafd0a9c 100644 --- a/core/reference.cpp +++ b/core/reference.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/reference.h b/core/reference.h index 65f31f78f3..8bfbf19ab6 100644 --- a/core/reference.h +++ b/core/reference.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index 8754946bb1..d977ea3e18 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -101,10 +101,12 @@ void register_core_types() { resource_loader_binary = memnew( ResourceFormatLoaderBinary ); ResourceLoader::add_resource_format_loader(resource_loader_binary); +#ifdef XML_ENABLED resource_saver_xml = memnew( ResourceFormatSaverXML ); ResourceSaver::add_resource_format_saver(resource_saver_xml); resource_loader_xml = memnew( ResourceFormatLoaderXML ); ResourceLoader::add_resource_format_loader(resource_loader_xml); +#endif ObjectTypeDB::register_type<Object>(); diff --git a/core/register_core_types.h b/core/register_core_types.h index a84849c969..239d67f1ec 100644 --- a/core/register_core_types.h +++ b/core/register_core_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/res_ptr.cpp b/core/res_ptr.cpp index fcff285e8f..11312b8021 100644 --- a/core/res_ptr.cpp +++ b/core/res_ptr.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/res_ptr.h b/core/res_ptr.h index 21f7fb6a2c..e1dc66b290 100644 --- a/core/res_ptr.h +++ b/core/res_ptr.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/resource.cpp b/core/resource.cpp index 6967599f96..e0706cf541 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -278,7 +278,7 @@ void Resource::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_import_metadata","metadata"),&Resource::set_import_metadata); ObjectTypeDB::bind_method(_MD("get_import_metadata"),&Resource::get_import_metadata); - ObjectTypeDB::bind_method(_MD("duplicate"),&Resource::duplicate,DEFVAL(false)); + ObjectTypeDB::bind_method(_MD("duplicate","subresources"),&Resource::duplicate,DEFVAL(false)); ADD_SIGNAL( MethodInfo("changed") ); ADD_PROPERTY( PropertyInfo(Variant::STRING,"resource/path",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR ), _SCS("set_path"),_SCS("get_path")); ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"resource/name"), _SCS("set_name"),_SCS("get_name")); diff --git a/core/resource.h b/core/resource.h index cd28a51755..f0c86631cc 100644 --- a/core/resource.h +++ b/core/resource.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/rid.cpp b/core/rid.cpp index 0870e6ab2d..219c2f0e69 100644 --- a/core/rid.cpp +++ b/core/rid.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/rid.h b/core/rid.h index e6582757ee..85ae1b15d3 100644 --- a/core/rid.h +++ b/core/rid.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/ring_buffer.h b/core/ring_buffer.h index 5cbd261ec8..4658ec5e51 100644 --- a/core/ring_buffer.h +++ b/core/ring_buffer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/safe_refcount.cpp b/core/safe_refcount.cpp index afe2a4eb33..7718e466f2 100644 --- a/core/safe_refcount.cpp +++ b/core/safe_refcount.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/safe_refcount.h b/core/safe_refcount.h index 481b9fa7e9..e5dc854c23 100644 --- a/core/safe_refcount.h +++ b/core/safe_refcount.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/script_debugger_debugger.cpp b/core/script_debugger_debugger.cpp index 5c592a130c..71ad33f5ed 100644 --- a/core/script_debugger_debugger.cpp +++ b/core/script_debugger_debugger.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/script_debugger_local.cpp b/core/script_debugger_local.cpp index 649bbe89f0..3e442f7f59 100644 --- a/core/script_debugger_local.cpp +++ b/core/script_debugger_local.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/script_debugger_local.h b/core/script_debugger_local.h index 45ff1d4466..4abacfc519 100644 --- a/core/script_debugger_local.h +++ b/core/script_debugger_local.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index d72c9f7532..b56ff4c0e1 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,7 +30,7 @@ #include "os/os.h" #include "io/ip.h" #include "globals.h" - +#include "os/input.h" void ScriptDebuggerRemote::_send_video_memory() { List<ResourceUsage> usage; @@ -135,6 +135,10 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) { packet_peer_stream->put_var(p_can_continue); packet_peer_stream->put_var(p_script->debug_get_error()); + Input::MouseMode mouse_mode=Input::get_singleton()->get_mouse_mode(); + if (mouse_mode!=Input::MOUSE_MODE_VISIBLE) + Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); + while(true) { @@ -296,6 +300,9 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) { packet_peer_stream->put_var("debug_exit"); packet_peer_stream->put_var(0); + if (mouse_mode!=Input::MOUSE_MODE_VISIBLE) + Input::get_singleton()->set_mouse_mode(mouse_mode); + } diff --git a/core/script_debugger_remote.h b/core/script_debugger_remote.h index 973fa23212..f18e212236 100644 --- a/core/script_debugger_remote.h +++ b/core/script_debugger_remote.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/script_language.cpp b/core/script_language.cpp index b7a0f579f4..2ce3844ba3 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/script_language.h b/core/script_language.h index 9660f141c7..3138c88e8e 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -98,6 +98,7 @@ public: virtual bool has_script_signal(const StringName& p_signal) const=0; virtual void get_script_signal_list(List<MethodInfo> *r_signals) const=0; + virtual bool get_property_default_value(const StringName& p_property,Variant& r_value) const=0; virtual void update_exports() {} //editor tool @@ -165,6 +166,7 @@ public: virtual String make_function(const String& p_class,const String& p_name,const StringArray& p_args) const=0; virtual Error complete_code(const String& p_code, const String& p_base_path, Object*p_owner,List<String>* r_options,String& r_call_hint) { return ERR_UNAVAILABLE; } virtual void auto_indent_code(String& p_code,int p_from_line,int p_to_line) const=0; + virtual void add_global_constant(const StringName& p_variable,const Variant& p_value)=0; /* DEBUGGER FUNCTIONS */ diff --git a/core/self_list.h b/core/self_list.h index b414baaba6..bfdcfbfbc2 100644 --- a/core/self_list.h +++ b/core/self_list.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/set.h b/core/set.h index 91c4e3f9c4..808ffe5b36 100644 --- a/core/set.h +++ b/core/set.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/simple_type.h b/core/simple_type.h index 84e08bf0b4..1cc597146e 100644 --- a/core/simple_type.h +++ b/core/simple_type.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/sort.h b/core/sort.h index 65664d0ed8..bd61921c8a 100644 --- a/core/sort.h +++ b/core/sort.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/string_db.cpp b/core/string_db.cpp index b48d9f37d4..0e953cc326 100644 --- a/core/string_db.cpp +++ b/core/string_db.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/string_db.h b/core/string_db.h index 3b3249bf5e..f6c6ecefec 100644 --- a/core/string_db.h +++ b/core/string_db.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/translation.cpp b/core/translation.cpp index 8247cd1201..e4dad8d8de 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -626,7 +626,7 @@ bool TranslationServer::_load_translations(const String& p_from) { for(int i=0;i<tcount;i++) { - print_line( "Loading translation from " + r[i] ); + //print_line( "Loading translation from " + r[i] ); Ref<Translation> tr = ResourceLoader::load(r[i]); if (tr.is_valid()) add_translation(tr); @@ -670,10 +670,10 @@ void TranslationServer::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_locale","locale"),&TranslationServer::set_locale); ObjectTypeDB::bind_method(_MD("get_locale"),&TranslationServer::get_locale); - ObjectTypeDB::bind_method(_MD("translate"),&TranslationServer::translate); + ObjectTypeDB::bind_method(_MD("translate","message"),&TranslationServer::translate); - ObjectTypeDB::bind_method(_MD("add_translation"),&TranslationServer::add_translation); - ObjectTypeDB::bind_method(_MD("remove_translation"),&TranslationServer::remove_translation); + ObjectTypeDB::bind_method(_MD("add_translation","translation:Translation"),&TranslationServer::add_translation); + ObjectTypeDB::bind_method(_MD("remove_translation","translation:Translation"),&TranslationServer::remove_translation); ObjectTypeDB::bind_method(_MD("clear"),&TranslationServer::clear); diff --git a/core/translation.h b/core/translation.h index 54118cd3b5..5be6b8913a 100644 --- a/core/translation.h +++ b/core/translation.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/typedefs.h b/core/typedefs.h index 460b2e2110..1ca7a4f66d 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index ece9a02e24..ecbda1d3fd 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/undo_redo.h b/core/undo_redo.h index 141a413c2a..7f63ba9ed6 100644 --- a/core/undo_redo.h +++ b/core/undo_redo.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/ustring.cpp b/core/ustring.cpp index bf2494e9b5..ee750c39e5 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1636,12 +1636,16 @@ int64_t String::to_int64() const { return integer*sign; } -int String::to_int(const char* p_str) { +int String::to_int(const char* p_str,int p_len) { int to=0; - while(p_str[to]!=0 && p_str[to]!='.') - to++; + if (p_len>=0) + to=p_len; + else { + while(p_str[to]!=0 && p_str[to]!='.') + to++; + } int integer=0; @@ -3154,6 +3158,21 @@ String String::c_escape() const { return escaped; } +String String::json_escape() const { + + String escaped=*this; + escaped=escaped.replace("\\","\\\\"); + escaped=escaped.replace("\b","\\b"); + escaped=escaped.replace("\f","\\f"); + escaped=escaped.replace("\n","\\n"); + escaped=escaped.replace("\r","\\r"); + escaped=escaped.replace("\t","\\t"); + escaped=escaped.replace("\v","\\v"); + escaped=escaped.replace("\"","\\\""); + + return escaped; +} + String String::xml_escape(bool p_escape_quotes) const { String str=*this; diff --git a/core/ustring.h b/core/ustring.h index 2f3c4bff4d..9276afa0f7 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -144,7 +144,7 @@ public: int to_int() const; int64_t to_int64() const; - static int to_int(const char* p_str); + static int to_int(const char* p_str, int p_len=-1); static double to_double(const char* p_str); static double to_double(const CharType* p_str, const CharType **r_end=NULL); static int64_t to_int(const CharType* p_str,int p_len=-1); @@ -211,6 +211,7 @@ public: String http_unescape() const; String c_escape() const; String c_unescape() const; + String json_escape() const; String world_wrap(int p_chars_per_line) const; String percent_encode() const; diff --git a/core/variant.cpp b/core/variant.cpp index c6a55b10e6..3bd8d80528 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ #include "scene/gui/control.h" #include "io/marshalls.h" #include "core_string_names.h" - +#include "variant_parser.h" String Variant::get_type_name(Variant::Type p_type) { @@ -706,6 +706,17 @@ bool Variant::operator==(const Variant& p_variant) const { } +bool Variant::operator!=(const Variant& p_variant) const { + + if (type!=p_variant.type) //evaluation of operator== needs to be more strict + return true; + bool v; + Variant r; + evaluate(OP_NOT_EQUAL,*this,p_variant,r,v); + return r; + +} + bool Variant::operator<(const Variant& p_variant) const { if (type!=p_variant.type) //if types differ, then order by type first return type<p_variant.type; @@ -2973,132 +2984,40 @@ void Variant::construct_from_string(const String& p_string,Variant& r_value,Obje } -String Variant::get_construct_string(ObjectDeConstruct p_obj_deconstruct,void *p_deconstruct_ud) const { - - switch( type ) { - - case NIL: return "null"; - case BOOL: return _data._bool ? "true" : "false"; - case INT: return String::num(_data._int); - case REAL: return String::num(_data._real); - case STRING: return "\""+reinterpret_cast<const String*>(_data._mem)->c_escape()+"\""; - case VECTOR2: return "Vector2("+operator Vector2()+")"; - case RECT2: return "Rect2("+operator Rect2()+")"; - case MATRIX32: return "Matrix32("+operator Matrix32()+")"; - case VECTOR3: return "Vector3("+operator Vector3()+")"; - case PLANE: return "Plane("+operator Plane()+")"; - //case QUAT: - case _AABB: return "AABB("+operator AABB()+")"; - case QUAT: return "Quat("+operator Quat()+")"; - case MATRIX3: return "Matrix3("+operator Matrix3()+")"; - case TRANSFORM: return "Transform("+operator Transform()+")"; - case NODE_PATH: return "@\""+String(operator NodePath()).c_escape()+"\""; - case INPUT_EVENT: return "InputEvent()"; - case COLOR: return "Color("+String::num( operator Color().r)+","+String::num( operator Color().g)+","+String::num( operator Color().b)+","+String::num( operator Color().a)+")" ; - case DICTIONARY: { - - const Dictionary &d =*reinterpret_cast<const Dictionary*>(_data._mem); - //const String *K=NULL; - String str="{"; - List<Variant> keys; - d.get_key_list(&keys); - - Vector<_VariantStrPair> pairs; - - for(List<Variant>::Element *E=keys.front();E;E=E->next()) { - - _VariantStrPair sp; - sp.key=E->get().get_construct_string(p_obj_deconstruct,p_deconstruct_ud); - sp.value=d[E->get()].get_construct_string(p_obj_deconstruct,p_deconstruct_ud); - pairs.push_back(sp); - } +String Variant::get_construct_string() const { - pairs.sort(); + String vars; + VariantWriter::write_to_string(*this,vars); - for(int i=0;i<pairs.size();i++) { - if (i>0) - str+=", "; - str+="("+pairs[i].key+":"+pairs[i].value+")"; - } - str+="}"; + return vars; - return str; - } break; - case VECTOR3_ARRAY: { - - DVector<Vector3> vec = operator DVector<Vector3>(); - String str="Vector3Array(["; - for(int i=0;i<vec.size();i++) { - - if (i>0) - str+=", "; - str+=Variant( vec[i] ).get_construct_string(); - } - return str+"])"; - } break; - case STRING_ARRAY: { +} - DVector<String> vec = operator DVector<String>(); - String str="StringArray(["; - for(int i=0;i<vec.size();i++) { +String Variant::get_call_error_text(Object* p_base, const StringName& p_method,const Variant** p_argptrs,int p_argcount,const Variant::CallError &ce) { - if (i>0) - str+=", "; - str=str+=Variant( vec[i] ).get_construct_string(); - } - return str+"])"; - } break; - case INT_ARRAY: { - DVector<int> vec = operator DVector<int>(); - String str="IntArray(["; - for(int i=0;i<vec.size();i++) { + String err_text; - if (i>0) - str+=", "; - str=str+itos(vec[i]); - } - return str+"])"; - } break; - case REAL_ARRAY: { - - DVector<real_t> vec = operator DVector<real_t>(); - String str="FloatArray(["; - for(int i=0;i<vec.size();i++) { - - if (i>0) - str+=", "; - str=str+rtos(vec[i]); - } - return str+"])"; - } break; - case ARRAY: { - - Array arr = operator Array(); - String str="["; - for (int i=0; i<arr.size(); i++) { - if (i) - str+=", "; - str += arr[i].get_construct_string(p_obj_deconstruct,p_deconstruct_ud); - }; - return str+"]"; - - } break; - case OBJECT: { + if (ce.error==Variant::CallError::CALL_ERROR_INVALID_ARGUMENT) { + int errorarg=ce.argument; + err_text="Cannot convert argument "+itos(errorarg+1)+" from "+Variant::get_type_name(p_argptrs[errorarg]->get_type())+" to "+Variant::get_type_name(ce.expected)+"."; + } else if (ce.error==Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) { + err_text="Expected "+itos(ce.argument)+" arguments."; + } else if (ce.error==Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) { + err_text="Expected "+itos(ce.argument)+" arguments."; + } else if (ce.error==Variant::CallError::CALL_ERROR_INVALID_METHOD) { + err_text="Method not found."; + } else if (ce.error==Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL) { + err_text="Instance is null"; + } else if (ce.error==Variant::CallError::CALL_OK){ + return "Call OK"; + } - if (_get_obj().obj) { - if (p_obj_deconstruct) { - return "Object(\""+p_obj_deconstruct(Variant(*this),p_deconstruct_ud).c_escape()+")"; - } else { - return _get_obj().obj->get_type()+".new()"; - } - } else - return "null"; + String class_name = p_base->get_type(); + Ref<Script> script = p_base->get_script(); + if (script.is_valid() && script->get_path().is_resource_file()) { - } break; - default: { - return "["+get_type_name(type)+"]"; - } + class_name+="("+script->get_path().get_file()+")"; } - + return "'"+class_name+"::"+String(p_method)+"': "+err_text; } diff --git a/core/variant.h b/core/variant.h index e75a2b1c92..b58c781bdd 100644 --- a/core/variant.h +++ b/core/variant.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -390,6 +390,9 @@ public: Variant call(const StringName& p_method,const Variant** p_args,int p_argcount,CallError &r_error); Variant call(const StringName& p_method,const Variant& p_arg1=Variant(),const Variant& p_arg2=Variant(),const Variant& p_arg3=Variant(),const Variant& p_arg4=Variant(),const Variant& p_arg5=Variant()); + + static String get_call_error_text(Object* p_base, const StringName& p_method,const Variant** p_argptrs,int p_argcount,const Variant::CallError &ce); + static Variant construct(const Variant::Type,const Variant** p_args,int p_argcount,CallError &r_error,bool p_strict=true); void get_method_list(List<MethodInfo> *p_list) const; @@ -411,6 +414,7 @@ public: //argsVariant call() bool operator==(const Variant& p_variant) const; + bool operator!=(const Variant& p_variant) const; bool operator<(const Variant& p_variant) const; uint32_t hash() const; @@ -425,7 +429,7 @@ public: typedef String (*ObjectDeConstruct)(const Variant& p_object,void *ud); typedef void (*ObjectConstruct)(const String& p_text,void *ud,Variant& r_value); - String get_construct_string(ObjectDeConstruct p_obj_deconstruct=NULL,void *p_deconstruct_ud=NULL) const; + String get_construct_string() const; static void construct_from_string(const String& p_string,Variant& r_value,ObjectConstruct p_obj_construct=NULL,void *p_construct_ud=NULL); void operator=(const Variant& p_variant); // only this is enough for all the other types diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 2ac876c8f4..90f868c866 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -272,6 +272,9 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM0R(String,get_file); VCALL_LOCALMEM0R(String,xml_escape); VCALL_LOCALMEM0R(String,xml_unescape); + VCALL_LOCALMEM0R(String,c_escape); + VCALL_LOCALMEM0R(String,c_unescape); + VCALL_LOCALMEM0R(String,json_escape); VCALL_LOCALMEM0R(String,percent_encode); VCALL_LOCALMEM0R(String,percent_decode); VCALL_LOCALMEM0R(String,is_valid_identifier); @@ -1286,6 +1289,9 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(STRING,STRING,String,get_file,varray()); ADDFUNC0(STRING,STRING,String,xml_escape,varray()); ADDFUNC0(STRING,STRING,String,xml_unescape,varray()); + ADDFUNC0(STRING,STRING,String,c_escape,varray()); + ADDFUNC0(STRING,STRING,String,c_unescape,varray()); + ADDFUNC0(STRING,STRING,String,json_escape,varray()); ADDFUNC0(STRING,STRING,String,percent_encode,varray()); ADDFUNC0(STRING,STRING,String,percent_decode,varray()); ADDFUNC0(STRING,BOOL,String,is_valid_identifier,varray()); diff --git a/core/variant_call_bind.h b/core/variant_call_bind.h index 613669203d..54954540b0 100644 --- a/core/variant_call_bind.h +++ b/core/variant_call_bind.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/variant_op.cpp b/core/variant_op.cpp index e33b79e63c..204a00e1d5 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1003,7 +1003,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) return; } - *str = str->substr(0,idx-1)+chr+str->substr(idx+1,str->length()); + *str = str->substr(0,idx)+chr+str->substr(idx+1,str->length()); valid=true; return; @@ -1352,6 +1352,22 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) valid=true; v->set_hsv(v->get_h(),v->get_s(),p_value); return; + } else if (*str=="r8" ) { + valid=true; + v->g=float(p_value)/255.0; + return; + } else if (*str=="g8" ) { + valid=true; + v->g=float(p_value)/255.0; + return; + } else if (*str=="b8" ) { + valid=true; + v->b=float(p_value)/255.0; + return; + } else if (*str=="a8" ) {\ + valid=true; + v->a=float(p_value)/255.0; + return; } } else if (p_index.get_type()==Variant::INT) { @@ -2195,6 +2211,18 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { } else if (*str=="v" ) { valid=true; return v->get_v(); + } else if (*str=="r8") { + valid=true; + return v->r*255.0; + } else if (*str=="g8" ) { + valid=true; + return v->g*255.0; + } else if (*str=="b8" ) { + valid=true; + return v->b*255.0; + } else if (*str=="a8" ) { + valid=true; + return v->a*255.0; } } else if (p_index.get_type()==Variant::INT) { @@ -2866,6 +2894,10 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back( PropertyInfo(Variant::REAL,"h")); p_list->push_back( PropertyInfo(Variant::REAL,"s")); p_list->push_back( PropertyInfo(Variant::REAL,"v")); + p_list->push_back( PropertyInfo(Variant::INT,"r8")); + p_list->push_back( PropertyInfo(Variant::INT,"g8")); + p_list->push_back( PropertyInfo(Variant::INT,"b8")); + p_list->push_back( PropertyInfo(Variant::INT,"a8")); } break; case IMAGE: { } break; diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 239b129388..3efa87de80 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -19,6 +19,20 @@ bool VariantParser::StreamFile::is_eof() const { } +CharType VariantParser::StreamString::get_char() { + + if (pos>=s.length()) + return 0; + else + return s[pos++]; +} + +bool VariantParser::StreamString::is_utf8() const { + return false; +} +bool VariantParser::StreamString::is_eof() const { + return pos>s.length(); +} ///////////////////////////////////////////////////////////////////////////////////////////////// @@ -35,8 +49,10 @@ const char * VariantParser::tk_name[TK_MAX] = { "identifier", "string", "number", + "color", "':'", "','", + "'.'", "'='", "EOF", "ERROR" @@ -106,16 +122,58 @@ Error VariantParser::get_token(Stream *p_stream, Token& r_token, int &line, Stri r_token.type=TK_COLON; return OK; }; + case ';': { + + while(true) { + CharType ch=p_stream->get_char(); + if (p_stream->is_eof()) { + r_token.type=TK_EOF; + return OK; + } + if (ch=='\n') + break; + } + + break; + }; case ',': { r_token.type=TK_COMMA; return OK; }; + case '.': { + + r_token.type=TK_PERIOD; + return OK; + }; case '=': { r_token.type=TK_EQUAL; return OK; }; + case '#': { + + + String color_str="#"; + while(true) { + CharType ch=p_stream->get_char(); + if (p_stream->is_eof()) { + r_token.type=TK_EOF; + return OK; + } else if ( (ch>='0' && ch<='9') || (ch>='a' && ch<='f') || (ch>='A' && ch<='F') ) { + color_str+=String::chr(ch); + + } else { + p_stream->saved=ch; + break; + } + } + + r_token.value=Color::html(color_str); + r_token.type=TK_COLOR; + return OK; + + }; case '"': { @@ -336,6 +394,42 @@ Error VariantParser::get_token(Stream *p_stream, Token& r_token, int &line, Stri return ERR_PARSE_ERROR; } +Error VariantParser::_parse_enginecfg(Stream *p_stream, Vector<String>& strings, int &line, String &r_err_str) { + + Token token; + get_token(p_stream,token,line,r_err_str); + if (token.type!=TK_PARENTHESIS_OPEN) { + r_err_str="Expected '(' in old-style engine.cfg construct"; + return ERR_PARSE_ERROR; + } + + + String accum; + + while(true) { + + CharType c=p_stream->get_char(); + + if (p_stream->is_eof()) { + r_err_str="Unexpected EOF while parsing old-style engine.cfg construct"; + return ERR_PARSE_ERROR; + } + + if (c==',') { + strings.push_back(accum.strip_edges()); + accum=String(); + } else if (c==')') { + strings.push_back(accum.strip_edges()); + return OK; + } else if (c=='\n') { + line++; + } + + } + + return OK; +} + template<class T> Error VariantParser::_parse_construct(Stream *p_stream,Vector<T>& r_construct,int &line,String &r_err_str) { @@ -354,7 +448,7 @@ Error VariantParser::_parse_construct(Stream *p_stream,Vector<T>& r_construct,in if (!first) { get_token(p_stream,token,line,r_err_str); if (token.type==TK_COMMA) { - //do none + //do none } else if (token.type==TK_PARENTHESIS_CLOSE) { break; } else { @@ -364,7 +458,10 @@ Error VariantParser::_parse_construct(Stream *p_stream,Vector<T>& r_construct,in } } get_token(p_stream,token,line,r_err_str); - if (token.type!=TK_NUMBER) { + + if (first && token.type==TK_PARENTHESIS_CLOSE) { + break; + } else if (token.type!=TK_NUMBER) { r_err_str="Expected float in constructor"; return ERR_PARSE_ERROR; } @@ -984,8 +1081,24 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in ie.joy_motion.axis = token.value; get_token(p_stream,token,line,r_err_str); + + if (token.type!=TK_COMMA) { + r_err_str="Expected ',' after axis index"; + return ERR_PARSE_ERROR; + } + + get_token(p_stream,token,line,r_err_str); + if (token.type!=TK_NUMBER) { + r_err_str="Expected axis sign"; + return ERR_PARSE_ERROR; + } + + ie.joy_motion.axis_value = token.value; + + get_token(p_stream,token,line,r_err_str); + if (token.type!=TK_PARENTHESIS_CLOSE) { - r_err_str="Expected ')'"; + r_err_str="Expected ')' for jaxis"; return ERR_PARSE_ERROR; } @@ -1079,7 +1192,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in get_token(p_stream,token,line,r_err_str); if (token.type==TK_COMMA) { //do none - } else if (token.type!=TK_PARENTHESIS_CLOSE) { + } else if (token.type==TK_PARENTHESIS_CLOSE) { break; } else { r_err_str="Expected ',' or ')'"; @@ -1088,11 +1201,13 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in } } get_token(p_stream,token,line,r_err_str); + if (token.type!=TK_STRING) { - r_err_str="Expected string"; + r_err_str="Expected string"; return ERR_PARSE_ERROR; } + first=false; cs.push_back(token.value); } @@ -1174,6 +1289,112 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value=arr; return OK; + } else if (id=="key") { // compatibility with engine.cfg + + Vector<String> params; + Error err = _parse_enginecfg(p_stream,params,line,r_err_str); + if (err) + return err; + ERR_FAIL_COND_V(params.size()!=1 && params.size()!=2,ERR_PARSE_ERROR); + + int scode=0; + + if (params[0].is_numeric()) { + scode=params[0].to_int(); + if (scode < 10) { + scode=KEY_0+scode; + } + } else + scode=find_keycode(params[0]); + + InputEvent ie; + ie.type=InputEvent::KEY; + ie.key.scancode=scode; + + if (params.size()==2) { + String mods=params[1]; + if (mods.findn("C")!=-1) + ie.key.mod.control=true; + if (mods.findn("A")!=-1) + ie.key.mod.alt=true; + if (mods.findn("S")!=-1) + ie.key.mod.shift=true; + if (mods.findn("M")!=-1) + ie.key.mod.meta=true; + } + value=ie; + return OK; + + } else if (id=="mbutton") { // compatibility with engine.cfg + + Vector<String> params; + Error err = _parse_enginecfg(p_stream,params,line,r_err_str); + if (err) + return err; + ERR_FAIL_COND_V(params.size()!=2,ERR_PARSE_ERROR); + + InputEvent ie; + ie.type=InputEvent::MOUSE_BUTTON; + ie.device=params[0].to_int(); + ie.mouse_button.button_index=params[1].to_int(); + + value=ie; + return OK; + } else if (id=="jbutton") { // compatibility with engine.cfg + + Vector<String> params; + Error err = _parse_enginecfg(p_stream,params,line,r_err_str); + if (err) + return err; + ERR_FAIL_COND_V(params.size()!=2,ERR_PARSE_ERROR); + InputEvent ie; + ie.type=InputEvent::JOYSTICK_BUTTON; + ie.device=params[0].to_int(); + ie.joy_button.button_index=params[1].to_int(); + + value=ie; + + return OK; + } else if (id=="jaxis") { // compatibility with engine.cfg + + Vector<String> params; + Error err = _parse_enginecfg(p_stream,params,line,r_err_str); + if (err) + return err; + ERR_FAIL_COND_V(params.size()!=2,ERR_PARSE_ERROR); + + InputEvent ie; + ie.type=InputEvent::JOYSTICK_MOTION; + ie.device=params[0].to_int(); + int axis=params[1].to_int(); + ie.joy_motion.axis=axis>>1; + ie.joy_motion.axis_value=axis&1?1:-1; + + value= ie; + + return OK; + } else if (id=="img") { // compatibility with engine.cfg + + Token token; + get_token(p_stream,token,line,r_err_str); + if (token.type!=TK_PARENTHESIS_OPEN) { + r_err_str="Expected '(' in old-style engine.cfg construct"; + return ERR_PARSE_ERROR; + } + + while(true) { + CharType c = p_stream->get_char(); + if (p_stream->is_eof()) { + r_err_str="Unexpected EOF in old style engine.cfg img()"; + return ERR_PARSE_ERROR; + } + if (c==')') + break; + } + + value=Image(); + + return OK; } else { r_err_str="Unexpected identifier: '"+id+"'."; @@ -1225,6 +1446,10 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value=token.value; return OK; + } else if (token.type==TK_COLOR) { + + value=token.value; + return OK; } else { r_err_str="Expected value, got "+String(tk_name[token.type])+"."; return ERR_PARSE_ERROR; @@ -1360,7 +1585,7 @@ Error VariantParser::_parse_dictionary(Dictionary &object, Stream *p_stream, int } -Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, ResourceParser *p_res_parser) { +Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, ResourceParser *p_res_parser,bool p_simple_tag) { r_tag.fields.clear(); @@ -1370,6 +1595,29 @@ Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, Strin } + if (p_simple_tag) { + + r_tag.name=""; + r_tag.fields.clear(); + + while(true) { + + CharType c = p_stream->get_char(); + if (p_stream->is_eof()) { + r_err_str="Unexpected EOF while parsing simple tag"; + return ERR_PARSE_ERROR; + } + if (c==']') + break; + r_tag.name+=String::chr(c); + } + + r_tag.name = r_tag.name.strip_edges(); + + return OK; + + } + get_token(p_stream,token,line,r_err_str); @@ -1379,6 +1627,7 @@ Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, Strin } r_tag.name=token.value; + bool parsing_tag=true; while(true) { @@ -1391,6 +1640,16 @@ Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, Strin if (token.type==TK_BRACKET_CLOSE) break; + if (parsing_tag && token.type==TK_PERIOD) { + r_tag.name+="."; //support tags such as [someprop.Anroid] for specific platforms + get_token(p_stream,token,line,r_err_str); + } else if (parsing_tag && token.type==TK_COLON) { + r_tag.name+=":"; //support tags such as [someprop.Anroid] for specific platforms + get_token(p_stream,token,line,r_err_str); + } else { + parsing_tag=false; + } + if (token.type!=TK_IDENTIFIER) { r_err_str="Expected Identifier"; return ERR_PARSE_ERROR; @@ -1398,10 +1657,13 @@ Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, Strin String id=token.value; + if (parsing_tag) { + r_tag.name+=id; + continue; + } get_token(p_stream,token,line,r_err_str); if (token.type!=TK_EQUAL) { - r_err_str="Expected '='"; return ERR_PARSE_ERROR; } @@ -1420,7 +1682,7 @@ Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, Strin } -Error VariantParser::parse_tag(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, ResourceParser *p_res_parser) { +Error VariantParser::parse_tag(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, ResourceParser *p_res_parser, bool p_simple_tag) { Token token; get_token(p_stream,token,line,r_err_str); @@ -1434,14 +1696,15 @@ Error VariantParser::parse_tag(Stream *p_stream, int &line, String &r_err_str, T return ERR_PARSE_ERROR; } - return _parse_tag(token,p_stream,line,r_err_str,r_tag,p_res_parser); + return _parse_tag(token,p_stream,line,r_err_str,r_tag,p_res_parser,p_simple_tag); } -Error VariantParser::parse_tag_assign_eof(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, String &r_assign, Variant &r_value, ResourceParser *p_res_parser) { +Error VariantParser::parse_tag_assign_eof(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, String &r_assign, Variant &r_value, ResourceParser *p_res_parser, bool p_simple_tag) { //assign.. + r_assign=""; String what; while(true) { @@ -1459,11 +1722,23 @@ Error VariantParser::parse_tag_assign_eof(Stream *p_stream, int &line, String &r if (p_stream->is_eof()) return ERR_FILE_EOF; + if (c==';') { //comment + while(true) { + CharType ch=p_stream->get_char(); + if (p_stream->is_eof()) { + return ERR_FILE_EOF; + } + if (ch=='\n') + break; + } + continue; + } + if (c=='[' && what.length()==0) { //it's a tag! p_stream->saved='['; //go back one - Error err = parse_tag(p_stream,line,r_err_str,r_tag,p_res_parser); + Error err = parse_tag(p_stream,line,r_err_str,r_tag,p_res_parser,p_simple_tag); return err; } @@ -1506,3 +1781,431 @@ Error VariantParser::parse(Stream *p_stream, Variant& r_ret, String &r_err_str, } + +////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_string_func, void *p_store_string_ud,EncodeResourceFunc p_encode_res_func,void* p_encode_res_ud) { + + switch( p_variant.get_type() ) { + + case Variant::NIL: { + p_store_string_func(p_store_string_ud,"null"); + } break; + case Variant::BOOL: { + + p_store_string_func(p_store_string_ud,p_variant.operator bool() ? "true":"false" ); + } break; + case Variant::INT: { + + p_store_string_func(p_store_string_ud, itos(p_variant.operator int()) ); + } break; + case Variant::REAL: { + + String s = rtoss(p_variant.operator real_t()); + if (s.find(".")==-1 && s.find("e")==-1) + s+=".0"; + p_store_string_func(p_store_string_ud, s ); + } break; + case Variant::STRING: { + + String str=p_variant; + + str="\""+str.c_escape()+"\""; + p_store_string_func(p_store_string_ud, str ); + } break; + case Variant::VECTOR2: { + + Vector2 v = p_variant; + p_store_string_func(p_store_string_ud,"Vector2( "+rtoss(v.x) +", "+rtoss(v.y)+" )" ); + } break; + case Variant::RECT2: { + + Rect2 aabb = p_variant; + p_store_string_func(p_store_string_ud,"Rect2( "+rtoss(aabb.pos.x) +", "+rtoss(aabb.pos.y) +", "+rtoss(aabb.size.x) +", "+rtoss(aabb.size.y)+" )" ); + + } break; + case Variant::VECTOR3: { + + Vector3 v = p_variant; + p_store_string_func(p_store_string_ud,"Vector3( "+rtoss(v.x) +", "+rtoss(v.y)+", "+rtoss(v.z)+" )"); + } break; + case Variant::PLANE: { + + Plane p = p_variant; + p_store_string_func(p_store_string_ud,"Plane( "+rtoss(p.normal.x) +", "+rtoss(p.normal.y)+", "+rtoss(p.normal.z)+", "+rtoss(p.d)+" )" ); + + } break; + case Variant::_AABB: { + + AABB aabb = p_variant; + p_store_string_func(p_store_string_ud,"AABB( "+rtoss(aabb.pos.x) +", "+rtoss(aabb.pos.y) +", "+rtoss(aabb.pos.z) +", "+rtoss(aabb.size.x) +", "+rtoss(aabb.size.y) +", "+rtoss(aabb.size.z)+" )" ); + + } break; + case Variant::QUAT: { + + Quat quat = p_variant; + p_store_string_func(p_store_string_ud,"Quat( "+rtoss(quat.x)+", "+rtoss(quat.y)+", "+rtoss(quat.z)+", "+rtoss(quat.w)+" )"); + + } break; + case Variant::MATRIX32: { + + String s="Matrix32( "; + Matrix32 m3 = p_variant; + for (int i=0;i<3;i++) { + for (int j=0;j<2;j++) { + + if (i!=0 || j!=0) + s+=", "; + s+=rtoss( m3.elements[i][j] ); + } + } + + p_store_string_func(p_store_string_ud,s+" )"); + + } break; + case Variant::MATRIX3: { + + String s="Matrix3( "; + Matrix3 m3 = p_variant; + for (int i=0;i<3;i++) { + for (int j=0;j<3;j++) { + + if (i!=0 || j!=0) + s+=", "; + s+=rtoss( m3.elements[i][j] ); + } + } + + p_store_string_func(p_store_string_ud,s+" )"); + + } break; + case Variant::TRANSFORM: { + + String s="Transform( "; + Transform t = p_variant; + Matrix3 &m3 = t.basis; + for (int i=0;i<3;i++) { + for (int j=0;j<3;j++) { + + if (i!=0 || j!=0) + s+=", "; + s+=rtoss( m3.elements[i][j] ); + } + } + + s=s+", "+rtoss(t.origin.x) +", "+rtoss(t.origin.y)+", "+rtoss(t.origin.z); + + p_store_string_func(p_store_string_ud,s+" )"); + } break; + + // misc types + case Variant::COLOR: { + + Color c = p_variant; + p_store_string_func(p_store_string_ud,"Color( "+rtoss(c.r) +", "+rtoss(c.g)+", "+rtoss(c.b)+", "+rtoss(c.a)+" )"); + + } break; + case Variant::IMAGE: { + + + Image img=p_variant; + + if (img.empty()) { + p_store_string_func(p_store_string_ud,"Image()"); + break; + } + + String imgstr="Image( "; + imgstr+=itos(img.get_width()); + imgstr+=", "+itos(img.get_height()); + imgstr+=", "+itos(img.get_mipmaps()); + imgstr+=", "; + + switch(img.get_format()) { + + case Image::FORMAT_GRAYSCALE: imgstr+="GRAYSCALE"; break; + case Image::FORMAT_INTENSITY: imgstr+="INTENSITY"; break; + case Image::FORMAT_GRAYSCALE_ALPHA: imgstr+="GRAYSCALE_ALPHA"; break; + case Image::FORMAT_RGB: imgstr+="RGB"; break; + case Image::FORMAT_RGBA: imgstr+="RGBA"; break; + case Image::FORMAT_INDEXED : imgstr+="INDEXED"; break; + case Image::FORMAT_INDEXED_ALPHA: imgstr+="INDEXED_ALPHA"; break; + case Image::FORMAT_BC1: imgstr+="BC1"; break; + case Image::FORMAT_BC2: imgstr+="BC2"; break; + case Image::FORMAT_BC3: imgstr+="BC3"; break; + case Image::FORMAT_BC4: imgstr+="BC4"; break; + case Image::FORMAT_BC5: imgstr+="BC5"; break; + case Image::FORMAT_PVRTC2: imgstr+="PVRTC2"; break; + case Image::FORMAT_PVRTC2_ALPHA: imgstr+="PVRTC2_ALPHA"; break; + case Image::FORMAT_PVRTC4: imgstr+="PVRTC4"; break; + case Image::FORMAT_PVRTC4_ALPHA: imgstr+="PVRTC4_ALPHA"; break; + case Image::FORMAT_ETC: imgstr+="ETC"; break; + case Image::FORMAT_ATC: imgstr+="ATC"; break; + case Image::FORMAT_ATC_ALPHA_EXPLICIT: imgstr+="ATC_ALPHA_EXPLICIT"; break; + case Image::FORMAT_ATC_ALPHA_INTERPOLATED: imgstr+="ATC_ALPHA_INTERPOLATED"; break; + case Image::FORMAT_CUSTOM: imgstr+="CUSTOM"; break; + default: {} + } + + + String s; + + DVector<uint8_t> data = img.get_data(); + int len = data.size(); + DVector<uint8_t>::Read r = data.read(); + const uint8_t *ptr=r.ptr();; + for (int i=0;i<len;i++) { + + if (i>0) + s+=", "; + s+=itos(ptr[i]); + } + + imgstr+=", "; + p_store_string_func(p_store_string_ud,imgstr); + p_store_string_func(p_store_string_ud,s); + p_store_string_func(p_store_string_ud," )"); + } break; + case Variant::NODE_PATH: { + + String str=p_variant; + + str="NodePath(\""+str.c_escape()+"\")"; + p_store_string_func(p_store_string_ud,str); + + } break; + + case Variant::OBJECT: { + + RES res = p_variant; + if (res.is_null()) { + p_store_string_func(p_store_string_ud,"null"); + break; // don't save it + } + + String res_text; + + if (p_encode_res_func) { + + res_text=p_encode_res_func(p_encode_res_ud,res); + } + + if (res_text==String() && res->get_path().is_resource_file()) { + + //external resource + String path=res->get_path(); + res_text="Resource( \""+path+"\")"; + } + + if (res_text==String()) + res_text="null"; + + p_store_string_func(p_store_string_ud,res_text); + + } break; + case Variant::INPUT_EVENT: { + + p_store_string_func(p_store_string_ud,"InputEvent()"); //will be added later + } break; + case Variant::DICTIONARY: { + + Dictionary dict = p_variant; + + List<Variant> keys; + dict.get_key_list(&keys); + keys.sort(); + + p_store_string_func(p_store_string_ud,"{ "); + for(List<Variant>::Element *E=keys.front();E;E=E->next()) { + + //if (!_check_type(dict[E->get()])) + // continue; + write(E->get(),p_store_string_func,p_store_string_ud,p_encode_res_func,p_encode_res_ud); + p_store_string_func(p_store_string_ud,":"); + write(dict[E->get()],p_store_string_func,p_store_string_ud,p_encode_res_func,p_encode_res_ud); + if (E->next()) + p_store_string_func(p_store_string_ud,", "); + } + + + p_store_string_func(p_store_string_ud," }"); + + + } break; + case Variant::ARRAY: { + + p_store_string_func(p_store_string_ud,"[ "); + Array array = p_variant; + int len=array.size(); + for (int i=0;i<len;i++) { + + if (i>0) + p_store_string_func(p_store_string_ud,", "); + write(array[i],p_store_string_func,p_store_string_ud,p_encode_res_func,p_encode_res_ud); + + } + p_store_string_func(p_store_string_ud," ]"); + + } break; + + case Variant::RAW_ARRAY: { + + p_store_string_func(p_store_string_ud,"ByteArray( "); + String s; + DVector<uint8_t> data = p_variant; + int len = data.size(); + DVector<uint8_t>::Read r = data.read(); + const uint8_t *ptr=r.ptr();; + for (int i=0;i<len;i++) { + + if (i>0) + p_store_string_func(p_store_string_ud,", "); + + p_store_string_func(p_store_string_ud,itos(ptr[i])); + + } + + p_store_string_func(p_store_string_ud," )"); + + } break; + case Variant::INT_ARRAY: { + + p_store_string_func(p_store_string_ud,"IntArray( "); + DVector<int> data = p_variant; + int len = data.size(); + DVector<int>::Read r = data.read(); + const int *ptr=r.ptr();; + + for (int i=0;i<len;i++) { + + if (i>0) + p_store_string_func(p_store_string_ud,", "); + + p_store_string_func(p_store_string_ud,itos(ptr[i])); + } + + + p_store_string_func(p_store_string_ud," )"); + + } break; + case Variant::REAL_ARRAY: { + + p_store_string_func(p_store_string_ud,"FloatArray( "); + DVector<real_t> data = p_variant; + int len = data.size(); + DVector<real_t>::Read r = data.read(); + const real_t *ptr=r.ptr();; + + for (int i=0;i<len;i++) { + + if (i>0) + p_store_string_func(p_store_string_ud,", "); + p_store_string_func(p_store_string_ud,rtoss(ptr[i])); + } + + p_store_string_func(p_store_string_ud," )"); + + } break; + case Variant::STRING_ARRAY: { + + p_store_string_func(p_store_string_ud,"StringArray( "); + DVector<String> data = p_variant; + int len = data.size(); + DVector<String>::Read r = data.read(); + const String *ptr=r.ptr();; + String s; + //write_string("\n"); + + + + for (int i=0;i<len;i++) { + + if (i>0) + p_store_string_func(p_store_string_ud,", "); + String str=ptr[i]; + p_store_string_func(p_store_string_ud,"\""+str.c_escape()+"\""); + } + + p_store_string_func(p_store_string_ud," )"); + + } break; + case Variant::VECTOR2_ARRAY: { + + p_store_string_func(p_store_string_ud,"Vector2Array( "); + DVector<Vector2> data = p_variant; + int len = data.size(); + DVector<Vector2>::Read r = data.read(); + const Vector2 *ptr=r.ptr();; + + for (int i=0;i<len;i++) { + + if (i>0) + p_store_string_func(p_store_string_ud,", "); + p_store_string_func(p_store_string_ud,rtoss(ptr[i].x)+", "+rtoss(ptr[i].y) ); + } + + p_store_string_func(p_store_string_ud," )"); + + } break; + case Variant::VECTOR3_ARRAY: { + + p_store_string_func(p_store_string_ud,"Vector3Array( "); + DVector<Vector3> data = p_variant; + int len = data.size(); + DVector<Vector3>::Read r = data.read(); + const Vector3 *ptr=r.ptr();; + + for (int i=0;i<len;i++) { + + if (i>0) + p_store_string_func(p_store_string_ud,", "); + p_store_string_func(p_store_string_ud,rtoss(ptr[i].x)+", "+rtoss(ptr[i].y)+", "+rtoss(ptr[i].z) ); + } + + p_store_string_func(p_store_string_ud," )"); + + } break; + case Variant::COLOR_ARRAY: { + + p_store_string_func(p_store_string_ud,"ColorArray( "); + + DVector<Color> data = p_variant; + int len = data.size(); + DVector<Color>::Read r = data.read(); + const Color *ptr=r.ptr();; + + for (int i=0;i<len;i++) { + + if (i>0) + p_store_string_func(p_store_string_ud,", "); + + p_store_string_func(p_store_string_ud,rtoss(ptr[i].r)+", "+rtoss(ptr[i].g)+", "+rtoss(ptr[i].b)+", "+rtoss(ptr[i].a) ); + + } + p_store_string_func(p_store_string_ud," )"); + + } break; + default: {} + + } + + return OK; +} + +static Error _write_to_str(void *ud,const String& p_string) { + + String *str=(String*)ud; + (*str)+=p_string; + return OK; +} + +Error VariantWriter::write_to_string(const Variant& p_variant, String& r_string, EncodeResourceFunc p_encode_res_func, void *p_encode_res_ud) { + + r_string=String(); + + return write(p_variant,_write_to_str,&r_string,p_encode_res_func,p_encode_res_ud); + +} diff --git a/core/variant_parser.h b/core/variant_parser.h index e1d25f7512..00f6910b29 100644 --- a/core/variant_parser.h +++ b/core/variant_parser.h @@ -32,6 +32,19 @@ public: }; + struct StreamString : public Stream { + + String s; + int pos; + + virtual CharType get_char(); + virtual bool is_utf8() const; + virtual bool is_eof() const; + + StreamString() { pos=0; } + + }; + typedef Error (*ParseResourceFunc)(void* p_self, Stream* p_stream,Ref<Resource>& r_res,int &line,String &r_err_str); struct ResourceParser { @@ -53,8 +66,10 @@ public: TK_IDENTIFIER, TK_STRING, TK_NUMBER, + TK_COLOR, TK_COLON, TK_COMMA, + TK_PERIOD, TK_EQUAL, TK_EOF, TK_ERROR, @@ -86,18 +101,39 @@ private: template<class T> static Error _parse_construct(Stream *p_stream, Vector<T>& r_construct, int &line, String &r_err_str); + static Error _parse_enginecfg(Stream *p_stream, Vector<String>& strings, int &line, String &r_err_str); static Error _parse_dictionary(Dictionary &object, Stream *p_stream, int &line, String &r_err_str,ResourceParser *p_res_parser=NULL); static Error _parse_array(Array &array, Stream *p_stream, int &line, String &r_err_str,ResourceParser *p_res_parser=NULL); - static Error _parse_tag(Token& token,Stream *p_stream, int &line, String &r_err_str,Tag& r_tag,ResourceParser *p_res_parser=NULL); + static Error _parse_tag(Token& token,Stream *p_stream, int &line, String &r_err_str,Tag& r_tag,ResourceParser *p_res_parser=NULL,bool p_simple_tag=false); public: - static Error parse_tag(Stream *p_stream, int &line, String &r_err_str,Tag& r_tag,ResourceParser *p_res_parser=NULL); - static Error parse_tag_assign_eof(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, String &r_assign, Variant &r_value,ResourceParser *p_res_parser=NULL); + static Error parse_tag(Stream *p_stream, int &line, String &r_err_str,Tag& r_tag,ResourceParser *p_res_parser=NULL,bool p_simple_tag=false); + static Error parse_tag_assign_eof(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, String &r_assign, Variant &r_value,ResourceParser *p_res_parser=NULL,bool p_simple_tag=false); static Error parse_value(Token& token,Variant &value, Stream *p_stream, int &line, String &r_err_str,ResourceParser *p_res_parser=NULL); static Error get_token(Stream *p_stream,Token& r_token,int &line,String &r_err_str); static Error parse(Stream *p_stream, Variant &r_ret, String &r_err_str, int &r_err_line,ResourceParser *p_res_parser=NULL); }; + + + +class VariantWriter { +public: + + typedef Error (*StoreStringFunc)(void *ud,const String& p_string); + typedef String (*EncodeResourceFunc)(void *ud,const RES& p_resource); + + static Error write(const Variant& p_variant, StoreStringFunc p_store_string_func, void *p_store_string_ud,EncodeResourceFunc p_encode_res_func,void* p_encode_res_ud); + static Error write_to_string(const Variant& p_variant, String& r_string, EncodeResourceFunc p_encode_res_func=NULL,void* p_encode_res_ud=NULL); + + +}; + + + + + + #endif // VARIANT_PARSER_H diff --git a/core/vector.h b/core/vector.h index 78dff5eadb..641721f401 100644 --- a/core/vector.h +++ b/core/vector.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/vmap.cpp b/core/vmap.cpp index 32481eb9eb..e94198257a 100644 --- a/core/vmap.cpp +++ b/core/vmap.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/vmap.h b/core/vmap.h index 5ff8f73978..6880abf260 100644 --- a/core/vmap.h +++ b/core/vmap.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/vset.cpp b/core/vset.cpp index c849bf3367..cefafeb073 100644 --- a/core/vset.cpp +++ b/core/vset.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/vset.h b/core/vset.h index e1e02ab435..cafcb0bb2f 100644 --- a/core/vset.h +++ b/core/vset.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/demos/3d/platformer/engine.cfg b/demos/3d/platformer/engine.cfg index 84cac52c97..84a7e8f597 100644 --- a/demos/3d/platformer/engine.cfg +++ b/demos/3d/platformer/engine.cfg @@ -6,7 +6,7 @@ icon="res://icon.png" [display] -height=450 +height=720 stretch_2d=true [input] diff --git a/demos/3d/platformer/player.scn b/demos/3d/platformer/player.scn Binary files differindex 854a8397e4..3b24da94ec 100644 --- a/demos/3d/platformer/player.scn +++ b/demos/3d/platformer/player.scn diff --git a/demos/misc/joysticks/diagram.png b/demos/misc/joysticks/diagram.png Binary files differnew file mode 100644 index 0000000000..3f8ba1f973 --- /dev/null +++ b/demos/misc/joysticks/diagram.png diff --git a/demos/misc/joysticks/engine.cfg b/demos/misc/joysticks/engine.cfg index 71ac91000e..79cda1eeb4 100644 --- a/demos/misc/joysticks/engine.cfg +++ b/demos/misc/joysticks/engine.cfg @@ -6,5 +6,5 @@ icon="res://icon.png" [display] -width=260 +width=550 height=300 diff --git a/demos/misc/joysticks/indicators.png b/demos/misc/joysticks/indicators.png Binary files differnew file mode 100644 index 0000000000..90fee48498 --- /dev/null +++ b/demos/misc/joysticks/indicators.png diff --git a/demos/misc/joysticks/joysticks.gd b/demos/misc/joysticks/joysticks.gd index 7add88573d..f5bc1bddad 100644 --- a/demos/misc/joysticks/joysticks.gd +++ b/demos/misc/joysticks/joysticks.gd @@ -14,8 +14,9 @@ var cur_joy var axis_value var btn_state +const DEADZONE = 0.2 -func _input(event): +func _fixed_process(delta): # Get the joystick device number from the spinbox joy_num = get_node("joy_num").get_value() @@ -29,15 +30,24 @@ func _input(event): axis_value = Input.get_joy_axis(joy_num, axis) get_node("axis_prog" + str(axis)).set_value(100*axis_value) get_node("axis_val" + str(axis)).set_text(str(axis_value)) + if (axis < 4): + if (abs(axis_value) < DEADZONE): + get_node("diagram/axes/" + str(axis) + "+").hide() + get_node("diagram/axes/" + str(axis) + "-").hide() + elif (axis_value > 0): + get_node("diagram/axes/" + str(axis) + "+").show() + else: + get_node("diagram/axes/" + str(axis) + "-").show() # Loop through the buttons and highlight the ones that are pressed - for btn in range(0, 17): + for btn in range(0, 16): btn_state = 1 if (Input.is_joy_button_pressed(joy_num, btn)): get_node("btn" + str(btn)).add_color_override("font_color", Color(1, 1, 1, 1)) + get_node("diagram/buttons/" + str(btn)).show() else: get_node("btn" + str(btn)).add_color_override("font_color", Color(0.2, 0.1, 0.3, 1)) - + get_node("diagram/buttons/" + str(btn)).hide() func _ready(): - set_process_input(true) + set_fixed_process(true) diff --git a/demos/misc/joysticks/joysticks.scn b/demos/misc/joysticks/joysticks.scn Binary files differindex b78bccbf33..3e0f326a0d 100644 --- a/demos/misc/joysticks/joysticks.scn +++ b/demos/misc/joysticks/joysticks.scn diff --git a/demos/misc/joysticks/jsdiagram.xscn b/demos/misc/joysticks/jsdiagram.xscn new file mode 100644 index 0000000000..537ad30278 --- /dev/null +++ b/demos/misc/joysticks/jsdiagram.xscn @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<resource_file type="PackedScene" subresource_count="3" version="2.0" version_name="Godot Engine v2.0.alpha.custom_build"> + <ext_resource path="res://indicators.png" type="Texture" index="1"></ext_resource> + <ext_resource path="res://diagram.png" type="Texture" index="0"></ext_resource> + <main_resource> + <dictionary name="_bundled" shared="false"> + <string> "conn_count" </string> + <int> 0 </int> + <string> "conns" </string> + <int_array len="0"> </int_array> + <string> "editable_instances" </string> + <array len="0" shared="false"> + </array> + <string> "names" </string> + <string_array len="37"> + <string> "diagram" </string> + <string> "transform/pos" </string> + <string> "transform/scale" </string> + <string> "texture" </string> + <string> "__meta__" </string> + <string> "Sprite" </string> + <string> "buttons" </string> + <string> "Node2D" </string> + <string> "0" </string> + <string> "region" </string> + <string> "region_rect" </string> + <string> "1" </string> + <string> "2" </string> + <string> "3" </string> + <string> "4" </string> + <string> "5" </string> + <string> "6" </string> + <string> "flip_h" </string> + <string> "7" </string> + <string> "8" </string> + <string> "9" </string> + <string> "10" </string> + <string> "11" </string> + <string> "12" </string> + <string> "13" </string> + <string> "flip_v" </string> + <string> "14" </string> + <string> "15" </string> + <string> "axes" </string> + <string> "0-" </string> + <string> "0+" </string> + <string> "1-" </string> + <string> "1+" </string> + <string> "3-" </string> + <string> "3+" </string> + <string> "2-" </string> + <string> "2+" </string> + </string_array> + <string> "node_count" </string> + <int> 27 </int> + <string> "node_paths" </string> + <array len="0" shared="false"> + </array> + <string> "nodes" </string> + <int_array len="453"> -1, -1, 5, 0, -1, 4, 1, 0, 2, 1, 3, 2, 4, 3, 0, 0, 0, 7, 6, -1, 1, 4, 4, 0, 1, 0, 5, 8, -1, 5, 1, 5, 2, 6, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 11, -1, 5, 1, 10, 2, 6, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 12, -1, 5, 1, 11, 2, 6, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 13, -1, 5, 1, 12, 2, 6, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 14, -1, 5, 1, 13, 2, 14, 3, 7, 9, 8, 10, 15, 0, 1, 0, 5, 15, -1, 5, 1, 16, 2, 14, 3, 7, 9, 8, 10, 15, 0, 1, 0, 5, 16, -1, 6, 1, 17, 2, 18, 3, 7, 17, 8, 9, 8, 10, 19, 0, 1, 0, 5, 18, -1, 5, 1, 20, 2, 18, 3, 7, 9, 8, 10, 19, 0, 1, 0, 5, 19, -1, 5, 1, 21, 2, 6, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 20, -1, 5, 1, 22, 2, 6, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 21, -1, 5, 1, 23, 2, 24, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 22, -1, 5, 1, 25, 2, 24, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 23, -1, 5, 1, 26, 2, 6, 3, 7, 9, 8, 10, 27, 0, 1, 0, 5, 24, -1, 6, 1, 28, 2, 6, 3, 7, 25, 8, 9, 8, 10, 27, 0, 1, 0, 5, 26, -1, 5, 1, 29, 2, 6, 3, 7, 9, 8, 10, 30, 0, 1, 0, 5, 27, -1, 6, 1, 31, 2, 6, 3, 7, 17, 8, 9, 8, 10, 30, 0, 0, 0, 7, 28, -1, 0, 0, 18, 0, 5, 29, -1, 5, 1, 32, 2, 6, 3, 7, 9, 8, 10, 30, 0, 18, 0, 5, 30, -1, 6, 1, 33, 2, 6, 3, 7, 17, 8, 9, 8, 10, 30, 0, 18, 0, 5, 31, -1, 5, 1, 34, 2, 6, 3, 7, 9, 8, 10, 27, 0, 18, 0, 5, 32, -1, 6, 1, 35, 2, 6, 3, 7, 25, 8, 9, 8, 10, 27, 0, 18, 0, 5, 33, -1, 5, 1, 36, 2, 6, 3, 7, 9, 8, 10, 27, 0, 18, 0, 5, 34, -1, 6, 1, 37, 2, 6, 3, 7, 25, 8, 9, 8, 10, 27, 0, 18, 0, 5, 35, -1, 5, 1, 38, 2, 6, 3, 7, 9, 8, 10, 30, 0, 18, 0, 5, 36, -1, 6, 1, 39, 2, 6, 3, 7, 17, 8, 9, 8, 10, 30, 0 </int_array> + <string> "variants" </string> + <array len="40" shared="false"> + <vector2> 368.635, 155.289 </vector2> + <vector2> 0.432859, 0.446287 </vector2> + <resource external="0"> </resource> + <dictionary shared="false"> + <string> "__editor_plugin_screen__" </string> + <string> "2D" </string> + </dictionary> + <dictionary shared="false"> + <string> "_editor_collapsed" </string> + <bool> True </bool> + </dictionary> + <vector2> 147.73, 120.925 </vector2> + <vector2> 0.9, 0.9 </vector2> + <resource external="1"> </resource> + <bool> True </bool> + <rect2> 0, 0, 45, 45 </rect2> + <vector2> 185.769, 82.4874 </vector2> + <vector2> 112.377, 82.4874 </vector2> + <vector2> 149.073, 47.3293 </vector2> + <vector2> -161.038, -158.037 </vector2> + <vector2> 5.3348, 3.35512 </vector2> + <rect2> 10, 10, 10, 10 </rect2> + <vector2> 159.362, -156.977 </vector2> + <vector2> -159.349, -221.878 </vector2> + <vector2> 1.0458, 2.16952 </vector2> + <rect2> 0, 0, 45, 22 </rect2> + <vector2> 156.677, -220.11 </vector2> + <vector2> -67.5308, 164.422 </vector2> + <vector2> 75.8825, 167.363 </vector2> + <vector2> -46.6707, 52.702 </vector2> + <vector2> 0.810497, 0.57205 </vector2> + <vector2> 56.2581, 54.4382 </vector2> + <vector2> -139.402, 46.8295 </vector2> + <rect2> 50, 0, 54, 14 </rect2> + <vector2> -139.838, 115.789 </vector2> + <vector2> -172.262, 81.8793 </vector2> + <rect2> 50, 0, 14, 54 </rect2> + <vector2> -105.085, 81.0326 </vector2> + <vector2> -94.4295, 164.932 </vector2> + <vector2> -40.3475, 164.509 </vector2> + <vector2> -67.6802, 137.926 </vector2> + <vector2> -67.4618, 192.915 </vector2> + <vector2> 76.6557, 140.986 </vector2> + <vector2> 76.0009, 195.339 </vector2> + <vector2> 48.8152, 167.145 </vector2> + <vector2> 102.899, 167.857 </vector2> + </array> + <string> "version" </string> + <int> 2 </int> + </dictionary> + + </main_resource> +</resource_file>
\ No newline at end of file diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 075f97c68e..4a1e437694 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -432,7 +432,7 @@ <method name="convert"> <return type="Object"> </return> - <argument index="0" name="what" type="var"> + <argument index="0" name="what" type="Variant"> </argument> <argument index="1" name="type" type="int"> </argument> @@ -443,9 +443,9 @@ <method name="str"> <return type="String"> </return> - <argument index="0" name="what" type="var"> + <argument index="0" name="what" type="Variant"> </argument> - <argument index="1" name="..." type="var"> + <argument index="1" name="..." type="Variant"> </argument> <description> Convert one or more arguments to strings in the best way possible. @@ -454,9 +454,9 @@ <method name="str"> <return type="String"> </return> - <argument index="0" name="what" type="var"> + <argument index="0" name="what" type="Variant"> </argument> - <argument index="1" name="..." type="var"> + <argument index="1" name="..." type="Variant"> </argument> <description> Convert one or more arguments to strings in the best way possible. @@ -465,9 +465,9 @@ <method name="print"> <return type="Nil"> </return> - <argument index="0" name="what" type="var"> + <argument index="0" name="what" type="Variant"> </argument> - <argument index="1" name="..." type="var"> + <argument index="1" name="..." type="Variant"> </argument> <description> Print one or more arguments to strings in the best way possible to a console line. @@ -476,9 +476,9 @@ <method name="printt"> <return type="Nil"> </return> - <argument index="0" name="what" type="var"> + <argument index="0" name="what" type="Variant"> </argument> - <argument index="1" name="..." type="var"> + <argument index="1" name="..." type="Variant"> </argument> <description> Print one or more arguments to the console with a tab between each argument. @@ -487,9 +487,9 @@ <method name="prints"> <return type="Nil"> </return> - <argument index="0" name="what" type="var"> + <argument index="0" name="what" type="Variant"> </argument> - <argument index="1" name="..." type="var"> + <argument index="1" name="..." type="Variant"> </argument> <description> </description> @@ -497,9 +497,9 @@ <method name="printerr"> <return type="Nil"> </return> - <argument index="0" name="what" type="var"> + <argument index="0" name="what" type="Variant"> </argument> - <argument index="1" name="..." type="var"> + <argument index="1" name="..." type="Variant"> </argument> <description> Print one or more arguments to strings in the best way possible to standard error line. @@ -508,9 +508,9 @@ <method name="printraw"> <return type="Nil"> </return> - <argument index="0" name="what" type="var"> + <argument index="0" name="what" type="Variant"> </argument> - <argument index="1" name="..." type="var"> + <argument index="1" name="..." type="Variant"> </argument> <description> Print one or more arguments to strings in the best way possible to console. No newline is added at the end. @@ -519,25 +519,40 @@ <method name="var2str"> <return type="String"> </return> - <argument index="0" name="var" type="var"> + <argument index="0" name="var" type="Variant"> </argument> <description> Converts the value of a variable to a String. </description> </method> - <method name="str2var:var"> - <return type="Nil"> + <method name="str2var"> + <return type="Variant"> </return> <argument index="0" name="string" type="String"> </argument> <description> - Converts the value of a String to a variable. + </description> + </method> + <method name="var2bytes"> + <return type="RawArray"> + </return> + <argument index="0" name="var" type="Variant"> + </argument> + <description> + </description> + </method> + <method name="bytes2var"> + <return type="Variant"> + </return> + <argument index="0" name="bytes" type="RawArray"> + </argument> + <description> </description> </method> <method name="range"> <return type="Array"> </return> - <argument index="0" name="..." type="var"> + <argument index="0" name="..." type="Variant"> </argument> <description> Return an array with the given range. Range can be 1 argument N (0 to N-1), two arguments (initial, final-1) or three arguments (initial,final-1,increment). @@ -573,12 +588,26 @@ <method name="hash"> <return type="int"> </return> - <argument index="0" name="var:var" type="var"> + <argument index="0" name="var:Variant" type="Variant"> </argument> <description> Hashes the variable passed and returns an integer. </description> </method> + <method name="Color8"> + <return type="Color"> + </return> + <argument index="0" name="r8" type="int"> + </argument> + <argument index="1" name="g8" type="int"> + </argument> + <argument index="2" name="b8" type="int"> + </argument> + <argument index="3" name="a8" type="int"> + </argument> + <description> + </description> + </method> <method name="print_stack"> <return type="Nil"> </return> @@ -1371,6 +1400,10 @@ </constant> <constant name="JOY_ANALOG_2_Y" value="5"> </constant> + <constant name="JOY_ANALOG_L2" value="6"> + </constant> + <constant name="JOY_ANALOG_R2" value="7"> + </constant> <constant name="OK" value="0"> Functions that return [Error] return OK when everything went ok. Most functions don't return error anyway and/or just print errors to stdout. </constant> @@ -1849,6 +1882,8 @@ </description> </method> <method name="register_text_enter"> + <return type="LineEdit"> + </return> <argument index="0" name="line_edit" type="Object"> </argument> <description> @@ -3724,7 +3759,7 @@ </description> </method> <method name="overlaps_body" qualifiers="const"> - <return type="bool"> + <return type="PhysicsBody2D"> </return> <argument index="0" name="body" type="Object"> </argument> @@ -3733,7 +3768,7 @@ </description> </method> <method name="overlaps_area" qualifiers="const"> - <return type="bool"> + <return type="Area2D"> </return> <argument index="0" name="area" type="Object"> </argument> @@ -3898,6 +3933,14 @@ Get whether this is a shared array instance. </description> </method> + <method name="pop_back"> + <description> + </description> + </method> + <method name="pop_front"> + <description> + </description> + </method> <method name="push_back"> <argument index="0" name="value" type="var"> </argument> @@ -3905,6 +3948,12 @@ Append an element at the end of the array. </description> </method> + <method name="push_front"> + <argument index="0" name="value" type="var"> + </argument> + <description> + </description> + </method> <method name="remove"> <argument index="0" name="pos" type="int"> </argument> @@ -4088,8 +4137,6 @@ </return> <argument index="0" name="sample" type="RID"> </argument> - <argument index="1" name="arg1" type="String"> - </argument> <description> Return the description of an audio sample. Mainly used for organization. </description> @@ -4133,7 +4180,7 @@ <method name="sample_set_data"> <argument index="0" name="sample" type="RID"> </argument> - <argument index="1" name="arg1" type="RawArray"> + <argument index="1" name="data" type="RawArray"> </argument> <description> Set the sample data for a given sample as an array of bytes. The length must be equal to the sample lenght expected in bytes or an error will be produced. @@ -5946,7 +5993,7 @@ </description> </method> <method name="set_zoom"> - <argument index="0" name="arg0" type="Vector2"> + <argument index="0" name="zoom" type="Vector2"> </argument> <description> </description> @@ -5969,6 +6016,18 @@ <description> </description> </method> + <method name="set_enable_follow_smoothing"> + <argument index="0" name="follow_smoothing" type="bool"> + </argument> + <description> + </description> + </method> + <method name="is_follow_smoothing_enabled" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="force_update_scroll"> <description> Force the camera to update scroll immediately. @@ -6061,6 +6120,12 @@ Hide the CanvasItem currently visible. </description> </method> + <method name="set_hidden"> + <argument index="0" name="hidden" type="bool"> + </argument> + <description> + </description> + </method> <method name="update"> <description> Queue the CanvasItem for update. NOTIFICATION_DRAW will be called on idle time to request redraw. @@ -6186,6 +6251,8 @@ </argument> <argument index="1" name="pos" type="Vector2"> </argument> + <argument index="2" name="modulate" type="Color" default="Color(1,1,1,1)"> + </argument> <description> Draw a texture at a given position. </description> @@ -7060,7 +7127,7 @@ <argument index="1" name="shape" type="Shape"> </argument> <description> - Change a shape in the collision body. + Change a shape in the collision body. </description> </method> <method name="set_shape_transform"> @@ -7175,7 +7242,7 @@ </description> <methods> <method name="set_build_mode"> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="build_mode" type="int"> </argument> <description> </description> @@ -7250,7 +7317,7 @@ </description> </method> <method name="set_build_mode"> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="build_mode" type="int"> </argument> <description> Set whether the polygon is to be a [ConvexPolygon2D] ([code]build_mode[/code]=0), or a [ConcavePolygon2D] ([code]build_mode[/code]=1). @@ -7264,7 +7331,7 @@ </description> </method> <method name="set_trigger"> - <argument index="0" name="arg0" type="bool"> + <argument index="0" name="trigger" type="bool"> </argument> <description> Set whether this polygon is a trigger. A trigger polygon detects collisions, but is otherwise unaffected by physics (i.e. colliding objects will not get blocked). @@ -7304,7 +7371,7 @@ </description> <methods> <method name="resource_changed"> - <argument index="0" name="arg0" type="Object"> + <argument index="0" name="resource" type="Object"> </argument> <description> </description> @@ -7527,6 +7594,14 @@ </member> <member name="v" type="float"> </member> + <member name="r8" type="int"> + </member> + <member name="g8" type="int"> + </member> + <member name="b8" type="int"> + </member> + <member name="a8" type="int"> + </member> </members> <constants> </constants> @@ -7734,6 +7809,66 @@ <description> </description> <methods> + <method name="add_point"> + <argument index="0" name="offset" type="float"> + </argument> + <argument index="1" name="color" type="Color"> + </argument> + <description> + </description> + </method> + <method name="remove_point"> + <argument index="0" name="offset" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_offset"> + <argument index="0" name="point" type="int"> + </argument> + <argument index="1" name="offset" type="float"> + </argument> + <description> + </description> + </method> + <method name="get_offset" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="point" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_color"> + <argument index="0" name="point" type="int"> + </argument> + <argument index="1" name="color" type="Color"> + </argument> + <description> + </description> + </method> + <method name="get_color" qualifiers="const"> + <return type="Color"> + </return> + <argument index="0" name="point" type="int"> + </argument> + <description> + </description> + </method> + <method name="interpolate"> + <return type="Color"> + </return> + <argument index="0" name="offset" type="float"> + </argument> + <description> + </description> + </method> + <method name="get_point_count" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="set_offsets"> <argument index="0" name="offsets" type="RealArray"> </argument> @@ -7874,6 +8009,8 @@ </argument> <argument index="1" name="key" type="String"> </argument> + <argument index="2" name="default" type="var" default="NULL"> + </argument> <description> </description> </method> @@ -7904,7 +8041,7 @@ <method name="get_section_keys" qualifiers="const"> <return type="StringArray"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="section" type="String"> </argument> <description> </description> @@ -8150,6 +8287,18 @@ Move the Control to a new position, relative to the top-left corner of the [i]window[/i] Control, and without changing current anchor mode. (see [method set_margin]). </description> </method> + <method name="set_rotation"> + <argument index="0" name="rotation" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_scale"> + <argument index="0" name="scale" type="Vector2"> + </argument> + <description> + </description> + </method> <method name="get_margin" qualifiers="const"> <return type="float"> </return> @@ -8186,6 +8335,18 @@ Returns the size of the Control, computed from all margins, however the size returned will [b]never be smaller than the minimum size reported by [method get_minimum_size][/b]. This means that even if end position of the Control rectangle is smaller than the begin position, the Control will still display and interact correctly. (see description, [method get_minimum_size], [method set_margin], [method set_anchor]). </description> </method> + <method name="get_rotation" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_scale" qualifiers="const"> + <return type="Vector2"> + </return> + <description> + </description> + </method> <method name="get_custom_minimum_size" qualifiers="const"> <return type="Vector2"> </return> @@ -9602,7 +9763,7 @@ This approximation makes straight segments between each point, then subdivides t </description> </method> <method name="set_show_hidden_files"> - <argument index="0" name="arg0" type="bool"> + <argument index="0" name="show" type="bool"> </argument> <description> </description> @@ -10195,6 +10356,12 @@ This approximation makes straight segments between each point, then subdivides t <description> </description> </method> + <method name="get_length" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> <method name="set_autoplay"> <argument index="0" name="enabled" type="bool"> </argument> @@ -10215,24 +10382,18 @@ This approximation makes straight segments between each point, then subdivides t <description> </description> </method> - <method name="get_channel_volumeidx" qualifiers="const"> + <method name="get_channel_volume" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="idx" type="int"> </argument> <description> </description> </method> - <method name="get_length" qualifiers="const"> - <return type="float"> - </return> - <description> - </description> - </method> <method name="get_channel_last_note_time" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="idx" type="int"> </argument> <description> </description> @@ -10619,7 +10780,7 @@ This approximation makes straight segments between each point, then subdivides t </description> </method> <method name="set_show_hidden_files"> - <argument index="0" name="arg0" type="bool"> + <argument index="0" name="show" type="bool"> </argument> <description> </description> @@ -10681,6 +10842,8 @@ This approximation makes straight segments between each point, then subdivides t </theme_item> <theme_item name="folder" type="Texture"> </theme_item> + <theme_item name="reload" type="Texture"> + </theme_item> </theme_items> </class> <class name="FixedMaterial" inherits="Material" category="Core"> @@ -10919,9 +11082,9 @@ This approximation makes straight segments between each point, then subdivides t <method name="get_kerning_pair" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="char_a" type="int"> </argument> - <argument index="1" name="arg1" type="int"> + <argument index="1" name="char_b" type="int"> </argument> <description> Return a kerning pair as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character. @@ -11032,6 +11195,18 @@ This approximation makes straight segments between each point, then subdivides t Draw character "char" into a canvas item using the font at a given "pos" position, with "modulate" color, and optionally kerning if "next" is apassed. clipping the width. "pos" specifies te baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. The width used by the character is returned, making this function useful for drawing strings character by character. </description> </method> + <method name="set_fallback"> + <argument index="0" name="fallback" type="Object"> + </argument> + <description> + </description> + </method> + <method name="get_fallback" qualifiers="const"> + <return type="Object"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> @@ -11089,6 +11264,8 @@ This approximation makes straight segments between each point, then subdivides t </description> <methods> <method name="resume"> + <return type="Variant"> + </return> <argument index="0" name="arg" type="var" default="NULL"> </argument> <description> @@ -11695,7 +11872,7 @@ This approximation makes straight segments between each point, then subdivides t <method name="has_singleton" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="name" type="String"> </argument> <description> </description> @@ -11703,7 +11880,7 @@ This approximation makes straight segments between each point, then subdivides t <method name="get_singleton" qualifiers="const"> <return type="Object"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="name" type="String"> </argument> <description> </description> @@ -11711,7 +11888,7 @@ This approximation makes straight segments between each point, then subdivides t <method name="load_resource_pack"> <return type="bool"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="pack" type="String"> </argument> <description> </description> @@ -11719,7 +11896,7 @@ This approximation makes straight segments between each point, then subdivides t <method name="save_custom"> <return type="int"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="file" type="String"> </argument> <description> </description> @@ -12235,7 +12412,7 @@ This approximation makes straight segments between each point, then subdivides t </description> </method> <method name="resource_changed"> - <argument index="0" name="arg0" type="Object"> + <argument index="0" name="resource" type="Object"> </argument> <description> </description> @@ -13369,6 +13546,10 @@ returns:= "username=user&password=pass" <description> </description> </method> + <method name="shrink_x2_and_keep_size"> + <description> + </description> + </method> <method name="set_size_override"> <argument index="0" name="size" type="Vector2"> </argument> @@ -13487,6 +13668,7 @@ returns:= "username=user&password=pass" <argument index="1" name="button" type="int"> </argument> <description> + Returns true if the joystick button at the given index is currently pressed. Returns false otherwise. (see JOY_* constans in [InputEvent]) </description> </method> <method name="is_action_pressed"> @@ -13497,6 +13679,31 @@ returns:= "username=user&password=pass" <description> </description> </method> + <method name="add_joy_mapping"> + <argument index="0" name="mapping" type="String"> + </argument> + <argument index="1" name="update_existing" type="bool" default="false"> + </argument> + <description> + Add a new mapping entry (in SDL2 format) to the mapping database. Optionally update already connected devices. + </description> + </method> + <method name="remove_joy_mapping"> + <argument index="0" name="guid" type="String"> + </argument> + <description> + Removes all mappings from the internal db that match the given uid. + </description> + </method> + <method name="is_joy_known"> + <return type="bool"> + </return> + <argument index="0" name="device" type="int"> + </argument> + <description> + Returns true if the specified device is known by the system. This means that it sets all button and axis indices exactly as defined in [InputEvent]. Unknown joysticks are not expected to match these constants, but you can still retrieve events from them. + </description> + </method> <method name="get_joy_axis"> <return type="float"> </return> @@ -13505,6 +13712,7 @@ returns:= "username=user&password=pass" <argument index="1" name="axis" type="int"> </argument> <description> + Returns the current value of the joystick axis at given index (see JOY_* enum in [InputEvent]) </description> </method> <method name="get_joy_name"> @@ -13513,6 +13721,16 @@ returns:= "username=user&password=pass" <argument index="0" name="device" type="int"> </argument> <description> + Returns the name of the joystick at the specified device index + </description> + </method> + <method name="get_joy_guid" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="device" type="int"> + </argument> + <description> + Returns a SDL2 compatible device guid on platforms that use gamepad remapping. Returns "Default Gamepad" otherwise. </description> </method> <method name="get_accelerometer"> @@ -13552,13 +13770,13 @@ returns:= "username=user&password=pass" </description> </method> <method name="action_press"> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="action" type="String"> </argument> <description> </description> </method> <method name="action_release"> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="action" type="String"> </argument> <description> </description> @@ -15038,6 +15256,18 @@ returns:= "username=user&password=pass" <description> </description> </method> + <method name="set_exclude_nodes_from_collision"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="get_exclude_nodes_from_collision" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> @@ -15054,7 +15284,7 @@ returns:= "username=user&password=pass" <argument index="0" name="node" type="NodePath"> </argument> <description> - Set the path to the A node for the joint. Must be of type PhysicsBody2D. + Set the path to the A node for the joint. Must be of type [PhysicsBody2D]. </description> </method> <method name="get_node_a" qualifiers="const"> @@ -15068,7 +15298,7 @@ returns:= "username=user&password=pass" <argument index="0" name="node" type="NodePath"> </argument> <description> - Set the path to the B node for the joint. Must be of type PhysicsBody2D. + Set the path to the B node for the joint. Must be of type [PhysicsBody2D]. </description> </method> <method name="get_node_b" qualifiers="const"> @@ -15090,6 +15320,18 @@ returns:= "username=user&password=pass" <description> </description> </method> + <method name="set_exclude_nodes_from_collision"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="get_exclude_nodes_from_collision" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> @@ -15150,6 +15392,8 @@ returns:= "username=user&password=pass" </description> </method> <method name="get_collider" qualifiers="const"> + <return type="Object"> + </return> <description> </description> </method> @@ -15225,8 +15469,12 @@ returns:= "username=user&password=pass" </class> <class name="KinematicBody2D" inherits="PhysicsBody2D" category="Core"> <brief_description> + Kinematic body 2D node. </brief_description> <description> + Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all (to other types of bodies, such a character or a rigid body, these are the same as a static body). They have however, two main uses: + Simulated Motion: When these bodies are moved manually, either from code or from an AnimationPlayer (with process mode set to fixed), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). + Kinematic Characters: KinematicBody2D also has an api for moving objects (the [method move] method) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics. </description> <methods> <method name="move"> @@ -15235,6 +15483,7 @@ returns:= "username=user&password=pass" <argument index="0" name="rel_vec" type="Vector2"> </argument> <description> + Move the body in the given direction, stopping if there is an obstacle. </description> </method> <method name="move_to"> @@ -15243,6 +15492,7 @@ returns:= "username=user&password=pass" <argument index="0" name="position" type="Vector2"> </argument> <description> + Move the body to the given position. This is not a teleport, and the body will stop if there is an obstacle. </description> </method> <method name="test_move"> @@ -15251,66 +15501,82 @@ returns:= "username=user&password=pass" <argument index="0" name="rel_vec" type="Vector2"> </argument> <description> + Return true if there would be a collision if the body moved in the given direction. </description> </method> <method name="get_travel" qualifiers="const"> <return type="Vector2"> </return> <description> + Return the last movement done by the body. </description> </method> <method name="revert_motion"> <description> + Undo the last movement done by the body. </description> </method> <method name="is_colliding" qualifiers="const"> <return type="bool"> </return> <description> + Return whether the body is colliding with another. </description> </method> <method name="get_collision_pos" qualifiers="const"> <return type="Vector2"> </return> <description> + Return the point in space where the body is touching another. If there is no collision, this method will return (0,0), so collisions must be checked first with [method is_colliding]. </description> </method> <method name="get_collision_normal" qualifiers="const"> <return type="Vector2"> </return> <description> + Return the normal of the surface the body collided with. This is useful to implement sliding along a surface. </description> </method> <method name="get_collider_velocity" qualifiers="const"> <return type="Vector2"> </return> <description> + Return the velocity of the body that collided with this one. </description> </method> <method name="get_collider" qualifiers="const"> + <return type="Object"> + </return> <description> + Return the body that collided with this one. </description> </method> <method name="get_collider_shape" qualifiers="const"> <return type="int"> </return> <description> + Return the shape index from the body that collided with this one. If there is no collision, this method will return 0, so collisions must be checked first with [method is_colliding]. </description> </method> <method name="get_collider_metadata" qualifiers="const"> + <return type="Variant"> + </return> <description> + Return the metadata of the shape that collided with this body. If there is no collision, it will return 0, so collisions must be checked first with [method is_colliding]. Aditionally, this metadata can not be set with [method Object.set_meta], it must be set with [method Physics2DServer.body_set_shape_metadata]. </description> </method> <method name="set_collision_margin"> <argument index="0" name="pixels" type="float"> </argument> <description> + Set the collision margin for this object. A collision margin is an amount (in pixels) that all shapes will grow when computing collisions, to account for numerical imprecision. </description> </method> <method name="get_collision_margin" qualifiers="const"> <return type="float"> </return> <description> + Return the collision margin for this object. </description> </method> </methods> @@ -15615,7 +15881,7 @@ returns:= "username=user&password=pass" <method name="get_parameter" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="variable" type="int"> </argument> <description> </description> @@ -15631,7 +15897,7 @@ returns:= "username=user&password=pass" <method name="get_color" qualifiers="const"> <return type="Color"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="color" type="int"> </argument> <description> </description> @@ -15968,6 +16234,8 @@ returns:= "username=user&password=pass" </constant> <constant name="MODE_MIX" value="2"> </constant> + <constant name="MODE_MASK" value="3"> + </constant> </constants> </class> <class name="LightOccluder2D" inherits="Node2D" category="Core"> @@ -16332,6 +16600,8 @@ returns:= "username=user&password=pass" </description> </method> <method name="base64_to_variant"> + <return type="Variant"> + </return> <argument index="0" name="base64_str" type="String"> </argument> <description> @@ -16920,9 +17190,9 @@ returns:= "username=user&password=pass" </argument> <argument index="1" name="arrays" type="Array"> </argument> - <argument index="2" name="morph_arrays" type="Array"> + <argument index="2" name="morph_arrays" type="Array" default="Array()"> </argument> - <argument index="3" name="arg3" type="bool" default="Array()"> + <argument index="3" name="alphasort" type="bool" default="false"> </argument> <description> Create a new surface ([method get_surface_count] that will become surf_idx for this. @@ -17595,7 +17865,7 @@ returns:= "username=user&password=pass" </description> </method> <method name="set_instance_count"> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="count" type="int"> </argument> <description> Set the amount of instnces that is going to be drawn. Changing this number will erase all the existing instance transform and color data. @@ -17609,9 +17879,9 @@ returns:= "username=user&password=pass" </description> </method> <method name="set_instance_transform"> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="instance" type="int"> </argument> - <argument index="1" name="arg1" type="Transform"> + <argument index="1" name="transform" type="Transform"> </argument> <description> Set the transform for a specific instance. @@ -17620,16 +17890,16 @@ returns:= "username=user&password=pass" <method name="get_instance_transform" qualifiers="const"> <return type="Transform"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="instance" type="int"> </argument> <description> Return the transform of a specific instance. </description> </method> <method name="set_instance_color"> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="instance" type="int"> </argument> - <argument index="1" name="arg1" type="Color"> + <argument index="1" name="color" type="Color"> </argument> <description> Set the color of a specific instance. @@ -17638,14 +17908,14 @@ returns:= "username=user&password=pass" <method name="get_instance_color" qualifiers="const"> <return type="Color"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="instance" type="int"> </argument> <description> Get the color of a specific instance. </description> </method> <method name="set_aabb"> - <argument index="0" name="arg0" type="AABB"> + <argument index="0" name="visibility_aabb" type="AABB"> </argument> <description> Set the visibility AABB. If not provided, MultiMesh will not be visible. @@ -18346,8 +18616,11 @@ returns:= "username=user&password=pass" <method name="add_child"> <argument index="0" name="node" type="Node"> </argument> + <argument index="1" name="legible_unique_name" type="bool" default="false"> + </argument> <description> Add a child [Node]. Nodes can have as many children as they want, but every child must have a unique name. Children nodes are automatically deleted when the parent node is deleted, so deleting a whole scene is performed by deleting its topmost node. + The optional boolean argument enforces creating child node with human-readable names, based on the name of node being instanced instead of its type only. </description> </method> <method name="remove_child"> @@ -18489,7 +18762,7 @@ returns:= "username=user&password=pass" <method name="add_to_group"> <argument index="0" name="group" type="String"> </argument> - <argument index="1" name="arg1" type="bool" default="false"> + <argument index="1" name="persistent" type="bool" default="false"> </argument> <description> Add a node to a group. Groups are helpers to name and organize group of nodes, like for example: "Enemies", "Collectables", etc. A [Node] can be in any number of groups. Nodes can be assigned a group at any time, but will not be added to it until they are inside the scene tree (see [method is_inside_scene]). @@ -18778,6 +19051,8 @@ returns:= "username=user&password=pass" </constant> <constant name="NOTIFICATION_UNPAUSED" value="15"> </constant> + <constant name="NOTIFICATION_INSTANCED" value="20"> + </constant> <constant name="PAUSE_MODE_INHERIT" value="0"> </constant> <constant name="PAUSE_MODE_STOP" value="1"> @@ -18940,15 +19215,15 @@ returns:= "username=user&password=pass" </description> </method> <method name="edit_set_pivot"> - <argument index="0" name="arg0" type="Vector2"> + <argument index="0" name="pivot" type="Vector2"> </argument> <description> </description> </method> - <method name="get_relative_transform" qualifiers="const"> + <method name="get_relative_transform_to_parent" qualifiers="const"> <return type="Matrix32"> </return> - <argument index="0" name="arg0" type="Object"> + <argument index="0" name="parent" type="Object"> </argument> <description> </description> @@ -19417,7 +19692,7 @@ returns:= "username=user&password=pass" </description> </method> <method name="set_icon"> - <argument index="0" name="arg0" type="Image"> + <argument index="0" name="icon" type="Image"> </argument> <description> </description> @@ -19582,7 +19857,7 @@ returns:= "username=user&password=pass" </description> </method> <method name="print_resources_by_type"> - <argument index="0" name="arg0" type="StringArray"> + <argument index="0" name="types" type="StringArray"> </argument> <description> </description> @@ -19590,13 +19865,13 @@ returns:= "username=user&password=pass" <method name="native_video_play"> <return type="int"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="path" type="String"> </argument> - <argument index="1" name="arg1" type="float"> + <argument index="1" name="volume" type="float"> </argument> - <argument index="2" name="arg2" type="String"> + <argument index="2" name="audio_track" type="String"> </argument> - <argument index="3" name="arg3" type="String"> + <argument index="3" name="subtitle_track" type="String"> </argument> <description> </description> @@ -19823,7 +20098,7 @@ returns:= "username=user&password=pass" <method name="notification"> <argument index="0" name="what" type="int"> </argument> - <argument index="1" name="arg1" type="bool" default="false"> + <argument index="1" name="reversed" type="bool" default="false"> </argument> <description> Notify the object of something. @@ -19961,6 +20236,8 @@ returns:= "username=user&password=pass" </description> </method> <method name="callv"> + <return type="Variant"> + </return> <argument index="0" name="method" type="String"> </argument> <argument index="1" name="arg_array" type="Array"> @@ -19971,7 +20248,7 @@ returns:= "username=user&password=pass" <method name="has_method" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="method" type="String"> </argument> <description> </description> @@ -19983,6 +20260,14 @@ returns:= "username=user&password=pass" Return the list of signals as an array of dictionaries. </description> </method> + <method name="get_signal_connection_list" qualifiers="const"> + <return type="Array"> + </return> + <argument index="0" name="signal" type="String"> + </argument> + <description> + </description> + </method> <method name="connect"> <return type="int"> </return> @@ -20299,7 +20584,7 @@ returns:= "username=user&password=pass" </description> </method> <method name="select"> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="idx" type="int"> </argument> <description> Select an item by index and make it the current item. @@ -20398,7 +20683,7 @@ returns:= "username=user&password=pass" <method name="flush"> <return type="int"> </return> - <argument index="0" name="arg0" type="bool"> + <argument index="0" name="verbose" type="bool"> </argument> <description> </description> @@ -20514,7 +20799,7 @@ returns:= "username=user&password=pass" <method name="put_var"> <return type="int"> </return> - <argument index="0" name="var" type="var"> + <argument index="0" name="var" type="Variant"> </argument> <description> </description> @@ -20735,7 +21020,7 @@ returns:= "username=user&password=pass" </description> </method> <method name="set_ignore_camera_zoom"> - <argument index="0" name="arg0" type="bool"> + <argument index="0" name="ignore" type="bool"> </argument> <description> </description> @@ -20998,7 +21283,7 @@ returns:= "username=user&password=pass" <method name="get_randomness" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="variable" type="int"> </argument> <description> Return the randomness for a specific variable of the particle system. Randomness produces small changes from the default each time a particle is emitted. @@ -21055,7 +21340,7 @@ returns:= "username=user&password=pass" </description> </method> <method name="set_emit_timeout"> - <argument index="0" name="arg0" type="float"> + <argument index="0" name="timeout" type="float"> </argument> <description> </description> @@ -21245,6 +21530,8 @@ returns:= "username=user&password=pass" </description> </method> <method name="set_texture"> + <return type="Texture"> + </return> <argument index="0" name="texture" type="Object"> </argument> <description> @@ -21269,6 +21556,8 @@ returns:= "username=user&password=pass" </description> </method> <method name="set_color_ramp"> + <return type="ColorRamp"> + </return> <argument index="0" name="color_ramp" type="Object"> </argument> <description> @@ -21402,6 +21691,10 @@ returns:= "username=user&password=pass" <description> </description> </method> + <method name="reset"> + <description> + </description> + </method> <method name="set_use_local_space"> <argument index="0" name="enable" type="bool"> </argument> @@ -22147,6 +22440,8 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="get_contact_collider_shape_metadata" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="contact_idx" type="int"> </argument> <description> @@ -22561,11 +22856,11 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="area_set_monitor_callback"> - <argument index="0" name="receiver" type="RID"> + <argument index="0" name="area" type="RID"> </argument> - <argument index="1" name="method" type="Object"> + <argument index="1" name="receiver" type="Object"> </argument> - <argument index="2" name="arg2" type="String"> + <argument index="2" name="method" type="String"> </argument> <description> </description> @@ -22875,9 +23170,9 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="body_set_one_way_collision_direction"> - <argument index="0" name="normal" type="RID"> + <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="arg1" type="Vector2"> + <argument index="1" name="normal" type="Vector2"> </argument> <description> </description> @@ -22885,15 +23180,15 @@ This method controls whether the position between two cached points is interpola <method name="body_get_one_way_collision_direction" qualifiers="const"> <return type="Vector2"> </return> - <argument index="0" name="arg0" type="RID"> + <argument index="0" name="body" type="RID"> </argument> <description> </description> </method> <method name="body_set_one_way_collision_max_depth"> - <argument index="0" name="normal" type="RID"> + <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="arg1" type="float"> + <argument index="1" name="depth" type="float"> </argument> <description> </description> @@ -22901,7 +23196,7 @@ This method controls whether the position between two cached points is interpola <method name="body_get_one_way_collision_max_depth" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="arg0" type="RID"> + <argument index="0" name="body" type="RID"> </argument> <description> </description> @@ -22929,7 +23224,7 @@ This method controls whether the position between two cached points is interpola </argument> <argument index="2" name="method" type="String"> </argument> - <argument index="3" name="arg3" type="var"> + <argument index="3" name="userdata" type="var" default="NULL"> </argument> <description> </description> @@ -23053,7 +23348,7 @@ This method controls whether the position between two cached points is interpola <method name="get_process_info"> <return type="int"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="process_info" type="int"> </argument> <description> </description> @@ -23092,15 +23387,15 @@ This method controls whether the position between two cached points is interpola </constant> <constant name="AREA_PARAM_PRIORITY" value="7"> </constant> + <constant name="AREA_SPACE_OVERRIDE_DISABLED" value="0"> + This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. + </constant> <constant name="AREA_SPACE_OVERRIDE_COMBINE" value="1"> This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. </constant> <constant name="AREA_SPACE_OVERRIDE_COMBINE_REPLACE" value="2"> This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. </constant> - <constant name="AREA_SPACE_OVERRIDE_DISABLED" value="0"> - This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. - </constant> <constant name="AREA_SPACE_OVERRIDE_REPLACE" value="3"> This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. </constant> @@ -24078,11 +24373,11 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="area_set_monitor_callback"> - <argument index="0" name="receiver" type="RID"> + <argument index="0" name="area" type="RID"> </argument> - <argument index="1" name="method" type="Object"> + <argument index="1" name="receiver" type="Object"> </argument> - <argument index="2" name="arg2" type="String"> + <argument index="2" name="method" type="String"> </argument> <description> </description> @@ -24142,8 +24437,6 @@ This method controls whether the position between two cached points is interpola </return> <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="arg1" type="int"> - </argument> <description> </description> </method> @@ -24688,7 +24981,7 @@ This method controls whether the position between two cached points is interpola <method name="get_process_info"> <return type="int"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="process_info" type="int"> </argument> <description> </description> @@ -24855,15 +25148,15 @@ This method controls whether the position between two cached points is interpola </constant> <constant name="AREA_PARAM_PRIORITY" value="7"> </constant> + <constant name="AREA_SPACE_OVERRIDE_DISABLED" value="0"> + This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. + </constant> <constant name="AREA_SPACE_OVERRIDE_COMBINE" value="1"> This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. </constant> <constant name="AREA_SPACE_OVERRIDE_COMBINE_REPLACE" value="2"> This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. </constant> - <constant name="AREA_SPACE_OVERRIDE_DISABLED" value="0"> - This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. - </constant> <constant name="AREA_SPACE_OVERRIDE_REPLACE" value="3"> This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. </constant> @@ -25679,7 +25972,7 @@ This method controls whether the position between two cached points is interpola <method name="set_item_checked"> <argument index="0" name="idx" type="int"> </argument> - <argument index="1" name="arg1" type="bool"> + <argument index="1" name="checked" type="bool"> </argument> <description> Set the checkstate status of the item at index "idx". @@ -26367,12 +26660,6 @@ This method controls whether the position between two cached points is interpola Return value mapped to 0 to 1 (unit) range. </description> </method> - <method name="get_rounded_values" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> <method name="set_val"> <argument index="0" name="value" type="float"> </argument> @@ -26420,11 +26707,17 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="set_rounded_values"> - <argument index="0" name="arg0" type="bool"> + <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> + <method name="is_rounded_values" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="set_exp_unit_value"> <argument index="0" name="enabled" type="bool"> </argument> @@ -27073,7 +27366,7 @@ This method controls whether the position between two cached points is interpola <argument index="1" name="capture" type="int" default="9"> </argument> <description> - Compiles and assign the regular expression pattern to use. The limit on the number of capturing groups can be specified or made unlimited if negative. + Compiles and assign the regular expression pattern to use. The limit on the number of capturing groups can be specified or made unlimited if negative. </description> </method> <method name="find" qualifiers="const"> @@ -27224,7 +27517,7 @@ This method controls whether the position between two cached points is interpola <method name="duplicate"> <return type="Object"> </return> - <argument index="0" name="arg0" type="bool" default="false"> + <argument index="0" name="subresources" type="bool" default="false"> </argument> <description> </description> @@ -27413,7 +27706,7 @@ This method controls whether the position between two cached points is interpola <method name="get_dependencies"> <return type="StringArray"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="path" type="String"> </argument> <description> </description> @@ -27421,7 +27714,7 @@ This method controls whether the position between two cached points is interpola <method name="has"> <return type="bool"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="path" type="String"> </argument> <description> </description> @@ -27507,7 +27800,7 @@ This method controls whether the position between two cached points is interpola </argument> <argument index="1" name="resource" type="Resource"> </argument> - <argument index="2" name="arg2" type="int" default="0"> + <argument index="2" name="flags" type="int" default="0"> </argument> <description> Save a resource to disk, to a given path. @@ -27602,6 +27895,26 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> + <method name="push_table"> + <argument index="0" name="columns" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_table_column_expand"> + <argument index="0" name="column" type="int"> + </argument> + <argument index="1" name="expand" type="bool"> + </argument> + <argument index="2" name="ratio" type="int"> + </argument> + <description> + </description> + </method> + <method name="push_cell"> + <description> + </description> + </method> <method name="pop"> <description> </description> @@ -27653,7 +27966,7 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="scroll_to_line"> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="line" type="int"> </argument> <description> </description> @@ -27766,7 +28079,7 @@ This method controls whether the position between two cached points is interpola </constant> <constant name="LIST_DOTS" value="2"> </constant> - <constant name="ITEM_MAIN" value="0"> + <constant name="ITEM_FRAME" value="0"> </constant> <constant name="ITEM_TEXT" value="1"> </constant> @@ -27786,10 +28099,14 @@ This method controls whether the position between two cached points is interpola </constant> <constant name="ITEM_LIST" value="9"> </constant> - <constant name="ITEM_META" value="10"> + <constant name="ITEM_META" value="11"> </constant> </constants> <theme_items> + <theme_item name="table_vseparation" type="int"> + </theme_item> + <theme_item name="table_hseparation" type="int"> + </theme_item> <theme_item name="line_separation" type="int"> </theme_item> <theme_item name="default_color" type="Color"> @@ -28103,7 +28420,7 @@ This method controls whether the position between two cached points is interpola Rigid body 2D node. </brief_description> <description> - Rigid body 2D node. This node is used for placing rigid bodies in the scene. It can contain a number of shapes, and also shift state between regular Rigid Body to Character or even Static. + Rigid body 2D node. This node is used for placing rigid bodies in the scene. It can contain a number of shapes, and also shift state between regular Rigid body, Kinematic, Character or Static. Character mode forbids the node from being rotated. This node can have a custom force integrator function, for writing complex physics motion behavior per node. As a warning, don't change this node position every frame or very often. Sporadic changes work fine, but physics runs at a different granularity (fixed hz) than usual rendering (process callback) and maybe even in a separate thread, so changing this from a process loop will yield strange behavior. </description> @@ -28126,7 +28443,7 @@ This method controls whether the position between two cached points is interpola <return type="int"> </return> <description> - Return the current body mode, see [set_mode]. + Return the current body mode, see [method set_mode]. </description> </method> <method name="set_mass"> @@ -28147,14 +28464,14 @@ This method controls whether the position between two cached points is interpola <argument index="0" name="weight" type="float"> </argument> <description> - Set the body mass given standard earth-weight (gravity 9.8). Not really useful for 2D since most measures for this node are in pixels. + Set the body weight given standard earth-weight (gravity 9.8). Not really useful for 2D since most measures for this node are in pixels. </description> </method> <method name="get_weight" qualifiers="const"> <return type="float"> </return> <description> - Return the body mass given standard earth-weight (gravity 9.8). + Return the body weight given standard earth-weight (gravity 9.8). </description> </method> <method name="set_friction"> @@ -28175,7 +28492,7 @@ This method controls whether the position between two cached points is interpola <argument index="0" name="bounce" type="float"> </argument> <description> - Set the body bounciness, from 0 (no bounce) to 1 (bounce). + Set the body bounciness, from 0 (no bounce) to 1 (full bounce). </description> </method> <method name="get_bounce" qualifiers="const"> @@ -28189,36 +28506,42 @@ This method controls whether the position between two cached points is interpola <argument index="0" name="gravity_scale" type="float"> </argument> <description> + Set The gravity factor. This factor multiplies gravity intensity just for this body. </description> </method> <method name="get_gravity_scale" qualifiers="const"> <return type="float"> </return> <description> + Return the gravity factor. </description> </method> <method name="set_linear_damp"> <argument index="0" name="linear_damp" type="float"> </argument> <description> + Set the linear damp for this body. If this value is different from -1, any linear damp derived from the world or areas will be overriden. </description> </method> <method name="get_linear_damp" qualifiers="const"> <return type="float"> </return> <description> + Return the linear damp for this body. </description> </method> <method name="set_angular_damp"> <argument index="0" name="angular_damp" type="float"> </argument> <description> + Set the angular damp for this body. If this value is different from -1, any angular damp derived from the world or areas will be overriden. </description> </method> <method name="get_angular_damp" qualifiers="const"> <return type="float"> </return> <description> + Return the angular damp for this body. </description> </method> <method name="set_linear_velocity"> @@ -28232,7 +28555,7 @@ This method controls whether the position between two cached points is interpola <return type="Vector2"> </return> <description> - Return the body linear velocity. This changes by physics granularity. See [set_linear_velocity]. + Return the body linear velocity. This changes by physics granularity. See [method set_linear_velocity]. </description> </method> <method name="set_angular_velocity"> @@ -28246,7 +28569,7 @@ This method controls whether the position between two cached points is interpola <return type="float"> </return> <description> - Return the body angular velocity. This changes by physics granularity. See [set_angular_velocity]. + Return the body angular velocity. This changes by physics granularity. See [method set_angular_velocity]. </description> </method> <method name="set_max_contacts_reported"> @@ -28260,14 +28583,14 @@ This method controls whether the position between two cached points is interpola <return type="int"> </return> <description> - Return the maximum contacts that can be reported. See [set_max_contacts_reported]. + Return the maximum contacts that can be reported. See [method set_max_contacts_reported]. </description> </method> <method name="set_use_custom_integrator"> <argument index="0" name="enable" type="bool"> </argument> <description> - Set to true if the body shall not do any internal force integration at all (like gravity or air friction). Only the [_integrate_forces] will be able to integrate them if overrided. + Set to true if the body shall not do any internal force integration at all (like gravity or air friction). Only the [method _integrate_forces] will be able to integrate them if overrided. </description> </method> <method name="is_using_custom_integrator"> @@ -28281,7 +28604,7 @@ This method controls whether the position between two cached points is interpola <argument index="0" name="enabled" type="bool"> </argument> <description> - Enable contact monitoring. (the signals to notify when a body entered/exited collision). + Enable contact monitoring. This allows the body to emit signals when it collides with another. </description> </method> <method name="is_contact_monitor_enabled" qualifiers="const"> @@ -28295,19 +28618,22 @@ This method controls whether the position between two cached points is interpola <argument index="0" name="mode" type="int"> </argument> <description> + Set the continuous collision detection mode from the enum CCD_MODE_*. + Coninuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. The first is more precise, and misses less impacts by small, fast-moving objects. The second is faster to compute, but can miss small, fat-moving objects. </description> </method> <method name="get_continuous_collision_detection_mode" qualifiers="const"> <return type="int"> </return> <description> + Return whether this body is using continuous collision detection. </description> </method> <method name="set_axis_velocity"> <argument index="0" name="axis_velocity" type="Vector2"> </argument> <description> - Set an axis velocity. The velocity in the given vector axis will be set as the given vector length. (This is useful for jumping behavior). + Set an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. </description> </method> <method name="apply_impulse"> @@ -28316,31 +28642,35 @@ This method controls whether the position between two cached points is interpola <argument index="1" name="impulse" type="Vector2"> </argument> <description> - Apply a positioned impulse (which will be affected by the body mass and shape). + Apply a positioned impulse (which will be affected by the body mass and shape). This is the equivalent of hitting a billiard ball with a cue: a force that is applied once, and only once. </description> </method> <method name="set_applied_force"> <argument index="0" name="force" type="Vector2"> </argument> <description> + Set the applied force vector. This is the equivalent of pushing a box over the ground: the force applied is applied constantly. </description> </method> <method name="get_applied_force" qualifiers="const"> <return type="Vector2"> </return> <description> + Return the applied force vector. </description> </method> <method name="set_sleeping"> <argument index="0" name="sleeping" type="bool"> </argument> <description> + Set whether a body is isleeping or not. Sleeping bodies are not affected by forces until a collision or an [method apply_impulse]/[method set_applied_force] wakes them up. Until then, they behave like a static body. </description> </method> <method name="is_sleeping" qualifiers="const"> <return type="bool"> </return> <description> + Return whether the body is sleeping. </description> </method> <method name="set_can_sleep"> @@ -28348,13 +28678,14 @@ This method controls whether the position between two cached points is interpola </argument> <description> Set the body ability to fall asleep when not moving. This saves an enormous amount of processor time when there are plenty of rigid bodies (non static) in a scene. + Sleeping bodies are not affected by forces until a collision or an [method apply_impulse]/[method set_applied_force] wakes them up. Until then, they behave like a static body. </description> </method> <method name="is_able_to_sleep" qualifiers="const"> <return type="bool"> </return> <description> - Return true if the body has the ability to fall asleep when not moving. See [set_can_sleep]. + Return true if the body has the ability to fall asleep when not moving. See [method set_can_sleep]. </description> </method> <method name="test_motion"> @@ -28367,12 +28698,14 @@ This method controls whether the position between two cached points is interpola <argument index="2" name="result" type="Physics2DTestMotionResult" default="NULL"> </argument> <description> + Return whether the body would collide, if it tried to move in the given vector. This method allows two extra parameters: A margin, which increases slightly the size of the shapes involved in the collision detection, and an object of type [Physics2DTestMotionResult], which will store additional information about the collision (should there be one). </description> </method> <method name="get_colliding_bodies" qualifiers="const"> <return type="Array"> </return> <description> + Return a list of the bodies colliding with this one. </description> </method> </methods> @@ -28381,7 +28714,7 @@ This method controls whether the position between two cached points is interpola <argument index="0" name="body" type="Object"> </argument> <description> - Emitted when a new body enters into contact with this one. Contact monitor and contacts reported must be enabled for this to work. + Emitted when a body enters into contact with this one. Contact monitor and contacts reported must be enabled for this to work. </description> </signal> <signal name="body_enter_shape"> @@ -28394,7 +28727,8 @@ This method controls whether the position between two cached points is interpola <argument index="3" name="local_shape" type="int"> </argument> <description> - Emitted when a new body sub-shape enters into contact with this one. Contact monitor and contacts reported must be enabled for this to work. + Emitted when a body enters into contact with this one. Contact monitor and contacts reported must be enabled for this to work. + This signal not only receives the body that collided with this one, but also its [RID] (body_id), the shape index from the colliding body (body_shape), and the shape index from this body (local_shape) the other body collided with. </description> </signal> <signal name="body_exit"> @@ -28415,26 +28749,31 @@ This method controls whether the position between two cached points is interpola </argument> <description> Emitted when a body shape exits contact with this one. Contact monitor and contacts reported must be enabled for this to work. + This signal not only receives the body that stopped colliding with this one, but also its [RID] (body_id), the shape index from the colliding body (body_shape), and the shape index from this body (local_shape) the other body stopped colliding with. </description> </signal> </signals> <constants> <constant name="MODE_STATIC" value="1"> - Static mode (does not move, can't be moved). + Static mode. The body behaves like a [StaticBody2D], and can only move by user code. </constant> <constant name="MODE_KINEMATIC" value="3"> + Kinematic body. The body behaves like a [KinematicBody2D], and can only move by user code. </constant> <constant name="MODE_RIGID" value="0"> - Rigid body, can move and rotate. + Rigid body. This is the "natural" state of a rigid body. It is affected by forces, and can move, rotate, and be affected by user code. </constant> <constant name="MODE_CHARACTER" value="2"> - Character body, can move but not rotate. + Character body. This behaves like a rigid body, but can not rotate. </constant> <constant name="CCD_MODE_DISABLED" value="0"> + Disables continuous collision detection. This is the fastest way to detect body collisions, but can miss small, fast-moving objects. </constant> <constant name="CCD_MODE_CAST_RAY" value="1"> + Enables continuous collision detection by raycasting. It is faster than shapecasting, but less precise. </constant> <constant name="CCD_MODE_CAST_SHAPE" value="2"> + Enables continuous collision detection by shapecasting. It is the slowest CCD method, and the most precise. </constant> </constants> </class> @@ -29375,7 +29714,7 @@ This method controls whether the position between two cached points is interpola <method name="get_nodes_in_group"> <return type="Array"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="group" type="String"> </argument> <description> </description> @@ -29386,6 +29725,14 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> + <method name="has_group" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </method> <method name="set_auto_accept_quit"> <argument index="0" name="enabled" type="bool"> </argument> @@ -29980,13 +30327,13 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> - <method name="scalar_const_node_get_value"> + <method name="scalar_const_node_get_value" qualifiers="const"> + <return type="float"> + </return> <argument index="0" name="shader_type" type="int"> </argument> <argument index="1" name="id" type="int"> </argument> - <argument index="2" name="arg2" type="float"> - </argument> <description> </description> </method> @@ -30000,13 +30347,13 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> - <method name="vec_const_node_get_value"> + <method name="vec_const_node_get_value" qualifiers="const"> + <return type="Vector3"> + </return> <argument index="0" name="shader_type" type="int"> </argument> <argument index="1" name="id" type="int"> </argument> - <argument index="2" name="arg2" type="Vector3"> - </argument> <description> </description> </method> @@ -30020,13 +30367,13 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> - <method name="rgb_const_node_get_value"> + <method name="rgb_const_node_get_value" qualifiers="const"> + <return type="Color"> + </return> <argument index="0" name="shader_type" type="int"> </argument> <argument index="1" name="id" type="int"> </argument> - <argument index="2" name="arg2" type="Color"> - </argument> <description> </description> </method> @@ -30040,13 +30387,13 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> - <method name="xform_const_node_get_value"> + <method name="xform_const_node_get_value" qualifiers="const"> + <return type="Transform"> + </return> <argument index="0" name="shader_type" type="int"> </argument> <argument index="1" name="id" type="int"> </argument> - <argument index="2" name="arg2" type="Transform"> - </argument> <description> </description> </method> @@ -30060,13 +30407,13 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> - <method name="texture_node_get_filter_size"> + <method name="texture_node_get_filter_size" qualifiers="const"> + <return type="int"> + </return> <argument index="0" name="shader_type" type="int"> </argument> <argument index="1" name="id" type="int"> </argument> - <argument index="2" name="arg2" type="int"> - </argument> <description> </description> </method> @@ -30080,13 +30427,13 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> - <method name="texture_node_get_filter_strength"> + <method name="texture_node_get_filter_strength" qualifiers="const"> + <return type="float"> + </return> <argument index="0" name="shader_type" type="int"> </argument> <argument index="1" name="id" type="float"> </argument> - <argument index="2" name="arg2" type="float"> - </argument> <description> </description> </method> @@ -30513,6 +30860,8 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="node_get_state" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="shader_type" type="int"> </argument> <argument index="1" name="id" type="int"> @@ -30775,12 +31124,14 @@ This method controls whether the position between two cached points is interpola <method name="set_shader_param"> <argument index="0" name="param" type="String"> </argument> - <argument index="1" name="value" type="var"> + <argument index="1" name="value" type="Variant"> </argument> <description> </description> </method> <method name="get_shader_param" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="param" type="String"> </argument> <description> @@ -30856,6 +31207,8 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="collide_and_get_contacts"> + <return type="Variant"> + </return> <argument index="0" name="local_xform" type="Matrix32"> </argument> <argument index="1" name="with_shape" type="Shape2D"> @@ -30868,6 +31221,8 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="collide_with_motion_and_get_contacts"> + <return type="Variant"> + </return> <argument index="0" name="local_xform" type="Matrix32"> </argument> <argument index="1" name="local_motion" type="Vector2"> @@ -31422,6 +31777,12 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> + <method name="set_hidden"> + <argument index="0" name="hidden" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_notify_local_transform"> <argument index="0" name="enable" type="bool"> </argument> @@ -31710,7 +32071,7 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="play"> - <argument index="0" name="arg0" type="float" default="0"> + <argument index="0" name="offset" type="float" default="0"> </argument> <description> </description> @@ -32543,7 +32904,7 @@ This method controls whether the position between two cached points is interpola <argument index="0" name="vel" type="Vector2"> </argument> <description> - Set a constant linear velocity for the body. + Set a constant linear velocity for the body. This does not move the body, but affects other bodies touching it, as if it was moving. </description> </method> <method name="set_constant_angular_velocity"> @@ -32557,7 +32918,7 @@ This method controls whether the position between two cached points is interpola <return type="Vector2"> </return> <description> - Return the constant linear velocity for the body. + Return the constant linear velocity for the body. This does not rotate the body, but affects other bodies touching it, as if it was rotating. </description> </method> <method name="get_constant_angular_velocity" qualifiers="const"> @@ -32571,24 +32932,28 @@ This method controls whether the position between two cached points is interpola <argument index="0" name="friction" type="float"> </argument> <description> + Set the body friction, from 0 (frictionless) to 1 (full friction). </description> </method> <method name="get_friction" qualifiers="const"> <return type="float"> </return> <description> + Return the body friction. </description> </method> <method name="set_bounce"> <argument index="0" name="bounce" type="float"> </argument> <description> + Set the body bounciness, from 0 (not bouncy) to 1 (bouncy). </description> </method> <method name="get_bounce" qualifiers="const"> <return type="float"> </return> <description> + Return the body bounciness. </description> </method> </methods> @@ -32639,6 +33004,178 @@ This method controls whether the position between two cached points is interpola Return a chunk data with the received bytes. The amount of bytes to be received can be requested in the "bytes" argument. If not enough bytes are available, the function will return how many were actually received. This function returns two values, an [Error] code, and a data array. </description> </method> + <method name="get_available_bytes" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="set_big_endian"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="is_big_endian_enabled" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="put_8"> + <argument index="0" name="val" type="int"> + </argument> + <description> + </description> + </method> + <method name="put_u8"> + <argument index="0" name="val" type="int"> + </argument> + <description> + </description> + </method> + <method name="put_16"> + <argument index="0" name="val" type="int"> + </argument> + <description> + </description> + </method> + <method name="put_u16"> + <argument index="0" name="val" type="int"> + </argument> + <description> + </description> + </method> + <method name="put_32"> + <argument index="0" name="val" type="int"> + </argument> + <description> + </description> + </method> + <method name="put_u32"> + <argument index="0" name="val" type="int"> + </argument> + <description> + </description> + </method> + <method name="put_64"> + <argument index="0" name="val" type="int"> + </argument> + <description> + </description> + </method> + <method name="put_u64"> + <argument index="0" name="val" type="int"> + </argument> + <description> + </description> + </method> + <method name="put_float"> + <argument index="0" name="val" type="float"> + </argument> + <description> + </description> + </method> + <method name="put_double"> + <argument index="0" name="val" type="float"> + </argument> + <description> + </description> + </method> + <method name="put_utf8_string"> + <argument index="0" name="val" type="String"> + </argument> + <description> + </description> + </method> + <method name="put_var"> + <argument index="0" name="val" type="Variant"> + </argument> + <description> + </description> + </method> + <method name="get_8"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_u8"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_16"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_u16"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_32"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_u32"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_64"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_u64"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_float"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_double"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_string"> + <return type="String"> + </return> + <argument index="0" name="bytes" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_utf8_string"> + <return type="String"> + </return> + <argument index="0" name="bytes" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_var"> + <return type="Variant"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> @@ -32770,7 +33307,7 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="play"> - <argument index="0" name="arg0" type="float" default="0"> + <argument index="0" name="offset" type="float" default="0"> </argument> <description> </description> @@ -32900,6 +33437,12 @@ This method controls whether the position between two cached points is interpola </description> </method> </methods> + <signals> + <signal name="finished"> + <description> + </description> + </signal> + </signals> <constants> </constants> </class> @@ -33449,9 +33992,9 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="draw" qualifiers="const"> - <argument index="0" name="arg0" type="RID"> + <argument index="0" name="canvas_item" type="RID"> </argument> - <argument index="1" name="arg1" type="Rect2"> + <argument index="1" name="rect" type="Rect2"> </argument> <description> </description> @@ -33604,7 +34147,7 @@ This method controls whether the position between two cached points is interpola <method name="get_expand_margin_size" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="margin" type="int"> </argument> <description> Return the expand margin size (from enum MARGIN_*). Parts of the image below the size of the margin (and in the direction of the margin) will not expand. @@ -33645,7 +34188,7 @@ This method controls whether the position between two cached points is interpola <method name="get_margin_size" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="margin" type="int"> </argument> <description> </description> @@ -33661,7 +34204,7 @@ This method controls whether the position between two cached points is interpola <method name="get_expand_margin_size" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="margin" type="int"> </argument> <description> </description> @@ -34132,6 +34675,14 @@ This method controls whether the position between two cached points is interpola </theme_item> <theme_item name="font_color_fg" type="Color"> </theme_item> + <theme_item name="increment_hilite" type="Texture"> + </theme_item> + <theme_item name="decrement_hilite" type="Texture"> + </theme_item> + <theme_item name="increment" type="Texture"> + </theme_item> + <theme_item name="decrement" type="Texture"> + </theme_item> <theme_item name="font" type="Font"> </theme_item> <theme_item name="tab_fg" type="StyleBox"> @@ -34195,7 +34746,7 @@ This method controls whether the position between two cached points is interpola <method name="get_line" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="line" type="int"> </argument> <description> Return the text of a specific line. @@ -34204,7 +34755,7 @@ This method controls whether the position between two cached points is interpola <method name="cursor_set_column"> <argument index="0" name="column" type="int"> </argument> - <argument index="1" name="arg1" type="bool"> + <argument index="1" name="adjust_viewport" type="bool" default="false"> </argument> <description> </description> @@ -34212,7 +34763,7 @@ This method controls whether the position between two cached points is interpola <method name="cursor_set_line"> <argument index="0" name="line" type="int"> </argument> - <argument index="1" name="arg1" type="bool"> + <argument index="1" name="adjust_viewport" type="bool" default="false"> </argument> <description> </description> @@ -34554,7 +35105,7 @@ This method controls whether the position between two cached points is interpola </argument> <argument index="2" name="modulate" type="Color" default="Color(1,1,1,1)"> </argument> - <argument index="3" name="arg3" type="bool" default="false"> + <argument index="3" name="transpose" type="bool" default="false"> </argument> <description> </description> @@ -34568,7 +35119,7 @@ This method controls whether the position between two cached points is interpola </argument> <argument index="3" name="modulate" type="Color" default="Color(1,1,1,1)"> </argument> - <argument index="4" name="arg4" type="bool" default="false"> + <argument index="4" name="transpose" type="bool" default="false"> </argument> <description> </description> @@ -34582,7 +35133,7 @@ This method controls whether the position between two cached points is interpola </argument> <argument index="3" name="modulate" type="Color" default="Color(1,1,1,1)"> </argument> - <argument index="4" name="arg4" type="bool" default="false"> + <argument index="4" name="transpose" type="bool" default="false"> </argument> <description> </description> @@ -34657,7 +35208,7 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> - <method name="set_scale"> + <method name="set_texture_scale"> <argument index="0" name="scale" type="Vector2"> </argument> <description> @@ -34705,7 +35256,7 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> - <method name="get_scale" qualifiers="const"> + <method name="get_texture_scale" qualifiers="const"> <return type="Vector2"> </return> <description> @@ -34927,7 +35478,7 @@ This method controls whether the position between two cached points is interpola <method name="get_icon_list" qualifiers="const"> <return type="StringArray"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="type" type="String"> </argument> <description> </description> @@ -34973,7 +35524,7 @@ This method controls whether the position between two cached points is interpola <method name="get_stylebox_list" qualifiers="const"> <return type="StringArray"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="type" type="String"> </argument> <description> </description> @@ -35019,7 +35570,7 @@ This method controls whether the position between two cached points is interpola <method name="get_font_list" qualifiers="const"> <return type="StringArray"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="type" type="String"> </argument> <description> </description> @@ -35065,7 +35616,7 @@ This method controls whether the position between two cached points is interpola <method name="get_color_list" qualifiers="const"> <return type="StringArray"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="type" type="String"> </argument> <description> </description> @@ -35111,7 +35662,7 @@ This method controls whether the position between two cached points is interpola <method name="get_constant_list" qualifiers="const"> <return type="StringArray"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="type" type="String"> </argument> <description> </description> @@ -35131,7 +35682,7 @@ This method controls whether the position between two cached points is interpola <method name="get_type_list" qualifiers="const"> <return type="StringArray"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="type" type="String"> </argument> <description> </description> @@ -35177,6 +35728,16 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="wait_to_finish"> + <return type="Variant"> + </return> + <description> + </description> + </method> + <method name="set_name"> + <return type="Error"> + </return> + <argument index="0" name="name" type="String"> + </argument> <description> </description> </method> @@ -35416,6 +35977,18 @@ This method controls whether the position between two cached points is interpola Return the collision bounce parameter. </description> </method> + <method name="set_occluder_light_mask"> + <argument index="0" name="mask" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_occluder_light_mask" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="set_cell"> <argument index="0" name="x" type="int"> </argument> @@ -36281,19 +36854,19 @@ This method controls whether the position between two cached points is interpola <method name="translate" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="message" type="String"> </argument> <description> </description> </method> <method name="add_translation"> - <argument index="0" name="arg0" type="Object"> + <argument index="0" name="translation" type="Translation"> </argument> <description> </description> </method> <method name="remove_translation"> - <argument index="0" name="arg0" type="Object"> + <argument index="0" name="translation" type="Translation"> </argument> <description> </description> @@ -36331,17 +36904,17 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="set_column_min_width"> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="column" type="int"> </argument> - <argument index="1" name="arg1" type="int"> + <argument index="1" name="min_width" type="int"> </argument> <description> </description> </method> <method name="set_column_expand"> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="column" type="int"> </argument> - <argument index="1" name="arg1" type="bool"> + <argument index="1" name="expand" type="bool"> </argument> <description> </description> @@ -36349,13 +36922,13 @@ This method controls whether the position between two cached points is interpola <method name="get_column_width" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="column" type="int"> </argument> <description> </description> </method> <method name="set_hide_root"> - <argument index="0" name="arg0" type="bool"> + <argument index="0" name="enable" type="bool"> </argument> <description> </description> @@ -36815,6 +37388,8 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="remove_child"> + <return type="TreeItem"> + </return> <argument index="0" name="child" type="Object"> </argument> <description> @@ -36913,7 +37488,7 @@ This method controls whether the position between two cached points is interpola </argument> <argument index="1" name="button" type="Texture"> </argument> - <argument index="2" name="arg2" type="int"> + <argument index="2" name="button_idx" type="int"> </argument> <description> </description> @@ -37437,7 +38012,7 @@ This method controls whether the position between two cached points is interpola </argument> <argument index="1" name="property" type="String"> </argument> - <argument index="2" name="value" type="var"> + <argument index="2" name="value" type="Variant"> </argument> <description> </description> @@ -37447,7 +38022,7 @@ This method controls whether the position between two cached points is interpola </argument> <argument index="1" name="property" type="String"> </argument> - <argument index="2" name="value" type="var"> + <argument index="2" name="value" type="Variant"> </argument> <description> </description> @@ -38475,6 +39050,12 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> + <method name="get_video_texutre"> + <return type="Texture"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> @@ -38805,7 +39386,7 @@ This method controls whether the position between two cached points is interpola </description> </method> <method name="set_render_target_to_screen_rect"> - <argument index="0" name="arg0" type="Rect2"> + <argument index="0" name="rect" type="Rect2"> </argument> <description> </description> @@ -40277,6 +40858,14 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> + <method name="canvas_item_set_z"> + <argument index="0" name="arg0" type="RID"> + </argument> + <argument index="1" name="arg1" type="int"> + </argument> + <description> + </description> + </method> <method name="canvas_item_add_line"> <argument index="0" name="arg0" type="RID"> </argument> @@ -40722,6 +41311,8 @@ This method controls whether the position between two cached points is interpola </description> <methods> <method name="get_ref" qualifiers="const"> + <return type="Object"> + </return> <description> </description> </method> @@ -40933,7 +41524,7 @@ This method controls whether the position between two cached points is interpola <method name="get_attribute_name" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="idx" type="int"> </argument> <description> </description> @@ -40941,7 +41532,7 @@ This method controls whether the position between two cached points is interpola <method name="get_attribute_value" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="idx" type="int"> </argument> <description> </description> @@ -40949,7 +41540,7 @@ This method controls whether the position between two cached points is interpola <method name="has_attribute" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="name" type="String"> </argument> <description> </description> @@ -40957,7 +41548,7 @@ This method controls whether the position between two cached points is interpola <method name="get_named_attribute_value" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="name" type="String"> </argument> <description> </description> @@ -40965,7 +41556,7 @@ This method controls whether the position between two cached points is interpola <method name="get_named_attribute_value_safe" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="name" type="String"> </argument> <description> </description> @@ -40989,7 +41580,7 @@ This method controls whether the position between two cached points is interpola <method name="seek"> <return type="int"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="pos" type="int"> </argument> <description> </description> diff --git a/doc/tools/makedocs.py b/doc/tools/makedocs.py index db9f04b091..063ee29002 100644 --- a/doc/tools/makedocs.py +++ b/doc/tools/makedocs.py @@ -3,7 +3,7 @@ # # makedocs.py: Generate documentation for Open Project Wiki -# Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. +# Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. # Contributor: Jorge Araya Navarro <elcorreo@deshackra.com> # diff --git a/drivers/SCsub b/drivers/SCsub index e52d6538e5..a00d7fc3f9 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -12,11 +12,13 @@ SConscript('windows/SCsub'); SConscript('gles2/SCsub'); SConscript('gl_context/SCsub'); SConscript('openssl/SCsub'); +SConscript('pnm/SCsub'); if (env["png"]=="yes"): SConscript("png/SCsub"); if (env["jpg"]=="yes"): - SConscript("jpg/SCsub"); + #SConscript("jpg/SCsub"); + SConscript("jpegd/SCsub"); if (env["webp"]=="yes"): SConscript("webp/SCsub"); SConscript("dds/SCsub"); diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp index 4bc35f86ee..6a3bd9bb22 100644 --- a/drivers/alsa/audio_driver_alsa.cpp +++ b/drivers/alsa/audio_driver_alsa.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/alsa/audio_driver_alsa.h b/drivers/alsa/audio_driver_alsa.h index 10f9298859..54fc8dccc9 100644 --- a/drivers/alsa/audio_driver_alsa.h +++ b/drivers/alsa/audio_driver_alsa.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_config.h b/drivers/chibi/cp_config.h index 9cd754ed47..2ad704ace7 100644 --- a/drivers/chibi/cp_config.h +++ b/drivers/chibi/cp_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_envelope.cpp b/drivers/chibi/cp_envelope.cpp index 6ed42a1167..fab8a68ada 100644 --- a/drivers/chibi/cp_envelope.cpp +++ b/drivers/chibi/cp_envelope.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_envelope.h b/drivers/chibi/cp_envelope.h index e01605ada3..d1ada53f7d 100644 --- a/drivers/chibi/cp_envelope.h +++ b/drivers/chibi/cp_envelope.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_file_access_wrapper.cpp b/drivers/chibi/cp_file_access_wrapper.cpp index d7c6c6d0b6..8ccde3735c 100644 --- a/drivers/chibi/cp_file_access_wrapper.cpp +++ b/drivers/chibi/cp_file_access_wrapper.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_file_access_wrapper.h b/drivers/chibi/cp_file_access_wrapper.h index c54ce5868d..5b361c0ea8 100644 --- a/drivers/chibi/cp_file_access_wrapper.h +++ b/drivers/chibi/cp_file_access_wrapper.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_instrument.cpp b/drivers/chibi/cp_instrument.cpp index 2e5af70565..7a732e33a4 100644 --- a/drivers/chibi/cp_instrument.cpp +++ b/drivers/chibi/cp_instrument.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_instrument.h b/drivers/chibi/cp_instrument.h index 8b434402c5..d8eb8333ee 100644 --- a/drivers/chibi/cp_instrument.h +++ b/drivers/chibi/cp_instrument.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_loader.h b/drivers/chibi/cp_loader.h index 7763c395b9..9d1074d1b8 100644 --- a/drivers/chibi/cp_loader.h +++ b/drivers/chibi/cp_loader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_loader_it.cpp b/drivers/chibi/cp_loader_it.cpp index 74dd228437..20a3960a23 100644 --- a/drivers/chibi/cp_loader_it.cpp +++ b/drivers/chibi/cp_loader_it.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_loader_it.h b/drivers/chibi/cp_loader_it.h index 6ba605bf04..38a1cdd9c4 100644 --- a/drivers/chibi/cp_loader_it.h +++ b/drivers/chibi/cp_loader_it.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_loader_it_info.cpp b/drivers/chibi/cp_loader_it_info.cpp index 0cfd73f1e3..0360f7f9a4 100644 --- a/drivers/chibi/cp_loader_it_info.cpp +++ b/drivers/chibi/cp_loader_it_info.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_loader_it_instruments.cpp b/drivers/chibi/cp_loader_it_instruments.cpp index 6293be162c..ccb24bd81c 100644 --- a/drivers/chibi/cp_loader_it_instruments.cpp +++ b/drivers/chibi/cp_loader_it_instruments.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_loader_it_patterns.cpp b/drivers/chibi/cp_loader_it_patterns.cpp index c79dffc180..d951a91620 100644 --- a/drivers/chibi/cp_loader_it_patterns.cpp +++ b/drivers/chibi/cp_loader_it_patterns.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_loader_it_samples.cpp b/drivers/chibi/cp_loader_it_samples.cpp index 24d3a12781..ced7252a6c 100644 --- a/drivers/chibi/cp_loader_it_samples.cpp +++ b/drivers/chibi/cp_loader_it_samples.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_loader_mod.cpp b/drivers/chibi/cp_loader_mod.cpp index 98174ff9b1..f867b77914 100644 --- a/drivers/chibi/cp_loader_mod.cpp +++ b/drivers/chibi/cp_loader_mod.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -446,18 +446,19 @@ CPLoader::Error CPLoader_MOD::load_song(const char *p_file,CPSong *p_song,bool p if (sid.is_null()) { continue; //empty sample, not stored? } - + sm->lock_data(sid); + uint8_t *dataptr = (uint8_t*)sm->get_data(sid); + int len=sm->get_size(sid); for (int s=0;s<len;s++) { uint8_t d=file->get_byte(); //d-=128; //convert to signed int8_t*ds=(int8_t*)&d; - int16_t d16=*ds; - d16<<=8; - sm->set_data( sid, s, d16 ); + dataptr[s]=*ds; } + sm->unlock_data(sid); } file->close(); diff --git a/drivers/chibi/cp_loader_mod.h b/drivers/chibi/cp_loader_mod.h index 77245349b7..636f4f00f2 100644 --- a/drivers/chibi/cp_loader_mod.h +++ b/drivers/chibi/cp_loader_mod.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_loader_s3m.cpp b/drivers/chibi/cp_loader_s3m.cpp index c21f7bdd38..0fc15c1e2f 100644 --- a/drivers/chibi/cp_loader_s3m.cpp +++ b/drivers/chibi/cp_loader_s3m.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -196,8 +196,12 @@ CPLoader::Error CPLoader_S3M::load_sample(CPSample *p_sample) { if (id.is_null()) return FILE_OUT_OF_MEMORY; + + sm->lock_data(id); + void *dataptr = sm->get_data(id); - for (int c=0;c<(data_is_stereo?2:1);c++) { + int chans = (data_is_stereo?2:1); + for (int c=0;c<chans;c++) { for (int i=0;i<sample_size;i++) { if (data_is_16bits) { @@ -206,7 +210,7 @@ CPLoader::Error CPLoader_S3M::load_sample(CPSample *p_sample) { s-=32768; //toggle sign int16_t *v=(int16_t*)&s; - sm->set_data(id,i,*v,c); + ((int16_t*)dataptr)[i*chans+c]=*v; } else { @@ -214,16 +218,16 @@ CPLoader::Error CPLoader_S3M::load_sample(CPSample *p_sample) { uint8_t s=file->get_byte(); s-=128; //toggle sign v=(int8_t*)&s; - int16_t v16=*v; - v16<<=8; - sm->set_data(id,i,v16,c); - + ((int8_t*)dataptr)[i*chans+c]=*v; + } - - + } } + + sm->unlock_data(id); + sm->set_loop_begin( id, loop_begin ); sm->set_loop_end( id, loop_end ); diff --git a/drivers/chibi/cp_loader_s3m.h b/drivers/chibi/cp_loader_s3m.h index 6fe9f0ca44..175e5e80fe 100644 --- a/drivers/chibi/cp_loader_s3m.h +++ b/drivers/chibi/cp_loader_s3m.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_loader_xm.cpp b/drivers/chibi/cp_loader_xm.cpp index 8bde6b673e..8ab6abc650 100644 --- a/drivers/chibi/cp_loader_xm.cpp +++ b/drivers/chibi/cp_loader_xm.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -627,6 +627,10 @@ CPLoader::Error CPLoader_XM::load_instrument_internal(CPInstrument *p_instr,bool CPSample *sample=song->get_sample(sample_index[j]); CPSample_ID sid=sample->get_sample_data(); + sm->lock_data(sid); + + void*dataptr=sm->get_data(sid); + if (sm->is_16bits( sid)) { int16_t old=0; @@ -638,8 +642,9 @@ CPLoader::Error CPLoader_XM::load_instrument_internal(CPInstrument *p_instr,bool int16_t sampleval=file->get_word(); newsample=sampleval+old; old=newsample; - - sm->set_data( sid, k, newsample ); + + ((int16_t*)dataptr)[k]=newsample; + //sm->set_data( sid, k, newsample ); } } else { @@ -653,10 +658,15 @@ CPLoader::Error CPLoader_XM::load_instrument_internal(CPInstrument *p_instr,bool newsample=sampleval+old; old=newsample; - sm->set_data( sid, k, (int16_t)newsample << 8 ); + ((int8_t*)dataptr)[k]=newsample; + + //sm->set_data( sid, k, (int16_t)newsample << 8 ); } } + + sm->unlock_data(sid); + } for (int j=0;j<96;j++) { diff --git a/drivers/chibi/cp_loader_xm.h b/drivers/chibi/cp_loader_xm.h index 0a2465475f..9ae480cc8f 100644 --- a/drivers/chibi/cp_loader_xm.h +++ b/drivers/chibi/cp_loader_xm.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_mixer.h b/drivers/chibi/cp_mixer.h index bac2087edf..7ad22ac146 100644 --- a/drivers/chibi/cp_mixer.h +++ b/drivers/chibi/cp_mixer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_note.h b/drivers/chibi/cp_note.h index 5d2c01844a..5cfa3f11ec 100644 --- a/drivers/chibi/cp_note.h +++ b/drivers/chibi/cp_note.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_order.h b/drivers/chibi/cp_order.h index a20e202bde..03ecc00bba 100644 --- a/drivers/chibi/cp_order.h +++ b/drivers/chibi/cp_order.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_pattern.cpp b/drivers/chibi/cp_pattern.cpp index cc65833d68..83e165bf87 100644 --- a/drivers/chibi/cp_pattern.cpp +++ b/drivers/chibi/cp_pattern.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_pattern.h b/drivers/chibi/cp_pattern.h index 22611eabab..4065caa5e5 100644 --- a/drivers/chibi/cp_pattern.h +++ b/drivers/chibi/cp_pattern.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_player_data.cpp b/drivers/chibi/cp_player_data.cpp index 76d8f280d2..3f3e9a5202 100644 --- a/drivers/chibi/cp_player_data.cpp +++ b/drivers/chibi/cp_player_data.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_player_data.h b/drivers/chibi/cp_player_data.h index 36a27942cb..282592b8f4 100644 --- a/drivers/chibi/cp_player_data.h +++ b/drivers/chibi/cp_player_data.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_player_data_control.cpp b/drivers/chibi/cp_player_data_control.cpp index d5ca648fff..d9aaed904f 100644 --- a/drivers/chibi/cp_player_data_control.cpp +++ b/drivers/chibi/cp_player_data_control.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_player_data_effects.cpp b/drivers/chibi/cp_player_data_effects.cpp index eb62b8d962..3a52a3b91b 100644 --- a/drivers/chibi/cp_player_data_effects.cpp +++ b/drivers/chibi/cp_player_data_effects.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_player_data_envelopes.cpp b/drivers/chibi/cp_player_data_envelopes.cpp index 94378b8bf4..96af42d19f 100644 --- a/drivers/chibi/cp_player_data_envelopes.cpp +++ b/drivers/chibi/cp_player_data_envelopes.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_player_data_events.cpp b/drivers/chibi/cp_player_data_events.cpp index 7a7cfdf5bb..8122988516 100644 --- a/drivers/chibi/cp_player_data_events.cpp +++ b/drivers/chibi/cp_player_data_events.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_player_data_filter.cpp b/drivers/chibi/cp_player_data_filter.cpp index fd87e4ae7a..30db807eed 100644 --- a/drivers/chibi/cp_player_data_filter.cpp +++ b/drivers/chibi/cp_player_data_filter.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_player_data_nna.cpp b/drivers/chibi/cp_player_data_nna.cpp index 3960234f5e..844f043694 100644 --- a/drivers/chibi/cp_player_data_nna.cpp +++ b/drivers/chibi/cp_player_data_nna.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_player_data_notes.cpp b/drivers/chibi/cp_player_data_notes.cpp index ea3ba42e86..621be019e1 100644 --- a/drivers/chibi/cp_player_data_notes.cpp +++ b/drivers/chibi/cp_player_data_notes.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_player_data_reserved.cpp b/drivers/chibi/cp_player_data_reserved.cpp index 8d9439158b..a626ffd111 100644 --- a/drivers/chibi/cp_player_data_reserved.cpp +++ b/drivers/chibi/cp_player_data_reserved.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_player_data_utils.cpp b/drivers/chibi/cp_player_data_utils.cpp index 5294fc8139..170a849863 100644 --- a/drivers/chibi/cp_player_data_utils.cpp +++ b/drivers/chibi/cp_player_data_utils.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_sample.cpp b/drivers/chibi/cp_sample.cpp index bff24d4c4c..55c2c910a5 100644 --- a/drivers/chibi/cp_sample.cpp +++ b/drivers/chibi/cp_sample.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_sample.h b/drivers/chibi/cp_sample.h index 71b57aaa81..4b3d218106 100644 --- a/drivers/chibi/cp_sample.h +++ b/drivers/chibi/cp_sample.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_sample_defs.h b/drivers/chibi/cp_sample_defs.h index 32817efc7d..169963c98e 100644 --- a/drivers/chibi/cp_sample_defs.h +++ b/drivers/chibi/cp_sample_defs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_sample_manager.cpp b/drivers/chibi/cp_sample_manager.cpp index 601db07acf..5c2988e3f9 100644 --- a/drivers/chibi/cp_sample_manager.cpp +++ b/drivers/chibi/cp_sample_manager.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_sample_manager.h b/drivers/chibi/cp_sample_manager.h index 2891034482..74bcafc0cf 100644 --- a/drivers/chibi/cp_sample_manager.h +++ b/drivers/chibi/cp_sample_manager.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_song.cpp b/drivers/chibi/cp_song.cpp index 956e2ee6d4..4aa1a4228d 100644 --- a/drivers/chibi/cp_song.cpp +++ b/drivers/chibi/cp_song.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_song.h b/drivers/chibi/cp_song.h index 6c35b43c76..da5d106a63 100644 --- a/drivers/chibi/cp_song.h +++ b/drivers/chibi/cp_song.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_tables.cpp b/drivers/chibi/cp_tables.cpp index 9f1ae30c9a..8c62150f31 100644 --- a/drivers/chibi/cp_tables.cpp +++ b/drivers/chibi/cp_tables.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/cp_tables.h b/drivers/chibi/cp_tables.h index 6c3c9271b0..ac7ee562b7 100644 --- a/drivers/chibi/cp_tables.h +++ b/drivers/chibi/cp_tables.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/event_stream_chibi.cpp b/drivers/chibi/event_stream_chibi.cpp index ecb5c3f22b..3449583d36 100644 --- a/drivers/chibi/event_stream_chibi.cpp +++ b/drivers/chibi/event_stream_chibi.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/chibi/event_stream_chibi.h b/drivers/chibi/event_stream_chibi.h index b564c16018..cc7b0ace86 100644 --- a/drivers/chibi/event_stream_chibi.h +++ b/drivers/chibi/event_stream_chibi.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/convex_decomp/b2Polygon.cpp b/drivers/convex_decomp/b2Polygon.cpp index 775f2adfe2..73955d3573 100644 --- a/drivers/convex_decomp/b2Polygon.cpp +++ b/drivers/convex_decomp/b2Polygon.cpp @@ -217,8 +217,8 @@ b2Polygon::b2Polygon(b2Triangle& t) { void b2Polygon::Set(const b2Polygon& p) { if (nVertices != p.nVertices){ nVertices = p.nVertices; - if (x) delete[] x; - if (y) delete[] y; + delete[] x; + delete[] y; x = new float32[nVertices]; y = new float32[nVertices]; } diff --git a/drivers/gl_context/context_gl.cpp b/drivers/gl_context/context_gl.cpp index 82195cc6f6..c1bf6b38ea 100644 --- a/drivers/gl_context/context_gl.cpp +++ b/drivers/gl_context/context_gl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/drivers/gl_context/context_gl.h b/drivers/gl_context/context_gl.h index 6b06ccdc37..1ea3662ada 100644 --- a/drivers/gl_context/context_gl.h +++ b/drivers/gl_context/context_gl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 83b71fd5ff..58d5c307f0 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -929,6 +929,7 @@ void RasterizerGLES2::texture_allocate(RID p_texture,int p_width, int p_height,I texture->compressed=compressed; texture->has_alpha=false; //by default it doesn't have alpha unless something with alpha is blitteds texture->data_size=0; + texture->mipmaps=0; glActiveTexture(GL_TEXTURE0); @@ -1086,6 +1087,7 @@ void RasterizerGLES2::texture_set_data(RID p_texture,const Image& p_image,VS::Cu glGenerateMipmap(texture->target); } + texture->mipmaps=mipmaps; @@ -1269,11 +1271,14 @@ void RasterizerGLES2::texture_set_flags(RID p_texture,uint32_t p_flags) { p_flags&=VS::TEXTURE_FLAG_FILTER;//can change only filter } + bool had_mipmaps = texture->flags&VS::TEXTURE_FLAG_MIPMAPS; + glActiveTexture(GL_TEXTURE0); glBindTexture(texture->target, texture->tex_id); uint32_t cube = texture->flags & VS::TEXTURE_FLAG_CUBEMAP; texture->flags=p_flags|cube; // can't remove a cube from being a cube + bool force_clamp_to_edge = !(p_flags&VS::TEXTURE_FLAG_MIPMAPS && !texture->ignore_mipmaps) && (nearest_power_of_2(texture->alloc_height)!=texture->alloc_height || nearest_power_of_2(texture->alloc_width)!=texture->alloc_width); if (!force_clamp_to_edge && (texture->flags&VS::TEXTURE_FLAG_REPEAT || texture->flags&VS::TEXTURE_FLAG_MIRRORED_REPEAT) && texture->target != GL_TEXTURE_CUBE_MAP) { @@ -1304,9 +1309,13 @@ void RasterizerGLES2::texture_set_flags(RID p_texture,uint32_t p_flags) { } } - if (texture->flags&VS::TEXTURE_FLAG_MIPMAPS && !texture->ignore_mipmaps) + if (texture->flags&VS::TEXTURE_FLAG_MIPMAPS && !texture->ignore_mipmaps) { + if (!had_mipmaps && texture->mipmaps==1) { + glGenerateMipmap(texture->target); + } glTexParameteri(texture->target,GL_TEXTURE_MIN_FILTER,use_fast_texture_filter?GL_LINEAR_MIPMAP_NEAREST:GL_LINEAR_MIPMAP_LINEAR); - else{ + + } else{ if (texture->flags&VS::TEXTURE_FLAG_FILTER) { glTexParameteri(texture->target,GL_TEXTURE_MIN_FILTER,GL_LINEAR); } else { @@ -8330,6 +8339,14 @@ void RasterizerGLES2::canvas_draw_rect(const Rect2& p_rect, int p_flags, const R if ( texture ) { + bool untile=false; + + if (p_flags&CANVAS_RECT_TILE && !(texture->flags&VS::TEXTURE_FLAG_REPEAT)) { + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); + untile=true; + } + if (!(p_flags&CANVAS_RECT_REGION)) { Rect2 region = Rect2(0,0,texture->width,texture->height); @@ -8340,6 +8357,12 @@ void RasterizerGLES2::canvas_draw_rect(const Rect2& p_rect, int p_flags, const R _draw_textured_quad(p_rect, p_source, Size2(texture->width,texture->height),p_flags&CANVAS_RECT_FLIP_H,p_flags&CANVAS_RECT_FLIP_V,p_flags&CANVAS_RECT_TRANSPOSE); } + + if (untile) { + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); + } + } else { //glDisable(GL_TEXTURE_2D); @@ -10306,6 +10329,8 @@ void RasterizerGLES2::_update_framebuffer() { return; int scale = GLOBAL_DEF("rasterizer/framebuffer_shrink",1); + if (scale<1) + scale=1; int dwidth = OS::get_singleton()->get_video_mode().width/scale; int dheight = OS::get_singleton()->get_video_mode().height/scale; diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index e203a56c24..0f70ceaa97 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -138,6 +138,8 @@ class RasterizerGLES2 : public Rasterizer { StringName reloader_func; Image image[6]; + int mipmaps; + bool active; GLuint tex_id; @@ -159,6 +161,7 @@ class RasterizerGLES2 : public Rasterizer { compressed=false; total_data_size=0; target=GL_TEXTURE_2D; + mipmaps=0; reloader=0; } diff --git a/drivers/gles2/rasterizer_instance_gles2.cpp b/drivers/gles2/rasterizer_instance_gles2.cpp index a8d478c6e0..9d43ecb085 100644 --- a/drivers/gles2/rasterizer_instance_gles2.cpp +++ b/drivers/gles2/rasterizer_instance_gles2.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/gles2/rasterizer_instance_gles2.h b/drivers/gles2/rasterizer_instance_gles2.h index f5ac5f1fe2..c41bd71c15 100644 --- a/drivers/gles2/rasterizer_instance_gles2.h +++ b/drivers/gles2/rasterizer_instance_gles2.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index f981529ee3..3be0fdab17 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/gles2/shader_compiler_gles2.h b/drivers/gles2/shader_compiler_gles2.h index 46ef2e035f..688003ecf6 100644 --- a/drivers/gles2/shader_compiler_gles2.h +++ b/drivers/gles2/shader_compiler_gles2.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/gles2/shader_gles2.cpp b/drivers/gles2/shader_gles2.cpp index e94930fffb..d397323171 100644 --- a/drivers/gles2/shader_gles2.cpp +++ b/drivers/gles2/shader_gles2.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -739,12 +739,12 @@ void ShaderGLES2::set_custom_shader(uint32_t p_code_id) { void ShaderGLES2::free_custom_shader(uint32_t p_code_id) { - if (! custom_code_map.has( p_code_id )) { + /* if (! custom_code_map.has( p_code_id )) { print_line("no code id "+itos(p_code_id)); } else { print_line("freed code id "+itos(p_code_id)); - } + }*/ ERR_FAIL_COND(! custom_code_map.has( p_code_id )); if (conditional_version.code_version==p_code_id) diff --git a/drivers/gles2/shader_gles2.h b/drivers/gles2/shader_gles2.h index 4604fd5501..68ae8af63f 100644 --- a/drivers/gles2/shader_gles2.h +++ b/drivers/gles2/shader_gles2.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -205,6 +205,11 @@ private: Plane val=p_value; glUniform4f( p_uniform, val.normal.x,val.normal.y,val.normal.z,val.d ); } break; + case Variant::QUAT: { + + Quat val=p_value; + glUniform4f( p_uniform, val.x,val.y,val.z,val.w ); + } break; case Variant::MATRIX32: { diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index 259e82d704..285abd30ff 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -196,7 +196,7 @@ void main() { #ifdef USE_DISTANCE_FIELD const float smoothing = 1.0/32.0; float distance = texture2D(texture, uv_interp).a; - color.a = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance); + color.a = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance) * color.a; #else color *= texture2D( texture, uv_interp ); diff --git a/drivers/jpg/SCsub b/drivers/jpegd/SCsub index df91b10a02..dfdb19402e 100644 --- a/drivers/jpg/SCsub +++ b/drivers/jpegd/SCsub @@ -2,9 +2,8 @@ Import('env') jpg_sources = [ - "jpg/tinyjpeg.c", - "jpg/jidctflt.c", - "jpg/image_loader_jpg.cpp" + "jpegd/jpgd.cpp", + "jpegd/image_loader_jpegd.cpp" ] env.drivers_sources+=jpg_sources diff --git a/drivers/jpegd/image_loader_jpegd.cpp b/drivers/jpegd/image_loader_jpegd.cpp new file mode 100644 index 0000000000..9d1263b81b --- /dev/null +++ b/drivers/jpegd/image_loader_jpegd.cpp @@ -0,0 +1,108 @@ +/*************************************************/ +/* image_loader_jpg.cpp */ +/*************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/*************************************************/ +/* Source code within this file is: */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ +/* All Rights Reserved. */ +/*************************************************/ + +#include "image_loader_jpegd.h" + +#include "print_string.h" +#include "os/os.h" +#include "jpgd.h" +#include <string.h> + + +Error ImageLoaderJPG::load_image(Image *p_image,FileAccess *f) { + + + DVector<uint8_t> src_image; + int src_image_len = f->get_len(); + ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT); + src_image.resize(src_image_len); + + DVector<uint8_t>::Write w = src_image.write(); + + f->get_buffer(&w[0],src_image_len); + + f->close(); + + + + jpgd::jpeg_decoder_mem_stream mem_stream(w.ptr(),src_image_len); + + jpgd::jpeg_decoder decoder(&mem_stream); + + if (decoder.get_error_code() != jpgd::JPGD_SUCCESS) { + return ERR_CANT_OPEN; + } + + const int image_width = decoder.get_width(); + const int image_height = decoder.get_height(); + int comps = decoder.get_num_components(); + if (comps==3) + comps=4; //weird + + if (decoder.begin_decoding() != jpgd::JPGD_SUCCESS) + return ERR_FILE_CORRUPT; + + const int dst_bpl = image_width * comps; + + DVector<uint8_t> data; + + data.resize(dst_bpl * image_height); + + DVector<uint8_t>::Write dw = data.write(); + + jpgd::uint8 *pImage_data = (jpgd::uint8*)dw.ptr(); + + for (int y = 0; y < image_height; y++) + { + const jpgd::uint8* pScan_line; + jpgd::uint scan_line_len; + if (decoder.decode((const void**)&pScan_line, &scan_line_len) != jpgd::JPGD_SUCCESS) + { + return ERR_FILE_CORRUPT; + } + + jpgd::uint8 *pDst = pImage_data + y * dst_bpl; + memcpy(pDst, pScan_line, dst_bpl); + + + } + + + //all good + + Image::Format fmt; + if (comps==1) + fmt=Image::FORMAT_GRAYSCALE; + else + fmt=Image::FORMAT_RGBA; + + dw = DVector<uint8_t>::Write(); + w = DVector<uint8_t>::Write(); + + p_image->create(image_width,image_height,0,fmt,data); + + return OK; + +} + +void ImageLoaderJPG::get_recognized_extensions(List<String> *p_extensions) const { + + p_extensions->push_back("jpg"); + p_extensions->push_back("jpeg"); +} + + +ImageLoaderJPG::ImageLoaderJPG() { + + +} + + diff --git a/drivers/jpg/image_loader_jpg.h b/drivers/jpegd/image_loader_jpegd.h index b1d5b8016f..1b2165ab47 100644 --- a/drivers/jpg/image_loader_jpg.h +++ b/drivers/jpegd/image_loader_jpegd.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/drivers/jpegd/jpgd.cpp b/drivers/jpegd/jpgd.cpp new file mode 100644 index 0000000000..fad9a37a9a --- /dev/null +++ b/drivers/jpegd/jpgd.cpp @@ -0,0 +1,3172 @@ +// jpgd.cpp - C++ class for JPEG decompression. +// Public domain, Rich Geldreich <richgel99@gmail.com> +// Alex Evans: Linear memory allocator (taken from jpge.h). +// v1.04, May. 19, 2012: Code tweaks to fix VS2008 static code analysis warnings (all looked harmless) +// +// Supports progressive and baseline sequential JPEG image files, and the most common chroma subsampling factors: Y, H1V1, H2V1, H1V2, and H2V2. +// +// Chroma upsampling quality: H2V2 is upsampled in the frequency domain, H2V1 and H1V2 are upsampled using point sampling. +// Chroma upsampling reference: "Fast Scheme for Image Size Change in the Compressed Domain" +// http://vision.ai.uiuc.edu/~dugad/research/dct/index.html + +#include "jpgd.h" +#include <string.h> + +#include <assert.h> +#define JPGD_ASSERT(x) assert(x) + +#ifdef _MSC_VER +#pragma warning (disable : 4611) // warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable +#endif + +// Set to 1 to enable freq. domain chroma upsampling on images using H2V2 subsampling (0=faster nearest neighbor sampling). +// This is slower, but results in higher quality on images with highly saturated colors. +#define JPGD_SUPPORT_FREQ_DOMAIN_UPSAMPLING 1 + +#define JPGD_TRUE (1) +#define JPGD_FALSE (0) + +#define JPGD_MAX(a,b) (((a)>(b)) ? (a) : (b)) +#define JPGD_MIN(a,b) (((a)<(b)) ? (a) : (b)) + +namespace jpgd { + +static inline void *jpgd_malloc(size_t nSize) { return malloc(nSize); } +static inline void jpgd_free(void *p) { free(p); } + +// DCT coefficients are stored in this sequence. +static int g_ZAG[64] = { 0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63 }; + +enum JPEG_MARKER +{ + M_SOF0 = 0xC0, M_SOF1 = 0xC1, M_SOF2 = 0xC2, M_SOF3 = 0xC3, M_SOF5 = 0xC5, M_SOF6 = 0xC6, M_SOF7 = 0xC7, M_JPG = 0xC8, + M_SOF9 = 0xC9, M_SOF10 = 0xCA, M_SOF11 = 0xCB, M_SOF13 = 0xCD, M_SOF14 = 0xCE, M_SOF15 = 0xCF, M_DHT = 0xC4, M_DAC = 0xCC, + M_RST0 = 0xD0, M_RST1 = 0xD1, M_RST2 = 0xD2, M_RST3 = 0xD3, M_RST4 = 0xD4, M_RST5 = 0xD5, M_RST6 = 0xD6, M_RST7 = 0xD7, + M_SOI = 0xD8, M_EOI = 0xD9, M_SOS = 0xDA, M_DQT = 0xDB, M_DNL = 0xDC, M_DRI = 0xDD, M_DHP = 0xDE, M_EXP = 0xDF, + M_APP0 = 0xE0, M_APP15 = 0xEF, M_JPG0 = 0xF0, M_JPG13 = 0xFD, M_COM = 0xFE, M_TEM = 0x01, M_ERROR = 0x100, RST0 = 0xD0 +}; + +enum JPEG_SUBSAMPLING { JPGD_GRAYSCALE = 0, JPGD_YH1V1, JPGD_YH2V1, JPGD_YH1V2, JPGD_YH2V2 }; + +#define CONST_BITS 13 +#define PASS1_BITS 2 +#define SCALEDONE ((int32)1) + +#define FIX_0_298631336 ((int32)2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((int32)3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((int32)4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((int32)6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((int32)7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((int32)9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((int32)12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((int32)15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((int32)16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((int32)16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((int32)20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((int32)25172) /* FIX(3.072711026) */ + +#define DESCALE(x,n) (((x) + (SCALEDONE << ((n)-1))) >> (n)) +#define DESCALE_ZEROSHIFT(x,n) (((x) + (128 << (n)) + (SCALEDONE << ((n)-1))) >> (n)) + +#define MULTIPLY(var, cnst) ((var) * (cnst)) + +#define CLAMP(i) ((static_cast<uint>(i) > 255) ? (((~i) >> 31) & 0xFF) : (i)) + +// Compiler creates a fast path 1D IDCT for X non-zero columns +template <int NONZERO_COLS> +struct Row +{ + static void idct(int* pTemp, const jpgd_block_t* pSrc) + { + // ACCESS_COL() will be optimized at compile time to either an array access, or 0. + #define ACCESS_COL(x) (((x) < NONZERO_COLS) ? (int)pSrc[x] : 0) + + const int z2 = ACCESS_COL(2), z3 = ACCESS_COL(6); + + const int z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + const int tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + const int tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + const int tmp0 = (ACCESS_COL(0) + ACCESS_COL(4)) << CONST_BITS; + const int tmp1 = (ACCESS_COL(0) - ACCESS_COL(4)) << CONST_BITS; + + const int tmp10 = tmp0 + tmp3, tmp13 = tmp0 - tmp3, tmp11 = tmp1 + tmp2, tmp12 = tmp1 - tmp2; + + const int atmp0 = ACCESS_COL(7), atmp1 = ACCESS_COL(5), atmp2 = ACCESS_COL(3), atmp3 = ACCESS_COL(1); + + const int bz1 = atmp0 + atmp3, bz2 = atmp1 + atmp2, bz3 = atmp0 + atmp2, bz4 = atmp1 + atmp3; + const int bz5 = MULTIPLY(bz3 + bz4, FIX_1_175875602); + + const int az1 = MULTIPLY(bz1, - FIX_0_899976223); + const int az2 = MULTIPLY(bz2, - FIX_2_562915447); + const int az3 = MULTIPLY(bz3, - FIX_1_961570560) + bz5; + const int az4 = MULTIPLY(bz4, - FIX_0_390180644) + bz5; + + const int btmp0 = MULTIPLY(atmp0, FIX_0_298631336) + az1 + az3; + const int btmp1 = MULTIPLY(atmp1, FIX_2_053119869) + az2 + az4; + const int btmp2 = MULTIPLY(atmp2, FIX_3_072711026) + az2 + az3; + const int btmp3 = MULTIPLY(atmp3, FIX_1_501321110) + az1 + az4; + + pTemp[0] = DESCALE(tmp10 + btmp3, CONST_BITS-PASS1_BITS); + pTemp[7] = DESCALE(tmp10 - btmp3, CONST_BITS-PASS1_BITS); + pTemp[1] = DESCALE(tmp11 + btmp2, CONST_BITS-PASS1_BITS); + pTemp[6] = DESCALE(tmp11 - btmp2, CONST_BITS-PASS1_BITS); + pTemp[2] = DESCALE(tmp12 + btmp1, CONST_BITS-PASS1_BITS); + pTemp[5] = DESCALE(tmp12 - btmp1, CONST_BITS-PASS1_BITS); + pTemp[3] = DESCALE(tmp13 + btmp0, CONST_BITS-PASS1_BITS); + pTemp[4] = DESCALE(tmp13 - btmp0, CONST_BITS-PASS1_BITS); + } +}; + +template <> +struct Row<0> +{ + static void idct(int* pTemp, const jpgd_block_t* pSrc) + { +#ifdef _MSC_VER + pTemp; pSrc; +#endif + } +}; + +template <> +struct Row<1> +{ + static void idct(int* pTemp, const jpgd_block_t* pSrc) + { + const int dcval = (pSrc[0] << PASS1_BITS); + + pTemp[0] = dcval; + pTemp[1] = dcval; + pTemp[2] = dcval; + pTemp[3] = dcval; + pTemp[4] = dcval; + pTemp[5] = dcval; + pTemp[6] = dcval; + pTemp[7] = dcval; + } +}; + +// Compiler creates a fast path 1D IDCT for X non-zero rows +template <int NONZERO_ROWS> +struct Col +{ + static void idct(uint8* pDst_ptr, const int* pTemp) + { + // ACCESS_ROW() will be optimized at compile time to either an array access, or 0. + #define ACCESS_ROW(x) (((x) < NONZERO_ROWS) ? pTemp[x * 8] : 0) + + const int z2 = ACCESS_ROW(2); + const int z3 = ACCESS_ROW(6); + + const int z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + const int tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + const int tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + const int tmp0 = (ACCESS_ROW(0) + ACCESS_ROW(4)) << CONST_BITS; + const int tmp1 = (ACCESS_ROW(0) - ACCESS_ROW(4)) << CONST_BITS; + + const int tmp10 = tmp0 + tmp3, tmp13 = tmp0 - tmp3, tmp11 = tmp1 + tmp2, tmp12 = tmp1 - tmp2; + + const int atmp0 = ACCESS_ROW(7), atmp1 = ACCESS_ROW(5), atmp2 = ACCESS_ROW(3), atmp3 = ACCESS_ROW(1); + + const int bz1 = atmp0 + atmp3, bz2 = atmp1 + atmp2, bz3 = atmp0 + atmp2, bz4 = atmp1 + atmp3; + const int bz5 = MULTIPLY(bz3 + bz4, FIX_1_175875602); + + const int az1 = MULTIPLY(bz1, - FIX_0_899976223); + const int az2 = MULTIPLY(bz2, - FIX_2_562915447); + const int az3 = MULTIPLY(bz3, - FIX_1_961570560) + bz5; + const int az4 = MULTIPLY(bz4, - FIX_0_390180644) + bz5; + + const int btmp0 = MULTIPLY(atmp0, FIX_0_298631336) + az1 + az3; + const int btmp1 = MULTIPLY(atmp1, FIX_2_053119869) + az2 + az4; + const int btmp2 = MULTIPLY(atmp2, FIX_3_072711026) + az2 + az3; + const int btmp3 = MULTIPLY(atmp3, FIX_1_501321110) + az1 + az4; + + int i = DESCALE_ZEROSHIFT(tmp10 + btmp3, CONST_BITS+PASS1_BITS+3); + pDst_ptr[8*0] = (uint8)CLAMP(i); + + i = DESCALE_ZEROSHIFT(tmp10 - btmp3, CONST_BITS+PASS1_BITS+3); + pDst_ptr[8*7] = (uint8)CLAMP(i); + + i = DESCALE_ZEROSHIFT(tmp11 + btmp2, CONST_BITS+PASS1_BITS+3); + pDst_ptr[8*1] = (uint8)CLAMP(i); + + i = DESCALE_ZEROSHIFT(tmp11 - btmp2, CONST_BITS+PASS1_BITS+3); + pDst_ptr[8*6] = (uint8)CLAMP(i); + + i = DESCALE_ZEROSHIFT(tmp12 + btmp1, CONST_BITS+PASS1_BITS+3); + pDst_ptr[8*2] = (uint8)CLAMP(i); + + i = DESCALE_ZEROSHIFT(tmp12 - btmp1, CONST_BITS+PASS1_BITS+3); + pDst_ptr[8*5] = (uint8)CLAMP(i); + + i = DESCALE_ZEROSHIFT(tmp13 + btmp0, CONST_BITS+PASS1_BITS+3); + pDst_ptr[8*3] = (uint8)CLAMP(i); + + i = DESCALE_ZEROSHIFT(tmp13 - btmp0, CONST_BITS+PASS1_BITS+3); + pDst_ptr[8*4] = (uint8)CLAMP(i); + } +}; + +template <> +struct Col<1> +{ + static void idct(uint8* pDst_ptr, const int* pTemp) + { + int dcval = DESCALE_ZEROSHIFT(pTemp[0], PASS1_BITS+3); + const uint8 dcval_clamped = (uint8)CLAMP(dcval); + pDst_ptr[0*8] = dcval_clamped; + pDst_ptr[1*8] = dcval_clamped; + pDst_ptr[2*8] = dcval_clamped; + pDst_ptr[3*8] = dcval_clamped; + pDst_ptr[4*8] = dcval_clamped; + pDst_ptr[5*8] = dcval_clamped; + pDst_ptr[6*8] = dcval_clamped; + pDst_ptr[7*8] = dcval_clamped; + } +}; + +static const uint8 s_idct_row_table[] = +{ + 1,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0, 2,1,0,0,0,0,0,0, 2,1,1,0,0,0,0,0, 2,2,1,0,0,0,0,0, 3,2,1,0,0,0,0,0, 4,2,1,0,0,0,0,0, 4,3,1,0,0,0,0,0, + 4,3,2,0,0,0,0,0, 4,3,2,1,0,0,0,0, 4,3,2,1,1,0,0,0, 4,3,2,2,1,0,0,0, 4,3,3,2,1,0,0,0, 4,4,3,2,1,0,0,0, 5,4,3,2,1,0,0,0, 6,4,3,2,1,0,0,0, + 6,5,3,2,1,0,0,0, 6,5,4,2,1,0,0,0, 6,5,4,3,1,0,0,0, 6,5,4,3,2,0,0,0, 6,5,4,3,2,1,0,0, 6,5,4,3,2,1,1,0, 6,5,4,3,2,2,1,0, 6,5,4,3,3,2,1,0, + 6,5,4,4,3,2,1,0, 6,5,5,4,3,2,1,0, 6,6,5,4,3,2,1,0, 7,6,5,4,3,2,1,0, 8,6,5,4,3,2,1,0, 8,7,5,4,3,2,1,0, 8,7,6,4,3,2,1,0, 8,7,6,5,3,2,1,0, + 8,7,6,5,4,2,1,0, 8,7,6,5,4,3,1,0, 8,7,6,5,4,3,2,0, 8,7,6,5,4,3,2,1, 8,7,6,5,4,3,2,2, 8,7,6,5,4,3,3,2, 8,7,6,5,4,4,3,2, 8,7,6,5,5,4,3,2, + 8,7,6,6,5,4,3,2, 8,7,7,6,5,4,3,2, 8,8,7,6,5,4,3,2, 8,8,8,6,5,4,3,2, 8,8,8,7,5,4,3,2, 8,8,8,7,6,4,3,2, 8,8,8,7,6,5,3,2, 8,8,8,7,6,5,4,2, + 8,8,8,7,6,5,4,3, 8,8,8,7,6,5,4,4, 8,8,8,7,6,5,5,4, 8,8,8,7,6,6,5,4, 8,8,8,7,7,6,5,4, 8,8,8,8,7,6,5,4, 8,8,8,8,8,6,5,4, 8,8,8,8,8,7,5,4, + 8,8,8,8,8,7,6,4, 8,8,8,8,8,7,6,5, 8,8,8,8,8,7,6,6, 8,8,8,8,8,7,7,6, 8,8,8,8,8,8,7,6, 8,8,8,8,8,8,8,6, 8,8,8,8,8,8,8,7, 8,8,8,8,8,8,8,8, +}; + +static const uint8 s_idct_col_table[] = { 1, 1, 2, 3, 3, 3, 3, 3, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 }; + +void idct(const jpgd_block_t* pSrc_ptr, uint8* pDst_ptr, int block_max_zag) +{ + JPGD_ASSERT(block_max_zag >= 1); + JPGD_ASSERT(block_max_zag <= 64); + + if (block_max_zag <= 1) + { + int k = ((pSrc_ptr[0] + 4) >> 3) + 128; + k = CLAMP(k); + k = k | (k<<8); + k = k | (k<<16); + + for (int i = 8; i > 0; i--) + { + *(int*)&pDst_ptr[0] = k; + *(int*)&pDst_ptr[4] = k; + pDst_ptr += 8; + } + return; + } + + int temp[64]; + + const jpgd_block_t* pSrc = pSrc_ptr; + int* pTemp = temp; + + const uint8* pRow_tab = &s_idct_row_table[(block_max_zag - 1) * 8]; + int i; + for (i = 8; i > 0; i--, pRow_tab++) + { + switch (*pRow_tab) + { + case 0: Row<0>::idct(pTemp, pSrc); break; + case 1: Row<1>::idct(pTemp, pSrc); break; + case 2: Row<2>::idct(pTemp, pSrc); break; + case 3: Row<3>::idct(pTemp, pSrc); break; + case 4: Row<4>::idct(pTemp, pSrc); break; + case 5: Row<5>::idct(pTemp, pSrc); break; + case 6: Row<6>::idct(pTemp, pSrc); break; + case 7: Row<7>::idct(pTemp, pSrc); break; + case 8: Row<8>::idct(pTemp, pSrc); break; + } + + pSrc += 8; + pTemp += 8; + } + + pTemp = temp; + + const int nonzero_rows = s_idct_col_table[block_max_zag - 1]; + for (i = 8; i > 0; i--) + { + switch (nonzero_rows) + { + case 1: Col<1>::idct(pDst_ptr, pTemp); break; + case 2: Col<2>::idct(pDst_ptr, pTemp); break; + case 3: Col<3>::idct(pDst_ptr, pTemp); break; + case 4: Col<4>::idct(pDst_ptr, pTemp); break; + case 5: Col<5>::idct(pDst_ptr, pTemp); break; + case 6: Col<6>::idct(pDst_ptr, pTemp); break; + case 7: Col<7>::idct(pDst_ptr, pTemp); break; + case 8: Col<8>::idct(pDst_ptr, pTemp); break; + } + + pTemp++; + pDst_ptr++; + } +} + +void idct_4x4(const jpgd_block_t* pSrc_ptr, uint8* pDst_ptr) +{ + int temp[64]; + int* pTemp = temp; + const jpgd_block_t* pSrc = pSrc_ptr; + + for (int i = 4; i > 0; i--) + { + Row<4>::idct(pTemp, pSrc); + pSrc += 8; + pTemp += 8; + } + + pTemp = temp; + for (int i = 8; i > 0; i--) + { + Col<4>::idct(pDst_ptr, pTemp); + pTemp++; + pDst_ptr++; + } +} + +// Retrieve one character from the input stream. +inline uint jpeg_decoder::get_char() +{ + // Any bytes remaining in buffer? + if (!m_in_buf_left) + { + // Try to get more bytes. + prep_in_buffer(); + // Still nothing to get? + if (!m_in_buf_left) + { + // Pad the end of the stream with 0xFF 0xD9 (EOI marker) + int t = m_tem_flag; + m_tem_flag ^= 1; + if (t) + return 0xD9; + else + return 0xFF; + } + } + + uint c = *m_pIn_buf_ofs++; + m_in_buf_left--; + + return c; +} + +// Same as previous method, except can indicate if the character is a pad character or not. +inline uint jpeg_decoder::get_char(bool *pPadding_flag) +{ + if (!m_in_buf_left) + { + prep_in_buffer(); + if (!m_in_buf_left) + { + *pPadding_flag = true; + int t = m_tem_flag; + m_tem_flag ^= 1; + if (t) + return 0xD9; + else + return 0xFF; + } + } + + *pPadding_flag = false; + + uint c = *m_pIn_buf_ofs++; + m_in_buf_left--; + + return c; +} + +// Inserts a previously retrieved character back into the input buffer. +inline void jpeg_decoder::stuff_char(uint8 q) +{ + *(--m_pIn_buf_ofs) = q; + m_in_buf_left++; +} + +// Retrieves one character from the input stream, but does not read past markers. Will continue to return 0xFF when a marker is encountered. +inline uint8 jpeg_decoder::get_octet() +{ + bool padding_flag; + int c = get_char(&padding_flag); + + if (c == 0xFF) + { + if (padding_flag) + return 0xFF; + + c = get_char(&padding_flag); + if (padding_flag) + { + stuff_char(0xFF); + return 0xFF; + } + + if (c == 0x00) + return 0xFF; + else + { + stuff_char(static_cast<uint8>(c)); + stuff_char(0xFF); + return 0xFF; + } + } + + return static_cast<uint8>(c); +} + +// Retrieves a variable number of bits from the input stream. Does not recognize markers. +inline uint jpeg_decoder::get_bits(int num_bits) +{ + if (!num_bits) + return 0; + + uint i = m_bit_buf >> (32 - num_bits); + + if ((m_bits_left -= num_bits) <= 0) + { + m_bit_buf <<= (num_bits += m_bits_left); + + uint c1 = get_char(); + uint c2 = get_char(); + m_bit_buf = (m_bit_buf & 0xFFFF0000) | (c1 << 8) | c2; + + m_bit_buf <<= -m_bits_left; + + m_bits_left += 16; + + JPGD_ASSERT(m_bits_left >= 0); + } + else + m_bit_buf <<= num_bits; + + return i; +} + +// Retrieves a variable number of bits from the input stream. Markers will not be read into the input bit buffer. Instead, an infinite number of all 1's will be returned when a marker is encountered. +inline uint jpeg_decoder::get_bits_no_markers(int num_bits) +{ + if (!num_bits) + return 0; + + uint i = m_bit_buf >> (32 - num_bits); + + if ((m_bits_left -= num_bits) <= 0) + { + m_bit_buf <<= (num_bits += m_bits_left); + + if ((m_in_buf_left < 2) || (m_pIn_buf_ofs[0] == 0xFF) || (m_pIn_buf_ofs[1] == 0xFF)) + { + uint c1 = get_octet(); + uint c2 = get_octet(); + m_bit_buf |= (c1 << 8) | c2; + } + else + { + m_bit_buf |= ((uint)m_pIn_buf_ofs[0] << 8) | m_pIn_buf_ofs[1]; + m_in_buf_left -= 2; + m_pIn_buf_ofs += 2; + } + + m_bit_buf <<= -m_bits_left; + + m_bits_left += 16; + + JPGD_ASSERT(m_bits_left >= 0); + } + else + m_bit_buf <<= num_bits; + + return i; +} + +// Decodes a Huffman encoded symbol. +inline int jpeg_decoder::huff_decode(huff_tables *pH) +{ + int symbol; + + // Check first 8-bits: do we have a complete symbol? + if ((symbol = pH->look_up[m_bit_buf >> 24]) < 0) + { + // Decode more bits, use a tree traversal to find symbol. + int ofs = 23; + do + { + symbol = pH->tree[-(int)(symbol + ((m_bit_buf >> ofs) & 1))]; + ofs--; + } while (symbol < 0); + + get_bits_no_markers(8 + (23 - ofs)); + } + else + get_bits_no_markers(pH->code_size[symbol]); + + return symbol; +} + +// Decodes a Huffman encoded symbol. +inline int jpeg_decoder::huff_decode(huff_tables *pH, int& extra_bits) +{ + int symbol; + + // Check first 8-bits: do we have a complete symbol? + if ((symbol = pH->look_up2[m_bit_buf >> 24]) < 0) + { + // Use a tree traversal to find symbol. + int ofs = 23; + do + { + symbol = pH->tree[-(int)(symbol + ((m_bit_buf >> ofs) & 1))]; + ofs--; + } while (symbol < 0); + + get_bits_no_markers(8 + (23 - ofs)); + + extra_bits = get_bits_no_markers(symbol & 0xF); + } + else + { + JPGD_ASSERT(((symbol >> 8) & 31) == pH->code_size[symbol & 255] + ((symbol & 0x8000) ? (symbol & 15) : 0)); + + if (symbol & 0x8000) + { + get_bits_no_markers((symbol >> 8) & 31); + extra_bits = symbol >> 16; + } + else + { + int code_size = (symbol >> 8) & 31; + int num_extra_bits = symbol & 0xF; + int bits = code_size + num_extra_bits; + if (bits <= (m_bits_left + 16)) + extra_bits = get_bits_no_markers(bits) & ((1 << num_extra_bits) - 1); + else + { + get_bits_no_markers(code_size); + extra_bits = get_bits_no_markers(num_extra_bits); + } + } + + symbol &= 0xFF; + } + + return symbol; +} + +// Tables and macro used to fully decode the DPCM differences. +static const int s_extend_test[16] = { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; +static const int s_extend_offset[16] = { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; +static const int s_extend_mask[] = { 0, (1<<0), (1<<1), (1<<2), (1<<3), (1<<4), (1<<5), (1<<6), (1<<7), (1<<8), (1<<9), (1<<10), (1<<11), (1<<12), (1<<13), (1<<14), (1<<15), (1<<16) }; +// The logical AND's in this macro are to shut up static code analysis (aren't really necessary - couldn't find another way to do this) +#define JPGD_HUFF_EXTEND(x, s) (((x) < s_extend_test[s & 15]) ? ((x) + s_extend_offset[s & 15]) : (x)) + +// Clamps a value between 0-255. +inline uint8 jpeg_decoder::clamp(int i) +{ + if (static_cast<uint>(i) > 255) + i = (((~i) >> 31) & 0xFF); + + return static_cast<uint8>(i); +} + +namespace DCT_Upsample +{ + struct Matrix44 + { + typedef int Element_Type; + enum { NUM_ROWS = 4, NUM_COLS = 4 }; + + Element_Type v[NUM_ROWS][NUM_COLS]; + + inline int rows() const { return NUM_ROWS; } + inline int cols() const { return NUM_COLS; } + + inline const Element_Type & at(int r, int c) const { return v[r][c]; } + inline Element_Type & at(int r, int c) { return v[r][c]; } + + inline Matrix44() { } + + inline Matrix44& operator += (const Matrix44& a) + { + for (int r = 0; r < NUM_ROWS; r++) + { + at(r, 0) += a.at(r, 0); + at(r, 1) += a.at(r, 1); + at(r, 2) += a.at(r, 2); + at(r, 3) += a.at(r, 3); + } + return *this; + } + + inline Matrix44& operator -= (const Matrix44& a) + { + for (int r = 0; r < NUM_ROWS; r++) + { + at(r, 0) -= a.at(r, 0); + at(r, 1) -= a.at(r, 1); + at(r, 2) -= a.at(r, 2); + at(r, 3) -= a.at(r, 3); + } + return *this; + } + + friend inline Matrix44 operator + (const Matrix44& a, const Matrix44& b) + { + Matrix44 ret; + for (int r = 0; r < NUM_ROWS; r++) + { + ret.at(r, 0) = a.at(r, 0) + b.at(r, 0); + ret.at(r, 1) = a.at(r, 1) + b.at(r, 1); + ret.at(r, 2) = a.at(r, 2) + b.at(r, 2); + ret.at(r, 3) = a.at(r, 3) + b.at(r, 3); + } + return ret; + } + + friend inline Matrix44 operator - (const Matrix44& a, const Matrix44& b) + { + Matrix44 ret; + for (int r = 0; r < NUM_ROWS; r++) + { + ret.at(r, 0) = a.at(r, 0) - b.at(r, 0); + ret.at(r, 1) = a.at(r, 1) - b.at(r, 1); + ret.at(r, 2) = a.at(r, 2) - b.at(r, 2); + ret.at(r, 3) = a.at(r, 3) - b.at(r, 3); + } + return ret; + } + + static inline void add_and_store(jpgd_block_t* pDst, const Matrix44& a, const Matrix44& b) + { + for (int r = 0; r < 4; r++) + { + pDst[0*8 + r] = static_cast<jpgd_block_t>(a.at(r, 0) + b.at(r, 0)); + pDst[1*8 + r] = static_cast<jpgd_block_t>(a.at(r, 1) + b.at(r, 1)); + pDst[2*8 + r] = static_cast<jpgd_block_t>(a.at(r, 2) + b.at(r, 2)); + pDst[3*8 + r] = static_cast<jpgd_block_t>(a.at(r, 3) + b.at(r, 3)); + } + } + + static inline void sub_and_store(jpgd_block_t* pDst, const Matrix44& a, const Matrix44& b) + { + for (int r = 0; r < 4; r++) + { + pDst[0*8 + r] = static_cast<jpgd_block_t>(a.at(r, 0) - b.at(r, 0)); + pDst[1*8 + r] = static_cast<jpgd_block_t>(a.at(r, 1) - b.at(r, 1)); + pDst[2*8 + r] = static_cast<jpgd_block_t>(a.at(r, 2) - b.at(r, 2)); + pDst[3*8 + r] = static_cast<jpgd_block_t>(a.at(r, 3) - b.at(r, 3)); + } + } + }; + + const int FRACT_BITS = 10; + const int SCALE = 1 << FRACT_BITS; + + typedef int Temp_Type; + #define D(i) (((i) + (SCALE >> 1)) >> FRACT_BITS) + #define F(i) ((int)((i) * SCALE + .5f)) + + // Any decent C++ compiler will optimize this at compile time to a 0, or an array access. + #define AT(c, r) ((((c)>=NUM_COLS)||((r)>=NUM_ROWS)) ? 0 : pSrc[(c)+(r)*8]) + + // NUM_ROWS/NUM_COLS = # of non-zero rows/cols in input matrix + template<int NUM_ROWS, int NUM_COLS> + struct P_Q + { + static void calc(Matrix44& P, Matrix44& Q, const jpgd_block_t* pSrc) + { + // 4x8 = 4x8 times 8x8, matrix 0 is constant + const Temp_Type X000 = AT(0, 0); + const Temp_Type X001 = AT(0, 1); + const Temp_Type X002 = AT(0, 2); + const Temp_Type X003 = AT(0, 3); + const Temp_Type X004 = AT(0, 4); + const Temp_Type X005 = AT(0, 5); + const Temp_Type X006 = AT(0, 6); + const Temp_Type X007 = AT(0, 7); + const Temp_Type X010 = D(F(0.415735f) * AT(1, 0) + F(0.791065f) * AT(3, 0) + F(-0.352443f) * AT(5, 0) + F(0.277785f) * AT(7, 0)); + const Temp_Type X011 = D(F(0.415735f) * AT(1, 1) + F(0.791065f) * AT(3, 1) + F(-0.352443f) * AT(5, 1) + F(0.277785f) * AT(7, 1)); + const Temp_Type X012 = D(F(0.415735f) * AT(1, 2) + F(0.791065f) * AT(3, 2) + F(-0.352443f) * AT(5, 2) + F(0.277785f) * AT(7, 2)); + const Temp_Type X013 = D(F(0.415735f) * AT(1, 3) + F(0.791065f) * AT(3, 3) + F(-0.352443f) * AT(5, 3) + F(0.277785f) * AT(7, 3)); + const Temp_Type X014 = D(F(0.415735f) * AT(1, 4) + F(0.791065f) * AT(3, 4) + F(-0.352443f) * AT(5, 4) + F(0.277785f) * AT(7, 4)); + const Temp_Type X015 = D(F(0.415735f) * AT(1, 5) + F(0.791065f) * AT(3, 5) + F(-0.352443f) * AT(5, 5) + F(0.277785f) * AT(7, 5)); + const Temp_Type X016 = D(F(0.415735f) * AT(1, 6) + F(0.791065f) * AT(3, 6) + F(-0.352443f) * AT(5, 6) + F(0.277785f) * AT(7, 6)); + const Temp_Type X017 = D(F(0.415735f) * AT(1, 7) + F(0.791065f) * AT(3, 7) + F(-0.352443f) * AT(5, 7) + F(0.277785f) * AT(7, 7)); + const Temp_Type X020 = AT(4, 0); + const Temp_Type X021 = AT(4, 1); + const Temp_Type X022 = AT(4, 2); + const Temp_Type X023 = AT(4, 3); + const Temp_Type X024 = AT(4, 4); + const Temp_Type X025 = AT(4, 5); + const Temp_Type X026 = AT(4, 6); + const Temp_Type X027 = AT(4, 7); + const Temp_Type X030 = D(F(0.022887f) * AT(1, 0) + F(-0.097545f) * AT(3, 0) + F(0.490393f) * AT(5, 0) + F(0.865723f) * AT(7, 0)); + const Temp_Type X031 = D(F(0.022887f) * AT(1, 1) + F(-0.097545f) * AT(3, 1) + F(0.490393f) * AT(5, 1) + F(0.865723f) * AT(7, 1)); + const Temp_Type X032 = D(F(0.022887f) * AT(1, 2) + F(-0.097545f) * AT(3, 2) + F(0.490393f) * AT(5, 2) + F(0.865723f) * AT(7, 2)); + const Temp_Type X033 = D(F(0.022887f) * AT(1, 3) + F(-0.097545f) * AT(3, 3) + F(0.490393f) * AT(5, 3) + F(0.865723f) * AT(7, 3)); + const Temp_Type X034 = D(F(0.022887f) * AT(1, 4) + F(-0.097545f) * AT(3, 4) + F(0.490393f) * AT(5, 4) + F(0.865723f) * AT(7, 4)); + const Temp_Type X035 = D(F(0.022887f) * AT(1, 5) + F(-0.097545f) * AT(3, 5) + F(0.490393f) * AT(5, 5) + F(0.865723f) * AT(7, 5)); + const Temp_Type X036 = D(F(0.022887f) * AT(1, 6) + F(-0.097545f) * AT(3, 6) + F(0.490393f) * AT(5, 6) + F(0.865723f) * AT(7, 6)); + const Temp_Type X037 = D(F(0.022887f) * AT(1, 7) + F(-0.097545f) * AT(3, 7) + F(0.490393f) * AT(5, 7) + F(0.865723f) * AT(7, 7)); + + // 4x4 = 4x8 times 8x4, matrix 1 is constant + P.at(0, 0) = X000; + P.at(0, 1) = D(X001 * F(0.415735f) + X003 * F(0.791065f) + X005 * F(-0.352443f) + X007 * F(0.277785f)); + P.at(0, 2) = X004; + P.at(0, 3) = D(X001 * F(0.022887f) + X003 * F(-0.097545f) + X005 * F(0.490393f) + X007 * F(0.865723f)); + P.at(1, 0) = X010; + P.at(1, 1) = D(X011 * F(0.415735f) + X013 * F(0.791065f) + X015 * F(-0.352443f) + X017 * F(0.277785f)); + P.at(1, 2) = X014; + P.at(1, 3) = D(X011 * F(0.022887f) + X013 * F(-0.097545f) + X015 * F(0.490393f) + X017 * F(0.865723f)); + P.at(2, 0) = X020; + P.at(2, 1) = D(X021 * F(0.415735f) + X023 * F(0.791065f) + X025 * F(-0.352443f) + X027 * F(0.277785f)); + P.at(2, 2) = X024; + P.at(2, 3) = D(X021 * F(0.022887f) + X023 * F(-0.097545f) + X025 * F(0.490393f) + X027 * F(0.865723f)); + P.at(3, 0) = X030; + P.at(3, 1) = D(X031 * F(0.415735f) + X033 * F(0.791065f) + X035 * F(-0.352443f) + X037 * F(0.277785f)); + P.at(3, 2) = X034; + P.at(3, 3) = D(X031 * F(0.022887f) + X033 * F(-0.097545f) + X035 * F(0.490393f) + X037 * F(0.865723f)); + // 40 muls 24 adds + + // 4x4 = 4x8 times 8x4, matrix 1 is constant + Q.at(0, 0) = D(X001 * F(0.906127f) + X003 * F(-0.318190f) + X005 * F(0.212608f) + X007 * F(-0.180240f)); + Q.at(0, 1) = X002; + Q.at(0, 2) = D(X001 * F(-0.074658f) + X003 * F(0.513280f) + X005 * F(0.768178f) + X007 * F(-0.375330f)); + Q.at(0, 3) = X006; + Q.at(1, 0) = D(X011 * F(0.906127f) + X013 * F(-0.318190f) + X015 * F(0.212608f) + X017 * F(-0.180240f)); + Q.at(1, 1) = X012; + Q.at(1, 2) = D(X011 * F(-0.074658f) + X013 * F(0.513280f) + X015 * F(0.768178f) + X017 * F(-0.375330f)); + Q.at(1, 3) = X016; + Q.at(2, 0) = D(X021 * F(0.906127f) + X023 * F(-0.318190f) + X025 * F(0.212608f) + X027 * F(-0.180240f)); + Q.at(2, 1) = X022; + Q.at(2, 2) = D(X021 * F(-0.074658f) + X023 * F(0.513280f) + X025 * F(0.768178f) + X027 * F(-0.375330f)); + Q.at(2, 3) = X026; + Q.at(3, 0) = D(X031 * F(0.906127f) + X033 * F(-0.318190f) + X035 * F(0.212608f) + X037 * F(-0.180240f)); + Q.at(3, 1) = X032; + Q.at(3, 2) = D(X031 * F(-0.074658f) + X033 * F(0.513280f) + X035 * F(0.768178f) + X037 * F(-0.375330f)); + Q.at(3, 3) = X036; + // 40 muls 24 adds + } + }; + + template<int NUM_ROWS, int NUM_COLS> + struct R_S + { + static void calc(Matrix44& R, Matrix44& S, const jpgd_block_t* pSrc) + { + // 4x8 = 4x8 times 8x8, matrix 0 is constant + const Temp_Type X100 = D(F(0.906127f) * AT(1, 0) + F(-0.318190f) * AT(3, 0) + F(0.212608f) * AT(5, 0) + F(-0.180240f) * AT(7, 0)); + const Temp_Type X101 = D(F(0.906127f) * AT(1, 1) + F(-0.318190f) * AT(3, 1) + F(0.212608f) * AT(5, 1) + F(-0.180240f) * AT(7, 1)); + const Temp_Type X102 = D(F(0.906127f) * AT(1, 2) + F(-0.318190f) * AT(3, 2) + F(0.212608f) * AT(5, 2) + F(-0.180240f) * AT(7, 2)); + const Temp_Type X103 = D(F(0.906127f) * AT(1, 3) + F(-0.318190f) * AT(3, 3) + F(0.212608f) * AT(5, 3) + F(-0.180240f) * AT(7, 3)); + const Temp_Type X104 = D(F(0.906127f) * AT(1, 4) + F(-0.318190f) * AT(3, 4) + F(0.212608f) * AT(5, 4) + F(-0.180240f) * AT(7, 4)); + const Temp_Type X105 = D(F(0.906127f) * AT(1, 5) + F(-0.318190f) * AT(3, 5) + F(0.212608f) * AT(5, 5) + F(-0.180240f) * AT(7, 5)); + const Temp_Type X106 = D(F(0.906127f) * AT(1, 6) + F(-0.318190f) * AT(3, 6) + F(0.212608f) * AT(5, 6) + F(-0.180240f) * AT(7, 6)); + const Temp_Type X107 = D(F(0.906127f) * AT(1, 7) + F(-0.318190f) * AT(3, 7) + F(0.212608f) * AT(5, 7) + F(-0.180240f) * AT(7, 7)); + const Temp_Type X110 = AT(2, 0); + const Temp_Type X111 = AT(2, 1); + const Temp_Type X112 = AT(2, 2); + const Temp_Type X113 = AT(2, 3); + const Temp_Type X114 = AT(2, 4); + const Temp_Type X115 = AT(2, 5); + const Temp_Type X116 = AT(2, 6); + const Temp_Type X117 = AT(2, 7); + const Temp_Type X120 = D(F(-0.074658f) * AT(1, 0) + F(0.513280f) * AT(3, 0) + F(0.768178f) * AT(5, 0) + F(-0.375330f) * AT(7, 0)); + const Temp_Type X121 = D(F(-0.074658f) * AT(1, 1) + F(0.513280f) * AT(3, 1) + F(0.768178f) * AT(5, 1) + F(-0.375330f) * AT(7, 1)); + const Temp_Type X122 = D(F(-0.074658f) * AT(1, 2) + F(0.513280f) * AT(3, 2) + F(0.768178f) * AT(5, 2) + F(-0.375330f) * AT(7, 2)); + const Temp_Type X123 = D(F(-0.074658f) * AT(1, 3) + F(0.513280f) * AT(3, 3) + F(0.768178f) * AT(5, 3) + F(-0.375330f) * AT(7, 3)); + const Temp_Type X124 = D(F(-0.074658f) * AT(1, 4) + F(0.513280f) * AT(3, 4) + F(0.768178f) * AT(5, 4) + F(-0.375330f) * AT(7, 4)); + const Temp_Type X125 = D(F(-0.074658f) * AT(1, 5) + F(0.513280f) * AT(3, 5) + F(0.768178f) * AT(5, 5) + F(-0.375330f) * AT(7, 5)); + const Temp_Type X126 = D(F(-0.074658f) * AT(1, 6) + F(0.513280f) * AT(3, 6) + F(0.768178f) * AT(5, 6) + F(-0.375330f) * AT(7, 6)); + const Temp_Type X127 = D(F(-0.074658f) * AT(1, 7) + F(0.513280f) * AT(3, 7) + F(0.768178f) * AT(5, 7) + F(-0.375330f) * AT(7, 7)); + const Temp_Type X130 = AT(6, 0); + const Temp_Type X131 = AT(6, 1); + const Temp_Type X132 = AT(6, 2); + const Temp_Type X133 = AT(6, 3); + const Temp_Type X134 = AT(6, 4); + const Temp_Type X135 = AT(6, 5); + const Temp_Type X136 = AT(6, 6); + const Temp_Type X137 = AT(6, 7); + // 80 muls 48 adds + + // 4x4 = 4x8 times 8x4, matrix 1 is constant + R.at(0, 0) = X100; + R.at(0, 1) = D(X101 * F(0.415735f) + X103 * F(0.791065f) + X105 * F(-0.352443f) + X107 * F(0.277785f)); + R.at(0, 2) = X104; + R.at(0, 3) = D(X101 * F(0.022887f) + X103 * F(-0.097545f) + X105 * F(0.490393f) + X107 * F(0.865723f)); + R.at(1, 0) = X110; + R.at(1, 1) = D(X111 * F(0.415735f) + X113 * F(0.791065f) + X115 * F(-0.352443f) + X117 * F(0.277785f)); + R.at(1, 2) = X114; + R.at(1, 3) = D(X111 * F(0.022887f) + X113 * F(-0.097545f) + X115 * F(0.490393f) + X117 * F(0.865723f)); + R.at(2, 0) = X120; + R.at(2, 1) = D(X121 * F(0.415735f) + X123 * F(0.791065f) + X125 * F(-0.352443f) + X127 * F(0.277785f)); + R.at(2, 2) = X124; + R.at(2, 3) = D(X121 * F(0.022887f) + X123 * F(-0.097545f) + X125 * F(0.490393f) + X127 * F(0.865723f)); + R.at(3, 0) = X130; + R.at(3, 1) = D(X131 * F(0.415735f) + X133 * F(0.791065f) + X135 * F(-0.352443f) + X137 * F(0.277785f)); + R.at(3, 2) = X134; + R.at(3, 3) = D(X131 * F(0.022887f) + X133 * F(-0.097545f) + X135 * F(0.490393f) + X137 * F(0.865723f)); + // 40 muls 24 adds + // 4x4 = 4x8 times 8x4, matrix 1 is constant + S.at(0, 0) = D(X101 * F(0.906127f) + X103 * F(-0.318190f) + X105 * F(0.212608f) + X107 * F(-0.180240f)); + S.at(0, 1) = X102; + S.at(0, 2) = D(X101 * F(-0.074658f) + X103 * F(0.513280f) + X105 * F(0.768178f) + X107 * F(-0.375330f)); + S.at(0, 3) = X106; + S.at(1, 0) = D(X111 * F(0.906127f) + X113 * F(-0.318190f) + X115 * F(0.212608f) + X117 * F(-0.180240f)); + S.at(1, 1) = X112; + S.at(1, 2) = D(X111 * F(-0.074658f) + X113 * F(0.513280f) + X115 * F(0.768178f) + X117 * F(-0.375330f)); + S.at(1, 3) = X116; + S.at(2, 0) = D(X121 * F(0.906127f) + X123 * F(-0.318190f) + X125 * F(0.212608f) + X127 * F(-0.180240f)); + S.at(2, 1) = X122; + S.at(2, 2) = D(X121 * F(-0.074658f) + X123 * F(0.513280f) + X125 * F(0.768178f) + X127 * F(-0.375330f)); + S.at(2, 3) = X126; + S.at(3, 0) = D(X131 * F(0.906127f) + X133 * F(-0.318190f) + X135 * F(0.212608f) + X137 * F(-0.180240f)); + S.at(3, 1) = X132; + S.at(3, 2) = D(X131 * F(-0.074658f) + X133 * F(0.513280f) + X135 * F(0.768178f) + X137 * F(-0.375330f)); + S.at(3, 3) = X136; + // 40 muls 24 adds + } + }; +} // end namespace DCT_Upsample + +// Unconditionally frees all allocated m_blocks. +void jpeg_decoder::free_all_blocks() +{ + m_pStream = NULL; + for (mem_block *b = m_pMem_blocks; b; ) + { + mem_block *n = b->m_pNext; + jpgd_free(b); + b = n; + } + m_pMem_blocks = NULL; +} + +// This method handles all errors. It will never return. +// It could easily be changed to use C++ exceptions. +JPGD_NORETURN void jpeg_decoder::stop_decoding(jpgd_status status) +{ + m_error_code = status; + free_all_blocks(); + longjmp(m_jmp_state, status); +} + +void *jpeg_decoder::alloc(size_t nSize, bool zero) +{ + nSize = (JPGD_MAX(nSize, 1) + 3) & ~3; + char *rv = NULL; + for (mem_block *b = m_pMem_blocks; b; b = b->m_pNext) + { + if ((b->m_used_count + nSize) <= b->m_size) + { + rv = b->m_data + b->m_used_count; + b->m_used_count += nSize; + break; + } + } + if (!rv) + { + int capacity = JPGD_MAX(32768 - 256, (nSize + 2047) & ~2047); + mem_block *b = (mem_block*)jpgd_malloc(sizeof(mem_block) + capacity); + if (!b) { stop_decoding(JPGD_NOTENOUGHMEM); } + b->m_pNext = m_pMem_blocks; m_pMem_blocks = b; + b->m_used_count = nSize; + b->m_size = capacity; + rv = b->m_data; + } + if (zero) memset(rv, 0, nSize); + return rv; +} + +void jpeg_decoder::word_clear(void *p, uint16 c, uint n) +{ + uint8 *pD = (uint8*)p; + const uint8 l = c & 0xFF, h = (c >> 8) & 0xFF; + while (n) + { + pD[0] = l; pD[1] = h; pD += 2; + n--; + } +} + +// Refill the input buffer. +// This method will sit in a loop until (A) the buffer is full or (B) +// the stream's read() method reports and end of file condition. +void jpeg_decoder::prep_in_buffer() +{ + m_in_buf_left = 0; + m_pIn_buf_ofs = m_in_buf; + + if (m_eof_flag) + return; + + do + { + int bytes_read = m_pStream->read(m_in_buf + m_in_buf_left, JPGD_IN_BUF_SIZE - m_in_buf_left, &m_eof_flag); + if (bytes_read == -1) + stop_decoding(JPGD_STREAM_READ); + + m_in_buf_left += bytes_read; + } while ((m_in_buf_left < JPGD_IN_BUF_SIZE) && (!m_eof_flag)); + + m_total_bytes_read += m_in_buf_left; + + // Pad the end of the block with M_EOI (prevents the decompressor from going off the rails if the stream is invalid). + // (This dates way back to when this decompressor was written in C/asm, and the all-asm Huffman decoder did some fancy things to increase perf.) + word_clear(m_pIn_buf_ofs + m_in_buf_left, 0xD9FF, 64); +} + +// Read a Huffman code table. +void jpeg_decoder::read_dht_marker() +{ + int i, index, count; + uint8 huff_num[17]; + uint8 huff_val[256]; + + uint num_left = get_bits(16); + + if (num_left < 2) + stop_decoding(JPGD_BAD_DHT_MARKER); + + num_left -= 2; + + while (num_left) + { + index = get_bits(8); + + huff_num[0] = 0; + + count = 0; + + for (i = 1; i <= 16; i++) + { + huff_num[i] = static_cast<uint8>(get_bits(8)); + count += huff_num[i]; + } + + if (count > 255) + stop_decoding(JPGD_BAD_DHT_COUNTS); + + for (i = 0; i < count; i++) + huff_val[i] = static_cast<uint8>(get_bits(8)); + + i = 1 + 16 + count; + + if (num_left < (uint)i) + stop_decoding(JPGD_BAD_DHT_MARKER); + + num_left -= i; + + if ((index & 0x10) > 0x10) + stop_decoding(JPGD_BAD_DHT_INDEX); + + index = (index & 0x0F) + ((index & 0x10) >> 4) * (JPGD_MAX_HUFF_TABLES >> 1); + + if (index >= JPGD_MAX_HUFF_TABLES) + stop_decoding(JPGD_BAD_DHT_INDEX); + + if (!m_huff_num[index]) + m_huff_num[index] = (uint8 *)alloc(17); + + if (!m_huff_val[index]) + m_huff_val[index] = (uint8 *)alloc(256); + + m_huff_ac[index] = (index & 0x10) != 0; + memcpy(m_huff_num[index], huff_num, 17); + memcpy(m_huff_val[index], huff_val, 256); + } +} + +// Read a quantization table. +void jpeg_decoder::read_dqt_marker() +{ + int n, i, prec; + uint num_left; + uint temp; + + num_left = get_bits(16); + + if (num_left < 2) + stop_decoding(JPGD_BAD_DQT_MARKER); + + num_left -= 2; + + while (num_left) + { + n = get_bits(8); + prec = n >> 4; + n &= 0x0F; + + if (n >= JPGD_MAX_QUANT_TABLES) + stop_decoding(JPGD_BAD_DQT_TABLE); + + if (!m_quant[n]) + m_quant[n] = (jpgd_quant_t *)alloc(64 * sizeof(jpgd_quant_t)); + + // read quantization entries, in zag order + for (i = 0; i < 64; i++) + { + temp = get_bits(8); + + if (prec) + temp = (temp << 8) + get_bits(8); + + m_quant[n][i] = static_cast<jpgd_quant_t>(temp); + } + + i = 64 + 1; + + if (prec) + i += 64; + + if (num_left < (uint)i) + stop_decoding(JPGD_BAD_DQT_LENGTH); + + num_left -= i; + } +} + +// Read the start of frame (SOF) marker. +void jpeg_decoder::read_sof_marker() +{ + int i; + uint num_left; + + num_left = get_bits(16); + + if (get_bits(8) != 8) /* precision: sorry, only 8-bit precision is supported right now */ + stop_decoding(JPGD_BAD_PRECISION); + + m_image_y_size = get_bits(16); + + if ((m_image_y_size < 1) || (m_image_y_size > JPGD_MAX_HEIGHT)) + stop_decoding(JPGD_BAD_HEIGHT); + + m_image_x_size = get_bits(16); + + if ((m_image_x_size < 1) || (m_image_x_size > JPGD_MAX_WIDTH)) + stop_decoding(JPGD_BAD_WIDTH); + + m_comps_in_frame = get_bits(8); + + if (m_comps_in_frame > JPGD_MAX_COMPONENTS) + stop_decoding(JPGD_TOO_MANY_COMPONENTS); + + if (num_left != (uint)(m_comps_in_frame * 3 + 8)) + stop_decoding(JPGD_BAD_SOF_LENGTH); + + for (i = 0; i < m_comps_in_frame; i++) + { + m_comp_ident[i] = get_bits(8); + m_comp_h_samp[i] = get_bits(4); + m_comp_v_samp[i] = get_bits(4); + m_comp_quant[i] = get_bits(8); + } +} + +// Used to skip unrecognized markers. +void jpeg_decoder::skip_variable_marker() +{ + uint num_left; + + num_left = get_bits(16); + + if (num_left < 2) + stop_decoding(JPGD_BAD_VARIABLE_MARKER); + + num_left -= 2; + + while (num_left) + { + get_bits(8); + num_left--; + } +} + +// Read a define restart interval (DRI) marker. +void jpeg_decoder::read_dri_marker() +{ + if (get_bits(16) != 4) + stop_decoding(JPGD_BAD_DRI_LENGTH); + + m_restart_interval = get_bits(16); +} + +// Read a start of scan (SOS) marker. +void jpeg_decoder::read_sos_marker() +{ + uint num_left; + int i, ci, n, c, cc; + + num_left = get_bits(16); + + n = get_bits(8); + + m_comps_in_scan = n; + + num_left -= 3; + + if ( (num_left != (uint)(n * 2 + 3)) || (n < 1) || (n > JPGD_MAX_COMPS_IN_SCAN) ) + stop_decoding(JPGD_BAD_SOS_LENGTH); + + for (i = 0; i < n; i++) + { + cc = get_bits(8); + c = get_bits(8); + num_left -= 2; + + for (ci = 0; ci < m_comps_in_frame; ci++) + if (cc == m_comp_ident[ci]) + break; + + if (ci >= m_comps_in_frame) + stop_decoding(JPGD_BAD_SOS_COMP_ID); + + m_comp_list[i] = ci; + m_comp_dc_tab[ci] = (c >> 4) & 15; + m_comp_ac_tab[ci] = (c & 15) + (JPGD_MAX_HUFF_TABLES >> 1); + } + + m_spectral_start = get_bits(8); + m_spectral_end = get_bits(8); + m_successive_high = get_bits(4); + m_successive_low = get_bits(4); + + if (!m_progressive_flag) + { + m_spectral_start = 0; + m_spectral_end = 63; + } + + num_left -= 3; + + while (num_left) /* read past whatever is num_left */ + { + get_bits(8); + num_left--; + } +} + +// Finds the next marker. +int jpeg_decoder::next_marker() +{ + uint c, bytes; + + bytes = 0; + + do + { + do + { + bytes++; + c = get_bits(8); + } while (c != 0xFF); + + do + { + c = get_bits(8); + } while (c == 0xFF); + + } while (c == 0); + + // If bytes > 0 here, there where extra bytes before the marker (not good). + + return c; +} + +// Process markers. Returns when an SOFx, SOI, EOI, or SOS marker is +// encountered. +int jpeg_decoder::process_markers() +{ + int c; + + for ( ; ; ) + { + c = next_marker(); + + switch (c) + { + case M_SOF0: + case M_SOF1: + case M_SOF2: + case M_SOF3: + case M_SOF5: + case M_SOF6: + case M_SOF7: +// case M_JPG: + case M_SOF9: + case M_SOF10: + case M_SOF11: + case M_SOF13: + case M_SOF14: + case M_SOF15: + case M_SOI: + case M_EOI: + case M_SOS: + { + return c; + } + case M_DHT: + { + read_dht_marker(); + break; + } + // No arithmitic support - dumb patents! + case M_DAC: + { + stop_decoding(JPGD_NO_ARITHMITIC_SUPPORT); + break; + } + case M_DQT: + { + read_dqt_marker(); + break; + } + case M_DRI: + { + read_dri_marker(); + break; + } + //case M_APP0: /* no need to read the JFIF marker */ + + case M_JPG: + case M_RST0: /* no parameters */ + case M_RST1: + case M_RST2: + case M_RST3: + case M_RST4: + case M_RST5: + case M_RST6: + case M_RST7: + case M_TEM: + { + stop_decoding(JPGD_UNEXPECTED_MARKER); + break; + } + default: /* must be DNL, DHP, EXP, APPn, JPGn, COM, or RESn or APP0 */ + { + skip_variable_marker(); + break; + } + } + } +} + +// Finds the start of image (SOI) marker. +// This code is rather defensive: it only checks the first 512 bytes to avoid +// false positives. +void jpeg_decoder::locate_soi_marker() +{ + uint lastchar, thischar; + uint bytesleft; + + lastchar = get_bits(8); + + thischar = get_bits(8); + + /* ok if it's a normal JPEG file without a special header */ + + if ((lastchar == 0xFF) && (thischar == M_SOI)) + return; + + bytesleft = 4096; //512; + + for ( ; ; ) + { + if (--bytesleft == 0) + stop_decoding(JPGD_NOT_JPEG); + + lastchar = thischar; + + thischar = get_bits(8); + + if (lastchar == 0xFF) + { + if (thischar == M_SOI) + break; + else if (thischar == M_EOI) // get_bits will keep returning M_EOI if we read past the end + stop_decoding(JPGD_NOT_JPEG); + } + } + + // Check the next character after marker: if it's not 0xFF, it can't be the start of the next marker, so the file is bad. + thischar = (m_bit_buf >> 24) & 0xFF; + + if (thischar != 0xFF) + stop_decoding(JPGD_NOT_JPEG); +} + +// Find a start of frame (SOF) marker. +void jpeg_decoder::locate_sof_marker() +{ + locate_soi_marker(); + + int c = process_markers(); + + switch (c) + { + case M_SOF2: + m_progressive_flag = JPGD_TRUE; + case M_SOF0: /* baseline DCT */ + case M_SOF1: /* extended sequential DCT */ + { + read_sof_marker(); + break; + } + case M_SOF9: /* Arithmitic coding */ + { + stop_decoding(JPGD_NO_ARITHMITIC_SUPPORT); + break; + } + default: + { + stop_decoding(JPGD_UNSUPPORTED_MARKER); + break; + } + } +} + +// Find a start of scan (SOS) marker. +int jpeg_decoder::locate_sos_marker() +{ + int c; + + c = process_markers(); + + if (c == M_EOI) + return JPGD_FALSE; + else if (c != M_SOS) + stop_decoding(JPGD_UNEXPECTED_MARKER); + + read_sos_marker(); + + return JPGD_TRUE; +} + +// Reset everything to default/uninitialized state. +void jpeg_decoder::init(jpeg_decoder_stream *pStream) +{ + m_pMem_blocks = NULL; + m_error_code = JPGD_SUCCESS; + m_ready_flag = false; + m_image_x_size = m_image_y_size = 0; + m_pStream = pStream; + m_progressive_flag = JPGD_FALSE; + + memset(m_huff_ac, 0, sizeof(m_huff_ac)); + memset(m_huff_num, 0, sizeof(m_huff_num)); + memset(m_huff_val, 0, sizeof(m_huff_val)); + memset(m_quant, 0, sizeof(m_quant)); + + m_scan_type = 0; + m_comps_in_frame = 0; + + memset(m_comp_h_samp, 0, sizeof(m_comp_h_samp)); + memset(m_comp_v_samp, 0, sizeof(m_comp_v_samp)); + memset(m_comp_quant, 0, sizeof(m_comp_quant)); + memset(m_comp_ident, 0, sizeof(m_comp_ident)); + memset(m_comp_h_blocks, 0, sizeof(m_comp_h_blocks)); + memset(m_comp_v_blocks, 0, sizeof(m_comp_v_blocks)); + + m_comps_in_scan = 0; + memset(m_comp_list, 0, sizeof(m_comp_list)); + memset(m_comp_dc_tab, 0, sizeof(m_comp_dc_tab)); + memset(m_comp_ac_tab, 0, sizeof(m_comp_ac_tab)); + + m_spectral_start = 0; + m_spectral_end = 0; + m_successive_low = 0; + m_successive_high = 0; + m_max_mcu_x_size = 0; + m_max_mcu_y_size = 0; + m_blocks_per_mcu = 0; + m_max_blocks_per_row = 0; + m_mcus_per_row = 0; + m_mcus_per_col = 0; + m_expanded_blocks_per_component = 0; + m_expanded_blocks_per_mcu = 0; + m_expanded_blocks_per_row = 0; + m_freq_domain_chroma_upsample = false; + + memset(m_mcu_org, 0, sizeof(m_mcu_org)); + + m_total_lines_left = 0; + m_mcu_lines_left = 0; + m_real_dest_bytes_per_scan_line = 0; + m_dest_bytes_per_scan_line = 0; + m_dest_bytes_per_pixel = 0; + + memset(m_pHuff_tabs, 0, sizeof(m_pHuff_tabs)); + + memset(m_dc_coeffs, 0, sizeof(m_dc_coeffs)); + memset(m_ac_coeffs, 0, sizeof(m_ac_coeffs)); + memset(m_block_y_mcu, 0, sizeof(m_block_y_mcu)); + + m_eob_run = 0; + + memset(m_block_y_mcu, 0, sizeof(m_block_y_mcu)); + + m_pIn_buf_ofs = m_in_buf; + m_in_buf_left = 0; + m_eof_flag = false; + m_tem_flag = 0; + + memset(m_in_buf_pad_start, 0, sizeof(m_in_buf_pad_start)); + memset(m_in_buf, 0, sizeof(m_in_buf)); + memset(m_in_buf_pad_end, 0, sizeof(m_in_buf_pad_end)); + + m_restart_interval = 0; + m_restarts_left = 0; + m_next_restart_num = 0; + + m_max_mcus_per_row = 0; + m_max_blocks_per_mcu = 0; + m_max_mcus_per_col = 0; + + memset(m_last_dc_val, 0, sizeof(m_last_dc_val)); + m_pMCU_coefficients = NULL; + m_pSample_buf = NULL; + + m_total_bytes_read = 0; + + m_pScan_line_0 = NULL; + m_pScan_line_1 = NULL; + + // Ready the input buffer. + prep_in_buffer(); + + // Prime the bit buffer. + m_bits_left = 16; + m_bit_buf = 0; + + get_bits(16); + get_bits(16); + + for (int i = 0; i < JPGD_MAX_BLOCKS_PER_MCU; i++) + m_mcu_block_max_zag[i] = 64; +} + +#define SCALEBITS 16 +#define ONE_HALF ((int) 1 << (SCALEBITS-1)) +#define FIX(x) ((int) ((x) * (1L<<SCALEBITS) + 0.5f)) + +// Create a few tables that allow us to quickly convert YCbCr to RGB. +void jpeg_decoder::create_look_ups() +{ + for (int i = 0; i <= 255; i++) + { + int k = i - 128; + m_crr[i] = ( FIX(1.40200f) * k + ONE_HALF) >> SCALEBITS; + m_cbb[i] = ( FIX(1.77200f) * k + ONE_HALF) >> SCALEBITS; + m_crg[i] = (-FIX(0.71414f)) * k; + m_cbg[i] = (-FIX(0.34414f)) * k + ONE_HALF; + } +} + +// This method throws back into the stream any bytes that where read +// into the bit buffer during initial marker scanning. +void jpeg_decoder::fix_in_buffer() +{ + // In case any 0xFF's where pulled into the buffer during marker scanning. + JPGD_ASSERT((m_bits_left & 7) == 0); + + if (m_bits_left == 16) + stuff_char( (uint8)(m_bit_buf & 0xFF)); + + if (m_bits_left >= 8) + stuff_char( (uint8)((m_bit_buf >> 8) & 0xFF)); + + stuff_char((uint8)((m_bit_buf >> 16) & 0xFF)); + stuff_char((uint8)((m_bit_buf >> 24) & 0xFF)); + + m_bits_left = 16; + get_bits_no_markers(16); + get_bits_no_markers(16); +} + +void jpeg_decoder::transform_mcu(int mcu_row) +{ + jpgd_block_t* pSrc_ptr = m_pMCU_coefficients; + uint8* pDst_ptr = m_pSample_buf + mcu_row * m_blocks_per_mcu * 64; + + for (int mcu_block = 0; mcu_block < m_blocks_per_mcu; mcu_block++) + { + idct(pSrc_ptr, pDst_ptr, m_mcu_block_max_zag[mcu_block]); + pSrc_ptr += 64; + pDst_ptr += 64; + } +} + +static const uint8 s_max_rc[64] = +{ + 17, 18, 34, 50, 50, 51, 52, 52, 52, 68, 84, 84, 84, 84, 85, 86, 86, 86, 86, 86, + 102, 118, 118, 118, 118, 118, 118, 119, 120, 120, 120, 120, 120, 120, 120, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136 +}; + +void jpeg_decoder::transform_mcu_expand(int mcu_row) +{ + jpgd_block_t* pSrc_ptr = m_pMCU_coefficients; + uint8* pDst_ptr = m_pSample_buf + mcu_row * m_expanded_blocks_per_mcu * 64; + + // Y IDCT + int mcu_block; + for (mcu_block = 0; mcu_block < m_expanded_blocks_per_component; mcu_block++) + { + idct(pSrc_ptr, pDst_ptr, m_mcu_block_max_zag[mcu_block]); + pSrc_ptr += 64; + pDst_ptr += 64; + } + + // Chroma IDCT, with upsampling + jpgd_block_t temp_block[64]; + + for (int i = 0; i < 2; i++) + { + DCT_Upsample::Matrix44 P, Q, R, S; + + JPGD_ASSERT(m_mcu_block_max_zag[mcu_block] >= 1); + JPGD_ASSERT(m_mcu_block_max_zag[mcu_block] <= 64); + + int max_zag = m_mcu_block_max_zag[mcu_block++] - 1; + if (max_zag <= 0) max_zag = 0; // should never happen, only here to shut up static analysis + switch (s_max_rc[max_zag]) + { + case 1*16+1: + DCT_Upsample::P_Q<1, 1>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<1, 1>::calc(R, S, pSrc_ptr); + break; + case 1*16+2: + DCT_Upsample::P_Q<1, 2>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<1, 2>::calc(R, S, pSrc_ptr); + break; + case 2*16+2: + DCT_Upsample::P_Q<2, 2>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<2, 2>::calc(R, S, pSrc_ptr); + break; + case 3*16+2: + DCT_Upsample::P_Q<3, 2>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<3, 2>::calc(R, S, pSrc_ptr); + break; + case 3*16+3: + DCT_Upsample::P_Q<3, 3>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<3, 3>::calc(R, S, pSrc_ptr); + break; + case 3*16+4: + DCT_Upsample::P_Q<3, 4>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<3, 4>::calc(R, S, pSrc_ptr); + break; + case 4*16+4: + DCT_Upsample::P_Q<4, 4>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<4, 4>::calc(R, S, pSrc_ptr); + break; + case 5*16+4: + DCT_Upsample::P_Q<5, 4>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<5, 4>::calc(R, S, pSrc_ptr); + break; + case 5*16+5: + DCT_Upsample::P_Q<5, 5>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<5, 5>::calc(R, S, pSrc_ptr); + break; + case 5*16+6: + DCT_Upsample::P_Q<5, 6>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<5, 6>::calc(R, S, pSrc_ptr); + break; + case 6*16+6: + DCT_Upsample::P_Q<6, 6>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<6, 6>::calc(R, S, pSrc_ptr); + break; + case 7*16+6: + DCT_Upsample::P_Q<7, 6>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<7, 6>::calc(R, S, pSrc_ptr); + break; + case 7*16+7: + DCT_Upsample::P_Q<7, 7>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<7, 7>::calc(R, S, pSrc_ptr); + break; + case 7*16+8: + DCT_Upsample::P_Q<7, 8>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<7, 8>::calc(R, S, pSrc_ptr); + break; + case 8*16+8: + DCT_Upsample::P_Q<8, 8>::calc(P, Q, pSrc_ptr); + DCT_Upsample::R_S<8, 8>::calc(R, S, pSrc_ptr); + break; + default: + JPGD_ASSERT(false); + } + + DCT_Upsample::Matrix44 a(P + Q); P -= Q; + DCT_Upsample::Matrix44& b = P; + DCT_Upsample::Matrix44 c(R + S); R -= S; + DCT_Upsample::Matrix44& d = R; + + DCT_Upsample::Matrix44::add_and_store(temp_block, a, c); + idct_4x4(temp_block, pDst_ptr); + pDst_ptr += 64; + + DCT_Upsample::Matrix44::sub_and_store(temp_block, a, c); + idct_4x4(temp_block, pDst_ptr); + pDst_ptr += 64; + + DCT_Upsample::Matrix44::add_and_store(temp_block, b, d); + idct_4x4(temp_block, pDst_ptr); + pDst_ptr += 64; + + DCT_Upsample::Matrix44::sub_and_store(temp_block, b, d); + idct_4x4(temp_block, pDst_ptr); + pDst_ptr += 64; + + pSrc_ptr += 64; + } +} + +// Loads and dequantizes the next row of (already decoded) coefficients. +// Progressive images only. +void jpeg_decoder::load_next_row() +{ + int i; + jpgd_block_t *p; + jpgd_quant_t *q; + int mcu_row, mcu_block, row_block = 0; + int component_num, component_id; + int block_x_mcu[JPGD_MAX_COMPONENTS]; + + memset(block_x_mcu, 0, JPGD_MAX_COMPONENTS * sizeof(int)); + + for (mcu_row = 0; mcu_row < m_mcus_per_row; mcu_row++) + { + int block_x_mcu_ofs = 0, block_y_mcu_ofs = 0; + + for (mcu_block = 0; mcu_block < m_blocks_per_mcu; mcu_block++) + { + component_id = m_mcu_org[mcu_block]; + q = m_quant[m_comp_quant[component_id]]; + + p = m_pMCU_coefficients + 64 * mcu_block; + + jpgd_block_t* pAC = coeff_buf_getp(m_ac_coeffs[component_id], block_x_mcu[component_id] + block_x_mcu_ofs, m_block_y_mcu[component_id] + block_y_mcu_ofs); + jpgd_block_t* pDC = coeff_buf_getp(m_dc_coeffs[component_id], block_x_mcu[component_id] + block_x_mcu_ofs, m_block_y_mcu[component_id] + block_y_mcu_ofs); + p[0] = pDC[0]; + memcpy(&p[1], &pAC[1], 63 * sizeof(jpgd_block_t)); + + for (i = 63; i > 0; i--) + if (p[g_ZAG[i]]) + break; + + m_mcu_block_max_zag[mcu_block] = i + 1; + + for ( ; i >= 0; i--) + if (p[g_ZAG[i]]) + p[g_ZAG[i]] = static_cast<jpgd_block_t>(p[g_ZAG[i]] * q[i]); + + row_block++; + + if (m_comps_in_scan == 1) + block_x_mcu[component_id]++; + else + { + if (++block_x_mcu_ofs == m_comp_h_samp[component_id]) + { + block_x_mcu_ofs = 0; + + if (++block_y_mcu_ofs == m_comp_v_samp[component_id]) + { + block_y_mcu_ofs = 0; + + block_x_mcu[component_id] += m_comp_h_samp[component_id]; + } + } + } + } + + if (m_freq_domain_chroma_upsample) + transform_mcu_expand(mcu_row); + else + transform_mcu(mcu_row); + } + + if (m_comps_in_scan == 1) + m_block_y_mcu[m_comp_list[0]]++; + else + { + for (component_num = 0; component_num < m_comps_in_scan; component_num++) + { + component_id = m_comp_list[component_num]; + + m_block_y_mcu[component_id] += m_comp_v_samp[component_id]; + } + } +} + +// Restart interval processing. +void jpeg_decoder::process_restart() +{ + int i; + int c = 0; + + // Align to a byte boundry + // FIXME: Is this really necessary? get_bits_no_markers() never reads in markers! + //get_bits_no_markers(m_bits_left & 7); + + // Let's scan a little bit to find the marker, but not _too_ far. + // 1536 is a "fudge factor" that determines how much to scan. + for (i = 1536; i > 0; i--) + if (get_char() == 0xFF) + break; + + if (i == 0) + stop_decoding(JPGD_BAD_RESTART_MARKER); + + for ( ; i > 0; i--) + if ((c = get_char()) != 0xFF) + break; + + if (i == 0) + stop_decoding(JPGD_BAD_RESTART_MARKER); + + // Is it the expected marker? If not, something bad happened. + if (c != (m_next_restart_num + M_RST0)) + stop_decoding(JPGD_BAD_RESTART_MARKER); + + // Reset each component's DC prediction values. + memset(&m_last_dc_val, 0, m_comps_in_frame * sizeof(uint)); + + m_eob_run = 0; + + m_restarts_left = m_restart_interval; + + m_next_restart_num = (m_next_restart_num + 1) & 7; + + // Get the bit buffer going again... + + m_bits_left = 16; + get_bits_no_markers(16); + get_bits_no_markers(16); +} + +static inline int dequantize_ac(int c, int q) { c *= q; return c; } + +// Decodes and dequantizes the next row of coefficients. +void jpeg_decoder::decode_next_row() +{ + int row_block = 0; + + for (int mcu_row = 0; mcu_row < m_mcus_per_row; mcu_row++) + { + if ((m_restart_interval) && (m_restarts_left == 0)) + process_restart(); + + jpgd_block_t* p = m_pMCU_coefficients; + for (int mcu_block = 0; mcu_block < m_blocks_per_mcu; mcu_block++, p += 64) + { + int component_id = m_mcu_org[mcu_block]; + jpgd_quant_t* q = m_quant[m_comp_quant[component_id]]; + + int r, s; + s = huff_decode(m_pHuff_tabs[m_comp_dc_tab[component_id]], r); + s = JPGD_HUFF_EXTEND(r, s); + + m_last_dc_val[component_id] = (s += m_last_dc_val[component_id]); + + p[0] = static_cast<jpgd_block_t>(s * q[0]); + + int prev_num_set = m_mcu_block_max_zag[mcu_block]; + + huff_tables *pH = m_pHuff_tabs[m_comp_ac_tab[component_id]]; + + int k; + for (k = 1; k < 64; k++) + { + int extra_bits; + s = huff_decode(pH, extra_bits); + + r = s >> 4; + s &= 15; + + if (s) + { + if (r) + { + if ((k + r) > 63) + stop_decoding(JPGD_DECODE_ERROR); + + if (k < prev_num_set) + { + int n = JPGD_MIN(r, prev_num_set - k); + int kt = k; + while (n--) + p[g_ZAG[kt++]] = 0; + } + + k += r; + } + + s = JPGD_HUFF_EXTEND(extra_bits, s); + + JPGD_ASSERT(k < 64); + + p[g_ZAG[k]] = static_cast<jpgd_block_t>(dequantize_ac(s, q[k])); //s * q[k]; + } + else + { + if (r == 15) + { + if ((k + 16) > 64) + stop_decoding(JPGD_DECODE_ERROR); + + if (k < prev_num_set) + { + int n = JPGD_MIN(16, prev_num_set - k); + int kt = k; + while (n--) + { + JPGD_ASSERT(kt <= 63); + p[g_ZAG[kt++]] = 0; + } + } + + k += 16 - 1; // - 1 because the loop counter is k + JPGD_ASSERT(p[g_ZAG[k]] == 0); + } + else + break; + } + } + + if (k < prev_num_set) + { + int kt = k; + while (kt < prev_num_set) + p[g_ZAG[kt++]] = 0; + } + + m_mcu_block_max_zag[mcu_block] = k; + + row_block++; + } + + if (m_freq_domain_chroma_upsample) + transform_mcu_expand(mcu_row); + else + transform_mcu(mcu_row); + + m_restarts_left--; + } +} + +// YCbCr H1V1 (1x1:1:1, 3 m_blocks per MCU) to RGB +void jpeg_decoder::H1V1Convert() +{ + int row = m_max_mcu_y_size - m_mcu_lines_left; + uint8 *d = m_pScan_line_0; + uint8 *s = m_pSample_buf + row * 8; + + for (int i = m_max_mcus_per_row; i > 0; i--) + { + for (int j = 0; j < 8; j++) + { + int y = s[j]; + int cb = s[64+j]; + int cr = s[128+j]; + + d[0] = clamp(y + m_crr[cr]); + d[1] = clamp(y + ((m_crg[cr] + m_cbg[cb]) >> 16)); + d[2] = clamp(y + m_cbb[cb]); + d[3] = 255; + + d += 4; + } + + s += 64*3; + } +} + +// YCbCr H2V1 (2x1:1:1, 4 m_blocks per MCU) to RGB +void jpeg_decoder::H2V1Convert() +{ + int row = m_max_mcu_y_size - m_mcu_lines_left; + uint8 *d0 = m_pScan_line_0; + uint8 *y = m_pSample_buf + row * 8; + uint8 *c = m_pSample_buf + 2*64 + row * 8; + + for (int i = m_max_mcus_per_row; i > 0; i--) + { + for (int l = 0; l < 2; l++) + { + for (int j = 0; j < 4; j++) + { + int cb = c[0]; + int cr = c[64]; + + int rc = m_crr[cr]; + int gc = ((m_crg[cr] + m_cbg[cb]) >> 16); + int bc = m_cbb[cb]; + + int yy = y[j<<1]; + d0[0] = clamp(yy+rc); + d0[1] = clamp(yy+gc); + d0[2] = clamp(yy+bc); + d0[3] = 255; + + yy = y[(j<<1)+1]; + d0[4] = clamp(yy+rc); + d0[5] = clamp(yy+gc); + d0[6] = clamp(yy+bc); + d0[7] = 255; + + d0 += 8; + + c++; + } + y += 64; + } + + y += 64*4 - 64*2; + c += 64*4 - 8; + } +} + +// YCbCr H2V1 (1x2:1:1, 4 m_blocks per MCU) to RGB +void jpeg_decoder::H1V2Convert() +{ + int row = m_max_mcu_y_size - m_mcu_lines_left; + uint8 *d0 = m_pScan_line_0; + uint8 *d1 = m_pScan_line_1; + uint8 *y; + uint8 *c; + + if (row < 8) + y = m_pSample_buf + row * 8; + else + y = m_pSample_buf + 64*1 + (row & 7) * 8; + + c = m_pSample_buf + 64*2 + (row >> 1) * 8; + + for (int i = m_max_mcus_per_row; i > 0; i--) + { + for (int j = 0; j < 8; j++) + { + int cb = c[0+j]; + int cr = c[64+j]; + + int rc = m_crr[cr]; + int gc = ((m_crg[cr] + m_cbg[cb]) >> 16); + int bc = m_cbb[cb]; + + int yy = y[j]; + d0[0] = clamp(yy+rc); + d0[1] = clamp(yy+gc); + d0[2] = clamp(yy+bc); + d0[3] = 255; + + yy = y[8+j]; + d1[0] = clamp(yy+rc); + d1[1] = clamp(yy+gc); + d1[2] = clamp(yy+bc); + d1[3] = 255; + + d0 += 4; + d1 += 4; + } + + y += 64*4; + c += 64*4; + } +} + +// YCbCr H2V2 (2x2:1:1, 6 m_blocks per MCU) to RGB +void jpeg_decoder::H2V2Convert() +{ + int row = m_max_mcu_y_size - m_mcu_lines_left; + uint8 *d0 = m_pScan_line_0; + uint8 *d1 = m_pScan_line_1; + uint8 *y; + uint8 *c; + + if (row < 8) + y = m_pSample_buf + row * 8; + else + y = m_pSample_buf + 64*2 + (row & 7) * 8; + + c = m_pSample_buf + 64*4 + (row >> 1) * 8; + + for (int i = m_max_mcus_per_row; i > 0; i--) + { + for (int l = 0; l < 2; l++) + { + for (int j = 0; j < 8; j += 2) + { + int cb = c[0]; + int cr = c[64]; + + int rc = m_crr[cr]; + int gc = ((m_crg[cr] + m_cbg[cb]) >> 16); + int bc = m_cbb[cb]; + + int yy = y[j]; + d0[0] = clamp(yy+rc); + d0[1] = clamp(yy+gc); + d0[2] = clamp(yy+bc); + d0[3] = 255; + + yy = y[j+1]; + d0[4] = clamp(yy+rc); + d0[5] = clamp(yy+gc); + d0[6] = clamp(yy+bc); + d0[7] = 255; + + yy = y[j+8]; + d1[0] = clamp(yy+rc); + d1[1] = clamp(yy+gc); + d1[2] = clamp(yy+bc); + d1[3] = 255; + + yy = y[j+8+1]; + d1[4] = clamp(yy+rc); + d1[5] = clamp(yy+gc); + d1[6] = clamp(yy+bc); + d1[7] = 255; + + d0 += 8; + d1 += 8; + + c++; + } + y += 64; + } + + y += 64*6 - 64*2; + c += 64*6 - 8; + } +} + +// Y (1 block per MCU) to 8-bit grayscale +void jpeg_decoder::gray_convert() +{ + int row = m_max_mcu_y_size - m_mcu_lines_left; + uint8 *d = m_pScan_line_0; + uint8 *s = m_pSample_buf + row * 8; + + for (int i = m_max_mcus_per_row; i > 0; i--) + { + *(uint *)d = *(uint *)s; + *(uint *)(&d[4]) = *(uint *)(&s[4]); + + s += 64; + d += 8; + } +} + +void jpeg_decoder::expanded_convert() +{ + int row = m_max_mcu_y_size - m_mcu_lines_left; + + uint8* Py = m_pSample_buf + (row / 8) * 64 * m_comp_h_samp[0] + (row & 7) * 8; + + uint8* d = m_pScan_line_0; + + for (int i = m_max_mcus_per_row; i > 0; i--) + { + for (int k = 0; k < m_max_mcu_x_size; k += 8) + { + const int Y_ofs = k * 8; + const int Cb_ofs = Y_ofs + 64 * m_expanded_blocks_per_component; + const int Cr_ofs = Y_ofs + 64 * m_expanded_blocks_per_component * 2; + for (int j = 0; j < 8; j++) + { + int y = Py[Y_ofs + j]; + int cb = Py[Cb_ofs + j]; + int cr = Py[Cr_ofs + j]; + + d[0] = clamp(y + m_crr[cr]); + d[1] = clamp(y + ((m_crg[cr] + m_cbg[cb]) >> 16)); + d[2] = clamp(y + m_cbb[cb]); + d[3] = 255; + + d += 4; + } + } + + Py += 64 * m_expanded_blocks_per_mcu; + } +} + +// Find end of image (EOI) marker, so we can return to the user the exact size of the input stream. +void jpeg_decoder::find_eoi() +{ + if (!m_progressive_flag) + { + // Attempt to read the EOI marker. + //get_bits_no_markers(m_bits_left & 7); + + // Prime the bit buffer + m_bits_left = 16; + get_bits(16); + get_bits(16); + + // The next marker _should_ be EOI + process_markers(); + } + + m_total_bytes_read -= m_in_buf_left; +} + +int jpeg_decoder::decode(const void** pScan_line, uint* pScan_line_len) +{ + if ((m_error_code) || (!m_ready_flag)) + return JPGD_FAILED; + + if (m_total_lines_left == 0) + return JPGD_DONE; + + if (m_mcu_lines_left == 0) + { + if (setjmp(m_jmp_state)) + return JPGD_FAILED; + + if (m_progressive_flag) + load_next_row(); + else + decode_next_row(); + + // Find the EOI marker if that was the last row. + if (m_total_lines_left <= m_max_mcu_y_size) + find_eoi(); + + m_mcu_lines_left = m_max_mcu_y_size; + } + + if (m_freq_domain_chroma_upsample) + { + expanded_convert(); + *pScan_line = m_pScan_line_0; + } + else + { + switch (m_scan_type) + { + case JPGD_YH2V2: + { + if ((m_mcu_lines_left & 1) == 0) + { + H2V2Convert(); + *pScan_line = m_pScan_line_0; + } + else + *pScan_line = m_pScan_line_1; + + break; + } + case JPGD_YH2V1: + { + H2V1Convert(); + *pScan_line = m_pScan_line_0; + break; + } + case JPGD_YH1V2: + { + if ((m_mcu_lines_left & 1) == 0) + { + H1V2Convert(); + *pScan_line = m_pScan_line_0; + } + else + *pScan_line = m_pScan_line_1; + + break; + } + case JPGD_YH1V1: + { + H1V1Convert(); + *pScan_line = m_pScan_line_0; + break; + } + case JPGD_GRAYSCALE: + { + gray_convert(); + *pScan_line = m_pScan_line_0; + + break; + } + } + } + + *pScan_line_len = m_real_dest_bytes_per_scan_line; + + m_mcu_lines_left--; + m_total_lines_left--; + + return JPGD_SUCCESS; +} + +// Creates the tables needed for efficient Huffman decoding. +void jpeg_decoder::make_huff_table(int index, huff_tables *pH) +{ + int p, i, l, si; + uint8 huffsize[257]; + uint huffcode[257]; + uint code; + uint subtree; + int code_size; + int lastp; + int nextfreeentry; + int currententry; + + pH->ac_table = m_huff_ac[index] != 0; + + p = 0; + + for (l = 1; l <= 16; l++) + { + for (i = 1; i <= m_huff_num[index][l]; i++) + huffsize[p++] = static_cast<uint8>(l); + } + + huffsize[p] = 0; + + lastp = p; + + code = 0; + si = huffsize[0]; + p = 0; + + while (huffsize[p]) + { + while (huffsize[p] == si) + { + huffcode[p++] = code; + code++; + } + + code <<= 1; + si++; + } + + memset(pH->look_up, 0, sizeof(pH->look_up)); + memset(pH->look_up2, 0, sizeof(pH->look_up2)); + memset(pH->tree, 0, sizeof(pH->tree)); + memset(pH->code_size, 0, sizeof(pH->code_size)); + + nextfreeentry = -1; + + p = 0; + + while (p < lastp) + { + i = m_huff_val[index][p]; + code = huffcode[p]; + code_size = huffsize[p]; + + pH->code_size[i] = static_cast<uint8>(code_size); + + if (code_size <= 8) + { + code <<= (8 - code_size); + + for (l = 1 << (8 - code_size); l > 0; l--) + { + JPGD_ASSERT(i < 256); + + pH->look_up[code] = i; + + bool has_extrabits = false; + int extra_bits = 0; + int num_extra_bits = i & 15; + + int bits_to_fetch = code_size; + if (num_extra_bits) + { + int total_codesize = code_size + num_extra_bits; + if (total_codesize <= 8) + { + has_extrabits = true; + extra_bits = ((1 << num_extra_bits) - 1) & (code >> (8 - total_codesize)); + JPGD_ASSERT(extra_bits <= 0x7FFF); + bits_to_fetch += num_extra_bits; + } + } + + if (!has_extrabits) + pH->look_up2[code] = i | (bits_to_fetch << 8); + else + pH->look_up2[code] = i | 0x8000 | (extra_bits << 16) | (bits_to_fetch << 8); + + code++; + } + } + else + { + subtree = (code >> (code_size - 8)) & 0xFF; + + currententry = pH->look_up[subtree]; + + if (currententry == 0) + { + pH->look_up[subtree] = currententry = nextfreeentry; + pH->look_up2[subtree] = currententry = nextfreeentry; + + nextfreeentry -= 2; + } + + code <<= (16 - (code_size - 8)); + + for (l = code_size; l > 9; l--) + { + if ((code & 0x8000) == 0) + currententry--; + + if (pH->tree[-currententry - 1] == 0) + { + pH->tree[-currententry - 1] = nextfreeentry; + + currententry = nextfreeentry; + + nextfreeentry -= 2; + } + else + currententry = pH->tree[-currententry - 1]; + + code <<= 1; + } + + if ((code & 0x8000) == 0) + currententry--; + + pH->tree[-currententry - 1] = i; + } + + p++; + } +} + +// Verifies the quantization tables needed for this scan are available. +void jpeg_decoder::check_quant_tables() +{ + for (int i = 0; i < m_comps_in_scan; i++) + if (m_quant[m_comp_quant[m_comp_list[i]]] == NULL) + stop_decoding(JPGD_UNDEFINED_QUANT_TABLE); +} + +// Verifies that all the Huffman tables needed for this scan are available. +void jpeg_decoder::check_huff_tables() +{ + for (int i = 0; i < m_comps_in_scan; i++) + { + if ((m_spectral_start == 0) && (m_huff_num[m_comp_dc_tab[m_comp_list[i]]] == NULL)) + stop_decoding(JPGD_UNDEFINED_HUFF_TABLE); + + if ((m_spectral_end > 0) && (m_huff_num[m_comp_ac_tab[m_comp_list[i]]] == NULL)) + stop_decoding(JPGD_UNDEFINED_HUFF_TABLE); + } + + for (int i = 0; i < JPGD_MAX_HUFF_TABLES; i++) + if (m_huff_num[i]) + { + if (!m_pHuff_tabs[i]) + m_pHuff_tabs[i] = (huff_tables *)alloc(sizeof(huff_tables)); + + make_huff_table(i, m_pHuff_tabs[i]); + } +} + +// Determines the component order inside each MCU. +// Also calcs how many MCU's are on each row, etc. +void jpeg_decoder::calc_mcu_block_order() +{ + int component_num, component_id; + int max_h_samp = 0, max_v_samp = 0; + + for (component_id = 0; component_id < m_comps_in_frame; component_id++) + { + if (m_comp_h_samp[component_id] > max_h_samp) + max_h_samp = m_comp_h_samp[component_id]; + + if (m_comp_v_samp[component_id] > max_v_samp) + max_v_samp = m_comp_v_samp[component_id]; + } + + for (component_id = 0; component_id < m_comps_in_frame; component_id++) + { + m_comp_h_blocks[component_id] = ((((m_image_x_size * m_comp_h_samp[component_id]) + (max_h_samp - 1)) / max_h_samp) + 7) / 8; + m_comp_v_blocks[component_id] = ((((m_image_y_size * m_comp_v_samp[component_id]) + (max_v_samp - 1)) / max_v_samp) + 7) / 8; + } + + if (m_comps_in_scan == 1) + { + m_mcus_per_row = m_comp_h_blocks[m_comp_list[0]]; + m_mcus_per_col = m_comp_v_blocks[m_comp_list[0]]; + } + else + { + m_mcus_per_row = (((m_image_x_size + 7) / 8) + (max_h_samp - 1)) / max_h_samp; + m_mcus_per_col = (((m_image_y_size + 7) / 8) + (max_v_samp - 1)) / max_v_samp; + } + + if (m_comps_in_scan == 1) + { + m_mcu_org[0] = m_comp_list[0]; + + m_blocks_per_mcu = 1; + } + else + { + m_blocks_per_mcu = 0; + + for (component_num = 0; component_num < m_comps_in_scan; component_num++) + { + int num_blocks; + + component_id = m_comp_list[component_num]; + + num_blocks = m_comp_h_samp[component_id] * m_comp_v_samp[component_id]; + + while (num_blocks--) + m_mcu_org[m_blocks_per_mcu++] = component_id; + } + } +} + +// Starts a new scan. +int jpeg_decoder::init_scan() +{ + if (!locate_sos_marker()) + return JPGD_FALSE; + + calc_mcu_block_order(); + + check_huff_tables(); + + check_quant_tables(); + + memset(m_last_dc_val, 0, m_comps_in_frame * sizeof(uint)); + + m_eob_run = 0; + + if (m_restart_interval) + { + m_restarts_left = m_restart_interval; + m_next_restart_num = 0; + } + + fix_in_buffer(); + + return JPGD_TRUE; +} + +// Starts a frame. Determines if the number of components or sampling factors +// are supported. +void jpeg_decoder::init_frame() +{ + int i; + + if (m_comps_in_frame == 1) + { + if ((m_comp_h_samp[0] != 1) || (m_comp_v_samp[0] != 1)) + stop_decoding(JPGD_UNSUPPORTED_SAMP_FACTORS); + + m_scan_type = JPGD_GRAYSCALE; + m_max_blocks_per_mcu = 1; + m_max_mcu_x_size = 8; + m_max_mcu_y_size = 8; + } + else if (m_comps_in_frame == 3) + { + if ( ((m_comp_h_samp[1] != 1) || (m_comp_v_samp[1] != 1)) || + ((m_comp_h_samp[2] != 1) || (m_comp_v_samp[2] != 1)) ) + stop_decoding(JPGD_UNSUPPORTED_SAMP_FACTORS); + + if ((m_comp_h_samp[0] == 1) && (m_comp_v_samp[0] == 1)) + { + m_scan_type = JPGD_YH1V1; + + m_max_blocks_per_mcu = 3; + m_max_mcu_x_size = 8; + m_max_mcu_y_size = 8; + } + else if ((m_comp_h_samp[0] == 2) && (m_comp_v_samp[0] == 1)) + { + m_scan_type = JPGD_YH2V1; + m_max_blocks_per_mcu = 4; + m_max_mcu_x_size = 16; + m_max_mcu_y_size = 8; + } + else if ((m_comp_h_samp[0] == 1) && (m_comp_v_samp[0] == 2)) + { + m_scan_type = JPGD_YH1V2; + m_max_blocks_per_mcu = 4; + m_max_mcu_x_size = 8; + m_max_mcu_y_size = 16; + } + else if ((m_comp_h_samp[0] == 2) && (m_comp_v_samp[0] == 2)) + { + m_scan_type = JPGD_YH2V2; + m_max_blocks_per_mcu = 6; + m_max_mcu_x_size = 16; + m_max_mcu_y_size = 16; + } + else + stop_decoding(JPGD_UNSUPPORTED_SAMP_FACTORS); + } + else + stop_decoding(JPGD_UNSUPPORTED_COLORSPACE); + + m_max_mcus_per_row = (m_image_x_size + (m_max_mcu_x_size - 1)) / m_max_mcu_x_size; + m_max_mcus_per_col = (m_image_y_size + (m_max_mcu_y_size - 1)) / m_max_mcu_y_size; + + // These values are for the *destination* pixels: after conversion. + if (m_scan_type == JPGD_GRAYSCALE) + m_dest_bytes_per_pixel = 1; + else + m_dest_bytes_per_pixel = 4; + + m_dest_bytes_per_scan_line = ((m_image_x_size + 15) & 0xFFF0) * m_dest_bytes_per_pixel; + + m_real_dest_bytes_per_scan_line = (m_image_x_size * m_dest_bytes_per_pixel); + + // Initialize two scan line buffers. + m_pScan_line_0 = (uint8 *)alloc(m_dest_bytes_per_scan_line, true); + if ((m_scan_type == JPGD_YH1V2) || (m_scan_type == JPGD_YH2V2)) + m_pScan_line_1 = (uint8 *)alloc(m_dest_bytes_per_scan_line, true); + + m_max_blocks_per_row = m_max_mcus_per_row * m_max_blocks_per_mcu; + + // Should never happen + if (m_max_blocks_per_row > JPGD_MAX_BLOCKS_PER_ROW) + stop_decoding(JPGD_ASSERTION_ERROR); + + // Allocate the coefficient buffer, enough for one MCU + m_pMCU_coefficients = (jpgd_block_t*)alloc(m_max_blocks_per_mcu * 64 * sizeof(jpgd_block_t)); + + for (i = 0; i < m_max_blocks_per_mcu; i++) + m_mcu_block_max_zag[i] = 64; + + m_expanded_blocks_per_component = m_comp_h_samp[0] * m_comp_v_samp[0]; + m_expanded_blocks_per_mcu = m_expanded_blocks_per_component * m_comps_in_frame; + m_expanded_blocks_per_row = m_max_mcus_per_row * m_expanded_blocks_per_mcu; + // Freq. domain chroma upsampling is only supported for H2V2 subsampling factor (the most common one I've seen). + m_freq_domain_chroma_upsample = false; +#if JPGD_SUPPORT_FREQ_DOMAIN_UPSAMPLING + m_freq_domain_chroma_upsample = (m_expanded_blocks_per_mcu == 4*3); +#endif + + if (m_freq_domain_chroma_upsample) + m_pSample_buf = (uint8 *)alloc(m_expanded_blocks_per_row * 64); + else + m_pSample_buf = (uint8 *)alloc(m_max_blocks_per_row * 64); + + m_total_lines_left = m_image_y_size; + + m_mcu_lines_left = 0; + + create_look_ups(); +} + +// The coeff_buf series of methods originally stored the coefficients +// into a "virtual" file which was located in EMS, XMS, or a disk file. A cache +// was used to make this process more efficient. Now, we can store the entire +// thing in RAM. +jpeg_decoder::coeff_buf* jpeg_decoder::coeff_buf_open(int block_num_x, int block_num_y, int block_len_x, int block_len_y) +{ + coeff_buf* cb = (coeff_buf*)alloc(sizeof(coeff_buf)); + + cb->block_num_x = block_num_x; + cb->block_num_y = block_num_y; + cb->block_len_x = block_len_x; + cb->block_len_y = block_len_y; + cb->block_size = (block_len_x * block_len_y) * sizeof(jpgd_block_t); + cb->pData = (uint8 *)alloc(cb->block_size * block_num_x * block_num_y, true); + return cb; +} + +inline jpgd_block_t *jpeg_decoder::coeff_buf_getp(coeff_buf *cb, int block_x, int block_y) +{ + JPGD_ASSERT((block_x < cb->block_num_x) && (block_y < cb->block_num_y)); + return (jpgd_block_t *)(cb->pData + block_x * cb->block_size + block_y * (cb->block_size * cb->block_num_x)); +} + +// The following methods decode the various types of m_blocks encountered +// in progressively encoded images. +void jpeg_decoder::decode_block_dc_first(jpeg_decoder *pD, int component_id, int block_x, int block_y) +{ + int s, r; + jpgd_block_t *p = pD->coeff_buf_getp(pD->m_dc_coeffs[component_id], block_x, block_y); + + if ((s = pD->huff_decode(pD->m_pHuff_tabs[pD->m_comp_dc_tab[component_id]])) != 0) + { + r = pD->get_bits_no_markers(s); + s = JPGD_HUFF_EXTEND(r, s); + } + + pD->m_last_dc_val[component_id] = (s += pD->m_last_dc_val[component_id]); + + p[0] = static_cast<jpgd_block_t>(s << pD->m_successive_low); +} + +void jpeg_decoder::decode_block_dc_refine(jpeg_decoder *pD, int component_id, int block_x, int block_y) +{ + if (pD->get_bits_no_markers(1)) + { + jpgd_block_t *p = pD->coeff_buf_getp(pD->m_dc_coeffs[component_id], block_x, block_y); + + p[0] |= (1 << pD->m_successive_low); + } +} + +void jpeg_decoder::decode_block_ac_first(jpeg_decoder *pD, int component_id, int block_x, int block_y) +{ + int k, s, r; + + if (pD->m_eob_run) + { + pD->m_eob_run--; + return; + } + + jpgd_block_t *p = pD->coeff_buf_getp(pD->m_ac_coeffs[component_id], block_x, block_y); + + for (k = pD->m_spectral_start; k <= pD->m_spectral_end; k++) + { + s = pD->huff_decode(pD->m_pHuff_tabs[pD->m_comp_ac_tab[component_id]]); + + r = s >> 4; + s &= 15; + + if (s) + { + if ((k += r) > 63) + pD->stop_decoding(JPGD_DECODE_ERROR); + + r = pD->get_bits_no_markers(s); + s = JPGD_HUFF_EXTEND(r, s); + + p[g_ZAG[k]] = static_cast<jpgd_block_t>(s << pD->m_successive_low); + } + else + { + if (r == 15) + { + if ((k += 15) > 63) + pD->stop_decoding(JPGD_DECODE_ERROR); + } + else + { + pD->m_eob_run = 1 << r; + + if (r) + pD->m_eob_run += pD->get_bits_no_markers(r); + + pD->m_eob_run--; + + break; + } + } + } +} + +void jpeg_decoder::decode_block_ac_refine(jpeg_decoder *pD, int component_id, int block_x, int block_y) +{ + int s, k, r; + int p1 = 1 << pD->m_successive_low; + int m1 = (-1) << pD->m_successive_low; + jpgd_block_t *p = pD->coeff_buf_getp(pD->m_ac_coeffs[component_id], block_x, block_y); + + JPGD_ASSERT(pD->m_spectral_end <= 63); + + k = pD->m_spectral_start; + + if (pD->m_eob_run == 0) + { + for ( ; k <= pD->m_spectral_end; k++) + { + s = pD->huff_decode(pD->m_pHuff_tabs[pD->m_comp_ac_tab[component_id]]); + + r = s >> 4; + s &= 15; + + if (s) + { + if (s != 1) + pD->stop_decoding(JPGD_DECODE_ERROR); + + if (pD->get_bits_no_markers(1)) + s = p1; + else + s = m1; + } + else + { + if (r != 15) + { + pD->m_eob_run = 1 << r; + + if (r) + pD->m_eob_run += pD->get_bits_no_markers(r); + + break; + } + } + + do + { + jpgd_block_t *this_coef = p + g_ZAG[k & 63]; + + if (*this_coef != 0) + { + if (pD->get_bits_no_markers(1)) + { + if ((*this_coef & p1) == 0) + { + if (*this_coef >= 0) + *this_coef = static_cast<jpgd_block_t>(*this_coef + p1); + else + *this_coef = static_cast<jpgd_block_t>(*this_coef + m1); + } + } + } + else + { + if (--r < 0) + break; + } + + k++; + + } while (k <= pD->m_spectral_end); + + if ((s) && (k < 64)) + { + p[g_ZAG[k]] = static_cast<jpgd_block_t>(s); + } + } + } + + if (pD->m_eob_run > 0) + { + for ( ; k <= pD->m_spectral_end; k++) + { + jpgd_block_t *this_coef = p + g_ZAG[k & 63]; // logical AND to shut up static code analysis + + if (*this_coef != 0) + { + if (pD->get_bits_no_markers(1)) + { + if ((*this_coef & p1) == 0) + { + if (*this_coef >= 0) + *this_coef = static_cast<jpgd_block_t>(*this_coef + p1); + else + *this_coef = static_cast<jpgd_block_t>(*this_coef + m1); + } + } + } + } + + pD->m_eob_run--; + } +} + +// Decode a scan in a progressively encoded image. +void jpeg_decoder::decode_scan(pDecode_block_func decode_block_func) +{ + int mcu_row, mcu_col, mcu_block; + int block_x_mcu[JPGD_MAX_COMPONENTS], m_block_y_mcu[JPGD_MAX_COMPONENTS]; + + memset(m_block_y_mcu, 0, sizeof(m_block_y_mcu)); + + for (mcu_col = 0; mcu_col < m_mcus_per_col; mcu_col++) + { + int component_num, component_id; + + memset(block_x_mcu, 0, sizeof(block_x_mcu)); + + for (mcu_row = 0; mcu_row < m_mcus_per_row; mcu_row++) + { + int block_x_mcu_ofs = 0, block_y_mcu_ofs = 0; + + if ((m_restart_interval) && (m_restarts_left == 0)) + process_restart(); + + for (mcu_block = 0; mcu_block < m_blocks_per_mcu; mcu_block++) + { + component_id = m_mcu_org[mcu_block]; + + decode_block_func(this, component_id, block_x_mcu[component_id] + block_x_mcu_ofs, m_block_y_mcu[component_id] + block_y_mcu_ofs); + + if (m_comps_in_scan == 1) + block_x_mcu[component_id]++; + else + { + if (++block_x_mcu_ofs == m_comp_h_samp[component_id]) + { + block_x_mcu_ofs = 0; + + if (++block_y_mcu_ofs == m_comp_v_samp[component_id]) + { + block_y_mcu_ofs = 0; + block_x_mcu[component_id] += m_comp_h_samp[component_id]; + } + } + } + } + + m_restarts_left--; + } + + if (m_comps_in_scan == 1) + m_block_y_mcu[m_comp_list[0]]++; + else + { + for (component_num = 0; component_num < m_comps_in_scan; component_num++) + { + component_id = m_comp_list[component_num]; + m_block_y_mcu[component_id] += m_comp_v_samp[component_id]; + } + } + } +} + +// Decode a progressively encoded image. +void jpeg_decoder::init_progressive() +{ + int i; + + if (m_comps_in_frame == 4) + stop_decoding(JPGD_UNSUPPORTED_COLORSPACE); + + // Allocate the coefficient buffers. + for (i = 0; i < m_comps_in_frame; i++) + { + m_dc_coeffs[i] = coeff_buf_open(m_max_mcus_per_row * m_comp_h_samp[i], m_max_mcus_per_col * m_comp_v_samp[i], 1, 1); + m_ac_coeffs[i] = coeff_buf_open(m_max_mcus_per_row * m_comp_h_samp[i], m_max_mcus_per_col * m_comp_v_samp[i], 8, 8); + } + + for ( ; ; ) + { + int dc_only_scan, refinement_scan; + pDecode_block_func decode_block_func; + + if (!init_scan()) + break; + + dc_only_scan = (m_spectral_start == 0); + refinement_scan = (m_successive_high != 0); + + if ((m_spectral_start > m_spectral_end) || (m_spectral_end > 63)) + stop_decoding(JPGD_BAD_SOS_SPECTRAL); + + if (dc_only_scan) + { + if (m_spectral_end) + stop_decoding(JPGD_BAD_SOS_SPECTRAL); + } + else if (m_comps_in_scan != 1) /* AC scans can only contain one component */ + stop_decoding(JPGD_BAD_SOS_SPECTRAL); + + if ((refinement_scan) && (m_successive_low != m_successive_high - 1)) + stop_decoding(JPGD_BAD_SOS_SUCCESSIVE); + + if (dc_only_scan) + { + if (refinement_scan) + decode_block_func = decode_block_dc_refine; + else + decode_block_func = decode_block_dc_first; + } + else + { + if (refinement_scan) + decode_block_func = decode_block_ac_refine; + else + decode_block_func = decode_block_ac_first; + } + + decode_scan(decode_block_func); + + m_bits_left = 16; + get_bits(16); + get_bits(16); + } + + m_comps_in_scan = m_comps_in_frame; + + for (i = 0; i < m_comps_in_frame; i++) + m_comp_list[i] = i; + + calc_mcu_block_order(); +} + +void jpeg_decoder::init_sequential() +{ + if (!init_scan()) + stop_decoding(JPGD_UNEXPECTED_MARKER); +} + +void jpeg_decoder::decode_start() +{ + init_frame(); + + if (m_progressive_flag) + init_progressive(); + else + init_sequential(); +} + +void jpeg_decoder::decode_init(jpeg_decoder_stream *pStream) +{ + init(pStream); + locate_sof_marker(); +} + +jpeg_decoder::jpeg_decoder(jpeg_decoder_stream *pStream) +{ + if (setjmp(m_jmp_state)) + return; + decode_init(pStream); +} + +int jpeg_decoder::begin_decoding() +{ + if (m_ready_flag) + return JPGD_SUCCESS; + + if (m_error_code) + return JPGD_FAILED; + + if (setjmp(m_jmp_state)) + return JPGD_FAILED; + + decode_start(); + + m_ready_flag = true; + + return JPGD_SUCCESS; +} + +jpeg_decoder::~jpeg_decoder() +{ + free_all_blocks(); +} + +jpeg_decoder_file_stream::jpeg_decoder_file_stream() +{ + m_pFile = NULL; + m_eof_flag = false; + m_error_flag = false; +} + +void jpeg_decoder_file_stream::close() +{ + if (m_pFile) + { + fclose(m_pFile); + m_pFile = NULL; + } + + m_eof_flag = false; + m_error_flag = false; +} + +jpeg_decoder_file_stream::~jpeg_decoder_file_stream() +{ + close(); +} + +bool jpeg_decoder_file_stream::open(const char *Pfilename) +{ + close(); + + m_eof_flag = false; + m_error_flag = false; + +#if defined(_MSC_VER) + m_pFile = NULL; + fopen_s(&m_pFile, Pfilename, "rb"); +#else + m_pFile = fopen(Pfilename, "rb"); +#endif + return m_pFile != NULL; +} + +int jpeg_decoder_file_stream::read(uint8 *pBuf, int max_bytes_to_read, bool *pEOF_flag) +{ + if (!m_pFile) + return -1; + + if (m_eof_flag) + { + *pEOF_flag = true; + return 0; + } + + if (m_error_flag) + return -1; + + int bytes_read = static_cast<int>(fread(pBuf, 1, max_bytes_to_read, m_pFile)); + if (bytes_read < max_bytes_to_read) + { + if (ferror(m_pFile)) + { + m_error_flag = true; + return -1; + } + + m_eof_flag = true; + *pEOF_flag = true; + } + + return bytes_read; +} + +bool jpeg_decoder_mem_stream::open(const uint8 *pSrc_data, uint size) +{ + close(); + m_pSrc_data = pSrc_data; + m_ofs = 0; + m_size = size; + return true; +} + +int jpeg_decoder_mem_stream::read(uint8 *pBuf, int max_bytes_to_read, bool *pEOF_flag) +{ + *pEOF_flag = false; + + if (!m_pSrc_data) + return -1; + + uint bytes_remaining = m_size - m_ofs; + if ((uint)max_bytes_to_read > bytes_remaining) + { + max_bytes_to_read = bytes_remaining; + *pEOF_flag = true; + } + + memcpy(pBuf, m_pSrc_data + m_ofs, max_bytes_to_read); + m_ofs += max_bytes_to_read; + + return max_bytes_to_read; +} + +unsigned char *decompress_jpeg_image_from_stream(jpeg_decoder_stream *pStream, int *width, int *height, int *actual_comps, int req_comps) +{ + if (!actual_comps) + return NULL; + *actual_comps = 0; + + if ((!pStream) || (!width) || (!height) || (!req_comps)) + return NULL; + + if ((req_comps != 1) && (req_comps != 3) && (req_comps != 4)) + return NULL; + + jpeg_decoder decoder(pStream); + if (decoder.get_error_code() != JPGD_SUCCESS) + return NULL; + + const int image_width = decoder.get_width(), image_height = decoder.get_height(); + *width = image_width; + *height = image_height; + *actual_comps = decoder.get_num_components(); + + if (decoder.begin_decoding() != JPGD_SUCCESS) + return NULL; + + const int dst_bpl = image_width * req_comps; + + uint8 *pImage_data = (uint8*)jpgd_malloc(dst_bpl * image_height); + if (!pImage_data) + return NULL; + + for (int y = 0; y < image_height; y++) + { + const uint8* pScan_line; + uint scan_line_len; + if (decoder.decode((const void**)&pScan_line, &scan_line_len) != JPGD_SUCCESS) + { + jpgd_free(pImage_data); + return NULL; + } + + uint8 *pDst = pImage_data + y * dst_bpl; + + if (((req_comps == 1) && (decoder.get_num_components() == 1)) || ((req_comps == 4) && (decoder.get_num_components() == 3))) + memcpy(pDst, pScan_line, dst_bpl); + else if (decoder.get_num_components() == 1) + { + if (req_comps == 3) + { + for (int x = 0; x < image_width; x++) + { + uint8 luma = pScan_line[x]; + pDst[0] = luma; + pDst[1] = luma; + pDst[2] = luma; + pDst += 3; + } + } + else + { + for (int x = 0; x < image_width; x++) + { + uint8 luma = pScan_line[x]; + pDst[0] = luma; + pDst[1] = luma; + pDst[2] = luma; + pDst[3] = 255; + pDst += 4; + } + } + } + else if (decoder.get_num_components() == 3) + { + if (req_comps == 1) + { + const int YR = 19595, YG = 38470, YB = 7471; + for (int x = 0; x < image_width; x++) + { + int r = pScan_line[x*4+0]; + int g = pScan_line[x*4+1]; + int b = pScan_line[x*4+2]; + *pDst++ = static_cast<uint8>((r * YR + g * YG + b * YB + 32768) >> 16); + } + } + else + { + for (int x = 0; x < image_width; x++) + { + pDst[0] = pScan_line[x*4+0]; + pDst[1] = pScan_line[x*4+1]; + pDst[2] = pScan_line[x*4+2]; + pDst += 3; + } + } + } + } + + return pImage_data; +} + +unsigned char *decompress_jpeg_image_from_memory(const unsigned char *pSrc_data, int src_data_size, int *width, int *height, int *actual_comps, int req_comps) +{ + jpgd::jpeg_decoder_mem_stream mem_stream(pSrc_data, src_data_size); + return decompress_jpeg_image_from_stream(&mem_stream, width, height, actual_comps, req_comps); +} + +unsigned char *decompress_jpeg_image_from_file(const char *pSrc_filename, int *width, int *height, int *actual_comps, int req_comps) +{ + jpgd::jpeg_decoder_file_stream file_stream; + if (!file_stream.open(pSrc_filename)) + return NULL; + return decompress_jpeg_image_from_stream(&file_stream, width, height, actual_comps, req_comps); +} + +} // namespace jpgd
\ No newline at end of file diff --git a/drivers/jpegd/jpgd.h b/drivers/jpegd/jpgd.h new file mode 100644 index 0000000000..150b9a0b26 --- /dev/null +++ b/drivers/jpegd/jpgd.h @@ -0,0 +1,319 @@ +// jpgd.h - C++ class for JPEG decompression. +// Public domain, Rich Geldreich <richgel99@gmail.com> +#ifndef JPEG_DECODER_H +#define JPEG_DECODER_H + +#include <stdlib.h> +#include <stdio.h> +#include <setjmp.h> + +#ifdef _MSC_VER + #define JPGD_NORETURN __declspec(noreturn) +#elif defined(__GNUC__) + #define JPGD_NORETURN __attribute__ ((noreturn)) +#else + #define JPGD_NORETURN +#endif + +namespace jpgd +{ + typedef unsigned char uint8; + typedef signed short int16; + typedef unsigned short uint16; + typedef unsigned int uint; + typedef signed int int32; + + // Loads a JPEG image from a memory buffer or a file. + // req_comps can be 1 (grayscale), 3 (RGB), or 4 (RGBA). + // On return, width/height will be set to the image's dimensions, and actual_comps will be set to the either 1 (grayscale) or 3 (RGB). + // Notes: For more control over where and how the source data is read, see the decompress_jpeg_image_from_stream() function below, or call the jpeg_decoder class directly. + // Requesting a 8 or 32bpp image is currently a little faster than 24bpp because the jpeg_decoder class itself currently always unpacks to either 8 or 32bpp. + unsigned char *decompress_jpeg_image_from_memory(const unsigned char *pSrc_data, int src_data_size, int *width, int *height, int *actual_comps, int req_comps); + unsigned char *decompress_jpeg_image_from_file(const char *pSrc_filename, int *width, int *height, int *actual_comps, int req_comps); + + // Success/failure error codes. + enum jpgd_status + { + JPGD_SUCCESS = 0, JPGD_FAILED = -1, JPGD_DONE = 1, + JPGD_BAD_DHT_COUNTS = -256, JPGD_BAD_DHT_INDEX, JPGD_BAD_DHT_MARKER, JPGD_BAD_DQT_MARKER, JPGD_BAD_DQT_TABLE, + JPGD_BAD_PRECISION, JPGD_BAD_HEIGHT, JPGD_BAD_WIDTH, JPGD_TOO_MANY_COMPONENTS, + JPGD_BAD_SOF_LENGTH, JPGD_BAD_VARIABLE_MARKER, JPGD_BAD_DRI_LENGTH, JPGD_BAD_SOS_LENGTH, + JPGD_BAD_SOS_COMP_ID, JPGD_W_EXTRA_BYTES_BEFORE_MARKER, JPGD_NO_ARITHMITIC_SUPPORT, JPGD_UNEXPECTED_MARKER, + JPGD_NOT_JPEG, JPGD_UNSUPPORTED_MARKER, JPGD_BAD_DQT_LENGTH, JPGD_TOO_MANY_BLOCKS, + JPGD_UNDEFINED_QUANT_TABLE, JPGD_UNDEFINED_HUFF_TABLE, JPGD_NOT_SINGLE_SCAN, JPGD_UNSUPPORTED_COLORSPACE, + JPGD_UNSUPPORTED_SAMP_FACTORS, JPGD_DECODE_ERROR, JPGD_BAD_RESTART_MARKER, JPGD_ASSERTION_ERROR, + JPGD_BAD_SOS_SPECTRAL, JPGD_BAD_SOS_SUCCESSIVE, JPGD_STREAM_READ, JPGD_NOTENOUGHMEM + }; + + // Input stream interface. + // Derive from this class to read input data from sources other than files or memory. Set m_eof_flag to true when no more data is available. + // The decoder is rather greedy: it will keep on calling this method until its internal input buffer is full, or until the EOF flag is set. + // It the input stream contains data after the JPEG stream's EOI (end of image) marker it will probably be pulled into the internal buffer. + // Call the get_total_bytes_read() method to determine the actual size of the JPEG stream after successful decoding. + class jpeg_decoder_stream + { + public: + jpeg_decoder_stream() { } + virtual ~jpeg_decoder_stream() { } + + // The read() method is called when the internal input buffer is empty. + // Parameters: + // pBuf - input buffer + // max_bytes_to_read - maximum bytes that can be written to pBuf + // pEOF_flag - set this to true if at end of stream (no more bytes remaining) + // Returns -1 on error, otherwise return the number of bytes actually written to the buffer (which may be 0). + // Notes: This method will be called in a loop until you set *pEOF_flag to true or the internal buffer is full. + virtual int read(uint8 *pBuf, int max_bytes_to_read, bool *pEOF_flag) = 0; + }; + + // stdio FILE stream class. + class jpeg_decoder_file_stream : public jpeg_decoder_stream + { + jpeg_decoder_file_stream(const jpeg_decoder_file_stream &); + jpeg_decoder_file_stream &operator =(const jpeg_decoder_file_stream &); + + FILE *m_pFile; + bool m_eof_flag, m_error_flag; + + public: + jpeg_decoder_file_stream(); + virtual ~jpeg_decoder_file_stream(); + + bool open(const char *Pfilename); + void close(); + + virtual int read(uint8 *pBuf, int max_bytes_to_read, bool *pEOF_flag); + }; + + // Memory stream class. + class jpeg_decoder_mem_stream : public jpeg_decoder_stream + { + const uint8 *m_pSrc_data; + uint m_ofs, m_size; + + public: + jpeg_decoder_mem_stream() : m_pSrc_data(NULL), m_ofs(0), m_size(0) { } + jpeg_decoder_mem_stream(const uint8 *pSrc_data, uint size) : m_pSrc_data(pSrc_data), m_ofs(0), m_size(size) { } + + virtual ~jpeg_decoder_mem_stream() { } + + bool open(const uint8 *pSrc_data, uint size); + void close() { m_pSrc_data = NULL; m_ofs = 0; m_size = 0; } + + virtual int read(uint8 *pBuf, int max_bytes_to_read, bool *pEOF_flag); + }; + + // Loads JPEG file from a jpeg_decoder_stream. + unsigned char *decompress_jpeg_image_from_stream(jpeg_decoder_stream *pStream, int *width, int *height, int *actual_comps, int req_comps); + + enum + { + JPGD_IN_BUF_SIZE = 8192, JPGD_MAX_BLOCKS_PER_MCU = 10, JPGD_MAX_HUFF_TABLES = 8, JPGD_MAX_QUANT_TABLES = 4, + JPGD_MAX_COMPONENTS = 4, JPGD_MAX_COMPS_IN_SCAN = 4, JPGD_MAX_BLOCKS_PER_ROW = 8192, JPGD_MAX_HEIGHT = 16384, JPGD_MAX_WIDTH = 16384 + }; + + typedef int16 jpgd_quant_t; + typedef int16 jpgd_block_t; + + class jpeg_decoder + { + public: + // Call get_error_code() after constructing to determine if the stream is valid or not. You may call the get_width(), get_height(), etc. + // methods after the constructor is called. You may then either destruct the object, or begin decoding the image by calling begin_decoding(), then decode() on each scanline. + jpeg_decoder(jpeg_decoder_stream *pStream); + + ~jpeg_decoder(); + + // Call this method after constructing the object to begin decompression. + // If JPGD_SUCCESS is returned you may then call decode() on each scanline. + int begin_decoding(); + + // Returns the next scan line. + // For grayscale images, pScan_line will point to a buffer containing 8-bit pixels (get_bytes_per_pixel() will return 1). + // Otherwise, it will always point to a buffer containing 32-bit RGBA pixels (A will always be 255, and get_bytes_per_pixel() will return 4). + // Returns JPGD_SUCCESS if a scan line has been returned. + // Returns JPGD_DONE if all scan lines have been returned. + // Returns JPGD_FAILED if an error occurred. Call get_error_code() for a more info. + int decode(const void** pScan_line, uint* pScan_line_len); + + inline jpgd_status get_error_code() const { return m_error_code; } + + inline int get_width() const { return m_image_x_size; } + inline int get_height() const { return m_image_y_size; } + + inline int get_num_components() const { return m_comps_in_frame; } + + inline int get_bytes_per_pixel() const { return m_dest_bytes_per_pixel; } + inline int get_bytes_per_scan_line() const { return m_image_x_size * get_bytes_per_pixel(); } + + // Returns the total number of bytes actually consumed by the decoder (which should equal the actual size of the JPEG file). + inline int get_total_bytes_read() const { return m_total_bytes_read; } + + private: + jpeg_decoder(const jpeg_decoder &); + jpeg_decoder &operator =(const jpeg_decoder &); + + typedef void (*pDecode_block_func)(jpeg_decoder *, int, int, int); + + struct huff_tables + { + bool ac_table; + uint look_up[256]; + uint look_up2[256]; + uint8 code_size[256]; + uint tree[512]; + }; + + struct coeff_buf + { + uint8 *pData; + int block_num_x, block_num_y; + int block_len_x, block_len_y; + int block_size; + }; + + struct mem_block + { + mem_block *m_pNext; + size_t m_used_count; + size_t m_size; + char m_data[1]; + }; + + jmp_buf m_jmp_state; + mem_block *m_pMem_blocks; + int m_image_x_size; + int m_image_y_size; + jpeg_decoder_stream *m_pStream; + int m_progressive_flag; + uint8 m_huff_ac[JPGD_MAX_HUFF_TABLES]; + uint8* m_huff_num[JPGD_MAX_HUFF_TABLES]; // pointer to number of Huffman codes per bit size + uint8* m_huff_val[JPGD_MAX_HUFF_TABLES]; // pointer to Huffman codes per bit size + jpgd_quant_t* m_quant[JPGD_MAX_QUANT_TABLES]; // pointer to quantization tables + int m_scan_type; // Gray, Yh1v1, Yh1v2, Yh2v1, Yh2v2 (CMYK111, CMYK4114 no longer supported) + int m_comps_in_frame; // # of components in frame + int m_comp_h_samp[JPGD_MAX_COMPONENTS]; // component's horizontal sampling factor + int m_comp_v_samp[JPGD_MAX_COMPONENTS]; // component's vertical sampling factor + int m_comp_quant[JPGD_MAX_COMPONENTS]; // component's quantization table selector + int m_comp_ident[JPGD_MAX_COMPONENTS]; // component's ID + int m_comp_h_blocks[JPGD_MAX_COMPONENTS]; + int m_comp_v_blocks[JPGD_MAX_COMPONENTS]; + int m_comps_in_scan; // # of components in scan + int m_comp_list[JPGD_MAX_COMPS_IN_SCAN]; // components in this scan + int m_comp_dc_tab[JPGD_MAX_COMPONENTS]; // component's DC Huffman coding table selector + int m_comp_ac_tab[JPGD_MAX_COMPONENTS]; // component's AC Huffman coding table selector + int m_spectral_start; // spectral selection start + int m_spectral_end; // spectral selection end + int m_successive_low; // successive approximation low + int m_successive_high; // successive approximation high + int m_max_mcu_x_size; // MCU's max. X size in pixels + int m_max_mcu_y_size; // MCU's max. Y size in pixels + int m_blocks_per_mcu; + int m_max_blocks_per_row; + int m_mcus_per_row, m_mcus_per_col; + int m_mcu_org[JPGD_MAX_BLOCKS_PER_MCU]; + int m_total_lines_left; // total # lines left in image + int m_mcu_lines_left; // total # lines left in this MCU + int m_real_dest_bytes_per_scan_line; + int m_dest_bytes_per_scan_line; // rounded up + int m_dest_bytes_per_pixel; // 4 (RGB) or 1 (Y) + huff_tables* m_pHuff_tabs[JPGD_MAX_HUFF_TABLES]; + coeff_buf* m_dc_coeffs[JPGD_MAX_COMPONENTS]; + coeff_buf* m_ac_coeffs[JPGD_MAX_COMPONENTS]; + int m_eob_run; + int m_block_y_mcu[JPGD_MAX_COMPONENTS]; + uint8* m_pIn_buf_ofs; + int m_in_buf_left; + int m_tem_flag; + bool m_eof_flag; + uint8 m_in_buf_pad_start[128]; + uint8 m_in_buf[JPGD_IN_BUF_SIZE + 128]; + uint8 m_in_buf_pad_end[128]; + int m_bits_left; + uint m_bit_buf; + int m_restart_interval; + int m_restarts_left; + int m_next_restart_num; + int m_max_mcus_per_row; + int m_max_blocks_per_mcu; + int m_expanded_blocks_per_mcu; + int m_expanded_blocks_per_row; + int m_expanded_blocks_per_component; + bool m_freq_domain_chroma_upsample; + int m_max_mcus_per_col; + uint m_last_dc_val[JPGD_MAX_COMPONENTS]; + jpgd_block_t* m_pMCU_coefficients; + int m_mcu_block_max_zag[JPGD_MAX_BLOCKS_PER_MCU]; + uint8* m_pSample_buf; + int m_crr[256]; + int m_cbb[256]; + int m_crg[256]; + int m_cbg[256]; + uint8* m_pScan_line_0; + uint8* m_pScan_line_1; + jpgd_status m_error_code; + bool m_ready_flag; + int m_total_bytes_read; + + void free_all_blocks(); + JPGD_NORETURN void stop_decoding(jpgd_status status); + void *alloc(size_t n, bool zero = false); + void word_clear(void *p, uint16 c, uint n); + void prep_in_buffer(); + void read_dht_marker(); + void read_dqt_marker(); + void read_sof_marker(); + void skip_variable_marker(); + void read_dri_marker(); + void read_sos_marker(); + int next_marker(); + int process_markers(); + void locate_soi_marker(); + void locate_sof_marker(); + int locate_sos_marker(); + void init(jpeg_decoder_stream * pStream); + void create_look_ups(); + void fix_in_buffer(); + void transform_mcu(int mcu_row); + void transform_mcu_expand(int mcu_row); + coeff_buf* coeff_buf_open(int block_num_x, int block_num_y, int block_len_x, int block_len_y); + inline jpgd_block_t *coeff_buf_getp(coeff_buf *cb, int block_x, int block_y); + void load_next_row(); + void decode_next_row(); + void make_huff_table(int index, huff_tables *pH); + void check_quant_tables(); + void check_huff_tables(); + void calc_mcu_block_order(); + int init_scan(); + void init_frame(); + void process_restart(); + void decode_scan(pDecode_block_func decode_block_func); + void init_progressive(); + void init_sequential(); + void decode_start(); + void decode_init(jpeg_decoder_stream * pStream); + void H2V2Convert(); + void H2V1Convert(); + void H1V2Convert(); + void H1V1Convert(); + void gray_convert(); + void expanded_convert(); + void find_eoi(); + inline uint get_char(); + inline uint get_char(bool *pPadding_flag); + inline void stuff_char(uint8 q); + inline uint8 get_octet(); + inline uint get_bits(int num_bits); + inline uint get_bits_no_markers(int numbits); + inline int huff_decode(huff_tables *pH); + inline int huff_decode(huff_tables *pH, int& extrabits); + static inline uint8 clamp(int i); + static void decode_block_dc_first(jpeg_decoder *pD, int component_id, int block_x, int block_y); + static void decode_block_dc_refine(jpeg_decoder *pD, int component_id, int block_x, int block_y); + static void decode_block_ac_first(jpeg_decoder *pD, int component_id, int block_x, int block_y); + static void decode_block_ac_refine(jpeg_decoder *pD, int component_id, int block_x, int block_y); + }; + +} // namespace jpgd + +#endif // JPEG_DECODER_H diff --git a/drivers/jpg/image_loader_jpg.cpp b/drivers/jpg/image_loader_jpg.cpp deleted file mode 100644 index 76a8b25f62..0000000000 --- a/drivers/jpg/image_loader_jpg.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/*************************************************/ -/* image_loader_jpg.cpp */ -/*************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/*************************************************/ -/* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ -/* All Rights Reserved. */ -/*************************************************/ - -#include "image_loader_jpg.h" - -#include "print_string.h" -#include "os/os.h" -#include "drivers/jpg/tinyjpeg.h" - - -static void* _tinyjpg_alloc(unsigned int amount) { - - return memalloc(amount); -} - -static void _tinyjpg_free(void *ptr) { - - memfree(ptr); -} - -Error ImageLoaderJPG::load_image(Image *p_image,FileAccess *f) { - - - DVector<uint8_t> src_image; - int src_image_len = f->get_len(); - ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT); - src_image.resize(src_image_len); - - DVector<uint8_t>::Write w = src_image.write(); - - f->get_buffer(&w[0],src_image_len); - - f->close(); - - jdec_private* jdec=tinyjpeg_init(_tinyjpg_alloc,_tinyjpg_free); - ERR_FAIL_COND_V(!jdec,ERR_UNAVAILABLE); - - int ret = tinyjpeg_parse_header(jdec,&w[0],src_image_len); - - if (ret!=0) { - tinyjpeg_free(jdec); - } - - ERR_FAIL_COND_V(ret!=0,ERR_FILE_CORRUPT); - - unsigned int width,height; - - - tinyjpeg_get_size(jdec,&width,&height); - - - - DVector<uint8_t> imgdata; - imgdata.resize(width*height*3); - DVector<uint8_t>::Write imgdataw = imgdata.write(); - - - unsigned char *components[1]={&imgdataw[0]}; - tinyjpeg_set_components(jdec,components,1); - tinyjpeg_decode(jdec,TINYJPEG_FMT_RGB24); - imgdataw = DVector<uint8_t>::Write(); - - Image dst_image(width,height,0,Image::FORMAT_RGB,imgdata); - - tinyjpeg_free(jdec); - - *p_image=dst_image; - - return OK; - -} - -void ImageLoaderJPG::get_recognized_extensions(List<String> *p_extensions) const { - - p_extensions->push_back("jpg"); - p_extensions->push_back("jpeg"); -} - - -ImageLoaderJPG::ImageLoaderJPG() { - - -} - - diff --git a/drivers/jpg/jidctflt.c b/drivers/jpg/jidctflt.c deleted file mode 100644 index 40a9eab83e..0000000000 --- a/drivers/jpg/jidctflt.c +++ /dev/null @@ -1,286 +0,0 @@ -/* - * jidctflt.c - * - * Copyright (C) 1994-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * - * The authors make NO WARRANTY or representation, either express or implied, - * with respect to this software, its quality, accuracy, merchantability, or - * fitness for a particular purpose. This software is provided "AS IS", and you, - * its user, assume the entire risk as to its quality and accuracy. - * - * This software is copyright (C) 1991-1998, Thomas G. Lane. - * All Rights Reserved except as specified below. - * - * Permission is hereby granted to use, copy, modify, and distribute this - * software (or portions thereof) for any purpose, without fee, subject to these - * conditions: - * (1) If any part of the source code for this software is distributed, then this - * README file must be included, with this copyright and no-warranty notice - * unaltered; and any additions, deletions, or changes to the original files - * must be clearly indicated in accompanying documentation. - * (2) If only executable code is distributed, then the accompanying - * documentation must state that "this software is based in part on the work of - * the Independent JPEG Group". - * (3) Permission for use of this software is granted only if the user accepts - * full responsibility for any undesirable consequences; the authors accept - * NO LIABILITY for damages of any kind. - * - * These conditions apply to any software derived from or based on the IJG code, - * not just to the unmodified library. If you use our work, you ought to - * acknowledge us. - * - * Permission is NOT granted for the use of any IJG author's name or company name - * in advertising or publicity relating to this software or products derived from - * it. This software may be referred to only as "the Independent JPEG Group's - * software". - * - * We specifically permit and encourage the use of this software as the basis of - * commercial products, provided that all warranty or liability claims are - * assumed by the product vendor. - * - * - * This file contains a floating-point implementation of the - * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine - * must also perform dequantization of the input coefficients. - * - * This implementation should be more accurate than either of the integer - * IDCT implementations. However, it may not give the same results on all - * machines because of differences in roundoff behavior. Speed will depend - * on the hardware's floating point capacity. - * - * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT - * on each row (or vice versa, but it's more convenient to emit a row at - * a time). Direct algorithms are also available, but they are much more - * complex and seem not to be any faster when reduced to code. - * - * This implementation is based on Arai, Agui, and Nakajima's algorithm for - * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in - * Japanese, but the algorithm is described in the Pennebaker & Mitchell - * JPEG textbook (see REFERENCES section in file README). The following code - * is based directly on figure 4-8 in P&M. - * While an 8-point DCT cannot be done in less than 11 multiplies, it is - * possible to arrange the computation so that many of the multiplies are - * simple scalings of the final outputs. These multiplies can then be - * folded into the multiplications or divisions by the JPEG quantization - * table entries. The AA&N method leaves only 5 multiplies and 29 adds - * to be done in the DCT itself. - * The primary disadvantage of this method is that with a fixed-point - * implementation, accuracy is lost due to imprecise representation of the - * scaled quantization values. However, that problem does not arise if - * we use floating point arithmetic. - */ - -#include "tinyjpeg-internal.h" - -#define FAST_FLOAT float -#define DCTSIZE 8 -#define DCTSIZE2 (DCTSIZE*DCTSIZE) - -#define DEQUANTIZE(coef,quantval) (((FAST_FLOAT) (coef)) * (quantval)) - -#if 0 && defined(__GNUC__) && (defined(__i686__)) -// || defined(__x86_64__)) - -static inline unsigned char descale_and_clamp(int x, int shift) -{ - __asm__ ( - "add %3,%1\n" - "\tsar %2,%1\n" - "\tsub $-128,%1\n" - "\tcmovl %5,%1\n" /* Use the sub to compare to 0 */ - "\tcmpl %4,%1\n" - "\tcmovg %4,%1\n" - : "=r"(x) - : "0"(x), "Ir"(shift), "ir"(1UL<<(shift-1)), "r" (0xff), "r" (0) - ); - return x; -} - -#else -static __inline unsigned char descale_and_clamp(int x, int shift) -{ - x += (1UL<<(shift-1)); - if (x<0) - x = (x >> shift) | ((~(0UL)) << (32-(shift))); - else - x >>= shift; - x += 128; - if (x>255) - return 255; - else if (x<0) - return 0; - else - return x; -} -#endif - -/* - * Perform dequantization and inverse DCT on one block of coefficients. - */ - -void -tinyjpeg_idct_float (struct component *compptr, uint8_t *output_buf, int stride) -{ - FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - FAST_FLOAT tmp10, tmp11, tmp12, tmp13; - FAST_FLOAT z5, z10, z11, z12, z13; - int16_t *inptr; - FAST_FLOAT *quantptr; - FAST_FLOAT *wsptr; - uint8_t *outptr; - int ctr; - FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */ - - /* Pass 1: process columns from input, store into work array. */ - - inptr = compptr->DCT; - quantptr = compptr->Q_table; - wsptr = workspace; - for (ctr = DCTSIZE; ctr > 0; ctr--) { - /* Due to quantization, we will usually find that many of the input - * coefficients are zero, especially the AC terms. We can exploit this - * by short-circuiting the IDCT calculation for any column in which all - * the AC terms are zero. In that case each output is equal to the - * DC coefficient (with scale factor as needed). - * With typical images and quantization tables, half or more of the - * column DCT calculations can be simplified this way. - */ - - if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && - inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && - inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && - inptr[DCTSIZE*7] == 0) { - /* AC terms all zero */ - FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); - - wsptr[DCTSIZE*0] = dcval; - wsptr[DCTSIZE*1] = dcval; - wsptr[DCTSIZE*2] = dcval; - wsptr[DCTSIZE*3] = dcval; - wsptr[DCTSIZE*4] = dcval; - wsptr[DCTSIZE*5] = dcval; - wsptr[DCTSIZE*6] = dcval; - wsptr[DCTSIZE*7] = dcval; - - inptr++; /* advance pointers to next column */ - quantptr++; - wsptr++; - continue; - } - - /* Even part */ - - tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); - tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); - tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); - tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); - - tmp10 = tmp0 + tmp2; /* phase 3 */ - tmp11 = tmp0 - tmp2; - - tmp13 = tmp1 + tmp3; /* phases 5-3 */ - tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */ - - tmp0 = tmp10 + tmp13; /* phase 2 */ - tmp3 = tmp10 - tmp13; - tmp1 = tmp11 + tmp12; - tmp2 = tmp11 - tmp12; - - /* Odd part */ - - tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); - tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); - tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); - tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); - - z13 = tmp6 + tmp5; /* phase 6 */ - z10 = tmp6 - tmp5; - z11 = tmp4 + tmp7; - z12 = tmp4 - tmp7; - - tmp7 = z11 + z13; /* phase 5 */ - tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */ - - z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ - tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */ - tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */ - - tmp6 = tmp12 - tmp7; /* phase 2 */ - tmp5 = tmp11 - tmp6; - tmp4 = tmp10 + tmp5; - - wsptr[DCTSIZE*0] = tmp0 + tmp7; - wsptr[DCTSIZE*7] = tmp0 - tmp7; - wsptr[DCTSIZE*1] = tmp1 + tmp6; - wsptr[DCTSIZE*6] = tmp1 - tmp6; - wsptr[DCTSIZE*2] = tmp2 + tmp5; - wsptr[DCTSIZE*5] = tmp2 - tmp5; - wsptr[DCTSIZE*4] = tmp3 + tmp4; - wsptr[DCTSIZE*3] = tmp3 - tmp4; - - inptr++; /* advance pointers to next column */ - quantptr++; - wsptr++; - } - - /* Pass 2: process rows from work array, store into output array. */ - /* Note that we must descale the results by a factor of 8 == 2**3. */ - - wsptr = workspace; - outptr = output_buf; - for (ctr = 0; ctr < DCTSIZE; ctr++) { - /* Rows of zeroes can be exploited in the same way as we did with columns. - * However, the column calculation has created many nonzero AC terms, so - * the simplification applies less often (typically 5% to 10% of the time). - * And testing floats for zero is relatively expensive, so we don't bother. - */ - - /* Even part */ - - tmp10 = wsptr[0] + wsptr[4]; - tmp11 = wsptr[0] - wsptr[4]; - - tmp13 = wsptr[2] + wsptr[6]; - tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13; - - tmp0 = tmp10 + tmp13; - tmp3 = tmp10 - tmp13; - tmp1 = tmp11 + tmp12; - tmp2 = tmp11 - tmp12; - - /* Odd part */ - - z13 = wsptr[5] + wsptr[3]; - z10 = wsptr[5] - wsptr[3]; - z11 = wsptr[1] + wsptr[7]; - z12 = wsptr[1] - wsptr[7]; - - tmp7 = z11 + z13; - tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); - - z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ - tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */ - tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */ - - tmp6 = tmp12 - tmp7; - tmp5 = tmp11 - tmp6; - tmp4 = tmp10 + tmp5; - - /* Final output stage: scale down by a factor of 8 and range-limit */ - - outptr[0] = descale_and_clamp((int)(tmp0 + tmp7), 3); - outptr[7] = descale_and_clamp((int)(tmp0 - tmp7), 3); - outptr[1] = descale_and_clamp((int)(tmp1 + tmp6), 3); - outptr[6] = descale_and_clamp((int)(tmp1 - tmp6), 3); - outptr[2] = descale_and_clamp((int)(tmp2 + tmp5), 3); - outptr[5] = descale_and_clamp((int)(tmp2 - tmp5), 3); - outptr[4] = descale_and_clamp((int)(tmp3 + tmp4), 3); - outptr[3] = descale_and_clamp((int)(tmp3 - tmp4), 3); - - - wsptr += DCTSIZE; /* advance pointer to next row */ - outptr += stride; - } -} - diff --git a/drivers/jpg/loadjpeg.c b/drivers/jpg/loadjpeg.c deleted file mode 100644 index 82072d4272..0000000000 --- a/drivers/jpg/loadjpeg.c +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Small jpeg decoder library - testing application - * - * Copyright (c) 2006, Luc Saillard <luc@saillard.org> - * All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * - Neither the name of the author nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "tinyjpeg.h" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> - -#define snprintf(buf, size, fmt, ...) sprintf(buf, fmt, __VA_ARGS__) - -static void exitmessage(const char *message) __attribute__((noreturn)); -static void exitmessage(const char *message) -{ - printf("%s\n", message); - exit(0); -} - -static int filesize(FILE *fp) -{ - long pos; - fseek(fp, 0, SEEK_END); - pos = ftell(fp); - fseek(fp, 0, SEEK_SET); - return pos; -} - -/** - * Save a buffer in 24bits Targa format - * (BGR byte order) - */ -static void write_tga(const char *filename, int output_format, int width, int height, unsigned char **components) -{ - unsigned char targaheader[18]; - FILE *F; - char temp[1024]; - unsigned int bufferlen = width * height * 3; - unsigned char *rgb_data = components[0]; - - sprintf(temp, sizeof(temp), filename); - - memset(targaheader,0,sizeof(targaheader)); - - targaheader[12] = (unsigned char) (width & 0xFF); - targaheader[13] = (unsigned char) (width >> 8); - targaheader[14] = (unsigned char) (height & 0xFF); - targaheader[15] = (unsigned char) (height >> 8); - targaheader[17] = 0x20; /* Top-down, non-interlaced */ - targaheader[2] = 2; /* image type = uncompressed RGB */ - targaheader[16] = 24; - - if (output_format == TINYJPEG_FMT_RGB24) - { - unsigned char *data = rgb_data + bufferlen - 3; - do - { - unsigned char c = data[0]; - data[0] = data[2]; - data[2] = c; - data-=3; - } - while (data > rgb_data); - } - - F = fopen(temp, "wb"); - fwrite(targaheader, sizeof(targaheader), 1, F); - fwrite(rgb_data, 1, bufferlen, F); - fclose(F); -} - -/** - * Save a buffer in three files (.Y, .U, .V) useable by yuvsplittoppm - */ -static void write_yuv(const char *filename, int width, int height, unsigned char **components) -{ - FILE *F; - char temp[1024]; - - snprintf(temp, 1024, "%s.Y", filename); - F = fopen(temp, "wb"); - fwrite(components[0], width, height, F); - fclose(F); - snprintf(temp, 1024, "%s.U", filename); - F = fopen(temp, "wb"); - fwrite(components[1], width*height/4, 1, F); - fclose(F); - snprintf(temp, 1024, "%s.V", filename); - F = fopen(temp, "wb"); - fwrite(components[2], width*height/4, 1, F); - fclose(F); -} - -/** - * Save a buffer in grey image (pgm format) - */ -static void write_pgm(const char *filename, int width, int height, unsigned char **components) -{ - FILE *F; - char temp[1024]; - - snprintf(temp, 1024, "%s", filename); - F = fopen(temp, "wb"); - fprintf(F, "P5\n%d %d\n255\n", width, height); - fwrite(components[0], width, height, F); - fclose(F); -} - -/** - * Load one jpeg image, and try to decompress 1000 times, and save the result. - * This is mainly used for benchmarking the decoder, or to test if between each - * called of the library the DCT is corrected reset (a bug was found). - */ -int load_multiple_times(const char *filename, const char *outfilename, int output_format) -{ - FILE *fp; - int count, length_of_file; - unsigned int width, height; - unsigned char *buf; - struct jdec_private *jdec; - unsigned char *components[4]; - - jdec = tinyjpeg_init(); - count = 0; - - /* Load the Jpeg into memory */ - fp = fopen(filename, "rb"); - if (fp == NULL) - exitmessage("Cannot open filename\n"); - length_of_file = filesize(fp); - buf = (unsigned char *)malloc(length_of_file + 4); - fread(buf, length_of_file, 1, fp); - fclose(fp); - - while (count<1000) - { - if (tinyjpeg_parse_header(jdec, buf, length_of_file)<0) - exitmessage(tinyjpeg_get_errorstring(jdec)); - - tinyjpeg_decode(jdec, output_format); - - count++; - } - - /* - * Get address for each plane (not only max 3 planes is supported), and - * depending of the output mode, only some components will be filled - * RGB: 1 plane, YUV420P: 3 planes, GREY: 1 plane - */ - tinyjpeg_get_components(jdec, components); - tinyjpeg_get_size(jdec, &width, &height); - - /* Save it */ - switch (output_format) - { - case TINYJPEG_FMT_RGB24: - case TINYJPEG_FMT_BGR24: - write_tga(outfilename, output_format, width, height, components); - break; - case TINYJPEG_FMT_YUV420P: - write_yuv(outfilename, width, height, components); - break; - case TINYJPEG_FMT_GREY: - write_pgm(outfilename, width, height, components); - break; - } - - free(buf); - tinyjpeg_free(jdec); - return 0; -} - -/** - * Load one jpeg image, and decompress it, and save the result. - */ -int convert_one_image(const char *infilename, const char *outfilename, int output_format) -{ - FILE *fp; - unsigned int length_of_file; - unsigned int width, height; - unsigned char *buf; - struct jdec_private *jdec; - unsigned char *components[3]; - - /* Load the Jpeg into memory */ - fp = fopen(infilename, "rb"); - if (fp == NULL) - exitmessage("Cannot open filename\n"); - length_of_file = filesize(fp); - buf = (unsigned char *)malloc(length_of_file + 4); - if (buf == NULL) - exitmessage("Not enough memory for loading file\n"); - fread(buf, length_of_file, 1, fp); - fclose(fp); - - /* Decompress it */ - jdec = tinyjpeg_init(); - if (jdec == NULL) - exitmessage("Not enough memory to alloc the structure need for decompressing\n"); - - if (tinyjpeg_parse_header(jdec, buf, length_of_file)<0) - exitmessage(tinyjpeg_get_errorstring(jdec)); - - /* Get the size of the image */ - tinyjpeg_get_size(jdec, &width, &height); - - printf("Decoding JPEG image...\n"); - if (tinyjpeg_decode(jdec, output_format) < 0) - exitmessage(tinyjpeg_get_errorstring(jdec)); - - /* - * Get address for each plane (not only max 3 planes is supported), and - * depending of the output mode, only some components will be filled - * RGB: 1 plane, YUV420P: 3 planes, GREY: 1 plane - */ - tinyjpeg_get_components(jdec, components); - - /* Save it */ - switch (output_format) - { - case TINYJPEG_FMT_RGB24: - case TINYJPEG_FMT_BGR24: - write_tga(outfilename, output_format, width, height, components); - break; - case TINYJPEG_FMT_YUV420P: - write_yuv(outfilename, width, height, components); - break; - case TINYJPEG_FMT_GREY: - write_pgm(outfilename, width, height, components); - break; - } - - /* Only called this if the buffers were allocated by tinyjpeg_decode() */ - tinyjpeg_free(jdec); - /* else called just free(jdec); */ - - free(buf); - return 0; -} - -static void usage(void) -{ - fprintf(stderr, "Usage: loadjpeg [options] <input_filename.jpeg> <format> <output_filename>\n"); - fprintf(stderr, "options:\n"); - fprintf(stderr, " --benchmark - Convert 1000 times the same image\n"); - fprintf(stderr, "format:\n"); - fprintf(stderr, " yuv420p - output 3 files .Y,.U,.V\n"); - fprintf(stderr, " rgb24 - output a .tga image\n"); - fprintf(stderr, " bgr24 - output a .tga image\n"); - fprintf(stderr, " gray - output a .pgm image\n"); - exit(1); -} - -/** - * main - * - */ -int main(int argc, char *argv[]) -{ - int output_format = TINYJPEG_FMT_YUV420P; - char *output_filename, *input_filename; - clock_t start_time, finish_time; - unsigned int duration; - int current_argument; - int benchmark_mode = 0; - - if (argc < 3) - usage(); - - current_argument = 1; - while (1) - { - if (strcmp(argv[current_argument], "--benchmark")==0) - benchmark_mode = 1; - else - break; - current_argument++; - } - - if (argc < current_argument+2) - usage(); - - input_filename = argv[current_argument]; - if (strcmp(argv[current_argument+1],"yuv420p")==0) - output_format = TINYJPEG_FMT_YUV420P; - else if (strcmp(argv[current_argument+1],"rgb24")==0) - output_format = TINYJPEG_FMT_RGB24; - else if (strcmp(argv[current_argument+1],"bgr24")==0) - output_format = TINYJPEG_FMT_BGR24; - else if (strcmp(argv[current_argument+1],"grey")==0) - output_format = TINYJPEG_FMT_GREY; - else - exitmessage("Bad format: need to be one of yuv420p, rgb24, bgr24, grey\n"); - output_filename = argv[current_argument+2]; - - start_time = clock(); - - if (benchmark_mode) - load_multiple_times(input_filename, output_filename, output_format); - else - convert_one_image(input_filename, output_filename, output_format); - - finish_time = clock(); - duration = finish_time - start_time; - printf("Decoding finished in %u ticks\n", duration); - - return 0; -} - - - - diff --git a/drivers/jpg/tinyjpeg-internal.h b/drivers/jpg/tinyjpeg-internal.h deleted file mode 100644 index b2d5fe42aa..0000000000 --- a/drivers/jpg/tinyjpeg-internal.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Small jpeg decoder library (Internal header) - * - * Copyright (c) 2006, Luc Saillard <luc@saillard.org> - * All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * - Neither the name of the author nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - */ - - -#ifndef __TINYJPEG_INTERNAL_H_ -#define __TINYJPEG_INTERNAL_H_ - -#ifdef _MSC_VER - -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; - -#else - -#ifdef NO_STDINT_H -typedef unsigned char uint8_t; -typedef signed char int8_t; -typedef unsigned short uint16_t; -typedef signed short int16_t; -typedef unsigned int uint32_t; -typedef signed int int32_t; -typedef long long int64_t; -typedef unsigned long long int64_t; -#else -#include <stdint.h> -#endif -#endif - - -#include <setjmp.h> - -#define SANITY_CHECK 1 - -struct jdec_private; - -#define HUFFMAN_BITS_SIZE 256 -#define HUFFMAN_HASH_NBITS 9 -#define HUFFMAN_HASH_SIZE (1UL<<HUFFMAN_HASH_NBITS) -#define HUFFMAN_HASH_MASK (HUFFMAN_HASH_SIZE-1) - -#define HUFFMAN_TABLES 4 -#define COMPONENTS 3 -#define JPEG_MAX_WIDTH 4096 -#define JPEG_MAX_HEIGHT 4096 - -struct huffman_table -{ - /* Fast look up table, using HUFFMAN_HASH_NBITS bits we can have directly the symbol, - * if the symbol is <0, then we need to look into the tree table */ - short int lookup[HUFFMAN_HASH_SIZE]; - /* code size: give the number of bits of a symbol is encoded */ - unsigned char code_size[HUFFMAN_HASH_SIZE]; - /* some place to store value that is not encoded in the lookup table - * FIXME: Calculate if 256 value is enough to store all values - */ - uint16_t slowtable[16-HUFFMAN_HASH_NBITS][256]; -}; - -struct component -{ - unsigned int Hfactor; - unsigned int Vfactor; - float *Q_table; /* Pointer to the quantisation table to use */ - struct huffman_table *AC_table; - struct huffman_table *DC_table; - short int previous_DC; /* Previous DC coefficient */ - short int DCT[64]; /* DCT coef */ -#if SANITY_CHECK - unsigned int cid; -#endif -}; - - -typedef void (*decode_MCU_fct) (struct jdec_private *priv); -typedef void (*convert_colorspace_fct) (struct jdec_private *priv); - -struct jdec_private -{ - void *(*allocate_mem)(unsigned int amount); - void (*free_mem)(void *mem); - - /* Public variables */ - uint8_t *components[COMPONENTS]; - unsigned int width, height; /* Size of the image */ - unsigned int flags; - - /* Private variables */ - const unsigned char *stream_begin, *stream_end; - unsigned int stream_length; - - const unsigned char *stream; /* Pointer to the current stream */ - unsigned int reservoir, nbits_in_reservoir; - - struct component component_infos[COMPONENTS]; - float Q_tables[COMPONENTS][64]; /* quantization tables */ - struct huffman_table HTDC[HUFFMAN_TABLES]; /* DC huffman tables */ - struct huffman_table HTAC[HUFFMAN_TABLES]; /* AC huffman tables */ - int default_huffman_table_initialized; - int restart_interval; - int restarts_to_go; /* MCUs left in this restart interval */ - int last_rst_marker_seen; /* Rst marker is incremented each time */ - - /* Temp space used after the IDCT to store each components */ - uint8_t Y[64*4], Cr[64], Cb[64]; - - jmp_buf jump_state; - /* Internal Pointer use for colorspace conversion, do not modify it !!! */ - uint8_t *plane[COMPONENTS]; - - uint8_t decomp_block[16][16*3]; - -}; - -#if defined(__GNUC__) && (__GNUC__ > 3) && defined(__OPTIMIZE__) -#define __likely(x) __builtin_expect(!!(x), 1) -#define __unlikely(x) __builtin_expect(!!(x), 0) -#else -#define __likely(x) (x) -#define __unlikely(x) (x) -#endif - -#define IDCT tinyjpeg_idct_float -void tinyjpeg_idct_float (struct component *compptr, uint8_t *output_buf, int stride); - -#endif - diff --git a/drivers/jpg/tinyjpeg.c b/drivers/jpg/tinyjpeg.c deleted file mode 100644 index 8e3c934ce0..0000000000 --- a/drivers/jpg/tinyjpeg.c +++ /dev/null @@ -1,2202 +0,0 @@ -/* - * Small jpeg decoder library - * - * Copyright (c) 2006, Luc Saillard <luc@saillard.org> - * All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * - Neither the name of the author nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <errno.h> - -#include "tinyjpeg.h" -#include "tinyjpeg-internal.h" - -enum std_markers { - DQT = 0xDB, /* Define Quantization Table */ - SOF = 0xC0, /* Start of Frame (size information) */ - DHT = 0xC4, /* Huffman Table */ - SOI = 0xD8, /* Start of Image */ - SOS = 0xDA, /* Start of Scan */ - RST = 0xD0, /* Reset Marker d0 -> .. */ - RST7 = 0xD7, /* Reset Marker .. -> d7 */ - EOI = 0xD9, /* End of Image */ - DRI = 0xDD, /* Define Restart Interval */ - APP0 = 0xE0, -}; - -#define cY 0 -#define cCb 1 -#define cCr 2 - -#define BLACK_Y 0 -#define BLACK_U 127 -#define BLACK_V 127 - -#if DEBUG -#define trace(fmt, args...) do { \ - fprintf(stderr, fmt, ## args); \ - fflush(stderr); \ -} while(0) -#else -#define trace(fmt, ...) do { } while (0) -#endif - -#define error(fmt, ...) do { \ - sprintf(error_string, fmt, ## __VA_ARGS__); \ - return -1; \ -} while(0) - - -#if 0 -static char *print_bits(unsigned int value, char *bitstr) -{ - int i, j; - i=31; - while (i>0) - { - if (value & (1UL<<i)) - break; - i--; - } - j=0; - while (i>=0) - { - bitstr[j++] = (value & (1UL<<i))?'1':'0'; - i--; - } - bitstr[j] = 0; - return bitstr; -} - -static void print_next_16bytes(int offset, const unsigned char *stream) -{ - trace("%4.4x: %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", - offset, - stream[0], stream[1], stream[2], stream[3], - stream[4], stream[5], stream[6], stream[7], - stream[8], stream[9], stream[10], stream[11], - stream[12], stream[13], stream[14], stream[15]); -} - -#endif - -/* Global variable to return the last error found while deconding */ -static char error_string[256]; - -static const unsigned char zigzag[64] = -{ - 0, 1, 5, 6, 14, 15, 27, 28, - 2, 4, 7, 13, 16, 26, 29, 42, - 3, 8, 12, 17, 25, 30, 41, 43, - 9, 11, 18, 24, 31, 40, 44, 53, - 10, 19, 23, 32, 39, 45, 52, 54, - 20, 22, 33, 38, 46, 51, 55, 60, - 21, 34, 37, 47, 50, 56, 59, 61, - 35, 36, 48, 49, 57, 58, 62, 63 -}; - -/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */ -/* IMPORTANT: these are only valid for 8-bit data precision! */ -static const unsigned char bits_dc_luminance[17] = -{ - 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 -}; -static const unsigned char val_dc_luminance[] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 -}; - -static const unsigned char bits_dc_chrominance[17] = -{ - 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 -}; -static const unsigned char val_dc_chrominance[] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 -}; - -static const unsigned char bits_ac_luminance[17] = -{ - 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d -}; -static const unsigned char val_ac_luminance[] = -{ - 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, - 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, - 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, - 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, - 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, - 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, - 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, - 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, - 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, - 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, - 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, - 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, - 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, - 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, - 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, - 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, - 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, - 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, - 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, - 0xf9, 0xfa -}; - -static const unsigned char bits_ac_chrominance[17] = -{ - 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 -}; - -static const unsigned char val_ac_chrominance[] = -{ - 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, - 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, - 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, - 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, - 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, - 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, - 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, - 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, - 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, - 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, - 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, - 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, - 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, - 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, - 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, - 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, - 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, - 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, - 0xf9, 0xfa -}; - - -/* - * 4 functions to manage the stream - * - * fill_nbits: put at least nbits in the reservoir of bits. - * But convert any 0xff,0x00 into 0xff - * get_nbits: read nbits from the stream, and put it in result, - * bits is removed from the stream and the reservoir is filled - * automaticaly. The result is signed according to the number of - * bits. - * look_nbits: read nbits from the stream without marking as read. - * skip_nbits: read nbits from the stream but do not return the result. - * - * stream: current pointer in the jpeg data (read bytes per bytes) - * nbits_in_reservoir: number of bits filled into the reservoir - * reservoir: register that contains bits information. Only nbits_in_reservoir - * is valid. - * nbits_in_reservoir - * <-- 17 bits --> - * Ex: 0000 0000 1010 0000 1111 0000 <== reservoir - * ^ - * bit 1 - * To get two bits from this example - * result = (reservoir >> 15) & 3 - * - */ -#define fill_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted) do { \ - while (nbits_in_reservoir<nbits_wanted) \ - { \ - unsigned char c; \ - if (stream >= priv->stream_end) \ - longjmp(priv->jump_state, -EIO); \ - c = *stream++; \ - reservoir <<= 8; \ - if (c == 0xff && *stream == 0x00) \ - stream++; \ - reservoir |= c; \ - nbits_in_reservoir+=8; \ - } \ -} while(0); - -/* Signed version !!!! */ -#define get_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted,result) do { \ - fill_nbits(reservoir,nbits_in_reservoir,stream,(nbits_wanted)); \ - result = ((reservoir)>>(nbits_in_reservoir-(nbits_wanted))); \ - nbits_in_reservoir -= (nbits_wanted); \ - reservoir &= ((1U<<nbits_in_reservoir)-1); \ - if ((unsigned int)result < (1UL<<((nbits_wanted)-1))) \ - result += (0xFFFFFFFFUL<<(nbits_wanted))+1; \ -} while(0); - -#define look_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted,result) do { \ - fill_nbits(reservoir,nbits_in_reservoir,stream,(nbits_wanted)); \ - result = ((reservoir)>>(nbits_in_reservoir-(nbits_wanted))); \ -} while(0); - -/* To speed up the decoding, we assume that the reservoir have enough bit - * slow version: - * #define skip_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted) do { \ - * fill_nbits(reservoir,nbits_in_reservoir,stream,(nbits_wanted)); \ - * nbits_in_reservoir -= (nbits_wanted); \ - * reservoir &= ((1U<<nbits_in_reservoir)-1); \ - * } while(0); - */ -#define skip_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted) do { \ - nbits_in_reservoir -= (nbits_wanted); \ - reservoir &= ((1U<<nbits_in_reservoir)-1); \ -} while(0); - - -#define be16_to_cpu(x) (((x)[0]<<8)|(x)[1]) - -static void resync(struct jdec_private *priv); - -/** - * Get the next (valid) huffman code in the stream. - * - * To speedup the procedure, we look HUFFMAN_HASH_NBITS bits and the code is - * lower than HUFFMAN_HASH_NBITS we have automaticaly the length of the code - * and the value by using two lookup table. - * Else if the value is not found, just search (linear) into an array for each - * bits is the code is present. - * - * If the code is not present for any reason, -1 is return. - */ -static int get_next_huffman_code(struct jdec_private *priv, struct huffman_table *huffman_table) -{ - int value, hcode; - unsigned int extra_nbits, nbits; - uint16_t *slowtable; - - look_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, HUFFMAN_HASH_NBITS, hcode); - value = huffman_table->lookup[hcode]; - if (__likely(value >= 0)) - { - unsigned int code_size = huffman_table->code_size[value]; - skip_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, code_size); - return value; - } - - /* Decode more bits each time ... */ - for (extra_nbits=0; extra_nbits<16-HUFFMAN_HASH_NBITS; extra_nbits++) - { - nbits = HUFFMAN_HASH_NBITS + 1 + extra_nbits; - - look_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, nbits, hcode); - slowtable = huffman_table->slowtable[extra_nbits]; - /* Search if the code is in this array */ - while (slowtable[0]) { - if (slowtable[0] == hcode) { - skip_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, nbits); - return slowtable[1]; - } - slowtable+=2; - } - } - return 0; -} - - - - -/** - * - * Decode a single block that contains the DCT coefficients. - * The table coefficients is already dezigzaged at the end of the operation. - * - */ -static void process_Huffman_data_unit(struct jdec_private *priv, int component) -{ - unsigned char j; - unsigned int huff_code; - unsigned char size_val, count_0; - - struct component *c = &priv->component_infos[component]; - short int DCT[64]; - - - /* Initialize the DCT coef table */ - memset(DCT, 0, sizeof(DCT)); - - /* DC coefficient decoding */ - huff_code = get_next_huffman_code(priv, c->DC_table); - //trace("+ %x\n", huff_code); - if (huff_code) { - get_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, huff_code, DCT[0]); - DCT[0] += c->previous_DC; - c->previous_DC = DCT[0]; - } else { - DCT[0] = c->previous_DC; - } - - /* AC coefficient decoding */ - j = 1; - while (j<64) - { - huff_code = get_next_huffman_code(priv, c->AC_table); - //trace("- %x\n", huff_code); - - size_val = huff_code & 0xF; - count_0 = huff_code >> 4; - - if (size_val == 0) - { /* RLE */ - if (count_0 == 0) - break; /* EOB found, go out */ - else if (count_0 == 0xF) - j += 16; /* skip 16 zeros */ - } - else - { - j += count_0; /* skip count_0 zeroes */ - if (__unlikely(j >= 64)) - { - sprintf(error_string, "Bad huffman data (buffer overflow)"); - break; - } - get_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, size_val, DCT[j]); - j++; - } - } - - for (j = 0; j < 64; j++) - c->DCT[j] = DCT[zigzag[j]]; -} - -/* - * Takes two array of bits, and build the huffman table for size, and code - * - * lookup will return the symbol if the code is less or equal than HUFFMAN_HASH_NBITS. - * code_size will be used to known how many bits this symbol is encoded. - * slowtable will be used when the first lookup didn't give the result. - */ -static void build_huffman_table(const unsigned char *bits, const unsigned char *vals, struct huffman_table *table) -{ - unsigned int i, j, code, code_size, val, nbits; - unsigned char huffsize[HUFFMAN_BITS_SIZE+1], *hz; - unsigned int huffcode[HUFFMAN_BITS_SIZE+1], *hc; - int next_free_entry; - - /* - * Build a temp array - * huffsize[X] => numbers of bits to write vals[X] - */ - hz = huffsize; - for (i=1; i<=16; i++) - { - for (j=1; j<=bits[i]; j++) - *hz++ = i; - } - *hz = 0; - - memset(table->lookup, 0xff, sizeof(table->lookup)); - for (i=0; i<(16-HUFFMAN_HASH_NBITS); i++) - table->slowtable[i][0] = 0; - - /* Build a temp array - * huffcode[X] => code used to write vals[X] - */ - code = 0; - hc = huffcode; - hz = huffsize; - nbits = *hz; - while (*hz) - { - while (*hz == nbits) - { - *hc++ = code++; - hz++; - } - code <<= 1; - nbits++; - } - - /* - * Build the lookup table, and the slowtable if needed. - */ - next_free_entry = -1; - for (i=0; huffsize[i]; i++) - { - val = vals[i]; - code = huffcode[i]; - code_size = huffsize[i]; - - trace("val=%2.2x code=%8.8x codesize=%2.2d\n", val, code, code_size); - - table->code_size[val] = code_size; - if (code_size <= HUFFMAN_HASH_NBITS) - { - /* - * Good: val can be put in the lookup table, so fill all value of this - * column with value val - */ - int repeat = 1UL<<(HUFFMAN_HASH_NBITS - code_size); - code <<= HUFFMAN_HASH_NBITS - code_size; - while ( repeat-- ) - table->lookup[code++] = val; - - } - else - { - /* Perhaps sorting the array will be an optimization */ - uint16_t *slowtable = table->slowtable[code_size-HUFFMAN_HASH_NBITS-1]; - while(slowtable[0]) - slowtable+=2; - slowtable[0] = code; - slowtable[1] = val; - slowtable[2] = 0; - /* TODO: NEED TO CHECK FOR AN OVERFLOW OF THE TABLE */ - } - - } -} - -static void build_default_huffman_tables(struct jdec_private *priv) -{ - if ( (priv->flags & TINYJPEG_FLAGS_MJPEG_TABLE) - && priv->default_huffman_table_initialized) - return; - - build_huffman_table(bits_dc_luminance, val_dc_luminance, &priv->HTDC[0]); - build_huffman_table(bits_ac_luminance, val_ac_luminance, &priv->HTAC[0]); - - build_huffman_table(bits_dc_chrominance, val_dc_chrominance, &priv->HTDC[1]); - build_huffman_table(bits_ac_chrominance, val_ac_chrominance, &priv->HTAC[1]); - - priv->default_huffman_table_initialized = 1; -} - - - -/******************************************************************************* - * - * Colorspace conversion routine - * - * - * Note: - * YCbCr is defined per CCIR 601-1, except that Cb and Cr are - * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. - * The conversion equations to be implemented are therefore - * R = Y + 1.40200 * Cr - * G = Y - 0.34414 * Cb - 0.71414 * Cr - * B = Y + 1.77200 * Cb - * - ******************************************************************************/ - -static unsigned char clamp(int i) -{ - if (i<0) - return 0; - else if (i>255) - return 255; - else - return i; -} - - -/** - * YCrCb -> YUV420P (1x1) - * .---. - * | 1 | - * `---' - */ -static void YCrCB_to_YUV420P_1x1(struct jdec_private *priv) -{ - const unsigned char *s, *y; - unsigned char *p; - int i,j; - - p = priv->plane[0]; - y = priv->Y; - for (i=0; i<8; i++) - { - memcpy(p, y, 8); - p+=priv->width; - y+=8; - } - - p = priv->plane[1]; - s = priv->Cb; - for (i=0; i<8; i+=2) - { - for (j=0; j<8; j+=2, s+=2) - *p++ = *s; - s += 8; /* Skip one line */ - p += priv->width/2 - 4; - } - - p = priv->plane[2]; - s = priv->Cr; - for (i=0; i<8; i+=2) - { - for (j=0; j<8; j+=2, s+=2) - *p++ = *s; - s += 8; /* Skip one line */ - p += priv->width/2 - 4; - } -} - -/** - * YCrCb -> YUV420P (2x1) - * .-------. - * | 1 | 2 | - * `-------' - */ -static void YCrCB_to_YUV420P_2x1(struct jdec_private *priv) -{ - unsigned char *p; - const unsigned char *s, *y1; - unsigned int i; - - p = priv->plane[0]; - y1 = priv->Y; - for (i=0; i<8; i++) - { - memcpy(p, y1, 16); - p += priv->width; - y1 += 16; - } - - p = priv->plane[1]; - s = priv->Cb; - for (i=0; i<8; i+=2) - { - memcpy(p, s, 8); - s += 16; /* Skip one line */ - p += priv->width/2; - } - - p = priv->plane[2]; - s = priv->Cr; - for (i=0; i<8; i+=2) - { - memcpy(p, s, 8); - s += 16; /* Skip one line */ - p += priv->width/2; - } -} - - -/** - * YCrCb -> YUV420P (1x2) - * .---. - * | 1 | - * |---| - * | 2 | - * `---' - */ -static void YCrCB_to_YUV420P_1x2(struct jdec_private *priv) -{ - const unsigned char *s, *y; - unsigned char *p; - int i,j; - - p = priv->plane[0]; - y = priv->Y; - for (i=0; i<16; i++) - { - memcpy(p, y, 8); - p+=priv->width; - y+=8; - } - - p = priv->plane[1]; - s = priv->Cb; - for (i=0; i<8; i++) - { - for (j=0; j<8; j+=2, s+=2) - *p++ = *s; - p += priv->width/2 - 4; - } - - p = priv->plane[2]; - s = priv->Cr; - for (i=0; i<8; i++) - { - for (j=0; j<8; j+=2, s+=2) - *p++ = *s; - p += priv->width/2 - 4; - } -} - -/** - * YCrCb -> YUV420P (2x2) - * .-------. - * | 1 | 2 | - * |---+---| - * | 3 | 4 | - * `-------' - */ -static void YCrCB_to_YUV420P_2x2(struct jdec_private *priv) -{ - unsigned char *p; - const unsigned char *s, *y1; - unsigned int i; - - p = priv->plane[0]; - y1 = priv->Y; - for (i=0; i<16; i++) - { - memcpy(p, y1, 16); - p += priv->width; - y1 += 16; - } - - p = priv->plane[1]; - s = priv->Cb; - for (i=0; i<8; i++) - { - memcpy(p, s, 8); - s += 8; - p += priv->width/2; - } - - p = priv->plane[2]; - s = priv->Cr; - for (i=0; i<8; i++) - { - memcpy(p, s, 8); - s += 8; - p += priv->width/2; - } -} - -/** - * YCrCb -> RGB24 (1x1) - * .---. - * | 1 | - * `---' - */ -static void YCrCB_to_RGB24_1x1(struct jdec_private *priv) -{ - const unsigned char *Y, *Cb, *Cr; - unsigned char *p; - int i,j; - int offset_to_next_row; - -#define SCALEBITS 10 -#define ONE_HALF (1UL << (SCALEBITS-1)) -#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5)) - - p = priv->plane[0]; - Y = priv->Y; - Cb = priv->Cb; - Cr = priv->Cr; - offset_to_next_row = priv->width*3 - 8*3; - for (i=0; i<8; i++) { - - for (j=0; j<8; j++) { - - int y, cb, cr; - int add_r, add_g, add_b; - int r, g , b; - - y = (*Y++) << SCALEBITS; - cb = *Cb++ - 128; - cr = *Cr++ - 128; - add_r = FIX(1.40200) * cr + ONE_HALF; - add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF; - add_b = FIX(1.77200) * cb + ONE_HALF; - - - r = (y + add_r) >> SCALEBITS; - g = (y + add_g) >> SCALEBITS; - b = (y + add_b) >> SCALEBITS; - priv->decomp_block[i][j*3+0]=clamp(r); - priv->decomp_block[i][j*3+1]=clamp(g); - priv->decomp_block[i][j*3+2]=clamp(b); - - } - -// p += offset_to_next_row; - } - -#undef SCALEBITS -#undef ONE_HALF -#undef FIX - -} - -/** - * YCrCb -> BGR24 (1x1) - * .---. - * | 1 | - * `---' - */ -static void YCrCB_to_BGR24_1x1(struct jdec_private *priv) -{ - const unsigned char *Y, *Cb, *Cr; - unsigned char *p; - int i,j; - int offset_to_next_row; - -#define SCALEBITS 10 -#define ONE_HALF (1UL << (SCALEBITS-1)) -#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5)) - - p = priv->plane[0]; - Y = priv->Y; - Cb = priv->Cb; - Cr = priv->Cr; - offset_to_next_row = priv->width*3 - 8*3; - for (i=0; i<8; i++) { - - for (j=0; j<8; j++) { - - int y, cb, cr; - int add_r, add_g, add_b; - int r, g , b; - - y = (*Y++) << SCALEBITS; - cb = *Cb++ - 128; - cr = *Cr++ - 128; - add_r = FIX(1.40200) * cr + ONE_HALF; - add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF; - add_b = FIX(1.77200) * cb + ONE_HALF; - - b = (y + add_b) >> SCALEBITS; - *p++ = clamp(b); - g = (y + add_g) >> SCALEBITS; - *p++ = clamp(g); - r = (y + add_r) >> SCALEBITS; - *p++ = clamp(r); - - } - - p += offset_to_next_row; - } - -#undef SCALEBITS -#undef ONE_HALF -#undef FIX - -} - - -/** - * YCrCb -> RGB24 (2x1) - * .-------. - * | 1 | 2 | - * `-------' - */ -static void YCrCB_to_RGB24_2x1(struct jdec_private *priv) -{ - const unsigned char *Y, *Cb, *Cr; - unsigned char *p; - int i,j; - int offset_to_next_row; - -#define SCALEBITS 10 -#define ONE_HALF (1UL << (SCALEBITS-1)) -#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5)) - - p = priv->plane[0]; - Y = priv->Y; - Cb = priv->Cb; - Cr = priv->Cr; - offset_to_next_row = priv->width*3 - 16*3; - for (i=0; i<8; i++) { - - for (j=0; j<8; j++) { - - int y, cb, cr; - int add_r, add_g, add_b; - int r, g , b; - - y = (*Y++) << SCALEBITS; - cb = *Cb++ - 128; - cr = *Cr++ - 128; - add_r = FIX(1.40200) * cr + ONE_HALF; - add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF; - add_b = FIX(1.77200) * cb + ONE_HALF; - - r = (y + add_r) >> SCALEBITS; - g = (y + add_g) >> SCALEBITS; - b = (y + add_b) >> SCALEBITS; - - priv->decomp_block[i][j*6+0]=clamp(r); - priv->decomp_block[i][j*6+1]=clamp(g); - priv->decomp_block[i][j*6+2]=clamp(b); - - y = (*Y++) << SCALEBITS; - - r = (y + add_r) >> SCALEBITS; - g = (y + add_g) >> SCALEBITS; - b = (y + add_b) >> SCALEBITS; - - priv->decomp_block[i][j*6+3]=clamp(r); - priv->decomp_block[i][j*6+4]=clamp(g); - priv->decomp_block[i][j*6+5]=clamp(b); - - } - - p += offset_to_next_row; - } - -#undef SCALEBITS -#undef ONE_HALF -#undef FIX - -} - -/* - * YCrCb -> BGR24 (2x1) - * .-------. - * | 1 | 2 | - * `-------' - */ -static void YCrCB_to_BGR24_2x1(struct jdec_private *priv) -{ - const unsigned char *Y, *Cb, *Cr; - unsigned char *p; - int i,j; - int offset_to_next_row; - -#define SCALEBITS 10 -#define ONE_HALF (1UL << (SCALEBITS-1)) -#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5)) - - p = priv->plane[0]; - Y = priv->Y; - Cb = priv->Cb; - Cr = priv->Cr; - offset_to_next_row = priv->width*3 - 16*3; - for (i=0; i<8; i++) { - - for (j=0; j<8; j++) { - - int y, cb, cr; - int add_r, add_g, add_b; - int r, g , b; - - cb = *Cb++ - 128; - cr = *Cr++ - 128; - add_r = FIX(1.40200) * cr + ONE_HALF; - add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF; - add_b = FIX(1.77200) * cb + ONE_HALF; - - y = (*Y++) << SCALEBITS; - b = (y + add_b) >> SCALEBITS; - *p++ = clamp(b); - g = (y + add_g) >> SCALEBITS; - *p++ = clamp(g); - r = (y + add_r) >> SCALEBITS; - *p++ = clamp(r); - - y = (*Y++) << SCALEBITS; - b = (y + add_b) >> SCALEBITS; - *p++ = clamp(b); - g = (y + add_g) >> SCALEBITS; - *p++ = clamp(g); - r = (y + add_r) >> SCALEBITS; - *p++ = clamp(r); - - } - - p += offset_to_next_row; - } - -#undef SCALEBITS -#undef ONE_HALF -#undef FIX - -} - -/** - * YCrCb -> RGB24 (1x2) - * .---. - * | 1 | - * |---| - * | 2 | - * `---' - */ -static void YCrCB_to_RGB24_1x2(struct jdec_private *priv) -{ - const unsigned char *Y, *Cb, *Cr; - unsigned char *p, *p2; - int i,j; - int offset_to_next_row; - -#define SCALEBITS 10 -#define ONE_HALF (1UL << (SCALEBITS-1)) -#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5)) - - p = priv->plane[0]; - p2 = priv->plane[0] + priv->width*3; - Y = priv->Y; - Cb = priv->Cb; - Cr = priv->Cr; - offset_to_next_row = 2*priv->width*3 - 8*3; - for (i=0; i<8; i++) { - - for (j=0; j<8; j++) { - - int y, cb, cr; - int add_r, add_g, add_b; - int r, g , b; - - cb = *Cb++ - 128; - cr = *Cr++ - 128; - add_r = FIX(1.40200) * cr + ONE_HALF; - add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF; - add_b = FIX(1.77200) * cb + ONE_HALF; - - y = (*Y++) << SCALEBITS; - r = (y + add_r) >> SCALEBITS; - g = (y + add_g) >> SCALEBITS; - b = (y + add_b) >> SCALEBITS; - - priv->decomp_block[i*2][j*3+0]=clamp(r); - priv->decomp_block[i*2][j*3+1]=clamp(g); - priv->decomp_block[i*2][j*3+2]=clamp(b); - - y = (Y[8-1]) << SCALEBITS; - r = (y + add_r) >> SCALEBITS; - g = (y + add_g) >> SCALEBITS; - b = (y + add_b) >> SCALEBITS; - - priv->decomp_block[i*2+1][j*3+0]=clamp(r); - priv->decomp_block[i*2+1][j*3+1]=clamp(g); - priv->decomp_block[i*2+1][j*3+2]=clamp(b); - - } - Y += 8; - p += offset_to_next_row; - p2 += offset_to_next_row; - } - -#undef SCALEBITS -#undef ONE_HALF -#undef FIX - -} - -/* - * YCrCb -> BGR24 (1x2) - * .---. - * | 1 | - * |---| - * | 2 | - * `---' - */ -static void YCrCB_to_BGR24_1x2(struct jdec_private *priv) -{ - const unsigned char *Y, *Cb, *Cr; - unsigned char *p, *p2; - int i,j; - int offset_to_next_row; - -#define SCALEBITS 10 -#define ONE_HALF (1UL << (SCALEBITS-1)) -#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5)) - - p = priv->plane[0]; - p2 = priv->plane[0] + priv->width*3; - Y = priv->Y; - Cb = priv->Cb; - Cr = priv->Cr; - offset_to_next_row = 2*priv->width*3 - 8*3; - for (i=0; i<8; i++) { - - for (j=0; j<8; j++) { - - int y, cb, cr; - int add_r, add_g, add_b; - int r, g , b; - - cb = *Cb++ - 128; - cr = *Cr++ - 128; - add_r = FIX(1.40200) * cr + ONE_HALF; - add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF; - add_b = FIX(1.77200) * cb + ONE_HALF; - - y = (*Y++) << SCALEBITS; - b = (y + add_b) >> SCALEBITS; - *p++ = clamp(b); - g = (y + add_g) >> SCALEBITS; - *p++ = clamp(g); - r = (y + add_r) >> SCALEBITS; - *p++ = clamp(r); - - y = (Y[8-1]) << SCALEBITS; - b = (y + add_b) >> SCALEBITS; - *p2++ = clamp(b); - g = (y + add_g) >> SCALEBITS; - *p2++ = clamp(g); - r = (y + add_r) >> SCALEBITS; - *p2++ = clamp(r); - - } - Y += 8; - p += offset_to_next_row; - p2 += offset_to_next_row; - } - -#undef SCALEBITS -#undef ONE_HALF -#undef FIX - -} - - -/** - * YCrCb -> RGB24 (2x2) - * .-------. - * | 1 | 2 | - * |---+---| - * | 3 | 4 | - * `-------' - */ -static void YCrCB_to_RGB24_2x2(struct jdec_private *priv) -{ - const unsigned char *Y, *Cb, *Cr; - unsigned char *p, *p2; - int i,j; - int offset_to_next_row; - -#define SCALEBITS 10 -#define ONE_HALF (1UL << (SCALEBITS-1)) -#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5)) - - p = priv->plane[0]; - p2 = priv->plane[0] + priv->width*3; - Y = priv->Y; - Cb = priv->Cb; - Cr = priv->Cr; - offset_to_next_row = (priv->width*3*2) - 16*3; - for (i=0; i<8; i++) { - - for (j=0; j<8; j++) { - - int y, cb, cr; - int add_r, add_g, add_b; - int r, g , b; - - cb = *Cb++ - 128; - cr = *Cr++ - 128; - add_r = FIX(1.40200) * cr + ONE_HALF; - add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF; - add_b = FIX(1.77200) * cb + ONE_HALF; - - y = (*Y++) << SCALEBITS; - r = (y + add_r) >> SCALEBITS; - g = (y + add_g) >> SCALEBITS; - b = (y + add_b) >> SCALEBITS; - - priv->decomp_block[i*2][j*6+0]=clamp(r); - priv->decomp_block[i*2][j*6+1]=clamp(g); - priv->decomp_block[i*2][j*6+2]=clamp(b); - - y = (*Y++) << SCALEBITS; - r = (y + add_r) >> SCALEBITS; - g = (y + add_g) >> SCALEBITS; - b = (y + add_b) >> SCALEBITS; - - priv->decomp_block[i*2][j*6+3]=clamp(r); - priv->decomp_block[i*2][j*6+4]=clamp(g); - priv->decomp_block[i*2][j*6+5]=clamp(b); - - y = (Y[16-2]) << SCALEBITS; - r = (y + add_r) >> SCALEBITS; - g = (y + add_g) >> SCALEBITS; - b = (y + add_b) >> SCALEBITS; - - priv->decomp_block[i*2+1][j*6+0]=clamp(r); - priv->decomp_block[i*2+1][j*6+1]=clamp(g); - priv->decomp_block[i*2+1][j*6+2]=clamp(b); - - y = (Y[16-1]) << SCALEBITS; - r = (y + add_r) >> SCALEBITS; - g = (y + add_g) >> SCALEBITS; - b = (y + add_b) >> SCALEBITS; - - priv->decomp_block[i*2+1][j*6+3]=clamp(r); - priv->decomp_block[i*2+1][j*6+4]=clamp(g); - priv->decomp_block[i*2+1][j*6+5]=clamp(b); - - } - Y += 16; - p += offset_to_next_row; - p2 += offset_to_next_row; - } - -#undef SCALEBITS -#undef ONE_HALF -#undef FIX - -} - - -/* - * YCrCb -> BGR24 (2x2) - * .-------. - * | 1 | 2 | - * |---+---| - * | 3 | 4 | - * `-------' - */ -static void YCrCB_to_BGR24_2x2(struct jdec_private *priv) -{ - const unsigned char *Y, *Cb, *Cr; - unsigned char *p, *p2; - int i,j; - int offset_to_next_row; - -#define SCALEBITS 10 -#define ONE_HALF (1UL << (SCALEBITS-1)) -#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5)) - - p = priv->plane[0]; - p2 = priv->plane[0] + priv->width*3; - Y = priv->Y; - Cb = priv->Cb; - Cr = priv->Cr; - offset_to_next_row = (priv->width*3*2) - 16*3; - for (i=0; i<8; i++) { - - for (j=0; j<8; j++) { - - int y, cb, cr; - int add_r, add_g, add_b; - int r, g , b; - - cb = *Cb++ - 128; - cr = *Cr++ - 128; - add_r = FIX(1.40200) * cr + ONE_HALF; - add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF; - add_b = FIX(1.77200) * cb + ONE_HALF; - - y = (*Y++) << SCALEBITS; - b = (y + add_b) >> SCALEBITS; - *p++ = clamp(b); - g = (y + add_g) >> SCALEBITS; - *p++ = clamp(g); - r = (y + add_r) >> SCALEBITS; - *p++ = clamp(r); - - y = (*Y++) << SCALEBITS; - b = (y + add_b) >> SCALEBITS; - *p++ = clamp(b); - g = (y + add_g) >> SCALEBITS; - *p++ = clamp(g); - r = (y + add_r) >> SCALEBITS; - *p++ = clamp(r); - - y = (Y[16-2]) << SCALEBITS; - b = (y + add_b) >> SCALEBITS; - *p2++ = clamp(b); - g = (y + add_g) >> SCALEBITS; - *p2++ = clamp(g); - r = (y + add_r) >> SCALEBITS; - *p2++ = clamp(r); - - y = (Y[16-1]) << SCALEBITS; - b = (y + add_b) >> SCALEBITS; - *p2++ = clamp(b); - g = (y + add_g) >> SCALEBITS; - *p2++ = clamp(g); - r = (y + add_r) >> SCALEBITS; - *p2++ = clamp(r); - } - Y += 16; - p += offset_to_next_row; - p2 += offset_to_next_row; - } - -#undef SCALEBITS -#undef ONE_HALF -#undef FIX - -} - - - -/** - * YCrCb -> Grey (1x1) - * .---. - * | 1 | - * `---' - */ -static void YCrCB_to_Grey_1x1(struct jdec_private *priv) -{ - const unsigned char *y; - unsigned char *p; - unsigned int i; - int offset_to_next_row; - - p = priv->plane[0]; - y = priv->Y; - offset_to_next_row = priv->width; - - for (i=0; i<8; i++) { - memcpy(p, y, 8); - y+=8; - p += offset_to_next_row; - } -} - -/** - * YCrCb -> Grey (2x1) - * .-------. - * | 1 | 2 | - * `-------' - */ -static void YCrCB_to_Grey_2x1(struct jdec_private *priv) -{ - const unsigned char *y; - unsigned char *p; - unsigned int i; - - p = priv->plane[0]; - y = priv->Y; - - for (i=0; i<8; i++) { - memcpy(p, y, 16); - y += 16; - p += priv->width; - } -} - - -/** - * YCrCb -> Grey (1x2) - * .---. - * | 1 | - * |---| - * | 2 | - * `---' - */ -static void YCrCB_to_Grey_1x2(struct jdec_private *priv) -{ - const unsigned char *y; - unsigned char *p; - unsigned int i; - - p = priv->plane[0]; - y = priv->Y; - - for (i=0; i<16; i++) { - memcpy(p, y, 8); - y += 8; - p += priv->width; - } -} - -/** - * YCrCb -> Grey (2x2) - * .-------. - * | 1 | 2 | - * |---+---| - * | 3 | 4 | - * `-------' - */ -static void YCrCB_to_Grey_2x2(struct jdec_private *priv) -{ - const unsigned char *y; - unsigned char *p; - unsigned int i; - - p = priv->plane[0]; - y = priv->Y; - - for (i=0; i<16; i++) { - memcpy(p, y, 16); - y += 16; - p += priv->width; - } -} - - -/* - * Decode all the 3 components for 1x1 - */ -static void decode_MCU_1x1_3planes(struct jdec_private *priv) -{ - // Y - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y, 8); - - // Cb - process_Huffman_data_unit(priv, cCb); - IDCT(&priv->component_infos[cCb], priv->Cb, 8); - - // Cr - process_Huffman_data_unit(priv, cCr); - IDCT(&priv->component_infos[cCr], priv->Cr, 8); -} - -/* - * Decode a 1x1 directly in 1 color - */ -static void decode_MCU_1x1_1plane(struct jdec_private *priv) -{ - // Y - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y, 8); - - // Cb - process_Huffman_data_unit(priv, cCb); - IDCT(&priv->component_infos[cCb], priv->Cb, 8); - - // Cr - process_Huffman_data_unit(priv, cCr); - IDCT(&priv->component_infos[cCr], priv->Cr, 8); -} - - -/* - * Decode a 2x1 - * .-------. - * | 1 | 2 | - * `-------' - */ -static void decode_MCU_2x1_3planes(struct jdec_private *priv) -{ - // Y - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y, 16); - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y+8, 16); - - // Cb - process_Huffman_data_unit(priv, cCb); - IDCT(&priv->component_infos[cCb], priv->Cb, 8); - - // Cr - process_Huffman_data_unit(priv, cCr); - IDCT(&priv->component_infos[cCr], priv->Cr, 8); -} - -/* - * Decode a 2x1 - * .-------. - * | 1 | 2 | - * `-------' - */ -static void decode_MCU_2x1_1plane(struct jdec_private *priv) -{ - // Y - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y, 16); - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y+8, 16); - - // Cb - process_Huffman_data_unit(priv, cCb); - - // Cr - process_Huffman_data_unit(priv, cCr); -} - - -/* - * Decode a 2x2 - * .-------. - * | 1 | 2 | - * |---+---| - * | 3 | 4 | - * `-------' - */ -static void decode_MCU_2x2_3planes(struct jdec_private *priv) -{ - // Y - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y, 16); - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y+8, 16); - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y+64*2, 16); - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y+64*2+8, 16); - - // Cb - process_Huffman_data_unit(priv, cCb); - IDCT(&priv->component_infos[cCb], priv->Cb, 8); - - // Cr - process_Huffman_data_unit(priv, cCr); - IDCT(&priv->component_infos[cCr], priv->Cr, 8); -} - -/* - * Decode a 2x2 directly in GREY format (8bits) - * .-------. - * | 1 | 2 | - * |---+---| - * | 3 | 4 | - * `-------' - */ -static void decode_MCU_2x2_1plane(struct jdec_private *priv) -{ - // Y - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y, 16); - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y+8, 16); - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y+64*2, 16); - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y+64*2+8, 16); - - // Cb - process_Huffman_data_unit(priv, cCb); - - // Cr - process_Huffman_data_unit(priv, cCr); -} - -/* - * Decode a 1x2 mcu - * .---. - * | 1 | - * |---| - * | 2 | - * `---' - */ -static void decode_MCU_1x2_3planes(struct jdec_private *priv) -{ - // Y - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y, 8); - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y+64, 8); - - // Cb - process_Huffman_data_unit(priv, cCb); - IDCT(&priv->component_infos[cCb], priv->Cb, 8); - - // Cr - process_Huffman_data_unit(priv, cCr); - IDCT(&priv->component_infos[cCr], priv->Cr, 8); -} - -/* - * Decode a 1x2 mcu - * .---. - * | 1 | - * |---| - * | 2 | - * `---' - */ -static void decode_MCU_1x2_1plane(struct jdec_private *priv) -{ - // Y - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y, 8); - process_Huffman_data_unit(priv, cY); - IDCT(&priv->component_infos[cY], priv->Y+64, 8); - - // Cb - process_Huffman_data_unit(priv, cCb); - - // Cr - process_Huffman_data_unit(priv, cCr); -} - -static void print_SOF(const unsigned char *stream) -{ - int width, height, nr_components, precision; -#if DEBUG - const char *nr_components_to_string[] = { - "????", - "Grayscale", - "????", - "YCbCr", - "CYMK" - }; -#endif - - precision = stream[2]; - height = be16_to_cpu(stream+3); - width = be16_to_cpu(stream+5); - nr_components = stream[7]; - - trace("> SOF marker\n"); - trace("Size:%dx%d nr_components:%d (%s) precision:%d\n", - width, height, - nr_components, nr_components_to_string[nr_components], - precision); -} - -/******************************************************************************* - * - * JPEG/JFIF Parsing functions - * - * Note: only a small subset of the jpeg file format is supported. No markers, - * nor progressive stream is supported. - * - ******************************************************************************/ - -static void build_quantization_table(float *qtable, const unsigned char *ref_table) -{ - /* Taken from libjpeg. Copyright Independent JPEG Group's LLM idct. - * For float AA&N IDCT method, divisors are equal to quantization - * coefficients scaled by scalefactor[row]*scalefactor[col], where - * scalefactor[0] = 1 - * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 - * We apply a further scale factor of 8. - * What's actually stored is 1/divisor so that the inner loop can - * use a multiplication rather than a division. - */ - int i, j; - static const double aanscalefactor[8] = { - 1.0, 1.387039845, 1.306562965, 1.175875602, - 1.0, 0.785694958, 0.541196100, 0.275899379 - }; - const unsigned char *zz = zigzag; - - for (i=0; i<8; i++) { - for (j=0; j<8; j++) { - *qtable++ = ref_table[*zz++] * aanscalefactor[i] * aanscalefactor[j]; - } - } - -} - -static int parse_DQT(struct jdec_private *priv, const unsigned char *stream) -{ - int qi; - float *table; - const unsigned char *dqt_block_end; - - trace("> DQT marker\n"); - dqt_block_end = stream + be16_to_cpu(stream); - stream += 2; /* Skip length */ - - while (stream < dqt_block_end) - { - qi = *stream++; -#if SANITY_CHECK - if (qi>>4) - error("16 bits quantization table is not supported\n"); - if (qi>4) - error("No more 4 quantization table is supported (got %d)\n", qi); -#endif - table = priv->Q_tables[qi]; - build_quantization_table(table, stream); - stream += 64; - } - trace("< DQT marker\n"); - return 0; -} - -static int parse_SOF(struct jdec_private *priv, const unsigned char *stream) -{ - int i, width, height, nr_components, cid, sampling_factor; - int Q_table; - struct component *c; - - trace("> SOF marker\n"); - print_SOF(stream); - - height = be16_to_cpu(stream+3); - width = be16_to_cpu(stream+5); - nr_components = stream[7]; -#if SANITY_CHECK - if (stream[2] != 8) - error("Precision other than 8 is not supported\n"); - if (width>JPEG_MAX_WIDTH || height>JPEG_MAX_HEIGHT) - error("Width and Height (%dx%d) seems suspicious\n", width, height); - if (nr_components != 3) - error("We only support YUV images\n"); - //if (height%16) -// error("Height need to be a multiple of 16 (current height is %d)\n", height); -// if (width%16) - // error("Width need to be a multiple of 16 (current Width is %d)\n", width); -#endif - stream += 8; - for (i=0; i<nr_components; i++) { - cid = *stream++; - sampling_factor = *stream++; - Q_table = *stream++; - c = &priv->component_infos[i]; -#if SANITY_CHECK - c->cid = cid; - if (Q_table >= COMPONENTS) - error("Bad Quantization table index (got %d, max allowed %d)\n", Q_table, COMPONENTS-1); -#endif - c->Vfactor = sampling_factor&0xf; - c->Hfactor = sampling_factor>>4; - c->Q_table = priv->Q_tables[Q_table]; - trace("Component:%d factor:%dx%d Quantization table:%d\n", - cid, c->Hfactor, c->Hfactor, Q_table ); - - } - priv->width = width; - priv->height = height; - - trace("< SOF marker\n"); - - return 0; -} - -static int parse_SOS(struct jdec_private *priv, const unsigned char *stream) -{ - unsigned int i, cid, table; - unsigned int nr_components = stream[2]; - - trace("> SOS marker\n"); - -#if SANITY_CHECK - if (nr_components != 3) - error("We only support YCbCr image\n"); -#endif - - stream += 3; - for (i=0;i<nr_components;i++) { - cid = *stream++; - table = *stream++; -#if SANITY_CHECK - if ((table&0xf)>=4) - error("We do not support more than 2 AC Huffman table\n"); - if ((table>>4)>=4) - error("We do not support more than 2 DC Huffman table\n"); - if (cid != priv->component_infos[i].cid) - error("SOS cid order (%d:%d) isn't compatible with the SOF marker (%d:%d)\n", - i, cid, i, priv->component_infos[i].cid); - trace("ComponentId:%d tableAC:%d tableDC:%d\n", cid, table&0xf, table>>4); -#endif - priv->component_infos[i].AC_table = &priv->HTAC[table&0xf]; - priv->component_infos[i].DC_table = &priv->HTDC[table>>4]; - } - priv->stream = stream+3; - trace("< SOS marker\n"); - return 0; -} - -static int parse_DHT(struct jdec_private *priv, const unsigned char *stream) -{ - unsigned int count, i; - unsigned char huff_bits[17]; - int length, index; - - length = be16_to_cpu(stream) - 2; - stream += 2; /* Skip length */ - - trace("> DHT marker (length=%d)\n", length); - - while (length>0) { - index = *stream++; - - /* We need to calculate the number of bytes 'vals' will takes */ - huff_bits[0] = 0; - count = 0; - for (i=1; i<17; i++) { - huff_bits[i] = *stream++; - count += huff_bits[i]; - } -#if SANITY_CHECK - if (count >= HUFFMAN_BITS_SIZE) - error("No more than %d bytes is allowed to describe a huffman table", HUFFMAN_BITS_SIZE); - if ( (index &0xf) >= HUFFMAN_TABLES) - error("No more than %d Huffman tables is supported (got %d)\n", HUFFMAN_TABLES, index&0xf); - trace("Huffman table %s[%d] length=%d\n", (index&0xf0)?"AC":"DC", index&0xf, count); -#endif - - if (index & 0xf0 ) - build_huffman_table(huff_bits, stream, &priv->HTAC[index&0xf]); - else - build_huffman_table(huff_bits, stream, &priv->HTDC[index&0xf]); - - length -= 1; - length -= 16; - length -= count; - stream += count; - } - trace("< DHT marker\n"); - return 0; -} - -static int parse_DRI(struct jdec_private *priv, const unsigned char *stream) -{ - unsigned int length; - - trace("> DRI marker\n"); - - length = be16_to_cpu(stream); - -#if SANITY_CHECK - if (length != 4) - error("Length of DRI marker need to be 4\n"); -#endif - - priv->restart_interval = be16_to_cpu(stream+2); - -#if DEBUG - trace("Restart interval = %d\n", priv->restart_interval); -#endif - - trace("< DRI marker\n"); - - return 0; -} - - - -static void resync(struct jdec_private *priv) -{ - int i; - - /* Init DC coefficients */ - for (i=0; i<COMPONENTS; i++) - priv->component_infos[i].previous_DC = 0; - - priv->reservoir = 0; - priv->nbits_in_reservoir = 0; - if (priv->restart_interval > 0) - priv->restarts_to_go = priv->restart_interval; - else - priv->restarts_to_go = -1; -} - -static int find_next_rst_marker(struct jdec_private *priv) -{ - int rst_marker_found = 0; - int marker; - const unsigned char *stream = priv->stream; - - /* Parse marker */ - while (!rst_marker_found) - { - while (*stream++ != 0xff) - { - if (stream >= priv->stream_end) - error("EOF while search for a RST marker."); - } - /* Skip any padding ff byte (this is normal) */ - while (*stream == 0xff) - stream++; - - marker = *stream++; - if ((RST+priv->last_rst_marker_seen) == marker) - rst_marker_found = 1; - else if (marker >= RST && marker <= RST7) - error("Wrong Reset marker found, abording"); - else if (marker == EOI) - return 0; - } - trace("RST Marker %d found at offset %d\n", priv->last_rst_marker_seen, stream - priv->stream_begin); - - priv->stream = stream; - priv->last_rst_marker_seen++; - priv->last_rst_marker_seen &= 7; - - return 0; -} - -static int parse_JFIF(struct jdec_private *priv, const unsigned char *stream) -{ - int chuck_len; - int marker; - int sos_marker_found = 0; - int dht_marker_found = 0; - const unsigned char *next_chunck; - - /* Parse marker */ - while (!sos_marker_found) - { - if (*stream++ != 0xff) - goto bogus_jpeg_format; - /* Skip any padding ff byte (this is normal) */ - while (*stream == 0xff) - stream++; - - marker = *stream++; - chuck_len = be16_to_cpu(stream); - next_chunck = stream + chuck_len; - switch (marker) - { - case SOF: - if (parse_SOF(priv, stream) < 0) - return -1; - break; - case DQT: - if (parse_DQT(priv, stream) < 0) - return -1; - break; - case SOS: - if (parse_SOS(priv, stream) < 0) - return -1; - sos_marker_found = 1; - break; - case DHT: - if (parse_DHT(priv, stream) < 0) - return -1; - dht_marker_found = 1; - break; - case DRI: - if (parse_DRI(priv, stream) < 0) - return -1; - break; - default: - trace("> Unknown marker %2.2x\n", marker); - break; - } - - stream = next_chunck; - } - - if (!dht_marker_found) { - trace("No Huffman table loaded, using the default one\n"); - build_default_huffman_tables(priv); - } - -#ifdef SANITY_CHECK - if ( (priv->component_infos[cY].Hfactor < priv->component_infos[cCb].Hfactor) - || (priv->component_infos[cY].Hfactor < priv->component_infos[cCr].Hfactor)) - error("Horizontal sampling factor for Y should be greater than horitontal sampling factor for Cb or Cr\n"); - if ( (priv->component_infos[cY].Vfactor < priv->component_infos[cCb].Vfactor) - || (priv->component_infos[cY].Vfactor < priv->component_infos[cCr].Vfactor)) - error("Vertical sampling factor for Y should be greater than vertical sampling factor for Cb or Cr\n"); - if ( (priv->component_infos[cCb].Hfactor!=1) - || (priv->component_infos[cCr].Hfactor!=1) - || (priv->component_infos[cCb].Vfactor!=1) - || (priv->component_infos[cCr].Vfactor!=1)) - error("Sampling other than 1x1 for Cr and Cb is not supported"); -#endif - - return 0; -bogus_jpeg_format: - trace("Bogus jpeg format\n"); - return -1; -} - -/******************************************************************************* - * - * Functions exported of the library. - * - * Note: Some applications can access directly to internal pointer of the - * structure. It's is not recommended, but if you have many images to - * uncompress with the same parameters, some functions can be called to speedup - * the decoding. - * - ******************************************************************************/ - -/** - * Allocate a new tinyjpeg decoder object. - * - * Before calling any other functions, an object need to be called. - */ -struct jdec_private *tinyjpeg_init(void *(*allocate_mem)(unsigned int),void (*free_mem)(void *)) -{ - struct jdec_private *priv; - unsigned int i; - - priv = (struct jdec_private *)allocate_mem(sizeof(struct jdec_private)); - for(i=0;i<sizeof(struct jdec_private);i++) { - char *pzero = (char*)priv; - pzero[i]=0; - } - priv->allocate_mem=allocate_mem; - priv->free_mem=free_mem; - if (priv == NULL) - return NULL; - return priv; -} - -/** - * Free a tinyjpeg object. - * - * No others function can be called after this one. - */ -void tinyjpeg_free(struct jdec_private *priv) -{ - int i; - for (i=0; i<COMPONENTS; i++) { - if (priv->components[i]) { - // priv->free_mem(priv->components[i]); - priv->components[i] = NULL; - } - } - priv->free_mem(priv); -} - -/** - * Initialize the tinyjpeg object and prepare the decoding of the stream. - * - * Check if the jpeg can be decoded with this jpeg decoder. - * Fill some table used for preprocessing. - */ -int tinyjpeg_parse_header(struct jdec_private *priv, const unsigned char *buf, unsigned int size) -{ - int ret; - - /* Identify the file */ - if ((buf[0] != 0xFF) || (buf[1] != SOI)) - error("Not a JPG file ?\n"); - - priv->stream_begin = buf+2; - priv->stream_length = size-2; - priv->stream_end = priv->stream_begin + priv->stream_length; - - ret = parse_JFIF(priv, priv->stream_begin); - - return ret; -} - -static const decode_MCU_fct decode_mcu_3comp_table[4] = { - decode_MCU_1x1_3planes, - decode_MCU_1x2_3planes, - decode_MCU_2x1_3planes, - decode_MCU_2x2_3planes, -}; - -static const decode_MCU_fct decode_mcu_1comp_table[4] = { - decode_MCU_1x1_1plane, - decode_MCU_1x2_1plane, - decode_MCU_2x1_1plane, - decode_MCU_2x2_1plane, -}; - -static const convert_colorspace_fct convert_colorspace_yuv420p[4] = { - YCrCB_to_YUV420P_1x1, - YCrCB_to_YUV420P_1x2, - YCrCB_to_YUV420P_2x1, - YCrCB_to_YUV420P_2x2, -}; - -static const convert_colorspace_fct convert_colorspace_rgb24[4] = { - YCrCB_to_RGB24_1x1, - YCrCB_to_RGB24_1x2, - YCrCB_to_RGB24_2x1, - YCrCB_to_RGB24_2x2, -}; - -static const convert_colorspace_fct convert_colorspace_bgr24[4] = { - YCrCB_to_BGR24_1x1, - YCrCB_to_BGR24_1x2, - YCrCB_to_BGR24_2x1, - YCrCB_to_BGR24_2x2, -}; - -static const convert_colorspace_fct convert_colorspace_grey[4] = { - YCrCB_to_Grey_1x1, - YCrCB_to_Grey_1x2, - YCrCB_to_Grey_2x1, - YCrCB_to_Grey_2x2, -}; - -/** - * Decode and convert the jpeg image into @pixfmt@ image - * - * Note: components will be automaticaly allocated if no memory is attached. - */ -int tinyjpeg_decode(struct jdec_private *priv, int pixfmt) -{ - unsigned int x, y, xstride_by_mcu, ystride_by_mcu; - unsigned int bytes_per_blocklines[3], bytes_per_mcu[3]; - decode_MCU_fct decode_MCU; - const decode_MCU_fct *decode_mcu_table; - const convert_colorspace_fct *colorspace_array_conv; - convert_colorspace_fct convert_to_pixfmt; - - if (pixfmt!=TINYJPEG_FMT_RGB24) - error("Only TINYJPEG_FMT_RGB24 is supported in this version"); - - if (setjmp(priv->jump_state)) - return -1; - - /* To keep gcc happy initialize some array */ - bytes_per_mcu[1] = 0; - bytes_per_mcu[2] = 0; - bytes_per_blocklines[1] = 0; - bytes_per_blocklines[2] = 0; - - decode_mcu_table = decode_mcu_3comp_table; - switch (pixfmt) { - case TINYJPEG_FMT_YUV420P: - colorspace_array_conv = convert_colorspace_yuv420p; - if (priv->components[0] == NULL) - priv->components[0] = (uint8_t *)priv->allocate_mem(priv->width * priv->height); - if (priv->components[1] == NULL) - priv->components[1] = (uint8_t *)priv->allocate_mem(priv->width * priv->height/4); - if (priv->components[2] == NULL) - priv->components[2] = (uint8_t *)priv->allocate_mem(priv->width * priv->height/4); - bytes_per_blocklines[0] = priv->width; - bytes_per_blocklines[1] = priv->width/4; - bytes_per_blocklines[2] = priv->width/4; - bytes_per_mcu[0] = 8; - bytes_per_mcu[1] = 4; - bytes_per_mcu[2] = 4; - break; - - case TINYJPEG_FMT_RGB24: - colorspace_array_conv = convert_colorspace_rgb24; - if (priv->components[0] == NULL) - priv->components[0] = (uint8_t *)priv->allocate_mem(priv->width * priv->height * 3); - bytes_per_blocklines[0] = priv->width * 3; - bytes_per_mcu[0] = 3*8; - break; - - case TINYJPEG_FMT_BGR24: - colorspace_array_conv = convert_colorspace_bgr24; - if (priv->components[0] == NULL) - priv->components[0] = (uint8_t *)priv->allocate_mem(priv->width * priv->height * 3); - bytes_per_blocklines[0] = priv->width * 3; - bytes_per_mcu[0] = 3*8; - break; - - case TINYJPEG_FMT_GREY: - decode_mcu_table = decode_mcu_1comp_table; - colorspace_array_conv = convert_colorspace_grey; - if (priv->components[0] == NULL) - priv->components[0] = (uint8_t *)priv->allocate_mem(priv->width * priv->height); - bytes_per_blocklines[0] = priv->width; - bytes_per_mcu[0] = 8; - break; - - default: - trace("Bad pixel format\n"); - return -1; - } - - xstride_by_mcu = ystride_by_mcu = 8; - if ((priv->component_infos[cY].Hfactor | priv->component_infos[cY].Vfactor) == 1) { - decode_MCU = decode_mcu_table[0]; - convert_to_pixfmt = colorspace_array_conv[0]; - trace("Use decode 1x1 sampling\n"); - } else if (priv->component_infos[cY].Hfactor == 1) { - decode_MCU = decode_mcu_table[1]; - convert_to_pixfmt = colorspace_array_conv[1]; - ystride_by_mcu = 16; - trace("Use decode 1x2 sampling (not supported)\n"); - } else if (priv->component_infos[cY].Vfactor == 2) { - decode_MCU = decode_mcu_table[3]; - convert_to_pixfmt = colorspace_array_conv[3]; - xstride_by_mcu = 16; - ystride_by_mcu = 16; - trace("Use decode 2x2 sampling\n"); - } else { - decode_MCU = decode_mcu_table[2]; - convert_to_pixfmt = colorspace_array_conv[2]; - xstride_by_mcu = 16; - trace("Use decode 2x1 sampling\n"); - } - - resync(priv); - - /* Don't forget to that block can be either 8 or 16 lines */ - bytes_per_blocklines[0] *= ystride_by_mcu; - bytes_per_blocklines[1] *= ystride_by_mcu; - bytes_per_blocklines[2] *= ystride_by_mcu; - - bytes_per_mcu[0] *= xstride_by_mcu/8; - bytes_per_mcu[1] *= xstride_by_mcu/8; - bytes_per_mcu[2] *= xstride_by_mcu/8; - - /* Just the decode the image by macroblock (size is 8x8, 8x16, or 16x16) */ - - - - for (y=0; y < priv->height; y+=ystride_by_mcu) - { - //trace("Decoding row %d\n", y); - /// priv->plane[0] = priv->components[0] + (y/ystride_by_mcu * bytes_per_blocklines[0]); - /// priv->plane[1] = priv->components[1] + (y/ystride_by_mcu * bytes_per_blocklines[1]); - /// priv->plane[2] = priv->components[2] + (y/ystride_by_mcu * bytes_per_blocklines[2]); - for (x=0; x < priv->width; x+=xstride_by_mcu) - { - int i,copy_x,copy_y; - decode_MCU(priv); - convert_to_pixfmt(priv); - //priv->plane[0] += bytes_per_mcu[0]; - //priv->plane[1] += bytes_per_mcu[1]; - //priv->plane[2] += bytes_per_mcu[2]; - - copy_x=priv->width-x; - if (copy_x>xstride_by_mcu) - copy_x=xstride_by_mcu; - - copy_y=priv->height-y; - if (copy_y>ystride_by_mcu) - copy_y=ystride_by_mcu; - - for(i=0;i<copy_y;i++) { - unsigned char *dst = &priv->components[0][((y+i)*priv->width+x)*3]; - memcpy(dst,&priv->decomp_block[i][0],copy_x*3); - } - - if (priv->restarts_to_go>0) - { - priv->restarts_to_go--; - if (priv->restarts_to_go == 0) - { - priv->stream -= (priv->nbits_in_reservoir/8); - resync(priv); - if (find_next_rst_marker(priv) < 0) - return -1; - } - } - } - } - - trace("Input file size: %d\n", priv->stream_length+2); - trace("Input bytes actually read: %d\n", priv->stream - priv->stream_begin + 2); - - return 0; -} - -const char *tinyjpeg_get_errorstring(struct jdec_private *priv) -{ - /* FIXME: the error string must be store in the context */ - priv = priv; - return error_string; -} - -void tinyjpeg_get_size(struct jdec_private *priv, unsigned int *width, unsigned int *height) -{ - *width = priv->width; - *height = priv->height; -} - -int tinyjpeg_get_components(struct jdec_private *priv, unsigned char **components) -{ - int i; - for (i=0; priv->components[i] && i<COMPONENTS; i++) - components[i] = priv->components[i]; - return 0; -} - -int tinyjpeg_set_components(struct jdec_private *priv, unsigned char **components, unsigned int ncomponents) -{ - unsigned int i; - if (ncomponents > COMPONENTS) - ncomponents = COMPONENTS; - for (i=0; i<ncomponents; i++) - priv->components[i] = components[i]; - return 0; -} - -int tinyjpeg_set_flags(struct jdec_private *priv, int flags) -{ - int oldflags = priv->flags; - priv->flags = flags; - return oldflags; -} - diff --git a/drivers/jpg/tinyjpeg.h b/drivers/jpg/tinyjpeg.h deleted file mode 100644 index fe4652360b..0000000000 --- a/drivers/jpg/tinyjpeg.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Small jpeg decoder library (header file) - * - * Copyright (c) 2006, Luc Saillard <luc@saillard.org> - * All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * - Neither the name of the author nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - */ - - -#ifndef __JPEGDEC_H__ -#define __JPEGDEC_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -struct jdec_private; - -/* Flags that can be set by any applications */ -#define TINYJPEG_FLAGS_MJPEG_TABLE (1<<1) - -/* Format accepted in outout */ -enum tinyjpeg_fmt { - TINYJPEG_FMT_GREY = 1, - TINYJPEG_FMT_BGR24, - TINYJPEG_FMT_RGB24, - TINYJPEG_FMT_YUV420P, -}; - -struct jdec_private *tinyjpeg_init(void *(*allocate_mem)(unsigned int),void (*free_mem)(void *)); - -void tinyjpeg_free(struct jdec_private *priv); - -int tinyjpeg_parse_header(struct jdec_private *priv, const unsigned char *buf, unsigned int size); -int tinyjpeg_decode(struct jdec_private *priv, int pixel_format); -const char *tinyjpeg_get_errorstring(struct jdec_private *priv); -void tinyjpeg_get_size(struct jdec_private *priv, unsigned int *width, unsigned int *height); -int tinyjpeg_get_components(struct jdec_private *priv, unsigned char **components); -int tinyjpeg_set_components(struct jdec_private *priv, unsigned char **components, unsigned int ncomponents); -int tinyjpeg_set_flags(struct jdec_private *priv, int flags); - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/drivers/nedmalloc/memory_pool_static_nedmalloc.cpp b/drivers/nedmalloc/memory_pool_static_nedmalloc.cpp index 76090844fe..301e94bb7b 100644 --- a/drivers/nedmalloc/memory_pool_static_nedmalloc.cpp +++ b/drivers/nedmalloc/memory_pool_static_nedmalloc.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/drivers/nedmalloc/memory_pool_static_nedmalloc.h b/drivers/nedmalloc/memory_pool_static_nedmalloc.h index 49f648a37b..20b060537c 100644 --- a/drivers/nedmalloc/memory_pool_static_nedmalloc.h +++ b/drivers/nedmalloc/memory_pool_static_nedmalloc.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/drivers/nrex/regex.cpp b/drivers/nrex/regex.cpp index e8578221a9..459cf28e1e 100644 --- a/drivers/nrex/regex.cpp +++ b/drivers/nrex/regex.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/drivers/nrex/regex.h b/drivers/nrex/regex.h index 76aab2aea6..ae8d40ceab 100644 --- a/drivers/nrex/regex.h +++ b/drivers/nrex/regex.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/drivers/opus/audio_stream_opus.cpp b/drivers/opus/audio_stream_opus.cpp index eb9c81e152..ab53fee0c9 100644 --- a/drivers/opus/audio_stream_opus.cpp +++ b/drivers/opus/audio_stream_opus.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Author: George Marques <george@gmarqu.es> */ /* */ diff --git a/drivers/opus/audio_stream_opus.h b/drivers/opus/audio_stream_opus.h index 2f173cc270..fc5531470d 100644 --- a/drivers/opus/audio_stream_opus.h +++ b/drivers/opus/audio_stream_opus.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Author: George Marques <george@gmarqu.es> */ /* */ diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp index 2a4720b07b..a86e747d80 100644 --- a/drivers/png/image_loader_png.cpp +++ b/drivers/png/image_loader_png.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/png/image_loader_png.h b/drivers/png/image_loader_png.h index 8413a7eae1..d87d67d898 100644 --- a/drivers/png/image_loader_png.h +++ b/drivers/png/image_loader_png.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp index 581efb5adc..b91329c8da 100644 --- a/drivers/png/resource_saver_png.cpp +++ b/drivers/png/resource_saver_png.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/pnm/SCsub b/drivers/pnm/SCsub new file mode 100644 index 0000000000..28b35773a4 --- /dev/null +++ b/drivers/pnm/SCsub @@ -0,0 +1,10 @@ +Import('env') + + +pnm_sources = [ + "pnm/bitmap_loader_pnm.cpp" + ] + +env.drivers_sources+=pnm_sources + +#env.add_source_files(env.drivers_sources, pnm_sources) diff --git a/drivers/pnm/bitmap_loader_pnm.cpp b/drivers/pnm/bitmap_loader_pnm.cpp new file mode 100644 index 0000000000..c9298be26a --- /dev/null +++ b/drivers/pnm/bitmap_loader_pnm.cpp @@ -0,0 +1,235 @@ +/*************************************************/ +/* image_loader_jpg.cpp */ +/*************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/*************************************************/ +/* Source code within this file is: */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ +/* All Rights Reserved. */ +/*************************************************/ + +#include "bitmap_loader_pnm.h" +#include "os/file_access.h" +#include "scene/resources/bit_mask.h" + + +static bool _get_token(FileAccessRef& f,uint8_t &saved,DVector<uint8_t>& r_token,bool p_binary=false,bool p_single_chunk=false) { + + + int token_max = r_token.size(); + DVector<uint8_t>::Write w; + if (token_max) + w=r_token.write(); + int ofs=0; + bool lf=false; + + + while(true) { + + uint8_t b; + if (saved) { + b=saved; + saved=0; + } else { + b = f->get_8(); + } + if (f->eof_reached()) { + if (ofs) { + w=DVector<uint8_t>::Write(); + r_token.resize(ofs); + return true; + } else { + return false; + } + } + + if (!ofs && !p_binary && b=='#') { + //skip comment + while(b!='\n') { + if (f->eof_reached()) { + return false; + } + + b = f->get_8(); + } + + lf=true; + + } else if (b<=32 && !(p_binary && (ofs || lf))) { + + if (b=='\n') { + lf=true; + } + + + if (ofs && !p_single_chunk) { + w=DVector<uint8_t>::Write(); + r_token.resize(ofs); + saved=b; + + return true; + } + } else { + + bool resized=false; + while (ofs>=token_max) { + if (token_max) + token_max<<=1; + else + token_max=1; + resized=true; + } + if (resized) { + w=DVector<uint8_t>::Write(); + r_token.resize(token_max); + w=r_token.write(); + } + w[ofs++]=b; + } + } + + return false; +} + +static int _get_number_from_token(DVector<uint8_t>& r_token) { + + int len = r_token.size(); + DVector<uint8_t>::Read r = r_token.read(); + return String::to_int((const char*)r.ptr(),len); + +} + + +RES ResourceFormatPBM::load(const String &p_path,const String& p_original_path,Error *r_error) { + +#define _RETURN(m_err)\ +{\ + if (r_error)\ + *r_error=m_err;\ + ERR_FAIL_V(RES());\ +} + + + FileAccessRef f=FileAccess::open(p_path,FileAccess::READ); + uint8_t saved=0; + if (!f) + _RETURN(ERR_CANT_OPEN); + + DVector<uint8_t> token; + + if (!_get_token(f,saved,token)) { + _RETURN(ERR_PARSE_ERROR); + } + + if (token.size()!=2) { + _RETURN(ERR_FILE_CORRUPT); + } + if (token[0]!='P') { + _RETURN(ERR_FILE_CORRUPT); + } + if (token[1]!='1' && token[1]!='4') { + _RETURN(ERR_FILE_CORRUPT); + } + + bool bits = token[1]=='4'; + + if (!_get_token(f,saved,token)) { + _RETURN(ERR_PARSE_ERROR); + } + + int width = _get_number_from_token(token); + if (width<=0) { + _RETURN(ERR_FILE_CORRUPT); + } + + + if (!_get_token(f,saved,token)) { + _RETURN(ERR_PARSE_ERROR); + } + + int height = _get_number_from_token(token); + if (height<=0) { + _RETURN(ERR_FILE_CORRUPT); + } + + + Ref<BitMap> bm; + bm.instance(); + bm->create(Size2i(width,height)); + + if (!bits) { + + int required_bytes = width*height; + if (!_get_token(f,saved,token,false,true)) { + _RETURN(ERR_PARSE_ERROR); + } + + if (token.size()<required_bytes) { + _RETURN(ERR_FILE_CORRUPT); + } + + DVector<uint8_t>::Read r=token.read(); + + for(int i=0;i<height;i++) { + for(int j=0;j<width;j++) { + + + char num = r[i*width+j]; + bm->set_bit(Point2i(j,i),num=='0'); + } + + } + + + + } else { + //a single, entire token of bits! + if (!_get_token(f,saved,token,true)) { + _RETURN(ERR_PARSE_ERROR); + } + int required_bytes = Math::ceil((width*height)/8.0); + if (token.size()<required_bytes) { + _RETURN(ERR_FILE_CORRUPT); + } + + DVector<uint8_t>::Read r=token.read(); + int bitwidth = width; + if (bitwidth % 8) + bitwidth+=8-(bitwidth%8); + + for(int i=0;i<height;i++) { + for(int j=0;j<width;j++) { + + int ofs = bitwidth*i+j; + + uint8_t byte = r[ofs/8]; + bool bit = (byte>>(7-(ofs%8)))&1; + + bm->set_bit(Point2i(j,i),!bit); + + } + + } + + } + + return bm; + + +} + +void ResourceFormatPBM::get_recognized_extensions(List<String> *p_extensions) const { + p_extensions->push_back("pbm"); +} +bool ResourceFormatPBM::handles_type(const String& p_type) const { + return p_type=="BitMap"; +} +String ResourceFormatPBM::get_resource_type(const String &p_path) const { + + if (p_path.extension().to_lower()=="pbm") + return "BitMap"; + return ""; +} + + diff --git a/drivers/pnm/bitmap_loader_pnm.h b/drivers/pnm/bitmap_loader_pnm.h new file mode 100644 index 0000000000..6e6c8a59c8 --- /dev/null +++ b/drivers/pnm/bitmap_loader_pnm.h @@ -0,0 +1,33 @@ +/*************************************************/ +/* image_loader_jpg.h */ +/*************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/*************************************************/ +/* Source code within this file is: */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ +/* All Rights Reserved. */ +/*************************************************/ + +#ifndef BITMAP_LOADER_PNM_H +#define BITMAP_LOADER_PNM_H + +#include "io/resource_loader.h" + +/** + @author Juan Linietsky <reduzio@gmail.com> +*/ +class ResourceFormatPBM : public ResourceFormatLoader { + + +public: + + virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL); + virtual void get_recognized_extensions(List<String> *p_extensions) const; + virtual bool handles_type(const String& p_type) const; + virtual String get_resource_type(const String &p_path) const; +}; + + + +#endif diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 4cda141f92..813a95816b 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.h b/drivers/pulseaudio/audio_driver_pulseaudio.h index e7c8bcce36..8a2fbfd38b 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.h +++ b/drivers/pulseaudio/audio_driver_pulseaudio.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp index 11c4e7dd29..e7bbf28f01 100644 --- a/drivers/register_driver_types.cpp +++ b/drivers/register_driver_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ @@ -14,11 +14,12 @@ #include "png/image_loader_png.h" #include "webp/image_loader_webp.h" #include "png/resource_saver_png.h" -#include "jpg/image_loader_jpg.h" +#include "jpegd/image_loader_jpegd.h" #include "dds/texture_loader_dds.h" #include "pvr/texture_loader_pvr.h" #include "etc1/image_etc.h" #include "chibi/event_stream_chibi.h" +#include "pnm/bitmap_loader_pnm.h" #ifdef TOOLS_ENABLED @@ -112,6 +113,9 @@ static ResourceFormatLoaderAudioStreamMPC * mpc_stream_loader=NULL; #include "openssl/register_openssl.h" #endif + +static ResourceFormatPBM * pbm_loader=NULL; + void register_core_driver_types() { #ifdef PNG_ENABLED @@ -138,6 +142,9 @@ void register_core_driver_types() { ImageLoader::add_image_format_loader( image_loader_jpg ); #endif + pbm_loader = memnew( ResourceFormatPBM ); + ResourceLoader::add_resource_format_loader(pbm_loader); + ObjectTypeDB::register_type<RegEx>(); } @@ -162,6 +169,7 @@ void unregister_core_driver_types() { memdelete( image_loader_jpg ); #endif + memdelete( pbm_loader ); } diff --git a/drivers/register_driver_types.h b/drivers/register_driver_types.h index 9ae4b0be08..8a13ad4471 100644 --- a/drivers/register_driver_types.h +++ b/drivers/register_driver_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/drivers/rtaudio/RtAudio.cpp b/drivers/rtaudio/RtAudio.cpp index 72ca836907..86981e56d2 100644 --- a/drivers/rtaudio/RtAudio.cpp +++ b/drivers/rtaudio/RtAudio.cpp @@ -139,8 +139,7 @@ void RtAudio :: getCompiledApi( std::vector<RtAudio::Api> &apis ) throw() void RtAudio :: openRtApi( RtAudio::Api api ) { - if ( rtapi_ ) - delete rtapi_; + delete rtapi_; rtapi_ = 0; #if defined(__UNIX_JACK__) @@ -216,8 +215,7 @@ RtAudio :: RtAudio( RtAudio::Api api ) RtAudio :: ~RtAudio() throw() { - if ( rtapi_ ) - delete rtapi_; + delete rtapi_; } void RtAudio :: openStream( RtAudio::StreamParameters *outputParameters, diff --git a/drivers/rtaudio/audio_driver_rtaudio.cpp b/drivers/rtaudio/audio_driver_rtaudio.cpp index 7bee495869..335f4b632f 100644 --- a/drivers/rtaudio/audio_driver_rtaudio.cpp +++ b/drivers/rtaudio/audio_driver_rtaudio.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/drivers/rtaudio/audio_driver_rtaudio.h b/drivers/rtaudio/audio_driver_rtaudio.h index a16470d701..115953ce1f 100644 --- a/drivers/rtaudio/audio_driver_rtaudio.h +++ b/drivers/rtaudio/audio_driver_rtaudio.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index 0c0867e030..23a63be339 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/dir_access_unix.h b/drivers/unix/dir_access_unix.h index 3091e01511..9cba1ed3e0 100644 --- a/drivers/unix/dir_access_unix.h +++ b/drivers/unix/dir_access_unix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index 8e70ecc932..9f24633bd4 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -75,6 +75,8 @@ Error FileAccessUnix::_open(const String& p_path, int p_mode_flags) { mode_string="wb"; else if (p_mode_flags==READ_WRITE) mode_string="rb+"; + else if (p_mode_flags==WRITE_READ) + mode_string="wb+"; else return ERR_INVALID_PARAMETER; diff --git a/drivers/unix/file_access_unix.h b/drivers/unix/file_access_unix.h index 6c41a51ec5..d6a172bf47 100644 --- a/drivers/unix/file_access_unix.h +++ b/drivers/unix/file_access_unix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp index 989aba52bb..535a425302 100644 --- a/drivers/unix/ip_unix.cpp +++ b/drivers/unix/ip_unix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/ip_unix.h b/drivers/unix/ip_unix.h index 5798ac8137..c0034c9a3a 100644 --- a/drivers/unix/ip_unix.h +++ b/drivers/unix/ip_unix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/memory_pool_static_malloc.cpp b/drivers/unix/memory_pool_static_malloc.cpp index e0bab27a63..1a79272dc1 100644 --- a/drivers/unix/memory_pool_static_malloc.cpp +++ b/drivers/unix/memory_pool_static_malloc.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/memory_pool_static_malloc.h b/drivers/unix/memory_pool_static_malloc.h index a96259556d..78ad82ee22 100644 --- a/drivers/unix/memory_pool_static_malloc.h +++ b/drivers/unix/memory_pool_static_malloc.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/mutex_posix.cpp b/drivers/unix/mutex_posix.cpp index 73563ea538..fb4fa4a891 100644 --- a/drivers/unix/mutex_posix.cpp +++ b/drivers/unix/mutex_posix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/mutex_posix.h b/drivers/unix/mutex_posix.h index 9b50d7963e..a1993be221 100644 --- a/drivers/unix/mutex_posix.h +++ b/drivers/unix/mutex_posix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 94a7b03f45..a004a116e0 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -78,11 +78,11 @@ void OS_Unix::print_error(const char* p_function,const char* p_file,int p_line,c break; case ERR_WARNING: print("\E[1;33mWARNING: %s: \E[0m\E[1m%s\n",p_function,err_details); - print("\E[0;33m At: %s:%i.\E[0m\n",p_file,p_line); + print("\E[0;33m At: %s:%i.\E[0m\n",p_file,p_line); break; case ERR_SCRIPT: print("\E[1;35mSCRIPT ERROR: %s: \E[0m\E[1m%s\n",p_function,err_details); - print("\E[0;35m At: %s:%i.\E[0m\n",p_file,p_line); + print("\E[0;35m At: %s:%i.\E[0m\n",p_file,p_line); break; } } @@ -149,8 +149,7 @@ void OS_Unix::finalize_core() { if (mempool_dynamic) memdelete( mempool_dynamic ); - if (mempool_static) - delete mempool_static; + delete mempool_static; } @@ -233,13 +232,12 @@ uint64_t OS_Unix::get_unix_time() const { return time(NULL); }; -uint64_t OS_Unix::get_system_time_msec() const { +uint64_t OS_Unix::get_system_time_secs() const { struct timeval tv_now; gettimeofday(&tv_now, NULL); //localtime(&tv_now.tv_usec); //localtime((const long *)&tv_now.tv_usec); - uint64_t msec = uint64_t(tv_now.tv_sec)*1000+tv_now.tv_usec/1000; - return msec; + return uint64_t(tv_now.tv_sec); } diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h index 9ac18c9055..a889bba0ff 100644 --- a/drivers/unix/os_unix.h +++ b/drivers/unix/os_unix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -95,7 +95,7 @@ public: virtual TimeZoneInfo get_time_zone_info() const; virtual uint64_t get_unix_time() const; - virtual uint64_t get_system_time_msec() const; + virtual uint64_t get_system_time_secs() const; virtual void delay_usec(uint32_t p_usec) const; virtual uint64_t get_ticks_usec() const; diff --git a/drivers/unix/semaphore_posix.cpp b/drivers/unix/semaphore_posix.cpp index fba4cd3641..3ae94ae5d9 100644 --- a/drivers/unix/semaphore_posix.cpp +++ b/drivers/unix/semaphore_posix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,7 +42,7 @@ Error SemaphorePosix::wait() { errno=0; continue; } else { -perror("sem waiting"); + perror("sem waiting"); return ERR_BUSY; } } diff --git a/drivers/unix/semaphore_posix.h b/drivers/unix/semaphore_posix.h index 6f938455b3..0a3cf36749 100644 --- a/drivers/unix/semaphore_posix.h +++ b/drivers/unix/semaphore_posix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index edf5e02971..45a4b934c1 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/stream_peer_tcp_posix.h b/drivers/unix/stream_peer_tcp_posix.h index 817f24c91c..a379efe3ca 100644 --- a/drivers/unix/stream_peer_tcp_posix.h +++ b/drivers/unix/stream_peer_tcp_posix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/tcp_server_posix.cpp b/drivers/unix/tcp_server_posix.cpp index aaca0fe0d8..98451957fd 100644 --- a/drivers/unix/tcp_server_posix.cpp +++ b/drivers/unix/tcp_server_posix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/tcp_server_posix.h b/drivers/unix/tcp_server_posix.h index 17a9fd1d98..570bcaab12 100644 --- a/drivers/unix/tcp_server_posix.h +++ b/drivers/unix/tcp_server_posix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/thread_posix.cpp b/drivers/unix/thread_posix.cpp index 1c18ebd855..bd33c81298 100644 --- a/drivers/unix/thread_posix.cpp +++ b/drivers/unix/thread_posix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,6 +30,10 @@ #if defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED) +#ifdef PTHREAD_BSD_SET_NAME +#include <pthread_np.h> +#endif + #include "os/memory.h" Thread::ID ThreadPosix::get_ID() const { @@ -100,9 +104,14 @@ Error ThreadPosix::set_name(const String& p_name) { #else + #ifdef PTHREAD_BSD_SET_NAME + pthread_set_name_np(pthread, p_name.utf8().get_data()); + int err = 0; // Open/FreeBSD ignore errors in this function + #else int err = pthread_setname_np(pthread, p_name.utf8().get_data()); + #endif // PTHREAD_BSD_SET_NAME - #endif + #endif // PTHREAD_RENAME_SELF return err == 0 ? OK : ERR_INVALID_PARAMETER; diff --git a/drivers/unix/thread_posix.h b/drivers/unix/thread_posix.h index 215da444e7..179d56d5bd 100644 --- a/drivers/unix/thread_posix.h +++ b/drivers/unix/thread_posix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/vorbis/audio_stream_ogg_vorbis.cpp b/drivers/vorbis/audio_stream_ogg_vorbis.cpp index 9a60098526..4ce7940a01 100644 --- a/drivers/vorbis/audio_stream_ogg_vorbis.cpp +++ b/drivers/vorbis/audio_stream_ogg_vorbis.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/vorbis/audio_stream_ogg_vorbis.h b/drivers/vorbis/audio_stream_ogg_vorbis.h index 5dbada962a..bb4d521c1e 100644 --- a/drivers/vorbis/audio_stream_ogg_vorbis.h +++ b/drivers/vorbis/audio_stream_ogg_vorbis.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/webp/image_loader_webp.cpp b/drivers/webp/image_loader_webp.cpp index 9d8a616556..5fb14eaf7a 100644 --- a/drivers/webp/image_loader_webp.cpp +++ b/drivers/webp/image_loader_webp.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/drivers/webp/image_loader_webp.h b/drivers/webp/image_loader_webp.h index 8fc188cc9c..ea99a60676 100644 --- a/drivers/webp/image_loader_webp.h +++ b/drivers/webp/image_loader_webp.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/drivers/webpold/image_loader_webp.cpp b/drivers/webpold/image_loader_webp.cpp index 9d8a616556..5fb14eaf7a 100644 --- a/drivers/webpold/image_loader_webp.cpp +++ b/drivers/webpold/image_loader_webp.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/drivers/webpold/image_loader_webp.h b/drivers/webpold/image_loader_webp.h index 8fc188cc9c..ea99a60676 100644 --- a/drivers/webpold/image_loader_webp.h +++ b/drivers/webpold/image_loader_webp.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index 7c81e8e051..0a413979fc 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/dir_access_windows.h b/drivers/windows/dir_access_windows.h index 384bc8327d..6861291fd9 100644 --- a/drivers/windows/dir_access_windows.h +++ b/drivers/windows/dir_access_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index 90903f2cbd..66181a6f44 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -72,6 +72,8 @@ Error FileAccessWindows::_open(const String& p_filename, int p_mode_flags) { mode_string=L"wb"; else if (p_mode_flags==READ_WRITE) mode_string=L"rb+"; + else if (p_mode_flags==WRITE_READ) + mode_string=L"wb+"; else return ERR_INVALID_PARAMETER; diff --git a/drivers/windows/file_access_windows.h b/drivers/windows/file_access_windows.h index a2598bfeec..b02b6f66a7 100644 --- a/drivers/windows/file_access_windows.h +++ b/drivers/windows/file_access_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/mutex_windows.cpp b/drivers/windows/mutex_windows.cpp index 09f8590510..f63415d0f8 100644 --- a/drivers/windows/mutex_windows.cpp +++ b/drivers/windows/mutex_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/mutex_windows.h b/drivers/windows/mutex_windows.h index 9447f17a1c..4cff027906 100644 --- a/drivers/windows/mutex_windows.h +++ b/drivers/windows/mutex_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/semaphore_windows.cpp b/drivers/windows/semaphore_windows.cpp index 50cdf7cce5..74094f482a 100644 --- a/drivers/windows/semaphore_windows.cpp +++ b/drivers/windows/semaphore_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/semaphore_windows.h b/drivers/windows/semaphore_windows.h index 43f6c0b560..e8836e49dc 100644 --- a/drivers/windows/semaphore_windows.h +++ b/drivers/windows/semaphore_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/shell_windows.cpp b/drivers/windows/shell_windows.cpp index 670f4e483d..c69d371a65 100644 --- a/drivers/windows/shell_windows.cpp +++ b/drivers/windows/shell_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/shell_windows.h b/drivers/windows/shell_windows.h index 98eae81175..6f97964a09 100644 --- a/drivers/windows/shell_windows.h +++ b/drivers/windows/shell_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/thread_windows.cpp b/drivers/windows/thread_windows.cpp index 6a9e97ba01..d5e489aab4 100644 --- a/drivers/windows/thread_windows.cpp +++ b/drivers/windows/thread_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/thread_windows.h b/drivers/windows/thread_windows.h index 3c8f92ce57..b051bfe370 100644 --- a/drivers/windows/thread_windows.h +++ b/drivers/windows/thread_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/main/input_default.cpp b/main/input_default.cpp index 4141102bf6..a79199580b 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -545,7 +545,12 @@ uint32_t InputDefault::joy_button(uint32_t p_last_id, int p_device, int p_button JoyEvent map = el->get(); if (map.type == TYPE_BUTTON) { - + //fake additional axis event for triggers + if (map.index == JOY_L2 || map.index == JOY_R2) { + float value = p_pressed ? 1.0f : 0.0f; + int axis = map.index == JOY_L2 ? JOY_ANALOG_L2 : JOY_ANALOG_R2; + p_last_id = _axis_event(p_last_id, p_device, axis, value); + } return _button_event(p_last_id, p_device, map.index, p_pressed); }; @@ -580,8 +585,9 @@ uint32_t InputDefault::joy_axis(uint32_t p_last_id, int p_device, int p_axis, co joy.last_axis[p_axis] = p_value.value; + float val = p_value.min == 0 ? -1.0f + 2.0f * p_value.value : p_value.value; + if (joy.mapping == -1) { - float val = p_value.min == 0 ? -1.0f + 2.0f * p_value.value : p_value.value; return _axis_event(p_last_id, p_device, p_axis, val); }; @@ -595,6 +601,12 @@ uint32_t InputDefault::joy_axis(uint32_t p_last_id, int p_device, int p_axis, co JoyEvent map = el->get(); if (map.type == TYPE_BUTTON) { + //send axis event for triggers + if (map.index == JOY_L2 || map.index == JOY_R2) { + float value = p_value.min == 0 ? p_value.value : 0.5f + p_value.value / 2.0f; + int axis = map.index == JOY_L2 ? JOY_ANALOG_L2 : JOY_ANALOG_R2; + p_last_id = _axis_event(p_last_id, p_device, axis, value); + } float deadzone = p_value.min == 0 ? 0.5f : 0.0f; bool pressed = p_value.value > deadzone ? true : false; if (pressed == joy_buttons_pressed.has(_combine_device(map.index,p_device))) { @@ -606,7 +618,6 @@ uint32_t InputDefault::joy_axis(uint32_t p_last_id, int p_device, int p_axis, co if (map.type == TYPE_AXIS) { - float val = p_value.min == 0 ? -1.0f + 2.0f * p_value.value : p_value.value; return _axis_event(p_last_id, p_device, map.index, val ); }; //printf("invalid mapping\n"); @@ -770,3 +781,49 @@ void InputDefault::parse_mapping(String p_mapping) { map_db.push_back(mapping); //printf("added mapping with uuid %ls\n", mapping.uid.c_str()); }; + +void InputDefault::add_joy_mapping(String p_mapping, bool p_update_existing) { + parse_mapping(p_mapping); + if (p_update_existing) { + Vector<String> entry = p_mapping.split(","); + String uid = entry[0]; + for (int i=0; i<joy_names.size(); i++) { + if (uid == joy_names[i].uid) { + joy_names[i].mapping = map_db.size() -1; + } + } + } +} + +void InputDefault::remove_joy_mapping(String p_guid) { + for (int i=map_db.size()-1; i >= 0;i--) { + if (p_guid == map_db[i].uid) { + map_db.remove(i); + } + } + for (int i=0; i<joy_names.size(); i++) { + if (joy_names[i].uid == p_guid) { + joy_names[i].mapping = -1; + } + } +} + +//Defaults to simple implementation for platforms with a fixed gamepad layout, like consoles. +bool InputDefault::is_joy_known(int p_device) { + + return OS::get_singleton()->is_joy_known(p_device); +} + +String InputDefault::get_joy_guid(int p_device) const { + return OS::get_singleton()->get_joy_guid(p_device); +} + +//platforms that use the remapping system can override and call to these ones +bool InputDefault::is_joy_mapped(int p_device) { + return joy_names[p_device].mapping != -1 ? true : false; +} + +String InputDefault::get_joy_guid_remapped(int p_device) const { + return joy_names[p_device].uid; +} + diff --git a/main/input_default.h b/main/input_default.h index 6645817b31..bbfd9ced2c 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -56,6 +56,7 @@ class InputDefault : public Input { } last_hat = HAT_MASK_CENTER; filter = 0.01f; + mapping = -1; } }; @@ -161,6 +162,14 @@ public: uint32_t joy_axis(uint32_t p_last_id, int p_device, int p_axis, const JoyAxis& p_value); uint32_t joy_hat(uint32_t p_last_id, int p_device, int p_val); + virtual void add_joy_mapping(String p_mapping, bool p_update_existing=false); + virtual void remove_joy_mapping(String p_guid); + virtual bool is_joy_known(int p_device); + virtual String get_joy_guid(int p_device) const; + + bool is_joy_mapped(int p_device); + String get_joy_guid_remapped(int p_device) const; + InputDefault(); }; diff --git a/main/main.cpp b/main/main.cpp index 66391ffa7e..8319c415fc 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -56,7 +56,7 @@ #ifdef TOOLS_ENABLED #include "tools/editor/editor_node.h" #include "tools/editor/project_manager.h" -#include "tools/editor/console.h" + #include "tools/pck/pck_packer.h" #endif @@ -124,7 +124,7 @@ static String unescape_cmdline(const String& p_str) { void Main::print_help(const char* p_binary) { - OS::get_singleton()->print(VERSION_FULL_NAME" (c) 2008-2015 Juan Linietsky, Ariel Manzur.\n"); + OS::get_singleton()->print(VERSION_FULL_NAME" (c) 2008-2016 Juan Linietsky, Ariel Manzur.\n"); OS::get_singleton()->print("Usage: %s [options] [scene]\n",p_binary); OS::get_singleton()->print("Options:\n"); OS::get_singleton()->print("\t-path [dir] : Path to a game, containing engine.cfg\n"); @@ -714,8 +714,12 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas } - if (rtm>=0 && rtm<3) + if (rtm>=0 && rtm<3) { + if (editor) { + rtm=OS::RENDER_THREAD_SAFE; + } OS::get_singleton()->_render_thread_mode=OS::RenderThreadMode(rtm); + } @@ -1323,6 +1327,8 @@ bool Main::start() { //autoload List<PropertyInfo> props; Globals::get_singleton()->get_property_list(&props); + + //first pass, add the constants so they exist before any script is loaded for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) { String s = E->get().name; @@ -1330,6 +1336,34 @@ bool Main::start() { continue; String name = s.get_slicec('/',1); String path = Globals::get_singleton()->get(s); + bool global_var=false; + if (path.begins_with("*")) { + global_var=true; + } + + if (global_var) { + for(int i=0;i<ScriptServer::get_language_count();i++) { + ScriptServer::get_language(i)->add_global_constant(name,Variant()); + } + } + + } + + //second pass, load into global constants + List<Node*> to_add; + for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) { + + String s = E->get().name; + if (!s.begins_with("autoload/")) + continue; + String name = s.get_slicec('/',1); + String path = Globals::get_singleton()->get(s); + bool global_var=false; + if (path.begins_with("*")) { + global_var=true; + path=path.substr(1,path.length()-1); + } + RES res = ResourceLoader::load(path); ERR_EXPLAIN("Can't autoload: "+path); ERR_CONTINUE(res.is_null()); @@ -1340,12 +1374,13 @@ bool Main::start() { } else if (res->is_type("Script")) { Ref<Script> s = res; StringName ibt = s->get_instance_base_type(); + bool valid_type = ObjectTypeDB::is_type(ibt,"Node"); ERR_EXPLAIN("Script does not inherit a Node: "+path); - ERR_CONTINUE( !ObjectTypeDB::is_type(ibt,"Node") ); + ERR_CONTINUE( !valid_type ); Object *obj = ObjectTypeDB::instance(ibt); - ERR_EXPLAIN("Cannot instance node for autoload type: "+String(ibt)); + ERR_EXPLAIN("Cannot instance script for autoload, expected 'Node' inheritance, got: "+String(ibt)); ERR_CONTINUE( obj==NULL ); n = obj->cast_to<Node>(); @@ -1355,9 +1390,26 @@ bool Main::start() { ERR_EXPLAIN("Path in autoload not a node or script: "+path); ERR_CONTINUE(!n); n->set_name(name); - sml->get_root()->add_child(n); + + //defer so references are all valid on _ready() + //sml->get_root()->add_child(n); + to_add.push_back(n); + + if (global_var) { + for(int i=0;i<ScriptServer::get_language_count();i++) { + ScriptServer::get_language(i)->add_global_constant(name,n); + } + } + } + for(List<Node*>::Element *E=to_add.front();E;E=E->next()) { + + sml->get_root()->add_child(E->get()); + } + + + } Node *scene=NULL; diff --git a/main/main.h b/main/main.h index 12b4411d56..bc8b18776e 100644 --- a/main/main.h +++ b/main/main.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/main/performance.cpp b/main/performance.cpp index f8c5df42d1..13ae0504f6 100644 --- a/main/performance.cpp +++ b/main/performance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/main/performance.h b/main/performance.h index f0cd217b2b..81e42710ca 100644 --- a/main/performance.h +++ b/main/performance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/main/splash.h b/main/splash.h index f69383cf00..832f504288 100644 --- a/main/splash.h +++ b/main/splash.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/methods.py b/methods.py index 21c2293bf0..a894973e69 100755 --- a/methods.py +++ b/methods.py @@ -1274,30 +1274,35 @@ def win32_spawn(sh, escape, cmd, args, spawnenv): return exit_code """ -def android_module_source(self,subpath,manifest=""): - base_path = "../../../modules/"+self.current_module+"/"+subpath - self.android_source_modules.append(base_path) - -def android_module_library(self,subpath,manifest=""): - base_path = "" - if (os.path.isabs(subpath)): - base_path=subpath - else: - base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+subpath - self.android_module_libraries.append(base_path) - -def android_module_file(self,file): - base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+file - self.android_source_files.append(base_path) -def android_module_manifest(self,file): +def android_add_maven_repository(self,url): + self.android_maven_repos.append(url) + +def android_add_dependency(self,depline): + self.android_dependencies.append(depline) + +def android_add_java_dir(self,subpath): + base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+subpath + self.android_java_dirs.append(base_path) + +def android_add_res_dir(self,subpath): + base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+subpath + self.android_res_dirs.append(base_path) +def android_add_aidl_dir(self,file): + base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+subpath + self.android_aidl_dirs.append(base_path) +def android_add_jni_dir(self,file): + base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+subpath + self.android_jni_dirs.append(base_path) + +def android_add_to_manifest(self,file): base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+file f = open(base_path,"rb") self.android_manifest_chunk+=f.read() -def android_module_permission(self,file): +def android_add_to_permissions(self,file): base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+file f = open(base_path,"rb") self.android_permission_chunk+=f.read() -def android_module_attribute(self,file): +def android_add_to_attributes(self,file): base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+file f = open(base_path,"rb") self.android_appattributes_chunk+=f.read() diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index a62225f663..53519030fc 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1156,6 +1156,10 @@ Error GDCompiler::_parse_block(CodeGen& codegen,const GDParser::BlockNode *p_blo codegen.opcodes.push_back(GDFunction::OPCODE_ASSERT); codegen.opcodes.push_back(ret); } break; + case GDParser::Node::TYPE_BREAKPOINT: { + // try subblocks + codegen.opcodes.push_back(GDFunction::OPCODE_BREAKPOINT); + } break; case GDParser::Node::TYPE_LOCAL_VAR: { @@ -1181,7 +1185,7 @@ Error GDCompiler::_parse_block(CodeGen& codegen,const GDParser::BlockNode *p_blo } -Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode *p_class,const GDParser::FunctionNode *p_func) { +Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode *p_class,const GDParser::FunctionNode *p_func,bool p_for_ready) { Vector<int> bytecode; CodeGen codegen; @@ -1212,9 +1216,9 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode * /* Parse initializer -if applies- */ - bool is_initializer=false || !p_func; + bool is_initializer=!p_for_ready && !p_func; - if (!p_func || String(p_func->name)=="_init") { + if (is_initializer || (p_func && String(p_func->name)=="_init")) { //parse initializer for class members if (!p_func && p_class->extends_used && p_script->native.is_null()){ @@ -1232,12 +1236,24 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode * } + if (p_for_ready || (p_func && String(p_func->name)=="_ready")) { + //parse initializer for class members + if (p_class->ready->statements.size()) { + Error err = _parse_block(codegen,p_class->ready,stack_level); + if (err) + return err; + } + + } + + /* Parse default argument code -if applies- */ Vector<int> defarg_addr; StringName func_name; if (p_func) { + if (p_func->default_values.size()) { codegen.opcodes.push_back(GDFunction::OPCODE_JUMP_TO_DEF_ARGUMENT); @@ -1260,7 +1276,10 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode * func_name=p_func->name; } else { - func_name="_init"; + if (p_for_ready) + func_name="_ready"; + else + func_name="_init"; } codegen.opcodes.push_back(GDFunction::OPCODE_END); @@ -1328,7 +1347,7 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode * if (defarg_addr.size()) { gdfunc->default_arguments=defarg_addr; - gdfunc->_default_arg_count=defarg_addr.size(); + gdfunc->_default_arg_count=defarg_addr.size()-1; gdfunc->_default_arg_ptr=&gdfunc->default_arguments[0]; } else { gdfunc->_default_arg_count=0; @@ -1614,10 +1633,14 @@ Error GDCompiler::_parse_class(GDScript *p_script,GDScript *p_owner,const GDPars //parse methods bool has_initializer=false; + bool has_ready=false; + for(int i=0;i<p_class->functions.size();i++) { if (!has_initializer && p_class->functions[i]->name=="_init") has_initializer=true; + if (!has_ready && p_class->functions[i]->name=="_ready") + has_ready=true; Error err = _parse_function(p_script,p_class,p_class->functions[i]); if (err) return err; @@ -1640,6 +1663,13 @@ Error GDCompiler::_parse_class(GDScript *p_script,GDScript *p_owner,const GDPars return err; } + if (!has_ready && p_class->ready->statements.size()) { + //create a constructor + Error err = _parse_function(p_script,p_class,NULL,true); + if (err) + return err; + } + #ifdef DEBUG_ENABLED //validate setters/getters if debug is enabled for(int i=0;i<p_class->variables.size();i++) { diff --git a/modules/gdscript/gd_compiler.h b/modules/gdscript/gd_compiler.h index bdf4e9816a..5bf7ec980d 100644 --- a/modules/gdscript/gd_compiler.h +++ b/modules/gdscript/gd_compiler.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -143,7 +143,7 @@ class GDCompiler { int _parse_assign_right_expression(CodeGen& codegen,const GDParser::OperatorNode *p_expression, int p_stack_level); int _parse_expression(CodeGen& codegen,const GDParser::Node *p_expression, int p_stack_level,bool p_root=false,bool p_initializer=false); Error _parse_block(CodeGen& codegen,const GDParser::BlockNode *p_block,int p_stack_level=0,int p_break_addr=-1,int p_continue_addr=-1); - Error _parse_function(GDScript *p_script,const GDParser::ClassNode *p_class,const GDParser::FunctionNode *p_func); + Error _parse_function(GDScript *p_script,const GDParser::ClassNode *p_class,const GDParser::FunctionNode *p_func,bool p_for_ready=false); Error _parse_class(GDScript *p_script,GDScript *p_owner,const GDParser::ClassNode *p_class); int err_line; int err_column; diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index 381edcba50..126a8cd1eb 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1147,8 +1147,54 @@ static bool _guess_identifier_type(GDCompletionContext& context,int p_line,const } } + //autoloads as singletons + List<PropertyInfo> props; + Globals::get_singleton()->get_property_list(&props); + for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) { + String s = E->get().name; + if (!s.begins_with("autoload/")) + continue; + String name = s.get_slice("/",1); + if (name==String(p_identifier)) { + + String path = Globals::get_singleton()->get(s); + if (path.begins_with("*")) { + String script =path.substr(1,path.length()); + + if (!script.ends_with(".gd")) { + //not a script, try find the script anyway, + //may have some success + script=script.basename()+".gd"; + } + + if (FileAccess::exists(script)) { + + //print_line("is a script"); + + + Ref<Script> scr; + if (ScriptCodeCompletionCache::get_sigleton()) + scr = ScriptCodeCompletionCache::get_sigleton()->get_cached_resource(script); + else + scr = ResourceLoader::load(script); + + + r_type.obj_type="Node"; + r_type.type=Variant::OBJECT; + r_type.script=scr; + r_type.value=Variant(); + + return true; + + } + } + } + + } + + //global for(Map<StringName,int>::Element *E=GDScriptLanguage::get_singleton()->get_global_map().front();E;E=E->next()) { if (E->key()==p_identifier) { @@ -1336,6 +1382,24 @@ static void _find_identifiers(GDCompletionContext& context,int p_line,bool p_onl result.insert(_type_names[i]); } + //autoload singletons + List<PropertyInfo> props; + Globals::get_singleton()->get_property_list(&props); + + for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) { + + String s = E->get().name; + if (!s.begins_with("autoload/")) + continue; + String name = s.get_slice("/",1); + String path = Globals::get_singleton()->get(s); + if (path.begins_with("*")) { + result.insert(name); + } + + } + + for(const Map<StringName,int>::Element *E=GDScriptLanguage::get_singleton()->get_global_map().front();E;E=E->next()) { result.insert(E->key().operator String()); } diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp index fd92c8a9ec..e015ddb65e 100644 --- a/modules/gdscript/gd_functions.cpp +++ b/modules/gdscript/gd_functions.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,6 +33,8 @@ #include "gd_script.h" #include "func_ref.h" #include "os/os.h" +#include "variant_parser.h" +#include "io/marshalls.h" const char *GDFunctions::get_func_name(Function p_func) { @@ -93,11 +95,14 @@ const char *GDFunctions::get_func_name(Function p_func) { "printraw", "var2str", "str2var", + "var2bytes", + "bytes2var", "range", "load", "inst2dict", "dict2inst", "hash", + "Color8", "print_stack", "instance_from_id", }; @@ -524,6 +529,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va for(int i=0;i<p_arg_count;i++) { String os = p_args[i]->operator String();; + if (i==0) str=os; else @@ -607,7 +613,9 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va } break; case VAR_TO_STR: { VALIDATE_ARG_COUNT(1); - r_ret=p_args[0]->get_construct_string(); + String vars; + VariantWriter::write_to_string(*p_args[0],vars); + r_ret=vars; } break; case STR_TO_VAR: { VALIDATE_ARG_COUNT(1); @@ -618,7 +626,72 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va r_ret=Variant(); return; } - Variant::construct_from_string(*p_args[0],r_ret); + + VariantParser::StreamString ss; + ss.s=*p_args[0]; + + String errs; + int line; + Error err = VariantParser::parse(&ss,r_ret,errs,line); + + if (err!=OK) { + r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.argument=0; + r_error.expected=Variant::STRING; + r_ret=Variant(); + } + + } break; + case VAR_TO_BYTES: { + VALIDATE_ARG_COUNT(1); + + ByteArray barr; + int len; + Error err = encode_variant(*p_args[0],NULL,len); + if (err) { + r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.argument=0; + r_error.expected=Variant::NIL; + r_ret=Variant(); + return; + } + + barr.resize(len); + { + ByteArray::Write w = barr.write(); + encode_variant(*p_args[0],w.ptr(),len); + + } + r_ret=barr; + } break; + case BYTES_TO_VAR: { + VALIDATE_ARG_COUNT(1); + if (p_args[0]->get_type()!=Variant::RAW_ARRAY) { + r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.argument=0; + r_error.expected=Variant::RAW_ARRAY; + r_ret=Variant(); + return; + } + + ByteArray varr=*p_args[0]; + Variant ret; + { + ByteArray::Read r=varr.read(); + Error err = decode_variant(ret,r.ptr(),varr.size(),NULL); + if (err!=OK) { + ERR_PRINT("Not enough bytes for decoding.."); + r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.argument=0; + r_error.expected=Variant::RAW_ARRAY; + r_ret=Variant(); + return; + } + + } + + r_ret=ret; + } break; case GEN_RANGE: { @@ -920,6 +993,33 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va r_ret=p_args[0]->hash(); } break; + case COLOR8: { + + if (p_arg_count<3) { + r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.argument=3; + return; + } + if (p_arg_count>4) { + r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.argument=4; + return; + } + + VALIDATE_ARG_NUM(0); + VALIDATE_ARG_NUM(1); + VALIDATE_ARG_NUM(2); + + Color color(*p_args[0],*p_args[1],*p_args[2]); + + if (p_arg_count==4) { + VALIDATE_ARG_NUM(3); + color.a=*p_args[3]; + } + + r_ret=color; + + } break; case PRINT_STACK: { @@ -999,6 +1099,7 @@ bool GDFunctions::is_deterministic(Function p_func) { case TYPE_CONVERT: case TYPE_OF: case TEXT_STR: + case COLOR8: // enable for debug only, otherwise not desirable - case GEN_RANGE: return true; default: @@ -1311,6 +1412,18 @@ MethodInfo GDFunctions::get_info(Function p_func) { mi.return_val.type=Variant::NIL; return mi; } break; + case VAR_TO_BYTES: { + MethodInfo mi("var2bytes",PropertyInfo(Variant::NIL,"var")); + mi.return_val.type=Variant::RAW_ARRAY; + return mi; + + } break; + case BYTES_TO_VAR: { + + MethodInfo mi("bytes2var:Variant",PropertyInfo(Variant::RAW_ARRAY,"bytes")); + mi.return_val.type=Variant::NIL; + return mi; + } break; case GEN_RANGE: { MethodInfo mi("range",PropertyInfo(Variant::NIL,"...")); @@ -1342,6 +1455,12 @@ MethodInfo GDFunctions::get_info(Function p_func) { mi.return_val.type=Variant::INT; return mi; } break; + case COLOR8: { + + MethodInfo mi("Color8",PropertyInfo(Variant::INT,"r8"),PropertyInfo(Variant::INT,"g8"),PropertyInfo(Variant::INT,"b8"),PropertyInfo(Variant::INT,"a8")); + mi.return_val.type=Variant::COLOR; + return mi; + } break; case PRINT_STACK: { MethodInfo mi("print_stack"); diff --git a/modules/gdscript/gd_functions.h b/modules/gdscript/gd_functions.h index ad35a628d5..8c88472567 100644 --- a/modules/gdscript/gd_functions.h +++ b/modules/gdscript/gd_functions.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -89,11 +89,14 @@ public: TEXT_PRINTRAW, VAR_TO_STR, STR_TO_VAR, + VAR_TO_BYTES, + BYTES_TO_VAR, GEN_RANGE, RESOURCE_LOAD, INST2DICT, DICT2INST, HASH, + COLOR8, PRINT_STACK, INSTANCE_FROM_ID, FUNC_MAX diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index 4339a13edf..c4175e048d 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -75,20 +75,28 @@ bool GDParser::_enter_indent_block(BlockNode* p_block) { if (tokenizer->get_token()!=GDTokenizer::TK_NEWLINE) { - _set_error("newline expected after ':'."); - return false; + // be more python-like + int current = tab_level.back()->get(); + tab_level.push_back(current+1); + return true; + //_set_error("newline expected after ':'."); + //return false; } while(true) { if (tokenizer->get_token()!=GDTokenizer::TK_NEWLINE) { + print_line("no newline"); return false; //wtf } else if (tokenizer->get_token(1)!=GDTokenizer::TK_NEWLINE) { int indent = tokenizer->get_token_line_indent(); int current = tab_level.back()->get(); - if (indent<=current) + if (indent<=current) { + print_line("current: "+itos(current)+" indent: "+itos(indent)); + print_line("less than current"); return false; + } tab_level.push_back(indent); tokenizer->advance(); @@ -259,6 +267,13 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_ constant->value=tokenizer->get_token_constant(); tokenizer->advance(); expr=constant; + } else if (tokenizer->get_token()==GDTokenizer::TK_CONST_PI) { + + //constant defined by tokenizer + ConstantNode *constant = alloc_node<ConstantNode>(); + constant->value=Math_PI; + tokenizer->advance(); + expr=constant; } else if (tokenizer->get_token()==GDTokenizer::TK_PR_PRELOAD) { //constant defined by tokenizer @@ -1588,6 +1603,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) { p_block->sub_blocks.push_back(cf_if->body); if (!_enter_indent_block(cf_if->body)) { + _set_error("Expected intended block after 'if'"); p_block->end_line=tokenizer->get_token_line(); return; } @@ -1647,6 +1663,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) { if (!_enter_indent_block(cf_if->body)) { + _set_error("Expected indented block after 'elif'"); p_block->end_line=tokenizer->get_token_line(); return; } @@ -1661,7 +1678,6 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) { } else if (tokenizer->get_token()==GDTokenizer::TK_CF_ELSE) { if (tab_level.back()->get() > indent_level) { - _set_error("Invalid indent"); return; } @@ -1673,6 +1689,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) { p_block->sub_blocks.push_back(cf_if->body_else); if (!_enter_indent_block(cf_if->body_else)) { + _set_error("Expected indented block after 'else'"); p_block->end_line=tokenizer->get_token_line(); return; } @@ -1713,6 +1730,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) { p_block->sub_blocks.push_back(cf_while->body); if (!_enter_indent_block(cf_while->body)) { + _set_error("Expected indented block after 'while'"); p_block->end_line=tokenizer->get_token_line(); return; } @@ -1764,6 +1782,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) { p_block->sub_blocks.push_back(cf_for->body); if (!_enter_indent_block(cf_for->body)) { + _set_error("Expected indented block after 'while'"); p_block->end_line=tokenizer->get_token_line(); return; } @@ -1850,6 +1869,17 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) { return; } } break; + case GDTokenizer::TK_PR_BREAKPOINT: { + + tokenizer->advance(); + BreakpointNode *bn = alloc_node<BreakpointNode>(); + p_block->statements.push_back(bn); + + if (!_end_statement()) { + _set_error("Expected end of statement after breakpoint."); + return; + } + } break; default: { Node *expression = _parse_and_reduce_expression(p_block,p_static,false,true); @@ -2058,6 +2088,8 @@ void GDParser::_parse_class(ClassNode *p_class) { ClassNode *newclass = alloc_node<ClassNode>(); newclass->initializer = alloc_node<BlockNode>(); newclass->initializer->parent_class=newclass; + newclass->ready = alloc_node<BlockNode>(); + newclass->ready->parent_class=newclass; newclass->name=name; newclass->owner=p_class; @@ -2767,6 +2799,17 @@ void GDParser::_parse_class(ClassNode *p_class) { } }; //fallthrough to var + case GDTokenizer::TK_PR_ONREADY: { + + if (token==GDTokenizer::TK_PR_ONREADY) { + //may be fallthrough from export, ignore if so + tokenizer->advance(); + if (tokenizer->get_token()!=GDTokenizer::TK_PR_VAR) { + _set_error("Expected 'var'."); + return; + } + } + }; //fallthrough to var case GDTokenizer::TK_PR_VAR: { //variale declaration and (eventual) initialization @@ -2777,6 +2820,8 @@ void GDParser::_parse_class(ClassNode *p_class) { current_export=PropertyInfo(); } + bool onready = tokenizer->get_token(-1)==GDTokenizer::TK_PR_ONREADY; + tokenizer->advance(); if (tokenizer->get_token()!=GDTokenizer::TK_IDENTIFIER) { @@ -2807,6 +2852,21 @@ void GDParser::_parse_class(ClassNode *p_class) { return; } + //discourage common error + if (!onready && subexpr->type==Node::TYPE_OPERATOR) { + + OperatorNode *op=static_cast<OperatorNode*>(subexpr); + if (op->op==OperatorNode::OP_CALL && op->arguments[0]->type==Node::TYPE_SELF && op->arguments[1]->type==Node::TYPE_IDENTIFIER) { + IdentifierNode *id=static_cast<IdentifierNode*>(op->arguments[1]); + if (id->name=="get_node") { + + _set_error("Use 'onready var "+String(member.identifier)+" = get_node(..)' instead"); + return; + + } + } + } + member.expression=subexpr; if (autoexport) { @@ -2853,12 +2913,19 @@ void GDParser::_parse_class(ClassNode *p_class) { op->arguments.push_back(id); op->arguments.push_back(subexpr); + #ifdef DEBUG_ENABLED NewLineNode *nl = alloc_node<NewLineNode>(); nl->line=line; - p_class->initializer->statements.push_back(nl); + if (onready) + p_class->ready->statements.push_back(nl); + else + p_class->initializer->statements.push_back(nl); #endif - p_class->initializer->statements.push_back(op); + if (onready) + p_class->ready->statements.push_back(op); + else + p_class->initializer->statements.push_back(op); @@ -3009,6 +3076,8 @@ Error GDParser::_parse(const String& p_base_path) { ClassNode *main_class = alloc_node<ClassNode>(); main_class->initializer = alloc_node<BlockNode>(); main_class->initializer->parent_class=main_class; + main_class->ready = alloc_node<BlockNode>(); + main_class->ready->parent_class=main_class; current_class=main_class; _parse_class(main_class); diff --git a/modules/gdscript/gd_parser.h b/modules/gdscript/gd_parser.h index 04f3dff3de..9ad8633968 100644 --- a/modules/gdscript/gd_parser.h +++ b/modules/gdscript/gd_parser.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -54,6 +54,7 @@ public: TYPE_CONTROL_FLOW, TYPE_LOCAL_VAR, TYPE_ASSERT, + TYPE_BREAKPOINT, TYPE_NEWLINE, }; @@ -105,6 +106,7 @@ public: Vector<FunctionNode*> static_functions; Vector<Signal> _signals; BlockNode *initializer; + BlockNode *ready; ClassNode *owner; //Vector<Node*> initializers; int end_line; @@ -275,6 +277,10 @@ public: AssertNode() { type=TYPE_ASSERT; } }; + struct BreakpointNode : public Node { + BreakpointNode() { type=TYPE_BREAKPOINT; } + }; + struct NewLineNode : public Node { NewLineNode() { type=TYPE_NEWLINE; } }; diff --git a/modules/gdscript/gd_pretty_print.cpp b/modules/gdscript/gd_pretty_print.cpp index 9c290eac4a..cca3cd3984 100644 --- a/modules/gdscript/gd_pretty_print.cpp +++ b/modules/gdscript/gd_pretty_print.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/gdscript/gd_pretty_print.h b/modules/gdscript/gd_pretty_print.h index 998fdc53ab..0106d873d9 100644 --- a/modules/gdscript/gd_pretty_print.h +++ b/modules/gdscript/gd_pretty_print.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 62006cf18b..9a3f50d3b8 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,17 +33,6 @@ #include "os/file_access.h" #include "io/file_access_encrypted.h" -/* TODO: - - *populate globals - *do checks as close to debugger as possible (but don't do debugger) - *const check plz - *check arguments and default arguments in GDFunction - -get property list in instance? - *missing opcodes - -const checks - -make thread safe - */ @@ -232,6 +221,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a r_err.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_err.argument=_argument_count; + return Variant(); } else if (p_argcount < _argument_count - _default_arg_count) { @@ -1077,6 +1067,14 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a ip+=2; } continue; + case OPCODE_BREAKPOINT: { +#ifdef DEBUG_ENABLED + if (ScriptDebugger::get_singleton()) { + GDScriptLanguage::get_singleton()->debug_break("Breakpoint Statement",true); + } +#endif + ip+=1; + } continue; case OPCODE_LINE: { CHECK_SPACE(2); @@ -1141,7 +1139,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a if (!GDScriptLanguage::get_singleton()->debug_break(err_text,false)) { // debugger break did not happen - _err_print_error(err_func.utf8().get_data(),err_file.utf8().get_data(),err_line,err_text.utf8().get_data()); + _err_print_error(err_func.utf8().get_data(),err_file.utf8().get_data(),err_line,err_text.utf8().get_data(),ERR_HANDLER_SCRIPT); } @@ -1595,6 +1593,28 @@ void GDScript::_update_placeholder(PlaceHolderScriptInstance *p_placeholder) { }*/ #endif + +bool GDScript::get_property_default_value(const StringName& p_property, Variant &r_value) const { + +#ifdef TOOLS_ENABLED + + //for (const Map<StringName,Variant>::Element *I=member_default_values.front();I;I=I->next()) { + // print_line("\t"+String(String(I->key())+":"+String(I->get()))); + //} + const Map<StringName,Variant>::Element *E=member_default_values_cache.find(p_property); + if (E) { + r_value=E->get(); + return true; + } + + if (base_cache.is_valid()) { + return base_cache->get_property_default_value(p_property,r_value); + } +#endif + return false; + +} + ScriptInstance* GDScript::instance_create(Object *p_this) { @@ -1732,16 +1752,21 @@ bool GDScript::_update_exports() { } } - Ref<GDScript> bf = ResourceLoader::load(path); + if (path!=get_path()) { - if (bf.is_valid()) { + Ref<GDScript> bf = ResourceLoader::load(path); - //print_line("parent is: "+bf->get_path()); - base_cache=bf; - bf->inheriters_cache.insert(get_instance_ID()); + if (bf.is_valid()) { - //bf->_update_exports(p_instances,true,false); + //print_line("parent is: "+bf->get_path()); + base_cache=bf; + bf->inheriters_cache.insert(get_instance_ID()); + //bf->_update_exports(p_instances,true,false); + + } + } else { + ERR_PRINT(("Path extending itself in "+path).utf8().get_data()); } } @@ -2570,6 +2595,12 @@ void GDScriptLanguage::_add_global(const StringName& p_name,const Variant& p_val _global_array=global_array.ptr(); } +void GDScriptLanguage::add_global_constant(const StringName& p_variable,const Variant& p_value) { + + _add_global(p_variable,p_value); +} + + void GDScriptLanguage::init() { @@ -2646,6 +2677,7 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const { "elif", "enum", "extends" , + "onready", "for" , "func" , "if" , @@ -2665,6 +2697,7 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const { "or", "export", "assert", + "breakpoint", "yield", "static", "float", diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h index 3d16b59065..a69f99314a 100644 --- a/modules/gdscript/gd_script.h +++ b/modules/gdscript/gd_script.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -71,6 +71,7 @@ public: OPCODE_ITERATE_BEGIN, OPCODE_ITERATE, OPCODE_ASSERT, + OPCODE_BREAKPOINT, OPCODE_LINE, OPCODE_END }; @@ -351,6 +352,8 @@ public: Vector<uint8_t> get_as_byte_code() const; + bool get_property_default_value(const StringName& p_property,Variant& r_value) const; + virtual ScriptLanguage *get_language() const; GDScript(); @@ -529,6 +532,8 @@ public: virtual String make_function(const String& p_class,const String& p_name,const StringArray& p_args) const; virtual Error complete_code(const String& p_code, const String& p_base_path, Object*p_owner,List<String>* r_options,String& r_call_hint); virtual void auto_indent_code(String& p_code,int p_from_line,int p_to_line) const; + virtual void add_global_constant(const StringName& p_variable,const Variant& p_value); + /* DEBUGGER FUNCTIONS */ diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp index e445701669..cbcb08334a 100644 --- a/modules/gdscript/gd_tokenizer.cpp +++ b/modules/gdscript/gd_tokenizer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -88,6 +88,7 @@ const char* GDTokenizer::token_names[TK_MAX]={ "func", "class", "extends", +"onready", "tool", "static", "export", @@ -98,6 +99,7 @@ const char* GDTokenizer::token_names[TK_MAX]={ "assert", "yield", "signal", +"breakpoint", "'['", "']'", "'{'", @@ -110,6 +112,7 @@ const char* GDTokenizer::token_names[TK_MAX]={ "'?'", "':'", "'\\n'", +"PI", "Error", "EOF", "Cursor"}; @@ -259,6 +262,7 @@ void GDTokenizerText::_advance() { } INCPOS(1); + line++; while(GETCHAR(0)==' ' || GETCHAR(0)=='\t') { INCPOS(1); @@ -851,6 +855,7 @@ void GDTokenizerText::_advance() { {TK_PR_FUNCTION,"function"}, {TK_PR_CLASS,"class"}, {TK_PR_EXTENDS,"extends"}, + {TK_PR_ONREADY,"onready"}, {TK_PR_TOOL,"tool"}, {TK_PR_STATIC,"static"}, {TK_PR_EXPORT,"export"}, @@ -860,6 +865,7 @@ void GDTokenizerText::_advance() { {TK_PR_ASSERT,"assert"}, {TK_PR_YIELD,"yield"}, {TK_PR_SIGNAL,"signal"}, + {TK_PR_BREAKPOINT,"breakpoint"}, {TK_PR_CONST,"const"}, //controlflow {TK_CF_IF,"if"}, @@ -874,6 +880,7 @@ void GDTokenizerText::_advance() { {TK_CF_RETURN,"return"}, {TK_CF_PASS,"pass"}, {TK_SELF,"self"}, + {TK_CONST_PI,"PI"}, {TK_ERROR,NULL} }; @@ -1040,7 +1047,7 @@ void GDTokenizerText::advance(int p_amount) { ////////////////////////////////////////////////////////////////////////////////////////////////////// -#define BYTECODE_VERSION 5 +#define BYTECODE_VERSION 10 Error GDTokenizerBuffer::set_code_buffer(const Vector<uint8_t> & p_buffer) { diff --git a/modules/gdscript/gd_tokenizer.h b/modules/gdscript/gd_tokenizer.h index d6bd63c5b8..aaff573090 100644 --- a/modules/gdscript/gd_tokenizer.h +++ b/modules/gdscript/gd_tokenizer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -95,6 +95,7 @@ public: TK_PR_FUNCTION, TK_PR_CLASS, TK_PR_EXTENDS, + TK_PR_ONREADY, TK_PR_TOOL, TK_PR_STATIC, TK_PR_EXPORT, @@ -105,6 +106,7 @@ public: TK_PR_ASSERT, TK_PR_YIELD, TK_PR_SIGNAL, + TK_PR_BREAKPOINT, TK_BRACKET_OPEN, TK_BRACKET_CLOSE, TK_CURLY_BRACKET_OPEN, @@ -117,6 +119,7 @@ public: TK_QUESTION_MARK, TK_COLON, TK_NEWLINE, + TK_CONST_PI, TK_ERROR, TK_EOF, TK_CURSOR, //used for code completion diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index 4470b7ca0c..2aea494f39 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/modules/gdscript/register_types.h b/modules/gdscript/register_types.h index 9eb5d1846b..aed11cd1d4 100644 --- a/modules/gdscript/register_types.h +++ b/modules/gdscript/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index ad7c392cd0..7d463b13d4 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1096,7 +1096,7 @@ void GridMap::_bind_methods() { // ObjectTypeDB::bind_method(_MD("_recreate_octants"),&GridMap::_recreate_octants); ObjectTypeDB::bind_method(_MD("_update_dirty_map_callback"),&GridMap::_update_dirty_map_callback); - ObjectTypeDB::bind_method(_MD("resource_changed"),&GridMap::resource_changed); + ObjectTypeDB::bind_method(_MD("resource_changed","resource"),&GridMap::resource_changed); ObjectTypeDB::bind_method(_MD("set_center_x","enable"),&GridMap::set_center_x); ObjectTypeDB::bind_method(_MD("get_center_x"),&GridMap::get_center_x); diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h index 9d3b1dcf95..66d3e6b44a 100644 --- a/modules/gridmap/grid_map.h +++ b/modules/gridmap/grid_map.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index e4559ca100..6043807db3 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h index 03b2d4226e..fc43866ef3 100644 --- a/modules/gridmap/grid_map_editor_plugin.h +++ b/modules/gridmap/grid_map_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/gridmap/register_types.cpp b/modules/gridmap/register_types.cpp index 2bc440759d..9dcc04b22a 100644 --- a/modules/gridmap/register_types.cpp +++ b/modules/gridmap/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/gridmap/register_types.h b/modules/gridmap/register_types.h index 326d7acf24..7b5c10f9e5 100644 --- a/modules/gridmap/register_types.h +++ b/modules/gridmap/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/AndroidManifest.xml.template b/platform/android/AndroidManifest.xml.template index c95c86c060..37dee4a9a5 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" @@ -11,7 +11,7 @@ android:xlargeScreens="true"/> <application android:label="@string/godot_project_name_string" android:icon="@drawable/icon" android:allowBackup="false" $$ADD_APPATTRIBUTE_CHUNKS$$ > - <activity android:name="com.android.godot.Godot" + <activity android:name="org.godotengine.godot.Godot" android:label="@string/godot_project_name_string" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:launchMode="singleTask" @@ -23,7 +23,7 @@ <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> - <service android:name="com.android.godot.GodotDownloaderService" /> + <service android:name="org.godotengine.godot.GodotDownloaderService" /> @@ -189,7 +189,7 @@ $$ADD_PERMISSION_CHUNKS$$ <uses-permission android:name="godot.custom.7"/> <uses-permission android:name="godot.custom.8"/> <uses-permission android:name="godot.custom.9"/> -<uses-permission android:name="godot.custom.0"/> +<uses-permission android:name="godot.custom.10"/> <uses-permission android:name="godot.custom.11"/> <uses-permission android:name="godot.custom.12"/> <uses-permission android:name="godot.custom.13"/> diff --git a/platform/android/SCsub b/platform/android/SCsub index 834ee58adc..3d645de38f 100644 --- a/platform/android/SCsub +++ b/platform/android/SCsub @@ -37,19 +37,59 @@ prog = None abspath=env.Dir(".").abspath -pp_basein = open(abspath+"/project.properties.template","rb") -pp_baseout = open(abspath+"/java/project.properties","wb") -pp_baseout.write( pp_basein.read() ) +gradle_basein = open(abspath+"/build.gradle.template","rb") +gradle_baseout = open(abspath+"/java/build.gradle","wb") -refcount=1 +gradle_text = gradle_basein.read() -for x in env.android_source_modules: - pp_baseout.write("android.library.reference."+str(refcount)+"="+x+"\n") - refcount+=1 +gradle_maven_repos_text="" +if len(env.android_maven_repos) > 0: + gradle_maven_repos_text+="maven {\n" + for x in env.android_maven_repos: + gradle_maven_repos_text+="\t\t"+x+"\n" + gradle_maven_repos_text+="\t}\n" -pp_baseout.close() +gradle_maven_dependencies_text="" + +for x in env.android_dependencies: + gradle_maven_dependencies_text+=x+"\n" + +gradle_java_dirs_text="" + +for x in env.android_java_dirs: + gradle_java_dirs_text+=",'"+x+"'" + + +gradle_res_dirs_text="" + +for x in env.android_res_dirs: + gradle_res_dirs_text+=",'"+x+"'" + +gradle_aidl_dirs_text="" + +for x in env.android_aidl_dirs: + gradle_aidl_dirs_text+=",'"+x+"'" + +gradle_jni_dirs_text="" + +for x in env.android_jni_dirs: + gradle_jni_dirs_text+=",'"+x+"'" + +gradle_asset_dirs_text="" + +gradle_text = gradle_text.replace("$$GRADLE_REPOSITORY_URLS$$",gradle_maven_repos_text) +gradle_text = gradle_text.replace("$$GRADLE_DEPENDENCIES$$",gradle_maven_dependencies_text) +gradle_text = gradle_text.replace("$$GRADLE_JAVA_DIRS$$",gradle_java_dirs_text) +gradle_text = gradle_text.replace("$$GRADLE_RES_DIRS$$",gradle_res_dirs_text) +gradle_text = gradle_text.replace("$$GRADLE_ASSET_DIRS$$",gradle_asset_dirs_text) +gradle_text = gradle_text.replace("$$GRADLE_AIDL_DIRS$$",gradle_aidl_dirs_text) +gradle_text = gradle_text.replace("$$GRADLE_JNI_DIRS$$",gradle_jni_dirs_text) + + +gradle_baseout.write( gradle_text ) +gradle_baseout.close() pp_basein = open(abspath+"/AndroidManifest.xml.template","rb") @@ -61,13 +101,6 @@ manifest = manifest.replace("$$ADD_APPATTRIBUTE_CHUNKS$$",env.android_appattribu pp_baseout.write( manifest ) -for x in env.android_source_files: - shutil.copy(x,abspath+"/java/src/com/android/godot") - -for x in env.android_module_libraries: - shutil.copy(x,abspath+"/java/libs") - - env_android.SharedLibrary("#bin/libgodot",[android_objects],SHLIBSUFFIX=env["SHLIBSUFFIX"]) #env.Command('#bin/libgodot_android.so', '#platform/android/libgodot_android.so', Copy('bin/libgodot_android.so', 'platform/android/libgodot_android.so')) diff --git a/platform/android/android_native_app_glue.h b/platform/android/android_native_app_glue.h index f5ba27ae66..3e7a4ea7a0 100644 --- a/platform/android/android_native_app_glue.h +++ b/platform/android/android_native_app_glue.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/audio_driver_jandroid.cpp b/platform/android/audio_driver_jandroid.cpp index 1a3a1cb563..6d428e3fe5 100644 --- a/platform/android/audio_driver_jandroid.cpp +++ b/platform/android/audio_driver_jandroid.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -147,13 +147,13 @@ void AudioDriverAndroid::setup( jobject p_io) { void AudioDriverAndroid::thread_func(JNIEnv *env) { - jclass cls = env->FindClass("com/android/godot/Godot"); + jclass cls = env->FindClass("org/godotengine/godot/Godot"); if (cls) { cls=(jclass)env->NewGlobalRef(cls); __android_log_print(ANDROID_LOG_INFO,"godot","*******CLASS FOUND!!!"); } - jfieldID fid = env->GetStaticFieldID(cls, "io", "Lcom/android/godot/GodotIO;"); + jfieldID fid = env->GetStaticFieldID(cls, "io", "Lorg/godotengine/godot/GodotIO;"); jobject ob = env->GetStaticObjectField(cls,fid); jobject gob = env->NewGlobalRef(ob); jclass c = env->GetObjectClass(gob); diff --git a/platform/android/audio_driver_jandroid.h b/platform/android/audio_driver_jandroid.h index bf8584051d..f79057efe5 100644 --- a/platform/android/audio_driver_jandroid.h +++ b/platform/android/audio_driver_jandroid.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/audio_driver_opensl.cpp b/platform/android/audio_driver_opensl.cpp index 761bef27aa..a908f6193e 100644 --- a/platform/android/audio_driver_opensl.cpp +++ b/platform/android/audio_driver_opensl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/audio_driver_opensl.h b/platform/android/audio_driver_opensl.h index e9d7c7a7ea..1b04f32fd2 100644 --- a/platform/android/audio_driver_opensl.h +++ b/platform/android/audio_driver_opensl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/build.gradle.template b/platform/android/build.gradle.template new file mode 100644 index 0000000000..9461cd2e99 --- /dev/null +++ b/platform/android/build.gradle.template @@ -0,0 +1,70 @@ +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.0' + } +} + +apply plugin: 'com.android.application' + +allprojects { + repositories { + mavenCentral() + $$GRADLE_REPOSITORY_URLS$$ + } +} + +dependencies { + + $$GRADLE_DEPENDENCIES$$ +} + +android { + + lintOptions { + abortOnError false + } + + compileSdkVersion 19 + buildToolsVersion "19.1" + + packagingOptions { + exclude 'META-INF/LICENSE' + exclude 'META-INF/NOTICE' + } + defaultConfig { + minSdkVersion 14 + targetSdkVersion 19 + } + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + java.srcDirs = ['src' + $$GRADLE_JAVA_DIRS$$ + ] + resources.srcDirs = [ + 'res' + $$GRADLE_RES_DIRS$$ + ] + res.srcDirs = ['res'] + // libs.srcDirs = ['libs'] + aidl.srcDirs = [ + 'aidl' + $$GRADLE_AIDL_DIRS$$ + ] + assets.srcDirs = [ + 'assets' + $$GRADLE_ASSET_DIRS$$ + ] + jniLibs.srcDirs = [ + 'libs' + $$GRADLE_JNI_DIRS$$ + ] + } + + } + + +} diff --git a/platform/android/detect.py b/platform/android/detect.py index 66097a5149..ee3dc119c2 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -106,10 +106,6 @@ def configure(env): #env['SPAWN'] = methods.win32_spawn env['SHLIBSUFFIX'] = '.so' - #env.android_source_modules.append("../libs/apk_expansion") - env.android_source_modules.append("../libs/google_play_services") - env.android_source_modules.append("../libs/downloader_library") - env.android_source_modules.append("../libs/play_licensing") neon_text="" if env["android_arch"]=="armv7" and env['android_neon']=='yes': diff --git a/platform/android/dir_access_android.cpp b/platform/android/dir_access_android.cpp index ca1e58da3f..85df5dc37a 100644 --- a/platform/android/dir_access_android.cpp +++ b/platform/android/dir_access_android.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/dir_access_android.h b/platform/android/dir_access_android.h index cbbcdb71bb..9477ca48fd 100644 --- a/platform/android/dir_access_android.h +++ b/platform/android/dir_access_android.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/dir_access_jandroid.cpp b/platform/android/dir_access_jandroid.cpp index 2b5fc6a50a..8b7cb992d9 100644 --- a/platform/android/dir_access_jandroid.cpp +++ b/platform/android/dir_access_jandroid.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -96,7 +96,7 @@ void DirAccessJAndroid::list_dir_end(){ return; JNIEnv *env = ThreadAndroid::get_env(); - env->CallObjectMethod(io,_dir_close,id); + env->CallVoidMethod(io,_dir_close,id); id=0; @@ -143,7 +143,7 @@ Error DirAccessJAndroid::change_dir(String p_dir){ if (res<=0) return ERR_INVALID_PARAMETER; - env->CallObjectMethod(io,_dir_close,res); + env->CallVoidMethod(io,_dir_close,res); current_dir=new_dir; diff --git a/platform/android/dir_access_jandroid.h b/platform/android/dir_access_jandroid.h index 7b6242ca32..356828dcc1 100644 --- a/platform/android/dir_access_jandroid.h +++ b/platform/android/dir_access_jandroid.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 7d550f4fa0..c908f6729b 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1569,7 +1569,7 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) { args.push_back("-a"); args.push_back("android.intent.action.MAIN"); args.push_back("-n"); - args.push_back(get_package_name()+"/com.android.godot.Godot"); + args.push_back(get_package_name()+"/org.godotengine.godot.Godot"); err = OS::get_singleton()->execute(adb,args,true,NULL,NULL,&rv); if (err || rv!=0) { diff --git a/platform/android/file_access_android.cpp b/platform/android/file_access_android.cpp index ff70d5ae76..7a038cca64 100644 --- a/platform/android/file_access_android.cpp +++ b/platform/android/file_access_android.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -132,12 +132,18 @@ int FileAccessAndroid::get_buffer(uint8_t *p_dst, int p_length) const { off_t r = AAsset_read(a,p_dst,p_length); + + if (pos+p_length >len ) { + eof=true; + } + if (r>=0) { + pos+=r; if (pos>len) { pos=len; - eof=true; } + } return r; diff --git a/platform/android/file_access_android.h b/platform/android/file_access_android.h index 506c2c023f..3fcd7836c3 100644 --- a/platform/android/file_access_android.h +++ b/platform/android/file_access_android.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/file_access_jandroid.cpp b/platform/android/file_access_jandroid.cpp index be38d806b2..b1b758edb1 100644 --- a/platform/android/file_access_jandroid.cpp +++ b/platform/android/file_access_jandroid.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/file_access_jandroid.h b/platform/android/file_access_jandroid.h index 13ac4e17b8..d576af93d6 100644 --- a/platform/android/file_access_jandroid.h +++ b/platform/android/file_access_jandroid.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp index 388ff06c10..f9feb3481f 100644 --- a/platform/android/godot_android.cpp +++ b/platform/android/godot_android.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -50,9 +50,9 @@ extern "C" { - JNIEXPORT void JNICALL Java_com_android_godot_Godot_registerSingleton(JNIEnv * env, jobject obj, jstring name,jobject p_object); - JNIEXPORT void JNICALL Java_com_android_godot_Godot_registerMethod(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args); - JNIEXPORT jstring JNICALL Java_com_android_godot_Godot_getGlobal(JNIEnv * env, jobject obj, jstring path); + JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerSingleton(JNIEnv * env, jobject obj, jstring name,jobject p_object); + JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerMethod(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args); + JNIEXPORT jstring JNICALL Java_org_godotengine_godot_Godot_getGlobal(JNIEnv * env, jobject obj, jstring path); }; class JNISingleton : public Object { @@ -671,12 +671,12 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) { static JNINativeMethod methods[] = { - {"registerSingleton", "(Ljava/lang/String;Ljava/lang/Object;)V",(void *)&Java_com_android_godot_Godot_registerSingleton}, - {"registerMethod", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V",(void *)&Java_com_android_godot_Godot_registerMethod}, - {"getGlobal", "(Ljava/lang/String;)Ljava/lang/String;", (void *)&Java_com_android_godot_Godot_getGlobal}, + {"registerSingleton", "(Ljava/lang/String;Ljava/lang/Object;)V",(void *)&Java_org_godotengine_godot_Godot_registerSingleton}, + {"registerMethod", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V",(void *)&Java_org_godotengine_godot_Godot_registerMethod}, + {"getGlobal", "(Ljava/lang/String;)Ljava/lang/String;", (void *)&Java_org_godotengine_godot_Godot_getGlobal}, }; - jstring gstrClassName = engine->jni->NewStringUTF("com/android/godot/Godot"); + jstring gstrClassName = engine->jni->NewStringUTF("org/godotengine/godot/Godot"); jclass GodotClass = (jclass)engine->jni->CallObjectMethod(cls, findClass, gstrClassName); __android_log_print(ANDROID_LOG_INFO,"godot","godot ****^*^*?^*^*class data %x",GodotClass); @@ -692,7 +692,7 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) { jclass singletonClass = (jclass)engine->jni->CallObjectMethod(cls, findClass, strClassName); __android_log_print(ANDROID_LOG_INFO,"godot","****^*^*?^*^*class data %x",singletonClass); - jmethodID initialize = engine->jni->GetStaticMethodID(singletonClass, "initialize", "(Landroid/app/Activity;)Lcom/android/godot/Godot$SingletonBase;"); + jmethodID initialize = engine->jni->GetStaticMethodID(singletonClass, "initialize", "(Landroid/app/Activity;)Lorg/godotengine/godot/Godot$SingletonBase;"); jobject obj = engine->jni->CallStaticObjectMethod(singletonClass,initialize,app->activity->clazz); @@ -863,7 +863,7 @@ void android_main(struct android_app* state) { -JNIEXPORT void JNICALL Java_com_android_godot_Godot_registerSingleton(JNIEnv * env, jobject obj, jstring name,jobject p_object){ +JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerSingleton(JNIEnv * env, jobject obj, jstring name,jobject p_object){ String singname = env->GetStringUTFChars( name, NULL ); JNISingleton *s = memnew( JNISingleton ); @@ -938,7 +938,7 @@ static const char* get_jni_sig(const String& p_type) { return ""; } -JNIEXPORT jstring JNICALL Java_com_android_godot_Godot_getGlobal(JNIEnv * env, jobject obj, jstring path) { +JNIEXPORT jstring JNICALL Java_org_godotengine_godot_Godot_getGlobal(JNIEnv * env, jobject obj, jstring path) { String js = env->GetStringUTFChars( path, NULL ); @@ -949,7 +949,7 @@ JNIEXPORT jstring JNICALL Java_com_android_godot_Godot_getGlobal(JNIEnv * env, j -JNIEXPORT void JNICALL Java_com_android_godot_Godot_registerMethod(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args){ +JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerMethod(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args){ String singname = env->GetStringUTFChars( sname, NULL ); diff --git a/platform/android/java/aidl/com/android/vending/billing/IInAppBillingService.aidl b/platform/android/java/aidl/com/android/vending/billing/IInAppBillingService.aidl new file mode 100644 index 0000000000..2a492f7845 --- /dev/null +++ b/platform/android/java/aidl/com/android/vending/billing/IInAppBillingService.aidl @@ -0,0 +1,144 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.vending.billing; + +import android.os.Bundle; + +/** + * InAppBillingService is the service that provides in-app billing version 3 and beyond. + * This service provides the following features: + * 1. Provides a new API to get details of in-app items published for the app including + * price, type, title and description. + * 2. The purchase flow is synchronous and purchase information is available immediately + * after it completes. + * 3. Purchase information of in-app purchases is maintained within the Google Play system + * till the purchase is consumed. + * 4. An API to consume a purchase of an inapp item. All purchases of one-time + * in-app items are consumable and thereafter can be purchased again. + * 5. An API to get current purchases of the user immediately. This will not contain any + * consumed purchases. + * + * All calls will give a response code with the following possible values + * RESULT_OK = 0 - success + * RESULT_USER_CANCELED = 1 - user pressed back or canceled a dialog + * RESULT_BILLING_UNAVAILABLE = 3 - this billing API version is not supported for the type requested + * RESULT_ITEM_UNAVAILABLE = 4 - requested SKU is not available for purchase + * RESULT_DEVELOPER_ERROR = 5 - invalid arguments provided to the API + * RESULT_ERROR = 6 - Fatal error during the API action + * RESULT_ITEM_ALREADY_OWNED = 7 - Failure to purchase since item is already owned + * RESULT_ITEM_NOT_OWNED = 8 - Failure to consume since item is not owned + */ +interface IInAppBillingService { + /** + * Checks support for the requested billing API version, package and in-app type. + * Minimum API version supported by this interface is 3. + * @param apiVersion the billing version which the app is using + * @param packageName the package name of the calling app + * @param type type of the in-app item being purchased "inapp" for one-time purchases + * and "subs" for subscription. + * @return RESULT_OK(0) on success, corresponding result code on failures + */ + int isBillingSupported(int apiVersion, String packageName, String type); + + /** + * Provides details of a list of SKUs + * Given a list of SKUs of a valid type in the skusBundle, this returns a bundle + * with a list JSON strings containing the productId, price, title and description. + * This API can be called with a maximum of 20 SKUs. + * @param apiVersion billing API version that the Third-party is using + * @param packageName the package name of the calling app + * @param skusBundle bundle containing a StringArrayList of SKUs with key "ITEM_ID_LIST" + * @return Bundle containing the following key-value pairs + * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on + * failure as listed above. + * "DETAILS_LIST" with a StringArrayList containing purchase information + * in JSON format similar to: + * '{ "productId" : "exampleSku", "type" : "inapp", "price" : "$5.00", + * "title : "Example Title", "description" : "This is an example description" }' + */ + Bundle getSkuDetails(int apiVersion, String packageName, String type, in Bundle skusBundle); + + /** + * Returns a pending intent to launch the purchase flow for an in-app item by providing a SKU, + * the type, a unique purchase token and an optional developer payload. + * @param apiVersion billing API version that the app is using + * @param packageName package name of the calling app + * @param sku the SKU of the in-app item as published in the developer console + * @param type the type of the in-app item ("inapp" for one-time purchases + * and "subs" for subscription). + * @param developerPayload optional argument to be sent back with the purchase information + * @return Bundle containing the following key-value pairs + * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on + * failure as listed above. + * "BUY_INTENT" - PendingIntent to start the purchase flow + * + * The Pending intent should be launched with startIntentSenderForResult. When purchase flow + * has completed, the onActivityResult() will give a resultCode of OK or CANCELED. + * If the purchase is successful, the result data will contain the following key-value pairs + * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on + * failure as listed above. + * "INAPP_PURCHASE_DATA" - String in JSON format similar to + * '{"orderId":"12999763169054705758.1371079406387615", + * "packageName":"com.example.app", + * "productId":"exampleSku", + * "purchaseTime":1345678900000, + * "purchaseToken" : "122333444455555", + * "developerPayload":"example developer payload" }' + * "INAPP_DATA_SIGNATURE" - String containing the signature of the purchase data that + * was signed with the private key of the developer + * TODO: change this to app-specific keys. + */ + Bundle getBuyIntent(int apiVersion, String packageName, String sku, String type, + String developerPayload); + + /** + * Returns the current SKUs owned by the user of the type and package name specified along with + * purchase information and a signature of the data to be validated. + * This will return all SKUs that have been purchased in V3 and managed items purchased using + * V1 and V2 that have not been consumed. + * @param apiVersion billing API version that the app is using + * @param packageName package name of the calling app + * @param type the type of the in-app items being requested + * ("inapp" for one-time purchases and "subs" for subscription). + * @param continuationToken to be set as null for the first call, if the number of owned + * skus are too many, a continuationToken is returned in the response bundle. + * This method can be called again with the continuation token to get the next set of + * owned skus. + * @return Bundle containing the following key-value pairs + * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on + * failure as listed above. + * "INAPP_PURCHASE_ITEM_LIST" - StringArrayList containing the list of SKUs + * "INAPP_PURCHASE_DATA_LIST" - StringArrayList containing the purchase information + * "INAPP_DATA_SIGNATURE_LIST"- StringArrayList containing the signatures + * of the purchase information + * "INAPP_CONTINUATION_TOKEN" - String containing a continuation token for the + * next set of in-app purchases. Only set if the + * user has more owned skus than the current list. + */ + Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken); + + /** + * Consume the last purchase of the given SKU. This will result in this item being removed + * from all subsequent responses to getPurchases() and allow re-purchase of this item. + * @param apiVersion billing API version that the app is using + * @param packageName package name of the calling app + * @param purchaseToken token in the purchase information JSON that identifies the purchase + * to be consumed + * @return 0 if consumption succeeded. Appropriate error values for failures. + */ + int consumePurchase(int apiVersion, String packageName, String purchaseToken); +} diff --git a/platform/android/java/ant.properties b/platform/android/java/ant.properties deleted file mode 100644 index b0971e891e..0000000000 --- a/platform/android/java/ant.properties +++ /dev/null @@ -1,17 +0,0 @@ -# This file is used to override default values used by the Ant build system. -# -# This file must be checked into Version Control Systems, as it is -# integral to the build system of your project. - -# This file is only used by the Ant script. - -# You can use this to override default values such as -# 'source.dir' for the location of your java source folder and -# 'out.dir' for the location of your output folder. - -# You can also use it define how the release builds are signed by declaring -# the following properties: -# 'key.store' for the location of your keystore and -# 'key.alias' for the name of the key to use. -# The password will be asked during the build when you use the 'release' target. - diff --git a/platform/android/java/build.properties b/platform/android/java/build.properties deleted file mode 100644 index ee52d86d94..0000000000 --- a/platform/android/java/build.properties +++ /dev/null @@ -1,17 +0,0 @@ -# This file is used to override default values used by the Ant build system. -# -# This file must be checked in Version Control Systems, as it is -# integral to the build system of your project. - -# This file is only used by the Ant script. - -# You can use this to override default values such as -# 'source.dir' for the location of your java source folder and -# 'out.dir' for the location of your output folder. - -# You can also use it define how the release builds are signed by declaring -# the following properties: -# 'key.store' for the location of your keystore and -# 'key.alias' for the name of the key to use. -# The password will be asked during the build when you use the 'release' target. - diff --git a/platform/android/java/build.xml b/platform/android/java/build.xml deleted file mode 100644 index 424e2827dc..0000000000 --- a/platform/android/java/build.xml +++ /dev/null @@ -1,92 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="Godot" default="help"> - - <!-- The local.properties file is created and updated by the 'android' tool. - It contains the path to the SDK. It should *NOT* be checked into - Version Control Systems. --> - <property file="local.properties" /> - - <!-- The ant.properties file can be created by you. It is only edited by the - 'android' tool to add properties to it. - This is the place to change some Ant specific build properties. - Here are some properties you may want to change/update: - - source.dir - The name of the source directory. Default is 'src'. - out.dir - The name of the output directory. Default is 'bin'. - - For other overridable properties, look at the beginning of the rules - files in the SDK, at tools/ant/build.xml - - Properties related to the SDK location or the project target should - be updated using the 'android' tool with the 'update' action. - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. - - --> - <property file="ant.properties" /> - - <!-- if sdk.dir was not set from one of the property file, then - get it from the ANDROID_HOME env var. - This must be done before we load project.properties since - the proguard config can use sdk.dir --> - <property environment="env" /> - <condition property="sdk.dir" value="${env.ANDROID_HOME}"> - <isset property="env.ANDROID_HOME" /> - </condition> - - <!-- The project.properties file is created and updated by the 'android' - tool, as well as ADT. - - This contains project specific properties such as project target, and library - dependencies. Lower level build properties are stored in ant.properties - (or in .classpath for Eclipse projects). - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. --> - <loadproperties srcFile="project.properties" /> - - <!-- quick check on sdk.dir --> - <fail - message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable." - unless="sdk.dir" - /> - - <!-- - Import per project custom build rules if present at the root of the project. - This is the place to put custom intermediary targets such as: - -pre-build - -pre-compile - -post-compile (This is typically used for code obfuscation. - Compiled code location: ${out.classes.absolute.dir} - If this is not done in place, override ${out.dex.input.absolute.dir}) - -post-package - -post-build - -pre-clean - --> - <import file="custom_rules.xml" optional="true" /> - - <!-- Import the actual build file. - - To customize existing targets, there are two options: - - Customize only one target: - - copy/paste the target into this file, *before* the - <import> task. - - customize it to your needs. - - Customize the whole content of build.xml - - copy/paste the content of the rules files (minus the top node) - into this file, replacing the <import> task. - - customize to your needs. - - *********************** - ****** IMPORTANT ****** - *********************** - In all cases you must update the value of version-tag below to read 'custom' instead of an integer, - in order to avoid having your file be overridden by tools such as "android update project" - --> - <!-- version-tag: 1 --> - <import file="${sdk.dir}/tools/ant/build.xml" /> - -</project> diff --git a/platform/android/java/default.properties b/platform/android/java/default.properties deleted file mode 100644 index e2e8061f26..0000000000 --- a/platform/android/java/default.properties +++ /dev/null @@ -1,11 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "build.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-8 diff --git a/platform/android/java/gradle/wrapper/gradle-wrapper.jar b/platform/android/java/gradle/wrapper/gradle-wrapper.jar Binary files differnew file mode 100644 index 0000000000..8c0fb64a86 --- /dev/null +++ b/platform/android/java/gradle/wrapper/gradle-wrapper.jar diff --git a/platform/android/java/gradle/wrapper/gradle-wrapper.properties b/platform/android/java/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..0c71e760dc --- /dev/null +++ b/platform/android/java/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/platform/android/java/gradlew b/platform/android/java/gradlew new file mode 100755 index 0000000000..91a7e269e1 --- /dev/null +++ b/platform/android/java/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/platform/android/java/gradlew.bat b/platform/android/java/gradlew.bat new file mode 100644 index 0000000000..aec99730b4 --- /dev/null +++ b/platform/android/java/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/platform/android/java/my-release-key.keystore b/platform/android/java/my-release-key.keystore Binary files differdeleted file mode 100644 index 410cccd865..0000000000 --- a/platform/android/java/my-release-key.keystore +++ /dev/null diff --git a/platform/android/java/proguard-project.txt b/platform/android/java/proguard-project.txt deleted file mode 100644 index f2fe1559a2..0000000000 --- a/platform/android/java/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/platform/android/java/proguard.cfg b/platform/android/java/proguard.cfg deleted file mode 100644 index 12dd0392c0..0000000000 --- a/platform/android/java/proguard.cfg +++ /dev/null @@ -1,36 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference --keep public class com.android.vending.licensing.ILicensingService - --keepclasseswithmembernames class * { - native <methods>; -} - --keepclasseswithmembernames class * { - public <init>(android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembernames class * { - public <init>(android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} diff --git a/platform/android/libs/apk_expansion/res/drawable-hdpi/notify_panel_notification_icon_bg.png b/platform/android/java/res/drawable-hdpi/notify_panel_notification_icon_bg.png Binary files differindex f5b762ecf3..f5b762ecf3 100644 --- a/platform/android/libs/apk_expansion/res/drawable-hdpi/notify_panel_notification_icon_bg.png +++ b/platform/android/java/res/drawable-hdpi/notify_panel_notification_icon_bg.png diff --git a/platform/android/libs/apk_expansion/res/drawable-mdpi/notify_panel_notification_icon_bg.png b/platform/android/java/res/drawable-mdpi/notify_panel_notification_icon_bg.png Binary files differindex 9ecb8af06c..9ecb8af06c 100644 --- a/platform/android/libs/apk_expansion/res/drawable-mdpi/notify_panel_notification_icon_bg.png +++ b/platform/android/java/res/drawable-mdpi/notify_panel_notification_icon_bg.png diff --git a/platform/android/libs/apk_expansion/res/layout/status_bar_ongoing_event_progress_bar.xml b/platform/android/java/res/layout/status_bar_ongoing_event_progress_bar.xml index 23bac02294..23bac02294 100644 --- a/platform/android/libs/apk_expansion/res/layout/status_bar_ongoing_event_progress_bar.xml +++ b/platform/android/java/res/layout/status_bar_ongoing_event_progress_bar.xml diff --git a/platform/android/libs/apk_expansion/res/values-v11/styles.xml b/platform/android/java/res/values-v11/styles.xml index f2013bc0bf..f2013bc0bf 100644 --- a/platform/android/libs/apk_expansion/res/values-v11/styles.xml +++ b/platform/android/java/res/values-v11/styles.xml diff --git a/platform/android/libs/apk_expansion/res/values-v9/styles.xml b/platform/android/java/res/values-v9/styles.xml index 736e77a5d6..736e77a5d6 100644 --- a/platform/android/libs/apk_expansion/res/values-v9/styles.xml +++ b/platform/android/java/res/values-v9/styles.xml diff --git a/platform/android/java/res/values/strings.xml b/platform/android/java/res/values/strings.xml index 49ebcc06f9..e1dbdfc062 100644 --- a/platform/android/java/res/values/strings.xml +++ b/platform/android/java/res/values/strings.xml @@ -14,4 +14,44 @@ <string name="text_button_resume">Resume Download</string> <string name="text_button_cancel">Cancel</string> <string name="text_button_cancel_verify">Cancel Verification</string> -</resources> + + <!-- APK Expansion Strings --> + + <!-- When a download completes, a notification is displayed, and this + string is used to indicate that the download successfully completed. + Note that such a download could have been initiated by a variety of + applications, including (but not limited to) the browser, an email + application, a content marketplace. --> + <string name="notification_download_complete">Download complete</string> + + <!-- When a download completes, a notification is displayed, and this + string is used to indicate that the download failed. + Note that such a download could have been initiated by a variety of + applications, including (but not limited to) the browser, an email + application, a content marketplace. --> + <string name="notification_download_failed">Download unsuccessful</string> + + + <string name="state_unknown">Starting..."</string> + <string name="state_idle">Waiting for download to start</string> + <string name="state_fetching_url">Looking for resources to download</string> + <string name="state_connecting">Connecting to the download server</string> + <string name="state_downloading">Downloading resources</string> + <string name="state_completed">Download finished</string> + <string name="state_paused_network_unavailable">Download paused because no network is available</string> + <string name="state_paused_network_setup_failure">Download paused. Test a website in browser</string> + <string name="state_paused_by_request">Download paused</string> + <string name="state_paused_wifi_unavailable">Download paused because wifi is unavailable</string> + <string name="state_paused_wifi_disabled">Download paused because wifi is disabled</string> + <string name="state_paused_roaming">Download paused because you are roaming</string> + <string name="state_paused_sdcard_unavailable">Download paused because the external storage is unavailable</string> + <string name="state_failed_unlicensed">Download failed because you may not have purchased this app</string> + <string name="state_failed_fetching_url">Download failed because the resources could not be found</string> + <string name="state_failed_sdcard_full">Download failed because the external storage is full</string> + <string name="state_failed_cancelled">Download cancelled</string> + <string name="state_failed">Download failed</string> + + <string name="kilobytes_per_second">%1$s KB/s</string> + <string name="time_remaining">Time remaining: %1$s</string> + <string name="time_remaining_notification">%1$s left</string> +</resources>
\ No newline at end of file diff --git a/platform/android/libs/apk_expansion/res/values/styles.xml b/platform/android/java/res/values/styles.xml index a442f61e7e..a442f61e7e 100644 --- a/platform/android/libs/apk_expansion/res/values/styles.xml +++ b/platform/android/java/res/values/styles.xml diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/AESObfuscator.java b/platform/android/java/src/com/android/vending/licensing/AESObfuscator.java index ee12c68deb..ee12c68deb 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/AESObfuscator.java +++ b/platform/android/java/src/com/android/vending/licensing/AESObfuscator.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/APKExpansionPolicy.java b/platform/android/java/src/com/android/vending/licensing/APKExpansionPolicy.java index 17cc7a7cfd..17cc7a7cfd 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/APKExpansionPolicy.java +++ b/platform/android/java/src/com/android/vending/licensing/APKExpansionPolicy.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/DeviceLimiter.java b/platform/android/java/src/com/android/vending/licensing/DeviceLimiter.java index e5c5e2d7ca..e5c5e2d7ca 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/DeviceLimiter.java +++ b/platform/android/java/src/com/android/vending/licensing/DeviceLimiter.java diff --git a/platform/android/libs/play_licensing/aidl/ILicenseResultListener.aidl b/platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.aidl index c816558afc..c816558afc 100644 --- a/platform/android/libs/play_licensing/aidl/ILicenseResultListener.aidl +++ b/platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.aidl diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ILicenseResultListener.java b/platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.java index d90d6eac7b..d90d6eac7b 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ILicenseResultListener.java +++ b/platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.java diff --git a/platform/android/libs/play_licensing/aidl/ILicensingService.aidl b/platform/android/java/src/com/android/vending/licensing/ILicensingService.aidl index 664510ce0c..664510ce0c 100644 --- a/platform/android/libs/play_licensing/aidl/ILicensingService.aidl +++ b/platform/android/java/src/com/android/vending/licensing/ILicensingService.aidl diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ILicensingService.java b/platform/android/java/src/com/android/vending/licensing/ILicensingService.java index 95599544e4..95599544e4 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ILicensingService.java +++ b/platform/android/java/src/com/android/vending/licensing/ILicensingService.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseChecker.java b/platform/android/java/src/com/android/vending/licensing/LicenseChecker.java index 8b53545e61..0b1c4b6cca 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseChecker.java +++ b/platform/android/java/src/com/android/vending/licensing/LicenseChecker.java @@ -63,7 +63,7 @@ public class LicenseChecker implements ServiceConnection { private static final int TIMEOUT_MS = 10 * 1000; private static final SecureRandom RANDOM = new SecureRandom(); - private static final boolean DEBUG_LICENSE_ERROR = true; + private static final boolean DEBUG_LICENSE_ERROR = false; private ILicensingService mService; diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseCheckerCallback.java b/platform/android/java/src/com/android/vending/licensing/LicenseCheckerCallback.java index b250a7147b..b250a7147b 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseCheckerCallback.java +++ b/platform/android/java/src/com/android/vending/licensing/LicenseCheckerCallback.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseValidator.java b/platform/android/java/src/com/android/vending/licensing/LicenseValidator.java index 61d3c7e79e..61d3c7e79e 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseValidator.java +++ b/platform/android/java/src/com/android/vending/licensing/LicenseValidator.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/NullDeviceLimiter.java b/platform/android/java/src/com/android/vending/licensing/NullDeviceLimiter.java index d87af3153f..d87af3153f 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/NullDeviceLimiter.java +++ b/platform/android/java/src/com/android/vending/licensing/NullDeviceLimiter.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/Obfuscator.java b/platform/android/java/src/com/android/vending/licensing/Obfuscator.java index b5d510d72d..b5d510d72d 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/Obfuscator.java +++ b/platform/android/java/src/com/android/vending/licensing/Obfuscator.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/Policy.java b/platform/android/java/src/com/android/vending/licensing/Policy.java index fa267fc71a..fa267fc71a 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/Policy.java +++ b/platform/android/java/src/com/android/vending/licensing/Policy.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/PreferenceObfuscator.java b/platform/android/java/src/com/android/vending/licensing/PreferenceObfuscator.java index 7c42bfc28a..7c42bfc28a 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/PreferenceObfuscator.java +++ b/platform/android/java/src/com/android/vending/licensing/PreferenceObfuscator.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ResponseData.java b/platform/android/java/src/com/android/vending/licensing/ResponseData.java index 2adef3709e..2adef3709e 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ResponseData.java +++ b/platform/android/java/src/com/android/vending/licensing/ResponseData.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ServerManagedPolicy.java b/platform/android/java/src/com/android/vending/licensing/ServerManagedPolicy.java index fbf8cf6d00..fbf8cf6d00 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ServerManagedPolicy.java +++ b/platform/android/java/src/com/android/vending/licensing/ServerManagedPolicy.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/StrictPolicy.java b/platform/android/java/src/com/android/vending/licensing/StrictPolicy.java index d8d83b4e4b..d8d83b4e4b 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/StrictPolicy.java +++ b/platform/android/java/src/com/android/vending/licensing/StrictPolicy.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ValidationException.java b/platform/android/java/src/com/android/vending/licensing/ValidationException.java index ee4df47c68..ee4df47c68 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ValidationException.java +++ b/platform/android/java/src/com/android/vending/licensing/ValidationException.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/util/Base64.java b/platform/android/java/src/com/android/vending/licensing/util/Base64.java index a0d2779af2..a0d2779af2 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/util/Base64.java +++ b/platform/android/java/src/com/android/vending/licensing/util/Base64.java diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/util/Base64DecoderException.java b/platform/android/java/src/com/android/vending/licensing/util/Base64DecoderException.java index 1aef1b54b8..1aef1b54b8 100644 --- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/util/Base64DecoderException.java +++ b/platform/android/java/src/com/android/vending/licensing/util/Base64DecoderException.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/Constants.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/Constants.java index ff2c6f535a..ff2c6f535a 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/Constants.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/Constants.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java index 9cb294d721..9cb294d721 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java index 2201751254..2201751254 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java index 054eaa9895..054eaa9895 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/Helpers.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java index 1e84e54a0f..b4c28d36e7 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/Helpers.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java @@ -16,7 +16,7 @@ package com.google.android.vending.expansion.downloader; -import com.android.vending.expansion.downloader.R; +import com.godot.game.R; import android.content.Context; import android.os.Environment; diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java index b8511a62a0..b8511a62a0 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IDownloaderService.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/IDownloaderService.java index 4789afe19c..4789afe19c 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IDownloaderService.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/IDownloaderService.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IStub.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/IStub.java index d5bc3a843e..d5bc3a843e 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IStub.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/IStub.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/SystemFacade.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/SystemFacade.java index 12edd97ab2..12edd97ab2 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/SystemFacade.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/SystemFacade.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java index 4667acce67..4667acce67 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java index b77af7e085..b77af7e085 100755 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java index 9a0ca02122..9a0ca02122 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java index 45111b16a3..45111b16a3 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java index eef205d7b7..d82b658bc3 100644 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java @@ -16,7 +16,7 @@ package com.google.android.vending.expansion.downloader.impl; -import com.android.vending.expansion.downloader.R; +import com.godot.game.R; import com.google.android.vending.expansion.downloader.DownloadProgressInfo; import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; import com.google.android.vending.expansion.downloader.Helpers; diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java index 056d1eca0b..056d1eca0b 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java index 627bf3eedd..627bf3eedd 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java index 250299c400..250299c400 100755 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java index 3f440e9893..3f440e9893 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java index e736603e2a..2e049a4d47 100644 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java @@ -16,7 +16,7 @@ package com.google.android.vending.expansion.downloader.impl; -import com.android.vending.expansion.downloader.R; +import com.godot.game.R; import com.google.android.vending.expansion.downloader.Helpers; import android.app.Notification; diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java index e3666e05b9..94e21de7ca 100644 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java @@ -16,7 +16,7 @@ package com.google.android.vending.expansion.downloader.impl; -import com.android.vending.expansion.downloader.R; +import com.godot.game.R; import com.google.android.vending.expansion.downloader.Helpers; import android.app.Notification; diff --git a/platform/android/java/src/com/android/godot/Dictionary.java b/platform/android/java/src/org/godotengine/godot/Dictionary.java index 4ed12f5818..34051c4bb8 100644 --- a/platform/android/java/src/com/android/godot/Dictionary.java +++ b/platform/android/java/src/org/godotengine/godot/Dictionary.java @@ -26,7 +26,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package com.android.godot; +package org.godotengine.godot; import java.util.HashMap; import java.util.Set; diff --git a/platform/android/java/src/com/android/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index 4c5a313576..c6bc6a6943 100644 --- a/platform/android/java/src/com/android/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,7 +26,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package com.android.godot; +package org.godotengine.godot; import android.R; import android.app.Activity; @@ -60,14 +60,14 @@ import java.lang.reflect.Method; import java.util.List; import java.util.ArrayList; -import com.android.godot.payments.PaymentsManager; +import org.godotengine.godot.payments.PaymentsManager; import java.io.IOException; import android.provider.Settings.Secure; import android.widget.FrameLayout; -import com.android.godot.input.*; +import org.godotengine.godot.input.*; import java.io.InputStream; import javax.microedition.khronos.opengles.GL10; diff --git a/platform/android/java/src/com/android/godot/GodotDownloaderAlarmReceiver.java b/platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java index e82c3eb0fe..b602f4757c 100644 --- a/platform/android/java/src/com/android/godot/GodotDownloaderAlarmReceiver.java +++ b/platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java @@ -1,4 +1,4 @@ -package com.android.godot; +package org.godotengine.godot; import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; diff --git a/platform/android/java/src/com/android/godot/GodotDownloaderService.java b/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java index 2657edc1d2..6735d387f3 100644 --- a/platform/android/java/src/com/android/godot/GodotDownloaderService.java +++ b/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java @@ -1,4 +1,4 @@ -package com.android.godot; +package org.godotengine.godot; import android.content.Context; import android.content.SharedPreferences; diff --git a/platform/android/java/src/com/android/godot/GodotIO.java b/platform/android/java/src/org/godotengine/godot/GodotIO.java index a7dc0c2f75..3e6919c2ad 100644 --- a/platform/android/java/src/com/android/godot/GodotIO.java +++ b/platform/android/java/src/org/godotengine/godot/GodotIO.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,7 +26,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package com.android.godot; +package org.godotengine.godot; import java.util.HashMap; import java.util.Locale; import android.net.Uri; @@ -47,7 +47,7 @@ import android.media.*; import android.hardware.*; import android.content.*; import android.content.pm.ActivityInfo; -import com.android.godot.input.*; +import org.godotengine.godot.input.*; //android.os.Build // Wrapper for native library diff --git a/platform/android/java/src/com/android/godot/GodotLib.java b/platform/android/java/src/org/godotengine/godot/GodotLib.java index 3d870b3b1f..aef6591864 100644 --- a/platform/android/java/src/com/android/godot/GodotLib.java +++ b/platform/android/java/src/org/godotengine/godot/GodotLib.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,7 +26,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package com.android.godot; +package org.godotengine.godot; // Wrapper for native library diff --git a/platform/android/java/src/com/android/godot/GodotPaymentV3.java b/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java index 0799e1e83d..6bec49410d 100644 --- a/platform/android/java/src/com/android/godot/GodotPaymentV3.java +++ b/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java @@ -1,6 +1,6 @@ -package com.android.godot; +package org.godotengine.godot; -import com.android.godot.Dictionary; +import org.godotengine.godot.Dictionary; import android.app.Activity; import android.util.Log; diff --git a/platform/android/java/src/com/android/godot/GodotView.java b/platform/android/java/src/org/godotengine/godot/GodotView.java index bc249d46c6..492eb4cb54 100644 --- a/platform/android/java/src/com/android/godot/GodotView.java +++ b/platform/android/java/src/org/godotengine/godot/GodotView.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,7 +26,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package com.android.godot; +package org.godotengine.godot; import android.content.Context; import android.graphics.PixelFormat; import android.opengl.GLSurfaceView; diff --git a/platform/android/java/src/com/android/godot/input/GodotEditText.java b/platform/android/java/src/org/godotengine/godot/input/GodotEditText.java index 5898e95423..c8ffa74ecd 100644 --- a/platform/android/java/src/com/android/godot/input/GodotEditText.java +++ b/platform/android/java/src/org/godotengine/godot/input/GodotEditText.java @@ -1,9 +1,9 @@ -package com.android.godot.input; +package org.godotengine.godot.input; import android.content.Context; import android.util.AttributeSet; import android.view.KeyEvent; import android.widget.EditText; -import com.android.godot.*; +import org.godotengine.godot.*; import android.os.Handler; import android.os.Message; import android.view.inputmethod.InputMethodManager; diff --git a/platform/android/java/src/com/android/godot/input/GodotTextInputWrapper.java b/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java index 537fa6aa76..64d8826b44 100644 --- a/platform/android/java/src/com/android/godot/input/GodotTextInputWrapper.java +++ b/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java @@ -1,4 +1,4 @@ -package com.android.godot.input; +package org.godotengine.godot.input; import android.content.Context; import android.text.Editable; import android.text.TextWatcher; @@ -8,7 +8,7 @@ import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; -import com.android.godot.*; +import org.godotengine.godot.*; public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListener { // =========================================================== diff --git a/platform/android/java/src/com/android/godot/payments/ConsumeTask.java b/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java index c983960770..61ccb97161 100644 --- a/platform/android/java/src/com/android/godot/payments/ConsumeTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java @@ -1,4 +1,4 @@ -package com.android.godot.payments; +package org.godotengine.godot.payments; import com.android.vending.billing.IInAppBillingService; diff --git a/platform/android/java/src/com/android/godot/payments/GenericConsumeTask.java b/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java index d68f029246..293e903284 100644 --- a/platform/android/java/src/com/android/godot/payments/GenericConsumeTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java @@ -1,4 +1,4 @@ -package com.android.godot.payments; +package org.godotengine.godot.payments; import com.android.vending.billing.IInAppBillingService; diff --git a/platform/android/java/src/com/android/godot/payments/HandlePurchaseTask.java b/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java index 4c31704cc8..d120551e4a 100644 --- a/platform/android/java/src/com/android/godot/payments/HandlePurchaseTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java @@ -1,10 +1,10 @@ -package com.android.godot.payments; +package org.godotengine.godot.payments; import org.json.JSONException; import org.json.JSONObject; -import com.android.godot.GodotLib; -import com.android.godot.utils.Crypt; +import org.godotengine.godot.GodotLib; +import org.godotengine.godot.utils.Crypt; import com.android.vending.billing.IInAppBillingService; import android.app.Activity; diff --git a/platform/android/java/src/com/android/godot/payments/PaymentsCache.java b/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java index 1de772bf28..5f3d931593 100644 --- a/platform/android/java/src/com/android/godot/payments/PaymentsCache.java +++ b/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java @@ -1,4 +1,4 @@ -package com.android.godot.payments; +package org.godotengine.godot.payments; import android.content.Context; import android.content.SharedPreferences; diff --git a/platform/android/java/src/com/android/godot/payments/PaymentsManager.java b/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java index 189f7108c1..effb58aa35 100644 --- a/platform/android/java/src/com/android/godot/payments/PaymentsManager.java +++ b/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java @@ -1,4 +1,4 @@ -package com.android.godot.payments; +package org.godotengine.godot.payments; import java.util.ArrayList; import java.util.List; @@ -17,9 +17,9 @@ import org.json.JSONException; import org.json.JSONObject; import org.json.JSONStringer; -import com.android.godot.Dictionary; -import com.android.godot.Godot; -import com.android.godot.GodotPaymentV3; +import org.godotengine.godot.Dictionary; +import org.godotengine.godot.Godot; +import org.godotengine.godot.GodotPaymentV3; import com.android.vending.billing.IInAppBillingService; public class PaymentsManager { diff --git a/platform/android/java/src/com/android/godot/payments/PurchaseTask.java b/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java index c1f9d164a1..8b048d8065 100644 --- a/platform/android/java/src/com/android/godot/payments/PurchaseTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java @@ -1,10 +1,10 @@ -package com.android.godot.payments; +package org.godotengine.godot.payments; import org.json.JSONException; import org.json.JSONObject; -import com.android.godot.GodotLib; -import com.android.godot.utils.Crypt; +import org.godotengine.godot.GodotLib; +import org.godotengine.godot.utils.Crypt; import com.android.vending.billing.IInAppBillingService; import android.app.Activity; diff --git a/platform/android/java/src/com/android/godot/payments/ReleaseAllConsumablesTask.java b/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java index c1a9c5d421..7bb5131b49 100644 --- a/platform/android/java/src/com/android/godot/payments/ReleaseAllConsumablesTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java @@ -1,12 +1,12 @@ -package com.android.godot.payments; +package org.godotengine.godot.payments; import java.util.ArrayList; import org.json.JSONException; import org.json.JSONObject; -import com.android.godot.Dictionary; -import com.android.godot.Godot; +import org.godotengine.godot.Dictionary; +import org.godotengine.godot.Godot; import com.android.vending.billing.IInAppBillingService; import android.content.Context; diff --git a/platform/android/java/src/com/android/godot/payments/ValidateTask.java b/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java index 6ea415e8a9..2fcf7483b4 100644 --- a/platform/android/java/src/com/android/godot/payments/ValidateTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java @@ -1,14 +1,14 @@ -package com.android.godot.payments; +package org.godotengine.godot.payments; import org.json.JSONException; import org.json.JSONObject; -import com.android.godot.Godot; -import com.android.godot.GodotLib; -import com.android.godot.GodotPaymentV3; -import com.android.godot.utils.Crypt; -import com.android.godot.utils.HttpRequester; -import com.android.godot.utils.RequestParams; +import org.godotengine.godot.Godot; +import org.godotengine.godot.GodotLib; +import org.godotengine.godot.GodotPaymentV3; +import org.godotengine.godot.utils.Crypt; +import org.godotengine.godot.utils.HttpRequester; +import org.godotengine.godot.utils.RequestParams; import com.android.vending.billing.IInAppBillingService; import android.app.Activity; diff --git a/platform/android/java/src/com/android/godot/utils/Crypt.java b/platform/android/java/src/org/godotengine/godot/utils/Crypt.java index 7801f474b9..2fb81cef8c 100644 --- a/platform/android/java/src/com/android/godot/utils/Crypt.java +++ b/platform/android/java/src/org/godotengine/godot/utils/Crypt.java @@ -1,4 +1,4 @@ -package com.android.godot.utils; +package org.godotengine.godot.utils; import java.security.MessageDigest; import java.util.Random; diff --git a/platform/android/java/src/com/android/godot/utils/CustomSSLSocketFactory.java b/platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java index 5f2b44fc8c..2db88fcc9b 100644 --- a/platform/android/java/src/com/android/godot/utils/CustomSSLSocketFactory.java +++ b/platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java @@ -1,4 +1,4 @@ -package com.android.godot.utils; +package org.godotengine.godot.utils; import java.io.IOException; import java.net.Socket; import java.net.UnknownHostException; diff --git a/platform/android/java/src/com/android/godot/utils/HttpRequester.java b/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java index 7de77881d0..14346702cc 100644 --- a/platform/android/java/src/com/android/godot/utils/HttpRequester.java +++ b/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java @@ -1,4 +1,4 @@ -package com.android.godot.utils; +package org.godotengine.godot.utils; import java.io.BufferedReader; import java.io.IOException; diff --git a/platform/android/java/src/com/android/godot/utils/RequestParams.java b/platform/android/java/src/org/godotengine/godot/utils/RequestParams.java index 31bf1940ad..36753e368c 100644 --- a/platform/android/java/src/com/android/godot/utils/RequestParams.java +++ b/platform/android/java/src/org/godotengine/godot/utils/RequestParams.java @@ -1,4 +1,4 @@ -package com.android.godot.utils; +package org.godotengine.godot.utils; import java.util.ArrayList; import java.util.Date; diff --git a/platform/android/java_class_wrapper.cpp b/platform/android/java_class_wrapper.cpp index d4cf848484..283ea81152 100644 --- a/platform/android/java_class_wrapper.cpp +++ b/platform/android/java_class_wrapper.cpp @@ -1281,7 +1281,7 @@ JavaClassWrapper::JavaClassWrapper(jobject p_activity) { JNIEnv *env = ThreadAndroid::get_env(); - jclass activityClass = env->FindClass("com/android/godot/Godot"); + jclass activityClass = env->FindClass("org/godotengine/godot/Godot"); jmethodID getClassLoader = env->GetMethodID(activityClass,"getClassLoader", "()Ljava/lang/ClassLoader;"); classLoader = env->CallObjectMethod(p_activity, getClassLoader); classLoader=(jclass)env->NewGlobalRef(classLoader); diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 2cc74c3bb0..459cf4c994 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -138,7 +138,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant* p_a case Variant::DICTIONARY: { Dictionary dict = *p_arg; - jclass dclass = env->FindClass("com/android/godot/Dictionary"); + jclass dclass = env->FindClass("org/godotengine/godot/Dictionary"); jmethodID ctor = env->GetMethodID(dclass, "<init>", "()V"); jobject jdict = env->NewObject(dclass, ctor); @@ -373,7 +373,7 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) { return varr; }; - if (name == "java.util.HashMap" || name == "com.android.godot.Dictionary") { + if (name == "java.util.HashMap" || name == "org.godotengine.godot.Dictionary") { Dictionary ret(true); jclass oclass = c; @@ -765,7 +765,7 @@ static void _stop_video() { env->CallVoidMethod(godot_io, _stopVideo); } -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env, jobject obj, jobject activity,jboolean p_need_reload_hook, jobjectArray p_cmdline,jobject p_asset_manager) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv * env, jobject obj, jobject activity,jboolean p_need_reload_hook, jobjectArray p_cmdline,jobject p_asset_manager) { __android_log_print(ANDROID_LOG_INFO,"godot","**INIT EVENT! - %p\n",env); @@ -783,7 +783,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env, { //setup IO Object - jclass cls = env->FindClass("com/android/godot/Godot"); + jclass cls = env->FindClass("org/godotengine/godot/Godot"); if (cls) { cls=(jclass)env->NewGlobalRef(cls); @@ -791,7 +791,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env, } __android_log_print(ANDROID_LOG_INFO,"godot","STEP2, %p",cls); - jfieldID fid = env->GetStaticFieldID(cls, "io", "Lcom/android/godot/GodotIO;"); + jfieldID fid = env->GetStaticFieldID(cls, "io", "Lorg/godotengine/godot/GodotIO;"); __android_log_print(ANDROID_LOG_INFO,"godot","STEP3 %i",fid); jobject ob = env->GetStaticObjectField(cls,fid); __android_log_print(ANDROID_LOG_INFO,"godot","STEP4, %p",ob); @@ -802,7 +802,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env, _on_video_init = env->GetMethodID(cls, "onVideoInit", "(Z)V"); - jclass clsio = env->FindClass("com/android/godot/Godot"); + jclass clsio = env->FindClass("org/godotengine/godot/Godot"); if (cls) { jclass c = env->GetObjectClass(gob); _openURI = env->GetMethodID(c,"openURI","(Ljava/lang/String;)I"); @@ -905,7 +905,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env, } -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_resize(JNIEnv * env, jobject obj, jint width, jint height, jboolean reload) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv * env, jobject obj, jint width, jint height, jboolean reload) { __android_log_print(ANDROID_LOG_INFO,"godot","^_^_^_^_^ resize %lld, %i, %i\n",Thread::get_caller_ID(),width,height); if (os_android) @@ -920,7 +920,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_resize(JNIEnv * env, jobj } -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_newcontext(JNIEnv * env, jobject obj,bool p_32_bits) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv * env, jobject obj,bool p_32_bits) { __android_log_print(ANDROID_LOG_INFO,"godot","^_^_^_^_^ newcontext %lld\n",Thread::get_caller_ID()); @@ -937,7 +937,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_newcontext(JNIEnv * env, } -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_quit(JNIEnv * env, jobject obj) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_quit(JNIEnv * env, jobject obj) { input_mutex->lock(); quit_request=true; @@ -958,7 +958,7 @@ static void _initialize_java_modules() { JNIEnv *env = ThreadAndroid::get_env(); - jclass activityClass = env->FindClass("com/android/godot/Godot"); + jclass activityClass = env->FindClass("org/godotengine/godot/Godot"); jmethodID getClassLoader = env->GetMethodID(activityClass,"getClassLoader", "()Ljava/lang/ClassLoader;"); @@ -987,7 +987,7 @@ static void _initialize_java_modules() { //singletonClass=(jclass)env->NewGlobalRef(singletonClass); __android_log_print(ANDROID_LOG_INFO,"godot","****^*^*?^*^*class data %x",singletonClass); - jmethodID initialize = env->GetStaticMethodID(singletonClass, "initialize", "(Landroid/app/Activity;)Lcom/android/godot/Godot$SingletonBase;"); + jmethodID initialize = env->GetStaticMethodID(singletonClass, "initialize", "(Landroid/app/Activity;)Lorg/godotengine/godot/Godot$SingletonBase;"); if (!initialize) { @@ -1007,7 +1007,7 @@ static void _initialize_java_modules() { } -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_step(JNIEnv * env, jobject obj) +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv * env, jobject obj) { @@ -1074,7 +1074,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_step(JNIEnv * env, jobjec if (os_android->main_loop_iterate()==true) { - jclass cls = env->FindClass("com/android/godot/Godot"); + jclass cls = env->FindClass("org/godotengine/godot/Godot"); jmethodID _finish = env->GetMethodID(cls, "forceQuit", "()V"); env->CallVoidMethod(_godot_instance, _finish); __android_log_print(ANDROID_LOG_INFO,"godot","**FINISH REQUEST!!! - %p-%i\n",env,Thread::get_caller_ID()); @@ -1085,7 +1085,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_step(JNIEnv * env, jobjec } -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_touch(JNIEnv * env, jobject obj, jint ev,jint pointer, jint count, jintArray positions) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_touch(JNIEnv * env, jobject obj, jint ev,jint pointer, jint count, jintArray positions) { @@ -1390,7 +1390,7 @@ static int find_device(int p_device) { return joy_device_ids.size() - 1; }; -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_joybutton(JNIEnv * env, jobject obj, jint p_device, jint p_button, jboolean p_pressed) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joybutton(JNIEnv * env, jobject obj, jint p_device, jint p_button, jboolean p_pressed) { InputEvent ievent; ievent.type = InputEvent::JOYSTICK_BUTTON; @@ -1403,7 +1403,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_joybutton(JNIEnv * env, j input_mutex->unlock(); }; -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_joyaxis(JNIEnv * env, jobject obj, jint p_device, jint p_axis, jfloat p_value) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyaxis(JNIEnv * env, jobject obj, jint p_device, jint p_axis, jfloat p_value) { InputEvent ievent; ievent.type = InputEvent::JOYSTICK_MOTION; @@ -1417,7 +1417,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_joyaxis(JNIEnv * env, job }; -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_key(JNIEnv * env, jobject obj, jint p_scancode, jint p_unicode_char, jboolean p_pressed) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_key(JNIEnv * env, jobject obj, jint p_scancode, jint p_unicode_char, jboolean p_pressed) { InputEvent ievent; ievent.type = InputEvent::KEY; @@ -1455,7 +1455,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_key(JNIEnv * env, jobject }; -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_accelerometer(JNIEnv * env, jobject obj, jfloat x, jfloat y, jfloat z) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_accelerometer(JNIEnv * env, jobject obj, jfloat x, jfloat y, jfloat z) { input_mutex->lock(); accelerometer=Vector3(x,y,z); @@ -1463,7 +1463,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_accelerometer(JNIEnv * en } -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_focusin(JNIEnv * env, jobject obj){ +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusin(JNIEnv * env, jobject obj){ if (!suspend_mutex) return; @@ -1475,7 +1475,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_focusin(JNIEnv * env, job suspend_mutex->unlock(); } -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_focusout(JNIEnv * env, jobject obj){ +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusout(JNIEnv * env, jobject obj){ if (!suspend_mutex) return; @@ -1490,7 +1490,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_focusout(JNIEnv * env, jo -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_audio(JNIEnv * env, jobject obj) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_audio(JNIEnv * env, jobject obj) { ThreadAndroid::setup_thread(); AudioDriverAndroid::thread_func(env); @@ -1499,7 +1499,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_audio(JNIEnv * env, jobje } -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_singleton(JNIEnv * env, jobject obj, jstring name,jobject p_object){ +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_singleton(JNIEnv * env, jobject obj, jstring name,jobject p_object){ String singname = env->GetStringUTFChars( name, NULL ); JNISingleton *s = memnew( JNISingleton ); @@ -1528,7 +1528,7 @@ static Variant::Type get_jni_type(const String& p_type) { {"[B",Variant::RAW_ARRAY}, {"[F",Variant::REAL_ARRAY}, {"[java.lang.String",Variant::STRING_ARRAY}, - {"com.android.godot.Dictionary", Variant::DICTIONARY}, + {"org.godotengine.godot.Dictionary", Variant::DICTIONARY}, {NULL,Variant::NIL} }; @@ -1559,7 +1559,7 @@ static const char* get_jni_sig(const String& p_type) { {"float","F"}, {"double","D"}, {"java.lang.String","Ljava/lang/String;"}, - {"com.android.godot.Dictionary", "Lcom/android/godot/Dictionary;"}, + {"org.godotengine.godot.Dictionary", "Lorg/godotengine/godot/Dictionary;"}, {"[I","[I"}, {"[B","[B"}, {"[F","[F"}, @@ -1581,7 +1581,7 @@ static const char* get_jni_sig(const String& p_type) { return "Ljava/lang/Object;"; } -JNIEXPORT jstring JNICALL Java_com_android_godot_GodotLib_getGlobal(JNIEnv * env, jobject obj, jstring path) { +JNIEXPORT jstring JNICALL Java_org_godotengine_godot_GodotLib_getGlobal(JNIEnv * env, jobject obj, jstring path) { String js = env->GetStringUTFChars( path, NULL ); @@ -1591,7 +1591,7 @@ JNIEXPORT jstring JNICALL Java_com_android_godot_GodotLib_getGlobal(JNIEnv * env } -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_method(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args){ +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_method(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args){ String singname = env->GetStringUTFChars( sname, NULL ); @@ -1632,7 +1632,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_method(JNIEnv * env, jobj } -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_callobject(JNIEnv * env, jobject p_obj, jint ID, jstring method, jobjectArray params) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv * env, jobject p_obj, jint ID, jstring method, jobjectArray params) { Object* obj = ObjectDB::get_instance(ID); ERR_FAIL_COND(!obj); @@ -1667,7 +1667,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_callobject(JNIEnv * env, }; -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_calldeferred(JNIEnv * env, jobject p_obj, jint ID, jstring method, jobjectArray params) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv * env, jobject p_obj, jint ID, jstring method, jobjectArray params) { Object* obj = ObjectDB::get_instance(ID); diff --git a/platform/android/java_glue.h b/platform/android/java_glue.h index e22b6775d8..efa5b2839d 100644 --- a/platform/android/java_glue.h +++ b/platform/android/java_glue.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,24 +36,24 @@ extern "C" { - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env, jobject obj, jobject activity,jboolean p_need_reload_hook, jobjectArray p_cmdline,jobject p_asset_manager); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_resize(JNIEnv * env, jobject obj, jint width, jint height, jboolean reload); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_newcontext(JNIEnv * env, jobject obj, bool p_32_bits); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_step(JNIEnv * env, jobject obj); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_quit(JNIEnv * env, jobject obj); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_touch(JNIEnv * env, jobject obj, jint ev,jint pointer, jint count, jintArray positions); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_key(JNIEnv * env, jobject obj, jint p_scancode, jint p_unicode_char, jboolean p_pressed); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_joybutton(JNIEnv * env, jobject obj, jint p_device, jint p_button, jboolean p_pressed); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_joyaxis(JNIEnv * env, jobject obj, jint p_device, jint p_axis, jfloat p_value); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_audio(JNIEnv * env, jobject obj); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_accelerometer(JNIEnv * env, jobject obj, jfloat x, jfloat y, jfloat z); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_focusin(JNIEnv * env, jobject obj); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_focusout(JNIEnv * env, jobject obj); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_singleton(JNIEnv * env, jobject obj, jstring name,jobject p_object); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_method(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args); - JNIEXPORT jstring JNICALL Java_com_android_godot_GodotLib_getGlobal(JNIEnv * env, jobject obj, jstring path); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_callobject(JNIEnv * env, jobject obj, jint ID, jstring method, jobjectArray params); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_calldeferred(JNIEnv * env, jobject obj, jint ID, jstring method, jobjectArray params); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv * env, jobject obj, jobject activity,jboolean p_need_reload_hook, jobjectArray p_cmdline,jobject p_asset_manager); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv * env, jobject obj, jint width, jint height, jboolean reload); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv * env, jobject obj, bool p_32_bits); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv * env, jobject obj); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_quit(JNIEnv * env, jobject obj); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_touch(JNIEnv * env, jobject obj, jint ev,jint pointer, jint count, jintArray positions); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_key(JNIEnv * env, jobject obj, jint p_scancode, jint p_unicode_char, jboolean p_pressed); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joybutton(JNIEnv * env, jobject obj, jint p_device, jint p_button, jboolean p_pressed); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyaxis(JNIEnv * env, jobject obj, jint p_device, jint p_axis, jfloat p_value); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_audio(JNIEnv * env, jobject obj); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_accelerometer(JNIEnv * env, jobject obj, jfloat x, jfloat y, jfloat z); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusin(JNIEnv * env, jobject obj); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusout(JNIEnv * env, jobject obj); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_singleton(JNIEnv * env, jobject obj, jstring name,jobject p_object); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_method(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args); + JNIEXPORT jstring JNICALL Java_org_godotengine_godot_GodotLib_getGlobal(JNIEnv * env, jobject obj, jstring path); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv * env, jobject obj, jint ID, jstring method, jobjectArray params); + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv * env, jobject obj, jint ID, jstring method, jobjectArray params); }; diff --git a/platform/android/libs/apk_expansion/AndroidManifest.xml b/platform/android/libs/apk_expansion/AndroidManifest.xml deleted file mode 100644 index 20b74a2988..0000000000 --- a/platform/android/libs/apk_expansion/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.vending.expansion.downloader" - android:versionCode="2" - android:versionName="1.1" > - - <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15"/> - -</manifest>
\ No newline at end of file diff --git a/platform/android/libs/apk_expansion/build.xml b/platform/android/libs/apk_expansion/build.xml deleted file mode 100644 index 5b2f2c590e..0000000000 --- a/platform/android/libs/apk_expansion/build.xml +++ /dev/null @@ -1,92 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="apk_expansion" default="help"> - - <!-- The local.properties file is created and updated by the 'android' tool. - It contains the path to the SDK. It should *NOT* be checked into - Version Control Systems. --> - <property file="local.properties" /> - - <!-- The ant.properties file can be created by you. It is only edited by the - 'android' tool to add properties to it. - This is the place to change some Ant specific build properties. - Here are some properties you may want to change/update: - - source.dir - The name of the source directory. Default is 'src'. - out.dir - The name of the output directory. Default is 'bin'. - - For other overridable properties, look at the beginning of the rules - files in the SDK, at tools/ant/build.xml - - Properties related to the SDK location or the project target should - be updated using the 'android' tool with the 'update' action. - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. - - --> - <property file="ant.properties" /> - - <!-- if sdk.dir was not set from one of the property file, then - get it from the ANDROID_HOME env var. - This must be done before we load project.properties since - the proguard config can use sdk.dir --> - <property environment="env" /> - <condition property="sdk.dir" value="${env.ANDROID_HOME}"> - <isset property="env.ANDROID_HOME" /> - </condition> - - <!-- The project.properties file is created and updated by the 'android' - tool, as well as ADT. - - This contains project specific properties such as project target, and library - dependencies. Lower level build properties are stored in ant.properties - (or in .classpath for Eclipse projects). - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. --> - <loadproperties srcFile="project.properties" /> - - <!-- quick check on sdk.dir --> - <fail - message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable." - unless="sdk.dir" - /> - - <!-- - Import per project custom build rules if present at the root of the project. - This is the place to put custom intermediary targets such as: - -pre-build - -pre-compile - -post-compile (This is typically used for code obfuscation. - Compiled code location: ${out.classes.absolute.dir} - If this is not done in place, override ${out.dex.input.absolute.dir}) - -post-package - -post-build - -pre-clean - --> - <import file="custom_rules.xml" optional="true" /> - - <!-- Import the actual build file. - - To customize existing targets, there are two options: - - Customize only one target: - - copy/paste the target into this file, *before* the - <import> task. - - customize it to your needs. - - Customize the whole content of build.xml - - copy/paste the content of the rules files (minus the top node) - into this file, replacing the <import> task. - - customize to your needs. - - *********************** - ****** IMPORTANT ****** - *********************** - In all cases you must update the value of version-tag below to read 'custom' instead of an integer, - in order to avoid having your file be overridden by tools such as "android update project" - --> - <!-- version-tag: 1 --> - <import file="${sdk.dir}/tools/ant/build.xml" /> - -</project> diff --git a/platform/android/libs/apk_expansion/proguard-project.txt b/platform/android/libs/apk_expansion/proguard-project.txt deleted file mode 100644 index f2fe1559a2..0000000000 --- a/platform/android/libs/apk_expansion/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/platform/android/libs/apk_expansion/project.properties b/platform/android/libs/apk_expansion/project.properties deleted file mode 100644 index eda83430bf..0000000000 --- a/platform/android/libs/apk_expansion/project.properties +++ /dev/null @@ -1,13 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-15 -android.library=true -android.library.reference.1=../play_licensing diff --git a/platform/android/libs/apk_expansion/res/values/strings.xml b/platform/android/libs/apk_expansion/res/values/strings.xml deleted file mode 100644 index b84749faf2..0000000000 --- a/platform/android/libs/apk_expansion/res/values/strings.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - - <!-- When a download completes, a notification is displayed, and this - string is used to indicate that the download successfully completed. - Note that such a download could have been initiated by a variety of - applications, including (but not limited to) the browser, an email - application, a content marketplace. --> - <string name="notification_download_complete">Download complete</string> - - <!-- When a download completes, a notification is displayed, and this - string is used to indicate that the download failed. - Note that such a download could have been initiated by a variety of - applications, including (but not limited to) the browser, an email - application, a content marketplace. --> - <string name="notification_download_failed">Download unsuccessful</string> - - - <string name="state_unknown">Starting..."</string> - <string name="state_idle">Waiting for download to start</string> - <string name="state_fetching_url">Looking for resources to download</string> - <string name="state_connecting">Connecting to the download server</string> - <string name="state_downloading">Downloading resources</string> - <string name="state_completed">Download finished</string> - <string name="state_paused_network_unavailable">Download paused because no network is available</string> - <string name="state_paused_network_setup_failure">Download paused. Test a website in browser</string> - <string name="state_paused_by_request">Download paused</string> - <string name="state_paused_wifi_unavailable">Download paused because wifi is unavailable</string> - <string name="state_paused_wifi_disabled">Download paused because wifi is disabled</string> - <string name="state_paused_roaming">Download paused because you are roaming</string> - <string name="state_paused_sdcard_unavailable">Download paused because the external storage is unavailable</string> - <string name="state_failed_unlicensed">Download failed because you may not have purchased this app</string> - <string name="state_failed_fetching_url">Download failed because the resources could not be found</string> - <string name="state_failed_sdcard_full">Download failed because the external storage is full</string> - <string name="state_failed_cancelled">Download cancelled</string> - <string name="state_failed">Download failed</string> - - <string name="kilobytes_per_second">%1$s KB/s</string> - <string name="time_remaining">Time remaining: %1$s</string> - <string name="time_remaining_notification">%1$s left</string> -</resources>
\ No newline at end of file diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java b/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java deleted file mode 100644 index eef205d7b7..0000000000 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader.impl; - -import com.android.vending.expansion.downloader.R; -import com.google.android.vending.expansion.downloader.DownloadProgressInfo; -import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; -import com.google.android.vending.expansion.downloader.Helpers; -import com.google.android.vending.expansion.downloader.IDownloaderClient; - -import android.app.Notification; -import android.app.NotificationManager; -import android.app.PendingIntent; -import android.content.Context; -import android.os.Messenger; - -/** - * This class handles displaying the notification associated with the download - * queue going on in the download manager. It handles multiple status types; - * Some require user interaction and some do not. Some of the user interactions - * may be transient. (for example: the user is queried to continue the download - * on 3G when it started on WiFi, but then the phone locks onto WiFi again so - * the prompt automatically goes away) - * <p/> - * The application interface for the downloader also needs to understand and - * handle these transient states. - */ -public class DownloadNotification implements IDownloaderClient { - - private int mState; - private final Context mContext; - private final NotificationManager mNotificationManager; - private String mCurrentTitle; - - private IDownloaderClient mClientProxy; - final ICustomNotification mCustomNotification; - private Notification mNotification; - private Notification mCurrentNotification; - private CharSequence mLabel; - private String mCurrentText; - private PendingIntent mContentIntent; - private DownloadProgressInfo mProgressInfo; - - static final String LOGTAG = "DownloadNotification"; - static final int NOTIFICATION_ID = LOGTAG.hashCode(); - - public PendingIntent getClientIntent() { - return mContentIntent; - } - - public void setClientIntent(PendingIntent mClientIntent) { - this.mContentIntent = mClientIntent; - } - - public void resendState() { - if (null != mClientProxy) { - mClientProxy.onDownloadStateChanged(mState); - } - } - - @Override - public void onDownloadStateChanged(int newState) { - if (null != mClientProxy) { - mClientProxy.onDownloadStateChanged(newState); - } - if (newState != mState) { - mState = newState; - if (newState == IDownloaderClient.STATE_IDLE || null == mContentIntent) { - return; - } - int stringDownloadID; - int iconResource; - boolean ongoingEvent; - - // get the new title string and paused text - switch (newState) { - case 0: - iconResource = android.R.drawable.stat_sys_warning; - stringDownloadID = R.string.state_unknown; - ongoingEvent = false; - break; - - case IDownloaderClient.STATE_DOWNLOADING: - iconResource = android.R.drawable.stat_sys_download; - stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState); - ongoingEvent = true; - break; - - case IDownloaderClient.STATE_FETCHING_URL: - case IDownloaderClient.STATE_CONNECTING: - iconResource = android.R.drawable.stat_sys_download_done; - stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState); - ongoingEvent = true; - break; - - case IDownloaderClient.STATE_COMPLETED: - case IDownloaderClient.STATE_PAUSED_BY_REQUEST: - iconResource = android.R.drawable.stat_sys_download_done; - stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState); - ongoingEvent = false; - break; - - case IDownloaderClient.STATE_FAILED: - case IDownloaderClient.STATE_FAILED_CANCELED: - case IDownloaderClient.STATE_FAILED_FETCHING_URL: - case IDownloaderClient.STATE_FAILED_SDCARD_FULL: - case IDownloaderClient.STATE_FAILED_UNLICENSED: - iconResource = android.R.drawable.stat_sys_warning; - stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState); - ongoingEvent = false; - break; - - default: - iconResource = android.R.drawable.stat_sys_warning; - stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState); - ongoingEvent = true; - break; - } - mCurrentText = mContext.getString(stringDownloadID); - mCurrentTitle = mLabel.toString(); - mCurrentNotification.tickerText = mLabel + ": " + mCurrentText; - mCurrentNotification.icon = iconResource; - mCurrentNotification.setLatestEventInfo(mContext, mCurrentTitle, mCurrentText, - mContentIntent); - if (ongoingEvent) { - mCurrentNotification.flags |= Notification.FLAG_ONGOING_EVENT; - } else { - mCurrentNotification.flags &= ~Notification.FLAG_ONGOING_EVENT; - mCurrentNotification.flags |= Notification.FLAG_AUTO_CANCEL; - } - mNotificationManager.notify(NOTIFICATION_ID, mCurrentNotification); - } - } - - @Override - public void onDownloadProgress(DownloadProgressInfo progress) { - mProgressInfo = progress; - if (null != mClientProxy) { - mClientProxy.onDownloadProgress(progress); - } - if (progress.mOverallTotal <= 0) { - // we just show the text - mNotification.tickerText = mCurrentTitle; - mNotification.icon = android.R.drawable.stat_sys_download; - mNotification.setLatestEventInfo(mContext, mLabel, mCurrentText, mContentIntent); - mCurrentNotification = mNotification; - } else { - mCustomNotification.setCurrentBytes(progress.mOverallProgress); - mCustomNotification.setTotalBytes(progress.mOverallTotal); - mCustomNotification.setIcon(android.R.drawable.stat_sys_download); - mCustomNotification.setPendingIntent(mContentIntent); - mCustomNotification.setTicker(mLabel + ": " + mCurrentText); - mCustomNotification.setTitle(mLabel); - mCustomNotification.setTimeRemaining(progress.mTimeRemaining); - mCurrentNotification = mCustomNotification.updateNotification(mContext); - } - mNotificationManager.notify(NOTIFICATION_ID, mCurrentNotification); - } - - public interface ICustomNotification { - void setTitle(CharSequence title); - - void setTicker(CharSequence ticker); - - void setPendingIntent(PendingIntent mContentIntent); - - void setTotalBytes(long totalBytes); - - void setCurrentBytes(long currentBytes); - - void setIcon(int iconResource); - - void setTimeRemaining(long timeRemaining); - - Notification updateNotification(Context c); - } - - /** - * Called in response to onClientUpdated. Creates a new proxy and notifies - * it of the current state. - * - * @param msg the client Messenger to notify - */ - public void setMessenger(Messenger msg) { - mClientProxy = DownloaderClientMarshaller.CreateProxy(msg); - if (null != mProgressInfo) { - mClientProxy.onDownloadProgress(mProgressInfo); - } - if (mState != -1) { - mClientProxy.onDownloadStateChanged(mState); - } - } - - /** - * Constructor - * - * @param ctx The context to use to obtain access to the Notification - * Service - */ - DownloadNotification(Context ctx, CharSequence applicationLabel) { - mState = -1; - mContext = ctx; - mLabel = applicationLabel; - mNotificationManager = (NotificationManager) - mContext.getSystemService(Context.NOTIFICATION_SERVICE); - mCustomNotification = CustomNotificationFactory - .createCustomNotification(); - mNotification = new Notification(); - mCurrentNotification = mNotification; - - } - - @Override - public void onServiceConnected(Messenger m) { - } - -} diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java b/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java deleted file mode 100644 index e736603e2a..0000000000 --- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader.impl; - -import com.android.vending.expansion.downloader.R; -import com.google.android.vending.expansion.downloader.Helpers; - -import android.app.Notification; -import android.app.PendingIntent; -import android.content.Context; - -public class V14CustomNotification implements DownloadNotification.ICustomNotification { - - CharSequence mTitle; - CharSequence mTicker; - int mIcon; - long mTotalKB = -1; - long mCurrentKB = -1; - long mTimeRemaining; - PendingIntent mPendingIntent; - - @Override - public void setIcon(int icon) { - mIcon = icon; - } - - @Override - public void setTitle(CharSequence title) { - mTitle = title; - } - - @Override - public void setTotalBytes(long totalBytes) { - mTotalKB = totalBytes; - } - - @Override - public void setCurrentBytes(long currentBytes) { - mCurrentKB = currentBytes; - } - - void setProgress(Notification.Builder builder) { - - } - - @Override - public Notification updateNotification(Context c) { - Notification.Builder builder = new Notification.Builder(c); - builder.setContentTitle(mTitle); - if (mTotalKB > 0 && -1 != mCurrentKB) { - builder.setProgress((int) (mTotalKB >> 8), (int) (mCurrentKB >> 8), false); - } else { - builder.setProgress(0, 0, true); - } - builder.setContentText(Helpers.getDownloadProgressString(mCurrentKB, mTotalKB)); - builder.setContentInfo(c.getString(R.string.time_remaining_notification, - Helpers.getTimeRemaining(mTimeRemaining))); - if (mIcon != 0) { - builder.setSmallIcon(mIcon); - } else { - int iconResource = android.R.drawable.stat_sys_download; - builder.setSmallIcon(iconResource); - } - builder.setOngoing(true); - builder.setTicker(mTicker); - builder.setContentIntent(mPendingIntent); - builder.setOnlyAlertOnce(true); - - return builder.getNotification(); - } - - @Override - public void setPendingIntent(PendingIntent contentIntent) { - mPendingIntent = contentIntent; - } - - @Override - public void setTicker(CharSequence ticker) { - mTicker = ticker; - } - - @Override - public void setTimeRemaining(long timeRemaining) { - mTimeRemaining = timeRemaining; - } - -} diff --git a/platform/android/libs/downloader_library/.classpath b/platform/android/libs/downloader_library/.classpath deleted file mode 100644 index 7bc01d9a9c..0000000000 --- a/platform/android/libs/downloader_library/.classpath +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="gen"/> - <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> - <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> - <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/> - <classpathentry kind="output" path="bin/classes"/> -</classpath> diff --git a/platform/android/libs/downloader_library/.settings/org.eclipse.jdt.core.prefs b/platform/android/libs/downloader_library/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b080d2ddc8..0000000000 --- a/platform/android/libs/downloader_library/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/platform/android/libs/downloader_library/AndroidManifest.xml b/platform/android/libs/downloader_library/AndroidManifest.xml deleted file mode 100644 index 20b74a2988..0000000000 --- a/platform/android/libs/downloader_library/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.vending.expansion.downloader" - android:versionCode="2" - android:versionName="1.1" > - - <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15"/> - -</manifest>
\ No newline at end of file diff --git a/platform/android/libs/downloader_library/build.xml b/platform/android/libs/downloader_library/build.xml deleted file mode 100644 index d65c145148..0000000000 --- a/platform/android/libs/downloader_library/build.xml +++ /dev/null @@ -1,92 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="downloader_library" default="help"> - - <!-- The local.properties file is created and updated by the 'android' tool. - It contains the path to the SDK. It should *NOT* be checked into - Version Control Systems. --> - <property file="local.properties" /> - - <!-- The ant.properties file can be created by you. It is only edited by the - 'android' tool to add properties to it. - This is the place to change some Ant specific build properties. - Here are some properties you may want to change/update: - - source.dir - The name of the source directory. Default is 'src'. - out.dir - The name of the output directory. Default is 'bin'. - - For other overridable properties, look at the beginning of the rules - files in the SDK, at tools/ant/build.xml - - Properties related to the SDK location or the project target should - be updated using the 'android' tool with the 'update' action. - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. - - --> - <property file="ant.properties" /> - - <!-- if sdk.dir was not set from one of the property file, then - get it from the ANDROID_HOME env var. - This must be done before we load project.properties since - the proguard config can use sdk.dir --> - <property environment="env" /> - <condition property="sdk.dir" value="${env.ANDROID_HOME}"> - <isset property="env.ANDROID_HOME" /> - </condition> - - <!-- The project.properties file is created and updated by the 'android' - tool, as well as ADT. - - This contains project specific properties such as project target, and library - dependencies. Lower level build properties are stored in ant.properties - (or in .classpath for Eclipse projects). - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. --> - <loadproperties srcFile="project.properties" /> - - <!-- quick check on sdk.dir --> - <fail - message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable." - unless="sdk.dir" - /> - - <!-- - Import per project custom build rules if present at the root of the project. - This is the place to put custom intermediary targets such as: - -pre-build - -pre-compile - -post-compile (This is typically used for code obfuscation. - Compiled code location: ${out.classes.absolute.dir} - If this is not done in place, override ${out.dex.input.absolute.dir}) - -post-package - -post-build - -pre-clean - --> - <import file="custom_rules.xml" optional="true" /> - - <!-- Import the actual build file. - - To customize existing targets, there are two options: - - Customize only one target: - - copy/paste the target into this file, *before* the - <import> task. - - customize it to your needs. - - Customize the whole content of build.xml - - copy/paste the content of the rules files (minus the top node) - into this file, replacing the <import> task. - - customize to your needs. - - *********************** - ****** IMPORTANT ****** - *********************** - In all cases you must update the value of version-tag below to read 'custom' instead of an integer, - in order to avoid having your file be overridden by tools such as "android update project" - --> - <!-- version-tag: 1 --> - <import file="${sdk.dir}/tools/ant/build.xml" /> - -</project> diff --git a/platform/android/libs/downloader_library/proguard-project.txt b/platform/android/libs/downloader_library/proguard-project.txt deleted file mode 100644 index f2fe1559a2..0000000000 --- a/platform/android/libs/downloader_library/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/platform/android/libs/downloader_library/project.properties b/platform/android/libs/downloader_library/project.properties deleted file mode 100644 index eda83430bf..0000000000 --- a/platform/android/libs/downloader_library/project.properties +++ /dev/null @@ -1,13 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-15 -android.library=true -android.library.reference.1=../play_licensing diff --git a/platform/android/libs/downloader_library/res/drawable-hdpi/notify_panel_notification_icon_bg.png b/platform/android/libs/downloader_library/res/drawable-hdpi/notify_panel_notification_icon_bg.png Binary files differdeleted file mode 100644 index f5b762ecf3..0000000000 --- a/platform/android/libs/downloader_library/res/drawable-hdpi/notify_panel_notification_icon_bg.png +++ /dev/null diff --git a/platform/android/libs/downloader_library/res/drawable-mdpi/notify_panel_notification_icon_bg.png b/platform/android/libs/downloader_library/res/drawable-mdpi/notify_panel_notification_icon_bg.png Binary files differdeleted file mode 100644 index 9ecb8af06c..0000000000 --- a/platform/android/libs/downloader_library/res/drawable-mdpi/notify_panel_notification_icon_bg.png +++ /dev/null diff --git a/platform/android/libs/downloader_library/res/layout/status_bar_ongoing_event_progress_bar.xml b/platform/android/libs/downloader_library/res/layout/status_bar_ongoing_event_progress_bar.xml deleted file mode 100644 index 23bac02294..0000000000 --- a/platform/android/libs/downloader_library/res/layout/status_bar_ongoing_event_progress_bar.xml +++ /dev/null @@ -1,104 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* -** Copyright 2008, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ ---> - -<LinearLayout android:layout_width="match_parent" - android:layout_height="match_parent" - android:baselineAligned="false" - android:orientation="horizontal" android:id="@+id/notificationLayout" xmlns:android="http://schemas.android.com/apk/res/android"> - - <RelativeLayout - android:layout_width="35dp" - android:layout_height="fill_parent" - android:paddingTop="10dp" - android:paddingBottom="8dp" > - - <ImageView - android:id="@+id/appIcon" - android:layout_width="fill_parent" - android:layout_height="25dp" - android:scaleType="centerInside" - android:layout_alignParentLeft="true" - android:layout_alignParentTop="true" - android:src="@android:drawable/stat_sys_download" /> - - <TextView - android:id="@+id/progress_text" - style="@style/NotificationText" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:layout_alignParentBottom="true" - android:layout_gravity="center_horizontal" - android:singleLine="true" - android:gravity="center" /> - </RelativeLayout> - - <RelativeLayout - android:layout_width="0dip" - android:layout_height="match_parent" - android:layout_weight="1.0" - android:clickable="true" - android:focusable="true" - android:paddingTop="10dp" - android:paddingRight="8dp" - android:paddingBottom="8dp" > - - <TextView - android:id="@+id/title" - style="@style/NotificationTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:singleLine="true"/> - - <TextView - android:id="@+id/time_remaining" - style="@style/NotificationText" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:singleLine="true"/> - <!-- Only one of progress_bar and paused_text will be visible. --> - - <FrameLayout - android:id="@+id/progress_bar_frame" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_alignParentBottom="true" > - - <ProgressBar - android:id="@+id/progress_bar" - style="?android:attr/progressBarStyleHorizontal" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:paddingRight="25dp" /> - - <TextView - android:id="@+id/description" - style="@style/NotificationTextShadow" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:paddingRight="25dp" - android:singleLine="true" /> - </FrameLayout> - - </RelativeLayout> - -</LinearLayout>
\ No newline at end of file diff --git a/platform/android/libs/downloader_library/res/values-v11/styles.xml b/platform/android/libs/downloader_library/res/values-v11/styles.xml deleted file mode 100644 index f2013bc0bf..0000000000 --- a/platform/android/libs/downloader_library/res/values-v11/styles.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <style name="NotificationTextSecondary" parent="NotificationText"> - <item name="android:textSize">12sp</item> - </style> -</resources>
\ No newline at end of file diff --git a/platform/android/libs/downloader_library/res/values-v9/styles.xml b/platform/android/libs/downloader_library/res/values-v9/styles.xml deleted file mode 100644 index 736e77a5d6..0000000000 --- a/platform/android/libs/downloader_library/res/values-v9/styles.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <style name="NotificationText" parent="android:TextAppearance.StatusBar.EventContent" /> - <style name="NotificationTitle" parent="android:TextAppearance.StatusBar.EventContent.Title" /> -</resources>
\ No newline at end of file diff --git a/platform/android/libs/downloader_library/res/values/strings.xml b/platform/android/libs/downloader_library/res/values/strings.xml deleted file mode 100644 index b84749faf2..0000000000 --- a/platform/android/libs/downloader_library/res/values/strings.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - - <!-- When a download completes, a notification is displayed, and this - string is used to indicate that the download successfully completed. - Note that such a download could have been initiated by a variety of - applications, including (but not limited to) the browser, an email - application, a content marketplace. --> - <string name="notification_download_complete">Download complete</string> - - <!-- When a download completes, a notification is displayed, and this - string is used to indicate that the download failed. - Note that such a download could have been initiated by a variety of - applications, including (but not limited to) the browser, an email - application, a content marketplace. --> - <string name="notification_download_failed">Download unsuccessful</string> - - - <string name="state_unknown">Starting..."</string> - <string name="state_idle">Waiting for download to start</string> - <string name="state_fetching_url">Looking for resources to download</string> - <string name="state_connecting">Connecting to the download server</string> - <string name="state_downloading">Downloading resources</string> - <string name="state_completed">Download finished</string> - <string name="state_paused_network_unavailable">Download paused because no network is available</string> - <string name="state_paused_network_setup_failure">Download paused. Test a website in browser</string> - <string name="state_paused_by_request">Download paused</string> - <string name="state_paused_wifi_unavailable">Download paused because wifi is unavailable</string> - <string name="state_paused_wifi_disabled">Download paused because wifi is disabled</string> - <string name="state_paused_roaming">Download paused because you are roaming</string> - <string name="state_paused_sdcard_unavailable">Download paused because the external storage is unavailable</string> - <string name="state_failed_unlicensed">Download failed because you may not have purchased this app</string> - <string name="state_failed_fetching_url">Download failed because the resources could not be found</string> - <string name="state_failed_sdcard_full">Download failed because the external storage is full</string> - <string name="state_failed_cancelled">Download cancelled</string> - <string name="state_failed">Download failed</string> - - <string name="kilobytes_per_second">%1$s KB/s</string> - <string name="time_remaining">Time remaining: %1$s</string> - <string name="time_remaining_notification">%1$s left</string> -</resources>
\ No newline at end of file diff --git a/platform/android/libs/downloader_library/res/values/styles.xml b/platform/android/libs/downloader_library/res/values/styles.xml deleted file mode 100644 index a442f61e7e..0000000000 --- a/platform/android/libs/downloader_library/res/values/styles.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - - <style name="NotificationText"> - <item name="android:textColor">?android:attr/textColorPrimary</item> - </style> - - <style name="NotificationTextShadow" parent="NotificationText"> - <item name="android:textColor">?android:attr/textColorPrimary</item> - <item name="android:shadowColor">@android:color/background_dark</item> - <item name="android:shadowDx">1.0</item> - <item name="android:shadowDy">1.0</item> - <item name="android:shadowRadius">1</item> - </style> - - <style name="NotificationTitle"> - <item name="android:textColor">?android:attr/textColorPrimary</item> - <item name="android:textStyle">bold</item> - </style> - - <style name="ButtonBackground"> - <item name="android:background">@android:color/background_dark</item> - </style> - -</resources>
\ No newline at end of file diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Constants.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Constants.java deleted file mode 100644 index ff2c6f535a..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Constants.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader; - -import java.io.File; - - -/** - * Contains the internal constants that are used in the download manager. - * As a general rule, modifying these constants should be done with care. - */ -public class Constants { - /** Tag used for debugging/logging */ - public static final String TAG = "LVLDL"; - - /** - * Expansion path where we store obb files - */ - public static final String EXP_PATH = File.separator + "Android" - + File.separator + "obb" + File.separator; - - /** The intent that gets sent when the service must wake up for a retry */ - public static final String ACTION_RETRY = "android.intent.action.DOWNLOAD_WAKEUP"; - - /** the intent that gets sent when clicking a successful download */ - public static final String ACTION_OPEN = "android.intent.action.DOWNLOAD_OPEN"; - - /** the intent that gets sent when clicking an incomplete/failed download */ - public static final String ACTION_LIST = "android.intent.action.DOWNLOAD_LIST"; - - /** the intent that gets sent when deleting the notification of a completed download */ - public static final String ACTION_HIDE = "android.intent.action.DOWNLOAD_HIDE"; - - /** - * When a number has to be appended to the filename, this string is used to separate the - * base filename from the sequence number - */ - public static final String FILENAME_SEQUENCE_SEPARATOR = "-"; - - /** The default user agent used for downloads */ - public static final String DEFAULT_USER_AGENT = "Android.LVLDM"; - - /** The buffer size used to stream the data */ - public static final int BUFFER_SIZE = 4096; - - /** The minimum amount of progress that has to be done before the progress bar gets updated */ - public static final int MIN_PROGRESS_STEP = 4096; - - /** The minimum amount of time that has to elapse before the progress bar gets updated, in ms */ - public static final long MIN_PROGRESS_TIME = 1000; - - /** The maximum number of rows in the database (FIFO) */ - public static final int MAX_DOWNLOADS = 1000; - - /** - * The number of times that the download manager will retry its network - * operations when no progress is happening before it gives up. - */ - public static final int MAX_RETRIES = 5; - - /** - * The minimum amount of time that the download manager accepts for - * a Retry-After response header with a parameter in delta-seconds. - */ - public static final int MIN_RETRY_AFTER = 30; // 30s - - /** - * The maximum amount of time that the download manager accepts for - * a Retry-After response header with a parameter in delta-seconds. - */ - public static final int MAX_RETRY_AFTER = 24 * 60 * 60; // 24h - - /** - * The maximum number of redirects. - */ - public static final int MAX_REDIRECTS = 5; // can't be more than 7. - - /** - * The time between a failure and the first retry after an IOException. - * Each subsequent retry grows exponentially, doubling each time. - * The time is in seconds. - */ - public static final int RETRY_FIRST_DELAY = 30; - - /** Enable separate connectivity logging */ - public static final boolean LOGX = true; - - /** Enable verbose logging */ - public static final boolean LOGV = false; - - /** Enable super-verbose logging */ - private static final boolean LOCAL_LOGVV = false; - public static final boolean LOGVV = LOCAL_LOGVV && LOGV; - - /** - * This download has successfully completed. - * Warning: there might be other status values that indicate success - * in the future. - * Use isSucccess() to capture the entire category. - */ - public static final int STATUS_SUCCESS = 200; - - /** - * This request couldn't be parsed. This is also used when processing - * requests with unknown/unsupported URI schemes. - */ - public static final int STATUS_BAD_REQUEST = 400; - - /** - * This download can't be performed because the content type cannot be - * handled. - */ - public static final int STATUS_NOT_ACCEPTABLE = 406; - - /** - * This download cannot be performed because the length cannot be - * determined accurately. This is the code for the HTTP error "Length - * Required", which is typically used when making requests that require - * a content length but don't have one, and it is also used in the - * client when a response is received whose length cannot be determined - * accurately (therefore making it impossible to know when a download - * completes). - */ - public static final int STATUS_LENGTH_REQUIRED = 411; - - /** - * This download was interrupted and cannot be resumed. - * This is the code for the HTTP error "Precondition Failed", and it is - * also used in situations where the client doesn't have an ETag at all. - */ - public static final int STATUS_PRECONDITION_FAILED = 412; - - /** - * The lowest-valued error status that is not an actual HTTP status code. - */ - public static final int MIN_ARTIFICIAL_ERROR_STATUS = 488; - - /** - * The requested destination file already exists. - */ - public static final int STATUS_FILE_ALREADY_EXISTS_ERROR = 488; - - /** - * Some possibly transient error occurred, but we can't resume the download. - */ - public static final int STATUS_CANNOT_RESUME = 489; - - /** - * This download was canceled - */ - public static final int STATUS_CANCELED = 490; - - /** - * This download has completed with an error. - * Warning: there will be other status values that indicate errors in - * the future. Use isStatusError() to capture the entire category. - */ - public static final int STATUS_UNKNOWN_ERROR = 491; - - /** - * This download couldn't be completed because of a storage issue. - * Typically, that's because the filesystem is missing or full. - * Use the more specific {@link #STATUS_INSUFFICIENT_SPACE_ERROR} - * and {@link #STATUS_DEVICE_NOT_FOUND_ERROR} when appropriate. - */ - public static final int STATUS_FILE_ERROR = 492; - - /** - * This download couldn't be completed because of an HTTP - * redirect response that the download manager couldn't - * handle. - */ - public static final int STATUS_UNHANDLED_REDIRECT = 493; - - /** - * This download couldn't be completed because of an - * unspecified unhandled HTTP code. - */ - public static final int STATUS_UNHANDLED_HTTP_CODE = 494; - - /** - * This download couldn't be completed because of an - * error receiving or processing data at the HTTP level. - */ - public static final int STATUS_HTTP_DATA_ERROR = 495; - - /** - * This download couldn't be completed because of an - * HttpException while setting up the request. - */ - public static final int STATUS_HTTP_EXCEPTION = 496; - - /** - * This download couldn't be completed because there were - * too many redirects. - */ - public static final int STATUS_TOO_MANY_REDIRECTS = 497; - - /** - * This download couldn't be completed due to insufficient storage - * space. Typically, this is because the SD card is full. - */ - public static final int STATUS_INSUFFICIENT_SPACE_ERROR = 498; - - /** - * This download couldn't be completed because no external storage - * device was found. Typically, this is because the SD card is not - * mounted. - */ - public static final int STATUS_DEVICE_NOT_FOUND_ERROR = 499; - - /** - * The wake duration to check to see if a download is possible. - */ - public static final long WATCHDOG_WAKE_TIMER = 60*1000; - - /** - * The wake duration to check to see if the process was killed. - */ - public static final long ACTIVE_THREAD_WATCHDOG = 5*1000; - -}
\ No newline at end of file diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java deleted file mode 100644 index 9cb294d721..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader; - -import android.os.Parcel; -import android.os.Parcelable; - - -/** - * This class contains progress information about the active download(s). - * - * When you build the Activity that initiates a download and tracks the - * progress by implementing the {@link IDownloaderClient} interface, you'll - * receive a DownloadProgressInfo object in each call to the {@link - * IDownloaderClient#onDownloadProgress} method. This allows you to update - * your activity's UI with information about the download progress, such - * as the progress so far, time remaining and current speed. - */ -public class DownloadProgressInfo implements Parcelable { - public long mOverallTotal; - public long mOverallProgress; - public long mTimeRemaining; // time remaining - public float mCurrentSpeed; // speed in KB/S - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel p, int i) { - p.writeLong(mOverallTotal); - p.writeLong(mOverallProgress); - p.writeLong(mTimeRemaining); - p.writeFloat(mCurrentSpeed); - } - - public DownloadProgressInfo(Parcel p) { - mOverallTotal = p.readLong(); - mOverallProgress = p.readLong(); - mTimeRemaining = p.readLong(); - mCurrentSpeed = p.readFloat(); - } - - public DownloadProgressInfo(long overallTotal, long overallProgress, - long timeRemaining, - float currentSpeed) { - this.mOverallTotal = overallTotal; - this.mOverallProgress = overallProgress; - this.mTimeRemaining = timeRemaining; - this.mCurrentSpeed = currentSpeed; - } - - public static final Creator<DownloadProgressInfo> CREATOR = new Creator<DownloadProgressInfo>() { - @Override - public DownloadProgressInfo createFromParcel(Parcel parcel) { - return new DownloadProgressInfo(parcel); - } - - @Override - public DownloadProgressInfo[] newArray(int i) { - return new DownloadProgressInfo[i]; - } - }; - -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java deleted file mode 100644 index 2201751254..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader; - -import com.google.android.vending.expansion.downloader.impl.DownloaderService; - -import android.app.PendingIntent; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.ServiceConnection; -import android.content.pm.PackageManager.NameNotFoundException; -import android.os.Bundle; -import android.os.Handler; -import android.os.IBinder; -import android.os.Message; -import android.os.Messenger; -import android.os.RemoteException; -import android.util.Log; - - - -/** - * This class binds the service API to your application client. It contains the IDownloaderClient proxy, - * which is used to call functions in your client as well as the Stub, which is used to call functions - * in the client implementation of IDownloaderClient. - * - * <p>The IPC is implemented using an Android Messenger and a service Binder. The connect method - * should be called whenever the client wants to bind to the service. It opens up a service connection - * that ends up calling the onServiceConnected client API that passes the service messenger - * in. If the client wants to be notified by the service, it is responsible for then passing its - * messenger to the service in a separate call. - * - * <p>Critical methods are {@link #startDownloadServiceIfRequired} and {@link #CreateStub}. - * - * <p>When your application first starts, you should first check whether your app's expansion files are - * already on the device. If not, you should then call {@link #startDownloadServiceIfRequired}, which - * starts your {@link impl.DownloaderService} to download the expansion files if necessary. The method - * returns a value indicating whether download is required or not. - * - * <p>If a download is required, {@link #startDownloadServiceIfRequired} begins the download through - * the specified service and you should then call {@link #CreateStub} to instantiate a member {@link - * IStub} object that you need in order to receive calls through your {@link IDownloaderClient} - * interface. - */ -public class DownloaderClientMarshaller { - public static final int MSG_ONDOWNLOADSTATE_CHANGED = 10; - public static final int MSG_ONDOWNLOADPROGRESS = 11; - public static final int MSG_ONSERVICECONNECTED = 12; - - public static final String PARAM_NEW_STATE = "newState"; - public static final String PARAM_PROGRESS = "progress"; - public static final String PARAM_MESSENGER = DownloaderService.EXTRA_MESSAGE_HANDLER; - - public static final int NO_DOWNLOAD_REQUIRED = DownloaderService.NO_DOWNLOAD_REQUIRED; - public static final int LVL_CHECK_REQUIRED = DownloaderService.LVL_CHECK_REQUIRED; - public static final int DOWNLOAD_REQUIRED = DownloaderService.DOWNLOAD_REQUIRED; - - private static class Proxy implements IDownloaderClient { - private Messenger mServiceMessenger; - - @Override - public void onDownloadStateChanged(int newState) { - Bundle params = new Bundle(1); - params.putInt(PARAM_NEW_STATE, newState); - send(MSG_ONDOWNLOADSTATE_CHANGED, params); - } - - @Override - public void onDownloadProgress(DownloadProgressInfo progress) { - Bundle params = new Bundle(1); - params.putParcelable(PARAM_PROGRESS, progress); - send(MSG_ONDOWNLOADPROGRESS, params); - } - - private void send(int method, Bundle params) { - Message m = Message.obtain(null, method); - m.setData(params); - try { - mServiceMessenger.send(m); - } catch (RemoteException e) { - e.printStackTrace(); - } - } - - public Proxy(Messenger msg) { - mServiceMessenger = msg; - } - - @Override - public void onServiceConnected(Messenger m) { - /** - * This is never called through the proxy. - */ - } - } - - private static class Stub implements IStub { - private IDownloaderClient mItf = null; - private Class<?> mDownloaderServiceClass; - private boolean mBound; - private Messenger mServiceMessenger; - private Context mContext; - /** - * Target we publish for clients to send messages to IncomingHandler. - */ - final Messenger mMessenger = new Messenger(new Handler() { - @Override - public void handleMessage(Message msg) { - switch (msg.what) { - case MSG_ONDOWNLOADPROGRESS: - Bundle bun = msg.getData(); - if ( null != mContext ) { - bun.setClassLoader(mContext.getClassLoader()); - DownloadProgressInfo dpi = (DownloadProgressInfo) msg.getData() - .getParcelable(PARAM_PROGRESS); - mItf.onDownloadProgress(dpi); - } - break; - case MSG_ONDOWNLOADSTATE_CHANGED: - mItf.onDownloadStateChanged(msg.getData().getInt(PARAM_NEW_STATE)); - break; - case MSG_ONSERVICECONNECTED: - mItf.onServiceConnected( - (Messenger) msg.getData().getParcelable(PARAM_MESSENGER)); - break; - } - } - }); - - public Stub(IDownloaderClient itf, Class<?> downloaderService) { - mItf = itf; - mDownloaderServiceClass = downloaderService; - } - - /** - * Class for interacting with the main interface of the service. - */ - private ServiceConnection mConnection = new ServiceConnection() { - public void onServiceConnected(ComponentName className, IBinder service) { - // This is called when the connection with the service has been - // established, giving us the object we can use to - // interact with the service. We are communicating with the - // service using a Messenger, so here we get a client-side - // representation of that from the raw IBinder object. - mServiceMessenger = new Messenger(service); - mItf.onServiceConnected( - mServiceMessenger); - } - - public void onServiceDisconnected(ComponentName className) { - // This is called when the connection with the service has been - // unexpectedly disconnected -- that is, its process crashed. - mServiceMessenger = null; - } - }; - - @Override - public void connect(Context c) { - mContext = c; - Intent bindIntent = new Intent(c, mDownloaderServiceClass); - bindIntent.putExtra(PARAM_MESSENGER, mMessenger); - if ( !c.bindService(bindIntent, mConnection, Context.BIND_DEBUG_UNBIND) ) { - if ( Constants.LOGVV ) { - Log.d(Constants.TAG, "Service Unbound"); - } - } else { - mBound = true; - } - - } - - @Override - public void disconnect(Context c) { - if (mBound) { - c.unbindService(mConnection); - mBound = false; - } - mContext = null; - } - - @Override - public Messenger getMessenger() { - return mMessenger; - } - } - - /** - * Returns a proxy that will marshal calls to IDownloaderClient methods - * - * @param msg - * @return - */ - public static IDownloaderClient CreateProxy(Messenger msg) { - return new Proxy(msg); - } - - /** - * Returns a stub object that, when connected, will listen for marshaled - * {@link IDownloaderClient} methods and translate them into calls to the supplied - * interface. - * - * @param itf An implementation of IDownloaderClient that will be called - * when remote method calls are unmarshaled. - * @param downloaderService The class for your implementation of {@link - * impl.DownloaderService}. - * @return The {@link IStub} that allows you to connect to the service such that - * your {@link IDownloaderClient} receives status updates. - */ - public static IStub CreateStub(IDownloaderClient itf, Class<?> downloaderService) { - return new Stub(itf, downloaderService); - } - - /** - * Starts the download if necessary. This function starts a flow that does ` - * many things. 1) Checks to see if the APK version has been checked and - * the metadata database updated 2) If the APK version does not match, - * checks the new LVL status to see if a new download is required 3) If the - * APK version does match, then checks to see if the download(s) have been - * completed 4) If the downloads have been completed, returns - * NO_DOWNLOAD_REQUIRED The idea is that this can be called during the - * startup of an application to quickly ascertain if the application needs - * to wait to hear about any updated APK expansion files. Note that this does - * mean that the application MUST be run for the first time with a network - * connection, even if Market delivers all of the files. - * - * @param context Your application Context. - * @param notificationClient A PendingIntent to start the Activity in your application - * that shows the download progress and which will also start the application when download - * completes. - * @param serviceClass the class of your {@link imp.DownloaderService} implementation - * @return whether the service was started and the reason for starting the service. - * Either {@link #NO_DOWNLOAD_REQUIRED}, {@link #LVL_CHECK_REQUIRED}, or {@link - * #DOWNLOAD_REQUIRED}. - * @throws NameNotFoundException - */ - public static int startDownloadServiceIfRequired(Context context, PendingIntent notificationClient, - Class<?> serviceClass) - throws NameNotFoundException { - return DownloaderService.startDownloadServiceIfRequired(context, notificationClient, - serviceClass); - } - - /** - * This version assumes that the intent contains the pending intent as a parameter. This - * is used for responding to alarms. - * <p>The pending intent must be in an extra with the key {@link - * impl.DownloaderService#EXTRA_PENDING_INTENT}. - * - * @param context - * @param notificationClient - * @param serviceClass the class of the service to start - * @return - * @throws NameNotFoundException - */ - public static int startDownloadServiceIfRequired(Context context, Intent notificationClient, - Class<?> serviceClass) - throws NameNotFoundException { - return DownloaderService.startDownloadServiceIfRequired(context, notificationClient, - serviceClass); - } - -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java deleted file mode 100644 index 054eaa9895..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader; - -import com.google.android.vending.expansion.downloader.impl.DownloaderService; - -import android.content.Context; -import android.os.Bundle; -import android.os.Handler; -import android.os.Message; -import android.os.Messenger; -import android.os.RemoteException; - - - -/** - * This class is used by the client activity to proxy requests to the Downloader - * Service. - * - * Most importantly, you must call {@link #CreateProxy} during the {@link - * IDownloaderClient#onServiceConnected} callback in your activity in order to instantiate - * an {@link IDownloaderService} object that you can then use to issue commands to the {@link - * DownloaderService} (such as to pause and resume downloads). - */ -public class DownloaderServiceMarshaller { - - public static final int MSG_REQUEST_ABORT_DOWNLOAD = - 1; - public static final int MSG_REQUEST_PAUSE_DOWNLOAD = - 2; - public static final int MSG_SET_DOWNLOAD_FLAGS = - 3; - public static final int MSG_REQUEST_CONTINUE_DOWNLOAD = - 4; - public static final int MSG_REQUEST_DOWNLOAD_STATE = - 5; - public static final int MSG_REQUEST_CLIENT_UPDATE = - 6; - - public static final String PARAMS_FLAGS = "flags"; - public static final String PARAM_MESSENGER = DownloaderService.EXTRA_MESSAGE_HANDLER; - - private static class Proxy implements IDownloaderService { - private Messenger mMsg; - - private void send(int method, Bundle params) { - Message m = Message.obtain(null, method); - m.setData(params); - try { - mMsg.send(m); - } catch (RemoteException e) { - e.printStackTrace(); - } - } - - public Proxy(Messenger msg) { - mMsg = msg; - } - - @Override - public void requestAbortDownload() { - send(MSG_REQUEST_ABORT_DOWNLOAD, new Bundle()); - } - - @Override - public void requestPauseDownload() { - send(MSG_REQUEST_PAUSE_DOWNLOAD, new Bundle()); - } - - @Override - public void setDownloadFlags(int flags) { - Bundle params = new Bundle(); - params.putInt(PARAMS_FLAGS, flags); - send(MSG_SET_DOWNLOAD_FLAGS, params); - } - - @Override - public void requestContinueDownload() { - send(MSG_REQUEST_CONTINUE_DOWNLOAD, new Bundle()); - } - - @Override - public void requestDownloadStatus() { - send(MSG_REQUEST_DOWNLOAD_STATE, new Bundle()); - } - - @Override - public void onClientUpdated(Messenger clientMessenger) { - Bundle bundle = new Bundle(1); - bundle.putParcelable(PARAM_MESSENGER, clientMessenger); - send(MSG_REQUEST_CLIENT_UPDATE, bundle); - } - } - - private static class Stub implements IStub { - private IDownloaderService mItf = null; - final Messenger mMessenger = new Messenger(new Handler() { - @Override - public void handleMessage(Message msg) { - switch (msg.what) { - case MSG_REQUEST_ABORT_DOWNLOAD: - mItf.requestAbortDownload(); - break; - case MSG_REQUEST_CONTINUE_DOWNLOAD: - mItf.requestContinueDownload(); - break; - case MSG_REQUEST_PAUSE_DOWNLOAD: - mItf.requestPauseDownload(); - break; - case MSG_SET_DOWNLOAD_FLAGS: - mItf.setDownloadFlags(msg.getData().getInt(PARAMS_FLAGS)); - break; - case MSG_REQUEST_DOWNLOAD_STATE: - mItf.requestDownloadStatus(); - break; - case MSG_REQUEST_CLIENT_UPDATE: - mItf.onClientUpdated((Messenger) msg.getData().getParcelable( - PARAM_MESSENGER)); - break; - } - } - }); - - public Stub(IDownloaderService itf) { - mItf = itf; - } - - @Override - public Messenger getMessenger() { - return mMessenger; - } - - @Override - public void connect(Context c) { - - } - - @Override - public void disconnect(Context c) { - - } - } - - /** - * Returns a proxy that will marshall calls to IDownloaderService methods - * - * @param ctx - * @return - */ - public static IDownloaderService CreateProxy(Messenger msg) { - return new Proxy(msg); - } - - /** - * Returns a stub object that, when connected, will listen for marshalled - * IDownloaderService methods and translate them into calls to the supplied - * interface. - * - * @param itf An implementation of IDownloaderService that will be called - * when remote method calls are unmarshalled. - * @return - */ - public static IStub CreateStub(IDownloaderService itf) { - return new Stub(itf); - } - -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Helpers.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Helpers.java deleted file mode 100644 index 1e84e54a0f..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Helpers.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader; - -import com.android.vending.expansion.downloader.R; - -import android.content.Context; -import android.os.Environment; -import android.os.StatFs; -import android.os.SystemClock; -import android.util.Log; - -import java.io.File; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Locale; -import java.util.Random; -import java.util.TimeZone; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Some helper functions for the download manager - */ -public class Helpers { - - public static Random sRandom = new Random(SystemClock.uptimeMillis()); - - /** Regex used to parse content-disposition headers */ - private static final Pattern CONTENT_DISPOSITION_PATTERN = Pattern - .compile("attachment;\\s*filename\\s*=\\s*\"([^\"]*)\""); - - private Helpers() { - } - - /* - * Parse the Content-Disposition HTTP Header. The format of the header is - * defined here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html This - * header provides a filename for content that is going to be downloaded to - * the file system. We only support the attachment type. - */ - static String parseContentDisposition(String contentDisposition) { - try { - Matcher m = CONTENT_DISPOSITION_PATTERN.matcher(contentDisposition); - if (m.find()) { - return m.group(1); - } - } catch (IllegalStateException ex) { - // This function is defined as returning null when it can't parse - // the header - } - return null; - } - - /** - * @return the root of the filesystem containing the given path - */ - public static File getFilesystemRoot(String path) { - File cache = Environment.getDownloadCacheDirectory(); - if (path.startsWith(cache.getPath())) { - return cache; - } - File external = Environment.getExternalStorageDirectory(); - if (path.startsWith(external.getPath())) { - return external; - } - throw new IllegalArgumentException( - "Cannot determine filesystem root for " + path); - } - - public static boolean isExternalMediaMounted() { - if (!Environment.getExternalStorageState().equals( - Environment.MEDIA_MOUNTED)) { - // No SD card found. - if ( Constants.LOGVV ) { - Log.d(Constants.TAG, "no external storage"); - } - return false; - } - return true; - } - - /** - * @return the number of bytes available on the filesystem rooted at the - * given File - */ - public static long getAvailableBytes(File root) { - StatFs stat = new StatFs(root.getPath()); - // put a bit of margin (in case creating the file grows the system by a - // few blocks) - long availableBlocks = (long) stat.getAvailableBlocks() - 4; - return stat.getBlockSize() * availableBlocks; - } - - /** - * Checks whether the filename looks legitimate - */ - public static boolean isFilenameValid(String filename) { - filename = filename.replaceFirst("/+", "/"); // normalize leading - // slashes - return filename.startsWith(Environment.getDownloadCacheDirectory().toString()) - || filename.startsWith(Environment.getExternalStorageDirectory().toString()); - } - - /* - * Delete the given file from device - */ - /* package */static void deleteFile(String path) { - try { - File file = new File(path); - file.delete(); - } catch (Exception e) { - Log.w(Constants.TAG, "file: '" + path + "' couldn't be deleted", e); - } - } - - /** - * Showing progress in MB here. It would be nice to choose the unit (KB, MB, - * GB) based on total file size, but given what we know about the expected - * ranges of file sizes for APK expansion files, it's probably not necessary. - * - * @param overallProgress - * @param overallTotal - * @return - */ - - static public String getDownloadProgressString(long overallProgress, long overallTotal) { - if (overallTotal == 0) { - if ( Constants.LOGVV ) { - Log.e(Constants.TAG, "Notification called when total is zero"); - } - return ""; - } - return String.format("%.2f", - (float) overallProgress / (1024.0f * 1024.0f)) - + "MB /" + - String.format("%.2f", (float) overallTotal / - (1024.0f * 1024.0f)) + "MB"; - } - - /** - * Adds a percentile to getDownloadProgressString. - * - * @param overallProgress - * @param overallTotal - * @return - */ - static public String getDownloadProgressStringNotification(long overallProgress, - long overallTotal) { - if (overallTotal == 0) { - if ( Constants.LOGVV ) { - Log.e(Constants.TAG, "Notification called when total is zero"); - } - return ""; - } - return getDownloadProgressString(overallProgress, overallTotal) + " (" + - getDownloadProgressPercent(overallProgress, overallTotal) + ")"; - } - - public static String getDownloadProgressPercent(long overallProgress, long overallTotal) { - if (overallTotal == 0) { - if ( Constants.LOGVV ) { - Log.e(Constants.TAG, "Notification called when total is zero"); - } - return ""; - } - return Long.toString(overallProgress * 100 / overallTotal) + "%"; - } - - public static String getSpeedString(float bytesPerMillisecond) { - return String.format("%.2f", bytesPerMillisecond * 1000 / 1024); - } - - public static String getTimeRemaining(long durationInMilliseconds) { - SimpleDateFormat sdf; - if (durationInMilliseconds > 1000 * 60 * 60) { - sdf = new SimpleDateFormat("HH:mm", Locale.getDefault()); - } else { - sdf = new SimpleDateFormat("mm:ss", Locale.getDefault()); - } - return sdf.format(new Date(durationInMilliseconds - TimeZone.getDefault().getRawOffset())); - } - - /** - * Returns the file name (without full path) for an Expansion APK file from - * the given context. - * - * @param c the context - * @param mainFile true for main file, false for patch file - * @param versionCode the version of the file - * @return String the file name of the expansion file - */ - public static String getExpansionAPKFileName(Context c, boolean mainFile, int versionCode) { - return (mainFile ? "main." : "patch.") + versionCode + "." + c.getPackageName() + ".obb"; - } - - /** - * Returns the filename (where the file should be saved) from info about a - * download - */ - static public String generateSaveFileName(Context c, String fileName) { - String path = getSaveFilePath(c) - + File.separator + fileName; - return path; - } - - static public String getSaveFilePath(Context c) { - File root = Environment.getExternalStorageDirectory(); - String path = root.toString() + Constants.EXP_PATH + c.getPackageName(); - return path; - } - - /** - * Helper function to ascertain the existence of a file and return - * true/false appropriately - * - * @param c the app/activity/service context - * @param fileName the name (sans path) of the file to query - * @param fileSize the size that the file must match - * @param deleteFileOnMismatch if the file sizes do not match, delete the - * file - * @return true if it does exist, false otherwise - */ - static public boolean doesFileExist(Context c, String fileName, long fileSize, - boolean deleteFileOnMismatch) { - // the file may have been delivered by Market --- let's make sure - // it's the size we expect - File fileForNewFile = new File(Helpers.generateSaveFileName(c, fileName)); - if (fileForNewFile.exists()) { - if (fileForNewFile.length() == fileSize) { - return true; - } - if (deleteFileOnMismatch) { - // delete the file --- we won't be able to resume - // because we cannot confirm the integrity of the file - fileForNewFile.delete(); - } - } - return false; - } - - /** - * Converts download states that are returned by the {@link - * IDownloaderClient#onDownloadStateChanged} callback into usable strings. - * This is useful if using the state strings built into the library to display user messages. - * @param state One of the STATE_* constants from {@link IDownloaderClient}. - * @return string resource ID for the corresponding string. - */ - static public int getDownloaderStringResourceIDFromState(int state) { - switch (state) { - case IDownloaderClient.STATE_IDLE: - return R.string.state_idle; - case IDownloaderClient.STATE_FETCHING_URL: - return R.string.state_fetching_url; - case IDownloaderClient.STATE_CONNECTING: - return R.string.state_connecting; - case IDownloaderClient.STATE_DOWNLOADING: - return R.string.state_downloading; - case IDownloaderClient.STATE_COMPLETED: - return R.string.state_completed; - case IDownloaderClient.STATE_PAUSED_NETWORK_UNAVAILABLE: - return R.string.state_paused_network_unavailable; - case IDownloaderClient.STATE_PAUSED_BY_REQUEST: - return R.string.state_paused_by_request; - case IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION: - return R.string.state_paused_wifi_disabled; - case IDownloaderClient.STATE_PAUSED_NEED_CELLULAR_PERMISSION: - return R.string.state_paused_wifi_unavailable; - case IDownloaderClient.STATE_PAUSED_WIFI_DISABLED: - return R.string.state_paused_wifi_disabled; - case IDownloaderClient.STATE_PAUSED_NEED_WIFI: - return R.string.state_paused_wifi_unavailable; - case IDownloaderClient.STATE_PAUSED_ROAMING: - return R.string.state_paused_roaming; - case IDownloaderClient.STATE_PAUSED_NETWORK_SETUP_FAILURE: - return R.string.state_paused_network_setup_failure; - case IDownloaderClient.STATE_PAUSED_SDCARD_UNAVAILABLE: - return R.string.state_paused_sdcard_unavailable; - case IDownloaderClient.STATE_FAILED_UNLICENSED: - return R.string.state_failed_unlicensed; - case IDownloaderClient.STATE_FAILED_FETCHING_URL: - return R.string.state_failed_fetching_url; - case IDownloaderClient.STATE_FAILED_SDCARD_FULL: - return R.string.state_failed_sdcard_full; - case IDownloaderClient.STATE_FAILED_CANCELED: - return R.string.state_failed_cancelled; - default: - return R.string.state_unknown; - } - } - -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java deleted file mode 100644 index b8511a62a0..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader; - -import android.os.Messenger; - -/** - * This interface should be implemented by the client activity for the - * downloader. It is used to pass status from the service to the client. - */ -public interface IDownloaderClient { - static final int STATE_IDLE = 1; - static final int STATE_FETCHING_URL = 2; - static final int STATE_CONNECTING = 3; - static final int STATE_DOWNLOADING = 4; - static final int STATE_COMPLETED = 5; - - static final int STATE_PAUSED_NETWORK_UNAVAILABLE = 6; - static final int STATE_PAUSED_BY_REQUEST = 7; - - /** - * Both STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION and - * STATE_PAUSED_NEED_CELLULAR_PERMISSION imply that Wi-Fi is unavailable and - * cellular permission will restart the service. Wi-Fi disabled means that - * the Wi-Fi manager is returning that Wi-Fi is not enabled, while in the - * other case Wi-Fi is enabled but not available. - */ - static final int STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION = 8; - static final int STATE_PAUSED_NEED_CELLULAR_PERMISSION = 9; - - /** - * Both STATE_PAUSED_WIFI_DISABLED and STATE_PAUSED_NEED_WIFI imply that - * Wi-Fi is unavailable and cellular permission will NOT restart the - * service. Wi-Fi disabled means that the Wi-Fi manager is returning that - * Wi-Fi is not enabled, while in the other case Wi-Fi is enabled but not - * available. - * <p> - * The service does not return these values. We recommend that app - * developers with very large payloads do not allow these payloads to be - * downloaded over cellular connections. - */ - static final int STATE_PAUSED_WIFI_DISABLED = 10; - static final int STATE_PAUSED_NEED_WIFI = 11; - - static final int STATE_PAUSED_ROAMING = 12; - - /** - * Scary case. We were on a network that redirected us to another website - * that delivered us the wrong file. - */ - static final int STATE_PAUSED_NETWORK_SETUP_FAILURE = 13; - - static final int STATE_PAUSED_SDCARD_UNAVAILABLE = 14; - - static final int STATE_FAILED_UNLICENSED = 15; - static final int STATE_FAILED_FETCHING_URL = 16; - static final int STATE_FAILED_SDCARD_FULL = 17; - static final int STATE_FAILED_CANCELED = 18; - - static final int STATE_FAILED = 19; - - /** - * Called internally by the stub when the service is bound to the client. - * <p> - * Critical implementation detail. In onServiceConnected we create the - * remote service and marshaler. This is how we pass the client information - * back to the service so the client can be properly notified of changes. We - * must do this every time we reconnect to the service. - * <p> - * That is, when you receive this callback, you should call - * {@link DownloaderServiceMarshaller#CreateProxy} to instantiate a member - * instance of {@link IDownloaderService}, then call - * {@link IDownloaderService#onClientUpdated} with the Messenger retrieved - * from your {@link IStub} proxy object. - * - * @param m the service Messenger. This Messenger is used to call the - * service API from the client. - */ - void onServiceConnected(Messenger m); - - /** - * Called when the download state changes. Depending on the state, there may - * be user requests. The service is free to change the download state in the - * middle of a user request, so the client should be able to handle this. - * <p> - * The Downloader Library includes a collection of string resources that - * correspond to each of the states, which you can use to provide users a - * useful message based on the state provided in this callback. To fetch the - * appropriate string for a state, call - * {@link Helpers#getDownloaderStringResourceIDFromState}. - * <p> - * What this means to the developer: The application has gotten a message - * that the download has paused due to lack of WiFi. The developer should - * then show UI asking the user if they want to enable downloading over - * cellular connections with appropriate warnings. If the application - * suddenly starts downloading, the application should revert to showing the - * progress again, rather than leaving up the download over cellular UI up. - * - * @param newState one of the STATE_* values defined in IDownloaderClient - */ - void onDownloadStateChanged(int newState); - - /** - * Shows the download progress. This is intended to be used to fill out a - * client UI. This progress should only be shown in a few states such as - * STATE_DOWNLOADING. - * - * @param progress the DownloadProgressInfo object containing the current - * progress of all downloads. - */ - void onDownloadProgress(DownloadProgressInfo progress); -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderService.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderService.java deleted file mode 100644 index 4789afe19c..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderService.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader; - -import com.google.android.vending.expansion.downloader.impl.DownloaderService; -import android.os.Messenger; - -/** - * This interface is implemented by the DownloaderService and by the - * DownloaderServiceMarshaller. It contains functions to control the service. - * When a client binds to the service, it must call the onClientUpdated - * function. - * <p> - * You can acquire a proxy that implements this interface for your service by - * calling {@link DownloaderServiceMarshaller#CreateProxy} during the - * {@link IDownloaderClient#onServiceConnected} callback. At which point, you - * should immediately call {@link #onClientUpdated}. - */ -public interface IDownloaderService { - /** - * Set this flag in response to the - * IDownloaderClient.STATE_PAUSED_NEED_CELLULAR_PERMISSION state and then - * call RequestContinueDownload to resume a download - */ - public static final int FLAGS_DOWNLOAD_OVER_CELLULAR = 1; - - /** - * Request that the service abort the current download. The service should - * respond by changing the state to {@link IDownloaderClient.STATE_ABORTED}. - */ - void requestAbortDownload(); - - /** - * Request that the service pause the current download. The service should - * respond by changing the state to - * {@link IDownloaderClient.STATE_PAUSED_BY_REQUEST}. - */ - void requestPauseDownload(); - - /** - * Request that the service continue a paused download, when in any paused - * or failed state, including - * {@link IDownloaderClient.STATE_PAUSED_BY_REQUEST}. - */ - void requestContinueDownload(); - - /** - * Set the flags for this download (e.g. - * {@link DownloaderService.FLAGS_DOWNLOAD_OVER_CELLULAR}). - * - * @param flags - */ - void setDownloadFlags(int flags); - - /** - * Requests that the download status be sent to the client. - */ - void requestDownloadStatus(); - - /** - * Call this when you get {@link - * IDownloaderClient.onServiceConnected(Messenger m)} from the - * DownloaderClient to register the client with the service. It will - * automatically send the current status to the client. - * - * @param clientMessenger - */ - void onClientUpdated(Messenger clientMessenger); -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IStub.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IStub.java deleted file mode 100644 index d5bc3a843e..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IStub.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader; - -import android.content.Context; -import android.os.Messenger; - -/** - * This is the interface that is used to connect/disconnect from the downloader - * service. - * <p> - * You should get a proxy object that implements this interface by calling - * {@link DownloaderClientMarshaller#CreateStub} in your activity when the - * downloader service starts. Then, call {@link #connect} during your activity's - * onResume() and call {@link #disconnect} during onStop(). - * <p> - * Then during the {@link IDownloaderClient#onServiceConnected} callback, you - * should call {@link #getMessenger} to pass the stub's Messenger object to - * {@link IDownloaderService#onClientUpdated}. - */ -public interface IStub { - Messenger getMessenger(); - - void connect(Context c); - - void disconnect(Context c); -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/SystemFacade.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/SystemFacade.java deleted file mode 100644 index 12edd97ab2..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/SystemFacade.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader; - -import android.app.Notification; -import android.app.NotificationManager; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager.NameNotFoundException; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; -import android.telephony.TelephonyManager; -import android.util.Log; - -/** - * Contains useful helper functions, typically tied to the application context. - */ -class SystemFacade { - private Context mContext; - private NotificationManager mNotificationManager; - - public SystemFacade(Context context) { - mContext = context; - mNotificationManager = (NotificationManager) - mContext.getSystemService(Context.NOTIFICATION_SERVICE); - } - - public long currentTimeMillis() { - return System.currentTimeMillis(); - } - - public Integer getActiveNetworkType() { - ConnectivityManager connectivity = - (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE); - if (connectivity == null) { - Log.w(Constants.TAG, "couldn't get connectivity manager"); - return null; - } - - NetworkInfo activeInfo = connectivity.getActiveNetworkInfo(); - if (activeInfo == null) { - if (Constants.LOGVV) { - Log.v(Constants.TAG, "network is not available"); - } - return null; - } - return activeInfo.getType(); - } - - public boolean isNetworkRoaming() { - ConnectivityManager connectivity = - (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE); - if (connectivity == null) { - Log.w(Constants.TAG, "couldn't get connectivity manager"); - return false; - } - - NetworkInfo info = connectivity.getActiveNetworkInfo(); - boolean isMobile = (info != null && info.getType() == ConnectivityManager.TYPE_MOBILE); - TelephonyManager tm = (TelephonyManager) mContext - .getSystemService(Context.TELEPHONY_SERVICE); - if (null == tm) { - Log.w(Constants.TAG, "couldn't get telephony manager"); - return false; - } - boolean isRoaming = isMobile && tm.isNetworkRoaming(); - if (Constants.LOGVV && isRoaming) { - Log.v(Constants.TAG, "network is roaming"); - } - return isRoaming; - } - - public Long getMaxBytesOverMobile() { - return (long) Integer.MAX_VALUE; - } - - public Long getRecommendedMaxBytesOverMobile() { - return 2097152L; - } - - public void sendBroadcast(Intent intent) { - mContext.sendBroadcast(intent); - } - - public boolean userOwnsPackage(int uid, String packageName) throws NameNotFoundException { - return mContext.getPackageManager().getApplicationInfo(packageName, 0).uid == uid; - } - - public void postNotification(long id, Notification notification) { - /** - * TODO: The system notification manager takes ints, not longs, as IDs, - * but the download manager uses IDs take straight from the database, - * which are longs. This will have to be dealt with at some point. - */ - mNotificationManager.notify((int) id, notification); - } - - public void cancelNotification(long id) { - mNotificationManager.cancel((int) id); - } - - public void cancelAllNotifications() { - mNotificationManager.cancelAll(); - } - - public void startThread(Thread thread) { - thread.start(); - } -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java deleted file mode 100644 index 4667acce67..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java +++ /dev/null @@ -1,536 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * This is a port of AndroidHttpClient to pre-Froyo devices, that takes advantage of - * the SSLSessionCache added Froyo devices using reflection. - */ - -package com.google.android.vending.expansion.downloader.impl; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URI; -import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; - -import org.apache.http.Header; -import org.apache.http.HttpEntity; -import org.apache.http.HttpEntityEnclosingRequest; -import org.apache.http.HttpException; -import org.apache.http.HttpHost; -import org.apache.http.HttpRequest; -import org.apache.http.HttpRequestInterceptor; -import org.apache.http.HttpResponse; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.HttpClient; -import org.apache.http.client.ResponseHandler; -import org.apache.http.client.methods.HttpUriRequest; -import org.apache.http.client.params.HttpClientParams; -import org.apache.http.client.protocol.ClientContext; -import org.apache.http.conn.ClientConnectionManager; -import org.apache.http.conn.scheme.PlainSocketFactory; -import org.apache.http.conn.scheme.Scheme; -import org.apache.http.conn.scheme.SchemeRegistry; -import org.apache.http.conn.scheme.SocketFactory; -import org.apache.http.conn.ssl.SSLSocketFactory; -import org.apache.http.entity.AbstractHttpEntity; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.impl.client.RequestWrapper; -import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager; -import org.apache.http.params.BasicHttpParams; -import org.apache.http.params.HttpConnectionParams; -import org.apache.http.params.HttpParams; -import org.apache.http.params.HttpProtocolParams; -import org.apache.http.protocol.BasicHttpContext; -import org.apache.http.protocol.BasicHttpProcessor; -import org.apache.http.protocol.HttpContext; - -import android.content.ContentResolver; -import android.content.Context; -import android.net.SSLCertificateSocketFactory; -import android.os.Looper; -import android.util.Log; - -/** - * Subclass of the Apache {@link DefaultHttpClient} that is configured with - * reasonable default settings and registered schemes for Android, and - * also lets the user add {@link HttpRequestInterceptor} classes. - * Don't create this directly, use the {@link #newInstance} factory method. - * - * <p>This client processes cookies but does not retain them by default. - * To retain cookies, simply add a cookie store to the HttpContext:</p> - * - * <pre>context.setAttribute(ClientContext.COOKIE_STORE, cookieStore);</pre> - */ -public final class AndroidHttpClient implements HttpClient { - - static Class<?> sSslSessionCacheClass; - static { - // if we are on Froyo+ devices, we can take advantage of the SSLSessionCache - try { - sSslSessionCacheClass = Class.forName("android.net.SSLSessionCache"); - } catch (Exception e) { - - } - } - - // Gzip of data shorter than this probably won't be worthwhile - public static long DEFAULT_SYNC_MIN_GZIP_BYTES = 256; - - // Default connection and socket timeout of 60 seconds. Tweak to taste. - private static final int SOCKET_OPERATION_TIMEOUT = 60 * 1000; - - private static final String TAG = "AndroidHttpClient"; - - - /** Interceptor throws an exception if the executing thread is blocked */ - private static final HttpRequestInterceptor sThreadCheckInterceptor = - new HttpRequestInterceptor() { - public void process(HttpRequest request, HttpContext context) { - // Prevent the HttpRequest from being sent on the main thread - if (Looper.myLooper() != null && Looper.myLooper() == Looper.getMainLooper() ) { - throw new RuntimeException("This thread forbids HTTP requests"); - } - } - }; - - /** - * Create a new HttpClient with reasonable defaults (which you can update). - * - * @param userAgent to report in your HTTP requests - * @param context to use for caching SSL sessions (may be null for no caching) - * @return AndroidHttpClient for you to use for all your requests. - */ - public static AndroidHttpClient newInstance(String userAgent, Context context) { - HttpParams params = new BasicHttpParams(); - - // Turn off stale checking. Our connections break all the time anyway, - // and it's not worth it to pay the penalty of checking every time. - HttpConnectionParams.setStaleCheckingEnabled(params, false); - - HttpConnectionParams.setConnectionTimeout(params, SOCKET_OPERATION_TIMEOUT); - HttpConnectionParams.setSoTimeout(params, SOCKET_OPERATION_TIMEOUT); - HttpConnectionParams.setSocketBufferSize(params, 8192); - - // Don't handle redirects -- return them to the caller. Our code - // often wants to re-POST after a redirect, which we must do ourselves. - HttpClientParams.setRedirecting(params, false); - - Object sessionCache = null; - // Use a session cache for SSL sockets -- Froyo only - if ( null != context && null != sSslSessionCacheClass ) { - Constructor<?> ct; - try { - ct = sSslSessionCacheClass.getConstructor(Context.class); - sessionCache = ct.newInstance(context); - } catch (SecurityException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (NoSuchMethodException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalArgumentException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (InvocationTargetException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - // Set the specified user agent and register standard protocols. - HttpProtocolParams.setUserAgent(params, userAgent); - SchemeRegistry schemeRegistry = new SchemeRegistry(); - schemeRegistry.register(new Scheme("http", - PlainSocketFactory.getSocketFactory(), 80)); - SocketFactory sslCertificateSocketFactory = null; - if ( null != sessionCache ) { - Method getHttpSocketFactoryMethod; - try { - getHttpSocketFactoryMethod = SSLCertificateSocketFactory.class.getDeclaredMethod("getHttpSocketFactory",Integer.TYPE, sSslSessionCacheClass); - sslCertificateSocketFactory = (SocketFactory)getHttpSocketFactoryMethod.invoke(null, SOCKET_OPERATION_TIMEOUT, sessionCache); - } catch (SecurityException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (NoSuchMethodException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalArgumentException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (InvocationTargetException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - if ( null == sslCertificateSocketFactory ) { - sslCertificateSocketFactory = SSLSocketFactory.getSocketFactory(); - } - schemeRegistry.register(new Scheme("https", - sslCertificateSocketFactory, 443)); - - ClientConnectionManager manager = - new ThreadSafeClientConnManager(params, schemeRegistry); - - // We use a factory method to modify superclass initialization - // parameters without the funny call-a-static-method dance. - return new AndroidHttpClient(manager, params); - } - - /** - * Create a new HttpClient with reasonable defaults (which you can update). - * @param userAgent to report in your HTTP requests. - * @return AndroidHttpClient for you to use for all your requests. - */ - public static AndroidHttpClient newInstance(String userAgent) { - return newInstance(userAgent, null /* session cache */); - } - - private final HttpClient delegate; - - private RuntimeException mLeakedException = new IllegalStateException( - "AndroidHttpClient created and never closed"); - - private AndroidHttpClient(ClientConnectionManager ccm, HttpParams params) { - this.delegate = new DefaultHttpClient(ccm, params) { - @Override - protected BasicHttpProcessor createHttpProcessor() { - // Add interceptor to prevent making requests from main thread. - BasicHttpProcessor processor = super.createHttpProcessor(); - processor.addRequestInterceptor(sThreadCheckInterceptor); - processor.addRequestInterceptor(new CurlLogger()); - - return processor; - } - - @Override - protected HttpContext createHttpContext() { - // Same as DefaultHttpClient.createHttpContext() minus the - // cookie store. - HttpContext context = new BasicHttpContext(); - context.setAttribute( - ClientContext.AUTHSCHEME_REGISTRY, - getAuthSchemes()); - context.setAttribute( - ClientContext.COOKIESPEC_REGISTRY, - getCookieSpecs()); - context.setAttribute( - ClientContext.CREDS_PROVIDER, - getCredentialsProvider()); - return context; - } - }; - } - - @Override - protected void finalize() throws Throwable { - super.finalize(); - if (mLeakedException != null) { - Log.e(TAG, "Leak found", mLeakedException); - mLeakedException = null; - } - } - - /** - * Modifies a request to indicate to the server that we would like a - * gzipped response. (Uses the "Accept-Encoding" HTTP header.) - * @param request the request to modify - * @see #getUngzippedContent - */ - public static void modifyRequestToAcceptGzipResponse(HttpRequest request) { - request.addHeader("Accept-Encoding", "gzip"); - } - - /** - * Gets the input stream from a response entity. If the entity is gzipped - * then this will get a stream over the uncompressed data. - * - * @param entity the entity whose content should be read - * @return the input stream to read from - * @throws IOException - */ - public static InputStream getUngzippedContent(HttpEntity entity) - throws IOException { - InputStream responseStream = entity.getContent(); - if (responseStream == null) return responseStream; - Header header = entity.getContentEncoding(); - if (header == null) return responseStream; - String contentEncoding = header.getValue(); - if (contentEncoding == null) return responseStream; - if (contentEncoding.contains("gzip")) responseStream - = new GZIPInputStream(responseStream); - return responseStream; - } - - /** - * Release resources associated with this client. You must call this, - * or significant resources (sockets and memory) may be leaked. - */ - public void close() { - if (mLeakedException != null) { - getConnectionManager().shutdown(); - mLeakedException = null; - } - } - - public HttpParams getParams() { - return delegate.getParams(); - } - - public ClientConnectionManager getConnectionManager() { - return delegate.getConnectionManager(); - } - - public HttpResponse execute(HttpUriRequest request) throws IOException { - return delegate.execute(request); - } - - public HttpResponse execute(HttpUriRequest request, HttpContext context) - throws IOException { - return delegate.execute(request, context); - } - - public HttpResponse execute(HttpHost target, HttpRequest request) - throws IOException { - return delegate.execute(target, request); - } - - public HttpResponse execute(HttpHost target, HttpRequest request, - HttpContext context) throws IOException { - return delegate.execute(target, request, context); - } - - public <T> T execute(HttpUriRequest request, - ResponseHandler<? extends T> responseHandler) - throws IOException, ClientProtocolException { - return delegate.execute(request, responseHandler); - } - - public <T> T execute(HttpUriRequest request, - ResponseHandler<? extends T> responseHandler, HttpContext context) - throws IOException, ClientProtocolException { - return delegate.execute(request, responseHandler, context); - } - - public <T> T execute(HttpHost target, HttpRequest request, - ResponseHandler<? extends T> responseHandler) throws IOException, - ClientProtocolException { - return delegate.execute(target, request, responseHandler); - } - - public <T> T execute(HttpHost target, HttpRequest request, - ResponseHandler<? extends T> responseHandler, HttpContext context) - throws IOException, ClientProtocolException { - return delegate.execute(target, request, responseHandler, context); - } - - /** - * Compress data to send to server. - * Creates a Http Entity holding the gzipped data. - * The data will not be compressed if it is too short. - * @param data The bytes to compress - * @return Entity holding the data - */ - public static AbstractHttpEntity getCompressedEntity(byte data[], ContentResolver resolver) - throws IOException { - AbstractHttpEntity entity; - if (data.length < getMinGzipSize(resolver)) { - entity = new ByteArrayEntity(data); - } else { - ByteArrayOutputStream arr = new ByteArrayOutputStream(); - OutputStream zipper = new GZIPOutputStream(arr); - zipper.write(data); - zipper.close(); - entity = new ByteArrayEntity(arr.toByteArray()); - entity.setContentEncoding("gzip"); - } - return entity; - } - - /** - * Retrieves the minimum size for compressing data. - * Shorter data will not be compressed. - */ - public static long getMinGzipSize(ContentResolver resolver) { - return DEFAULT_SYNC_MIN_GZIP_BYTES; // For now, this is just a constant. - } - - /* cURL logging support. */ - - /** - * Logging tag and level. - */ - private static class LoggingConfiguration { - - private final String tag; - private final int level; - - private LoggingConfiguration(String tag, int level) { - this.tag = tag; - this.level = level; - } - - /** - * Returns true if logging is turned on for this configuration. - */ - private boolean isLoggable() { - return Log.isLoggable(tag, level); - } - - /** - * Prints a message using this configuration. - */ - private void println(String message) { - Log.println(level, tag, message); - } - } - - /** cURL logging configuration. */ - private volatile LoggingConfiguration curlConfiguration; - - /** - * Enables cURL request logging for this client. - * - * @param name to log messages with - * @param level at which to log messages (see {@link android.util.Log}) - */ - public void enableCurlLogging(String name, int level) { - if (name == null) { - throw new NullPointerException("name"); - } - if (level < Log.VERBOSE || level > Log.ASSERT) { - throw new IllegalArgumentException("Level is out of range [" - + Log.VERBOSE + ".." + Log.ASSERT + "]"); - } - - curlConfiguration = new LoggingConfiguration(name, level); - } - - /** - * Disables cURL logging for this client. - */ - public void disableCurlLogging() { - curlConfiguration = null; - } - - /** - * Logs cURL commands equivalent to requests. - */ - private class CurlLogger implements HttpRequestInterceptor { - public void process(HttpRequest request, HttpContext context) - throws HttpException, IOException { - LoggingConfiguration configuration = curlConfiguration; - if (configuration != null - && configuration.isLoggable() - && request instanceof HttpUriRequest) { - // Never print auth token -- we used to check ro.secure=0 to - // enable that, but can't do that in unbundled code. - configuration.println(toCurl((HttpUriRequest) request, false)); - } - } - } - - /** - * Generates a cURL command equivalent to the given request. - */ - private static String toCurl(HttpUriRequest request, boolean logAuthToken) throws IOException { - StringBuilder builder = new StringBuilder(); - - builder.append("curl "); - - for (Header header: request.getAllHeaders()) { - if (!logAuthToken - && (header.getName().equals("Authorization") || - header.getName().equals("Cookie"))) { - continue; - } - builder.append("--header \""); - builder.append(header.toString().trim()); - builder.append("\" "); - } - - URI uri = request.getURI(); - - // If this is a wrapped request, use the URI from the original - // request instead. getURI() on the wrapper seems to return a - // relative URI. We want an absolute URI. - if (request instanceof RequestWrapper) { - HttpRequest original = ((RequestWrapper) request).getOriginal(); - if (original instanceof HttpUriRequest) { - uri = ((HttpUriRequest) original).getURI(); - } - } - - builder.append("\""); - builder.append(uri); - builder.append("\""); - - if (request instanceof HttpEntityEnclosingRequest) { - HttpEntityEnclosingRequest entityRequest = - (HttpEntityEnclosingRequest) request; - HttpEntity entity = entityRequest.getEntity(); - if (entity != null && entity.isRepeatable()) { - if (entity.getContentLength() < 1024) { - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - entity.writeTo(stream); - String entityString = stream.toString(); - - // TODO: Check the content type, too. - builder.append(" --data-ascii \"") - .append(entityString) - .append("\""); - } else { - builder.append(" [TOO MUCH DATA TO INCLUDE]"); - } - } - } - - return builder.toString(); - } - - /** - * Returns the date of the given HTTP date string. This method can identify - * and parse the date formats emitted by common HTTP servers, such as - * <a href="http://www.ietf.org/rfc/rfc0822.txt">RFC 822</a>, - * <a href="http://www.ietf.org/rfc/rfc0850.txt">RFC 850</a>, - * <a href="http://www.ietf.org/rfc/rfc1036.txt">RFC 1036</a>, - * <a href="http://www.ietf.org/rfc/rfc1123.txt">RFC 1123</a> and - * <a href="http://www.opengroup.org/onlinepubs/007908799/xsh/asctime.html">ANSI - * C's asctime()</a>. - * - * @return the number of milliseconds since Jan. 1, 1970, midnight GMT. - * @throws IllegalArgumentException if {@code dateString} is not a date or - * of an unsupported format. - */ - public static long parseDate(String dateString) { - return HttpDateTime.parse(dateString); - } -}
\ No newline at end of file diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java deleted file mode 100755 index b77af7e085..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader.impl; - -import android.app.Service; -import android.content.Intent; -import android.os.Handler; -import android.os.HandlerThread; -import android.os.IBinder; -import android.os.Looper; -import android.os.Message; -import android.util.Log; - -/** - * This service differs from IntentService in a few minor ways/ It will not - * auto-stop itself after the intent is handled unless the target returns "true" - * in should stop. Since the goal of this service is to handle a single kind of - * intent, it does not queue up batches of intents of the same type. - */ -public abstract class CustomIntentService extends Service { - private String mName; - private boolean mRedelivery; - private volatile ServiceHandler mServiceHandler; - private volatile Looper mServiceLooper; - private static final String LOG_TAG = "CancellableIntentService"; - private static final int WHAT_MESSAGE = -10; - - public CustomIntentService(String paramString) { - this.mName = paramString; - } - - @Override - public IBinder onBind(Intent paramIntent) { - return null; - } - - @Override - public void onCreate() { - super.onCreate(); - HandlerThread localHandlerThread = new HandlerThread("IntentService[" - + this.mName + "]"); - localHandlerThread.start(); - this.mServiceLooper = localHandlerThread.getLooper(); - this.mServiceHandler = new ServiceHandler(this.mServiceLooper); - } - - @Override - public void onDestroy() { - Thread localThread = this.mServiceLooper.getThread(); - if ((localThread != null) && (localThread.isAlive())) { - localThread.interrupt(); - } - this.mServiceLooper.quit(); - Log.d(LOG_TAG, "onDestroy"); - } - - protected abstract void onHandleIntent(Intent paramIntent); - - protected abstract boolean shouldStop(); - - @Override - public void onStart(Intent paramIntent, int startId) { - if (!this.mServiceHandler.hasMessages(WHAT_MESSAGE)) { - Message localMessage = this.mServiceHandler.obtainMessage(); - localMessage.arg1 = startId; - localMessage.obj = paramIntent; - localMessage.what = WHAT_MESSAGE; - this.mServiceHandler.sendMessage(localMessage); - } - } - - @Override - public int onStartCommand(Intent paramIntent, int flags, int startId) { - onStart(paramIntent, startId); - return mRedelivery ? START_REDELIVER_INTENT : START_NOT_STICKY; - } - - public void setIntentRedelivery(boolean enabled) { - this.mRedelivery = enabled; - } - - private final class ServiceHandler extends Handler { - public ServiceHandler(Looper looper) { - super(looper); - } - - @Override - public void handleMessage(Message paramMessage) { - CustomIntentService.this - .onHandleIntent((Intent) paramMessage.obj); - if (shouldStop()) { - Log.d(LOG_TAG, "stopSelf"); - CustomIntentService.this.stopSelf(paramMessage.arg1); - Log.d(LOG_TAG, "afterStopSelf"); - } - } - } -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java deleted file mode 100644 index 9a0ca02122..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader.impl; - -/** - * Uses the class-loader model to utilize the updated notification builders in - * Honeycomb while maintaining a compatible version for older devices. - */ -public class CustomNotificationFactory { - static public DownloadNotification.ICustomNotification createCustomNotification() { - if (android.os.Build.VERSION.SDK_INT > 13) - return new V14CustomNotification(); - else - return new V3CustomNotification(); - } -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java deleted file mode 100644 index 45111b16a3..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader.impl; - -import com.google.android.vending.expansion.downloader.Constants; -import com.google.android.vending.expansion.downloader.Helpers; - -import android.util.Log; - -/** - * Representation of information about an individual download from the database. - */ -public class DownloadInfo { - public String mUri; - public final int mIndex; - public final String mFileName; - public String mETag; - public long mTotalBytes; - public long mCurrentBytes; - public long mLastMod; - public int mStatus; - public int mControl; - public int mNumFailed; - public int mRetryAfter; - public int mRedirectCount; - - boolean mInitialized; - - public int mFuzz; - - public DownloadInfo(int index, String fileName, String pkg) { - mFuzz = Helpers.sRandom.nextInt(1001); - mFileName = fileName; - mIndex = index; - } - - public void resetDownload() { - mCurrentBytes = 0; - mETag = ""; - mLastMod = 0; - mStatus = 0; - mControl = 0; - mNumFailed = 0; - mRetryAfter = 0; - mRedirectCount = 0; - } - - /** - * Returns the time when a download should be restarted. - */ - public long restartTime(long now) { - if (mNumFailed == 0) { - return now; - } - if (mRetryAfter > 0) { - return mLastMod + mRetryAfter; - } - return mLastMod + - Constants.RETRY_FIRST_DELAY * - (1000 + mFuzz) * (1 << (mNumFailed - 1)); - } - - public void logVerboseInfo() { - Log.v(Constants.TAG, "Service adding new entry"); - Log.v(Constants.TAG, "FILENAME: " + mFileName); - Log.v(Constants.TAG, "URI : " + mUri); - Log.v(Constants.TAG, "FILENAME: " + mFileName); - Log.v(Constants.TAG, "CONTROL : " + mControl); - Log.v(Constants.TAG, "STATUS : " + mStatus); - Log.v(Constants.TAG, "FAILED_C: " + mNumFailed); - Log.v(Constants.TAG, "RETRY_AF: " + mRetryAfter); - Log.v(Constants.TAG, "REDIRECT: " + mRedirectCount); - Log.v(Constants.TAG, "LAST_MOD: " + mLastMod); - Log.v(Constants.TAG, "TOTAL : " + mTotalBytes); - Log.v(Constants.TAG, "CURRENT : " + mCurrentBytes); - Log.v(Constants.TAG, "ETAG : " + mETag); - } -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java deleted file mode 100644 index 056d1eca0b..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java +++ /dev/null @@ -1,963 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader.impl; - -import com.google.android.vending.expansion.downloader.Constants; -import com.google.android.vending.expansion.downloader.Helpers; -import com.google.android.vending.expansion.downloader.IDownloaderClient; - -import org.apache.http.Header; -import org.apache.http.HttpHost; -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.conn.params.ConnRouteParams; - -import android.content.Context; -import android.net.Proxy; -import android.os.PowerManager; -import android.os.Process; -import android.util.Log; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.SyncFailedException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Locale; - -/** - * Runs an actual download - */ -public class DownloadThread { - - private Context mContext; - private DownloadInfo mInfo; - private DownloaderService mService; - private final DownloadsDB mDB; - private final DownloadNotification mNotification; - private String mUserAgent; - - public DownloadThread(DownloadInfo info, DownloaderService service, - DownloadNotification notification) { - mContext = service; - mInfo = info; - mService = service; - mNotification = notification; - mDB = DownloadsDB.getDB(service); - mUserAgent = "APKXDL (Linux; U; Android " + android.os.Build.VERSION.RELEASE + ";" - + Locale.getDefault().toString() + "; " + android.os.Build.DEVICE + "/" - + android.os.Build.ID + ")" + - service.getPackageName(); - } - - /** - * Returns the default user agent - */ - private String userAgent() { - return mUserAgent; - } - - /** - * State for the entire run() method. - */ - private static class State { - public String mFilename; - public FileOutputStream mStream; - public boolean mCountRetry = false; - public int mRetryAfter = 0; - public int mRedirectCount = 0; - public String mNewUri; - public boolean mGotData = false; - public String mRequestUri; - - public State(DownloadInfo info, DownloaderService service) { - mRedirectCount = info.mRedirectCount; - mRequestUri = info.mUri; - mFilename = service.generateTempSaveFileName(info.mFileName); - } - } - - /** - * State within executeDownload() - */ - private static class InnerState { - public int mBytesSoFar = 0; - public int mBytesThisSession = 0; - public String mHeaderETag; - public boolean mContinuingDownload = false; - public String mHeaderContentLength; - public String mHeaderContentDisposition; - public String mHeaderContentLocation; - public int mBytesNotified = 0; - public long mTimeLastNotification = 0; - } - - /** - * Raised from methods called by run() to indicate that the current request - * should be stopped immediately. Note the message passed to this exception - * will be logged and therefore must be guaranteed not to contain any PII, - * meaning it generally can't include any information about the request URI, - * headers, or destination filename. - */ - private class StopRequest extends Throwable { - /** - * - */ - private static final long serialVersionUID = 6338592678988347973L; - public int mFinalStatus; - - public StopRequest(int finalStatus, String message) { - super(message); - mFinalStatus = finalStatus; - } - - public StopRequest(int finalStatus, String message, Throwable throwable) { - super(message, throwable); - mFinalStatus = finalStatus; - } - } - - /** - * Raised from methods called by executeDownload() to indicate that the - * download should be retried immediately. - */ - private class RetryDownload extends Throwable { - - /** - * - */ - private static final long serialVersionUID = 6196036036517540229L; - } - - /** - * Returns the preferred proxy to be used by clients. This is a wrapper - * around {@link android.net.Proxy#getHost()}. Currently no proxy will be - * returned for localhost or if the active network is Wi-Fi. - * - * @param context the context which will be passed to - * {@link android.net.Proxy#getHost()} - * @param url the target URL for the request - * @note Calling this method requires permission - * android.permission.ACCESS_NETWORK_STATE - * @return The preferred proxy to be used by clients, or null if there is no - * proxy. - */ - public HttpHost getPreferredHttpHost(Context context, - String url) { - if (!isLocalHost(url) && !mService.isWiFi()) { - final String proxyHost = Proxy.getHost(context); - if (proxyHost != null) { - return new HttpHost(proxyHost, Proxy.getPort(context), "http"); - } - } - - return null; - } - - static final private boolean isLocalHost(String url) { - if (url == null) { - return false; - } - - try { - final URI uri = URI.create(url); - final String host = uri.getHost(); - if (host != null) { - // TODO: InetAddress.isLoopbackAddress should be used to check - // for localhost. However no public factory methods exist which - // can be used without triggering DNS lookup if host is not - // localhost. - if (host.equalsIgnoreCase("localhost") || - host.equals("127.0.0.1") || - host.equals("[::1]")) { - return true; - } - } - } catch (IllegalArgumentException iex) { - // Ignore (URI.create) - } - - return false; - } - - /** - * Executes the download in a separate thread - */ - public void run() { - Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); - - State state = new State(mInfo, mService); - AndroidHttpClient client = null; - PowerManager.WakeLock wakeLock = null; - int finalStatus = DownloaderService.STATUS_UNKNOWN_ERROR; - - try { - PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); - wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Constants.TAG); - wakeLock.acquire(); - - if (Constants.LOGV) { - Log.v(Constants.TAG, "initiating download for " + mInfo.mFileName); - Log.v(Constants.TAG, " at " + mInfo.mUri); - } - - client = AndroidHttpClient.newInstance(userAgent(), mContext); - - boolean finished = false; - while (!finished) { - if (Constants.LOGV) { - Log.v(Constants.TAG, "initiating download for " + mInfo.mFileName); - Log.v(Constants.TAG, " at " + mInfo.mUri); - } - // Set or unset proxy, which may have changed since last GET - // request. - // setDefaultProxy() supports null as proxy parameter. - ConnRouteParams.setDefaultProxy(client.getParams(), - getPreferredHttpHost(mContext, state.mRequestUri)); - HttpGet request = new HttpGet(state.mRequestUri); - try { - executeDownload(state, client, request); - finished = true; - } catch (RetryDownload exc) { - // fall through - } finally { - request.abort(); - request = null; - } - } - - if (Constants.LOGV) { - Log.v(Constants.TAG, "download completed for " + mInfo.mFileName); - Log.v(Constants.TAG, " at " + mInfo.mUri); - } - finalizeDestinationFile(state); - finalStatus = DownloaderService.STATUS_SUCCESS; - } catch (StopRequest error) { - // remove the cause before printing, in case it contains PII - Log.w(Constants.TAG, - "Aborting request for download " + mInfo.mFileName + ": " + error.getMessage()); - error.printStackTrace(); - finalStatus = error.mFinalStatus; - // fall through to finally block - } catch (Throwable ex) { // sometimes the socket code throws unchecked - // exceptions - Log.w(Constants.TAG, "Exception for " + mInfo.mFileName + ": " + ex); - finalStatus = DownloaderService.STATUS_UNKNOWN_ERROR; - // falls through to the code that reports an error - } finally { - if (wakeLock != null) { - wakeLock.release(); - wakeLock = null; - } - if (client != null) { - client.close(); - client = null; - } - cleanupDestination(state, finalStatus); - notifyDownloadCompleted(finalStatus, state.mCountRetry, state.mRetryAfter, - state.mRedirectCount, state.mGotData, state.mFilename); - } - } - - /** - * Fully execute a single download request - setup and send the request, - * handle the response, and transfer the data to the destination file. - */ - private void executeDownload(State state, AndroidHttpClient client, HttpGet request) - throws StopRequest, RetryDownload { - InnerState innerState = new InnerState(); - byte data[] = new byte[Constants.BUFFER_SIZE]; - - checkPausedOrCanceled(state); - - setupDestinationFile(state, innerState); - addRequestHeaders(innerState, request); - - // check just before sending the request to avoid using an invalid - // connection at all - checkConnectivity(state); - - mNotification.onDownloadStateChanged(IDownloaderClient.STATE_CONNECTING); - HttpResponse response = sendRequest(state, client, request); - handleExceptionalStatus(state, innerState, response); - - if (Constants.LOGV) { - Log.v(Constants.TAG, "received response for " + mInfo.mUri); - } - - processResponseHeaders(state, innerState, response); - InputStream entityStream = openResponseEntity(state, response); - mNotification.onDownloadStateChanged(IDownloaderClient.STATE_DOWNLOADING); - transferData(state, innerState, data, entityStream); - } - - /** - * Check if current connectivity is valid for this request. - */ - private void checkConnectivity(State state) throws StopRequest { - switch (mService.getNetworkAvailabilityState(mDB)) { - case DownloaderService.NETWORK_OK: - return; - case DownloaderService.NETWORK_NO_CONNECTION: - throw new StopRequest(DownloaderService.STATUS_WAITING_FOR_NETWORK, - "waiting for network to return"); - case DownloaderService.NETWORK_TYPE_DISALLOWED_BY_REQUESTOR: - throw new StopRequest( - DownloaderService.STATUS_QUEUED_FOR_WIFI_OR_CELLULAR_PERMISSION, - "waiting for wifi or for download over cellular to be authorized"); - case DownloaderService.NETWORK_CANNOT_USE_ROAMING: - throw new StopRequest(DownloaderService.STATUS_WAITING_FOR_NETWORK, - "roaming is not allowed"); - case DownloaderService.NETWORK_UNUSABLE_DUE_TO_SIZE: - throw new StopRequest(DownloaderService.STATUS_QUEUED_FOR_WIFI, "waiting for wifi"); - } - } - - /** - * Transfer as much data as possible from the HTTP response to the - * destination file. - * - * @param data buffer to use to read data - * @param entityStream stream for reading the HTTP response entity - */ - private void transferData(State state, InnerState innerState, byte[] data, - InputStream entityStream) throws StopRequest { - for (;;) { - int bytesRead = readFromResponse(state, innerState, data, entityStream); - if (bytesRead == -1) { // success, end of stream already reached - handleEndOfStream(state, innerState); - return; - } - - state.mGotData = true; - writeDataToDestination(state, data, bytesRead); - innerState.mBytesSoFar += bytesRead; - innerState.mBytesThisSession += bytesRead; - reportProgress(state, innerState); - - checkPausedOrCanceled(state); - } - } - - /** - * Called after a successful completion to take any necessary action on the - * downloaded file. - */ - private void finalizeDestinationFile(State state) throws StopRequest { - syncDestination(state); - String tempFilename = state.mFilename; - String finalFilename = Helpers.generateSaveFileName(mService, mInfo.mFileName); - if (!state.mFilename.equals(finalFilename)) { - File startFile = new File(tempFilename); - File destFile = new File(finalFilename); - if (mInfo.mTotalBytes != -1 && mInfo.mCurrentBytes == mInfo.mTotalBytes) { - if (!startFile.renameTo(destFile)) { - throw new StopRequest(DownloaderService.STATUS_FILE_ERROR, - "unable to finalize destination file"); - } - } else { - throw new StopRequest(DownloaderService.STATUS_FILE_DELIVERED_INCORRECTLY, - "file delivered with incorrect size. probably due to network not browser configured"); - } - } - } - - /** - * Called just before the thread finishes, regardless of status, to take any - * necessary action on the downloaded file. - */ - private void cleanupDestination(State state, int finalStatus) { - closeDestination(state); - if (state.mFilename != null && DownloaderService.isStatusError(finalStatus)) { - new File(state.mFilename).delete(); - state.mFilename = null; - } - } - - /** - * Sync the destination file to storage. - */ - private void syncDestination(State state) { - FileOutputStream downloadedFileStream = null; - try { - downloadedFileStream = new FileOutputStream(state.mFilename, true); - downloadedFileStream.getFD().sync(); - } catch (FileNotFoundException ex) { - Log.w(Constants.TAG, "file " + state.mFilename + " not found: " + ex); - } catch (SyncFailedException ex) { - Log.w(Constants.TAG, "file " + state.mFilename + " sync failed: " + ex); - } catch (IOException ex) { - Log.w(Constants.TAG, "IOException trying to sync " + state.mFilename + ": " + ex); - } catch (RuntimeException ex) { - Log.w(Constants.TAG, "exception while syncing file: ", ex); - } finally { - if (downloadedFileStream != null) { - try { - downloadedFileStream.close(); - } catch (IOException ex) { - Log.w(Constants.TAG, "IOException while closing synced file: ", ex); - } catch (RuntimeException ex) { - Log.w(Constants.TAG, "exception while closing file: ", ex); - } - } - } - } - - /** - * Close the destination output stream. - */ - private void closeDestination(State state) { - try { - // close the file - if (state.mStream != null) { - state.mStream.close(); - state.mStream = null; - } - } catch (IOException ex) { - if (Constants.LOGV) { - Log.v(Constants.TAG, "exception when closing the file after download : " + ex); - } - // nothing can really be done if the file can't be closed - } - } - - /** - * Check if the download has been paused or canceled, stopping the request - * appropriately if it has been. - */ - private void checkPausedOrCanceled(State state) throws StopRequest { - if (mService.getControl() == DownloaderService.CONTROL_PAUSED) { - int status = mService.getStatus(); - switch (status) { - case DownloaderService.STATUS_PAUSED_BY_APP: - throw new StopRequest(mService.getStatus(), - "download paused"); - } - } - } - - /** - * Report download progress through the database if necessary. - */ - private void reportProgress(State state, InnerState innerState) { - long now = System.currentTimeMillis(); - if (innerState.mBytesSoFar - innerState.mBytesNotified - > Constants.MIN_PROGRESS_STEP - && now - innerState.mTimeLastNotification - > Constants.MIN_PROGRESS_TIME) { - // we store progress updates to the database here - mInfo.mCurrentBytes = innerState.mBytesSoFar; - mDB.updateDownloadCurrentBytes(mInfo); - - innerState.mBytesNotified = innerState.mBytesSoFar; - innerState.mTimeLastNotification = now; - - long totalBytesSoFar = innerState.mBytesThisSession + mService.mBytesSoFar; - - if (Constants.LOGVV) { - Log.v(Constants.TAG, "downloaded " + mInfo.mCurrentBytes + " out of " - + mInfo.mTotalBytes); - Log.v(Constants.TAG, " total " + totalBytesSoFar + " out of " - + mService.mTotalLength); - } - - mService.notifyUpdateBytes(totalBytesSoFar); - } - } - - /** - * Write a data buffer to the destination file. - * - * @param data buffer containing the data to write - * @param bytesRead how many bytes to write from the buffer - */ - private void writeDataToDestination(State state, byte[] data, int bytesRead) - throws StopRequest { - for (;;) { - try { - if (state.mStream == null) { - state.mStream = new FileOutputStream(state.mFilename, true); - } - state.mStream.write(data, 0, bytesRead); - // we close after every write --- this may be too inefficient - closeDestination(state); - return; - } catch (IOException ex) { - if (!Helpers.isExternalMediaMounted()) { - throw new StopRequest(DownloaderService.STATUS_DEVICE_NOT_FOUND_ERROR, - "external media not mounted while writing destination file"); - } - - long availableBytes = - Helpers.getAvailableBytes(Helpers.getFilesystemRoot(state.mFilename)); - if (availableBytes < bytesRead) { - throw new StopRequest(DownloaderService.STATUS_INSUFFICIENT_SPACE_ERROR, - "insufficient space while writing destination file", ex); - } - throw new StopRequest(DownloaderService.STATUS_FILE_ERROR, - "while writing destination file: " + ex.toString(), ex); - } - } - } - - /** - * Called when we've reached the end of the HTTP response stream, to update - * the database and check for consistency. - */ - private void handleEndOfStream(State state, InnerState innerState) throws StopRequest { - mInfo.mCurrentBytes = innerState.mBytesSoFar; - // this should always be set from the market - // if ( innerState.mHeaderContentLength == null ) { - // mInfo.mTotalBytes = innerState.mBytesSoFar; - // } - mDB.updateDownload(mInfo); - - boolean lengthMismatched = (innerState.mHeaderContentLength != null) - && (innerState.mBytesSoFar != Integer.parseInt(innerState.mHeaderContentLength)); - if (lengthMismatched) { - if (cannotResume(innerState)) { - throw new StopRequest(DownloaderService.STATUS_CANNOT_RESUME, - "mismatched content length"); - } else { - throw new StopRequest(getFinalStatusForHttpError(state), - "closed socket before end of file"); - } - } - } - - private boolean cannotResume(InnerState innerState) { - return innerState.mBytesSoFar > 0 && innerState.mHeaderETag == null; - } - - /** - * Read some data from the HTTP response stream, handling I/O errors. - * - * @param data buffer to use to read data - * @param entityStream stream for reading the HTTP response entity - * @return the number of bytes actually read or -1 if the end of the stream - * has been reached - */ - private int readFromResponse(State state, InnerState innerState, byte[] data, - InputStream entityStream) throws StopRequest { - try { - return entityStream.read(data); - } catch (IOException ex) { - logNetworkState(); - mInfo.mCurrentBytes = innerState.mBytesSoFar; - mDB.updateDownload(mInfo); - if (cannotResume(innerState)) { - String message = "while reading response: " + ex.toString() - + ", can't resume interrupted download with no ETag"; - throw new StopRequest(DownloaderService.STATUS_CANNOT_RESUME, - message, ex); - } else { - throw new StopRequest(getFinalStatusForHttpError(state), - "while reading response: " + ex.toString(), ex); - } - } - } - - /** - * Open a stream for the HTTP response entity, handling I/O errors. - * - * @return an InputStream to read the response entity - */ - private InputStream openResponseEntity(State state, HttpResponse response) - throws StopRequest { - try { - return response.getEntity().getContent(); - } catch (IOException ex) { - logNetworkState(); - throw new StopRequest(getFinalStatusForHttpError(state), - "while getting entity: " + ex.toString(), ex); - } - } - - private void logNetworkState() { - if (Constants.LOGX) { - Log.i(Constants.TAG, - "Net " - + (mService.getNetworkAvailabilityState(mDB) == DownloaderService.NETWORK_OK ? "Up" - : "Down")); - } - } - - /** - * Read HTTP response headers and take appropriate action, including setting - * up the destination file and updating the database. - */ - private void processResponseHeaders(State state, InnerState innerState, HttpResponse response) - throws StopRequest { - if (innerState.mContinuingDownload) { - // ignore response headers on resume requests - return; - } - - readResponseHeaders(state, innerState, response); - - try { - state.mFilename = mService.generateSaveFile(mInfo.mFileName, mInfo.mTotalBytes); - } catch (DownloaderService.GenerateSaveFileError exc) { - throw new StopRequest(exc.mStatus, exc.mMessage); - } - try { - state.mStream = new FileOutputStream(state.mFilename); - } catch (FileNotFoundException exc) { - // make sure the directory exists - File pathFile = new File(Helpers.getSaveFilePath(mService)); - try { - if (pathFile.mkdirs()) { - state.mStream = new FileOutputStream(state.mFilename); - } - } catch (Exception ex) { - throw new StopRequest(DownloaderService.STATUS_FILE_ERROR, - "while opening destination file: " + exc.toString(), exc); - } - } - if (Constants.LOGV) { - Log.v(Constants.TAG, "writing " + mInfo.mUri + " to " + state.mFilename); - } - - updateDatabaseFromHeaders(state, innerState); - // check connectivity again now that we know the total size - checkConnectivity(state); - } - - /** - * Update necessary database fields based on values of HTTP response headers - * that have been read. - */ - private void updateDatabaseFromHeaders(State state, InnerState innerState) { - mInfo.mETag = innerState.mHeaderETag; - mDB.updateDownload(mInfo); - } - - /** - * Read headers from the HTTP response and store them into local state. - */ - private void readResponseHeaders(State state, InnerState innerState, HttpResponse response) - throws StopRequest { - Header header = response.getFirstHeader("Content-Disposition"); - if (header != null) { - innerState.mHeaderContentDisposition = header.getValue(); - } - header = response.getFirstHeader("Content-Location"); - if (header != null) { - innerState.mHeaderContentLocation = header.getValue(); - } - header = response.getFirstHeader("ETag"); - if (header != null) { - innerState.mHeaderETag = header.getValue(); - } - String headerTransferEncoding = null; - header = response.getFirstHeader("Transfer-Encoding"); - if (header != null) { - headerTransferEncoding = header.getValue(); - } - String headerContentType = null; - header = response.getFirstHeader("Content-Type"); - if (header != null) { - headerContentType = header.getValue(); - if (!headerContentType.equals("application/vnd.android.obb")) { - throw new StopRequest(DownloaderService.STATUS_FILE_DELIVERED_INCORRECTLY, - "file delivered with incorrect Mime type"); - } - } - - if (headerTransferEncoding == null) { - header = response.getFirstHeader("Content-Length"); - if (header != null) { - innerState.mHeaderContentLength = header.getValue(); - // this is always set from Market - long contentLength = Long.parseLong(innerState.mHeaderContentLength); - if (contentLength != -1 && contentLength != mInfo.mTotalBytes) { - // we're most likely on a bad wifi connection -- we should - // probably - // also look at the mime type --- but the size mismatch is - // enough - // to tell us that something is wrong here - Log.e(Constants.TAG, "Incorrect file size delivered."); - } - } - } else { - // Ignore content-length with transfer-encoding - 2616 4.4 3 - if (Constants.LOGVV) { - Log.v(Constants.TAG, - "ignoring content-length because of xfer-encoding"); - } - } - if (Constants.LOGVV) { - Log.v(Constants.TAG, "Content-Disposition: " + - innerState.mHeaderContentDisposition); - Log.v(Constants.TAG, "Content-Length: " + innerState.mHeaderContentLength); - Log.v(Constants.TAG, "Content-Location: " + innerState.mHeaderContentLocation); - Log.v(Constants.TAG, "ETag: " + innerState.mHeaderETag); - Log.v(Constants.TAG, "Transfer-Encoding: " + headerTransferEncoding); - } - - boolean noSizeInfo = innerState.mHeaderContentLength == null - && (headerTransferEncoding == null - || !headerTransferEncoding.equalsIgnoreCase("chunked")); - if (noSizeInfo) { - throw new StopRequest(DownloaderService.STATUS_HTTP_DATA_ERROR, - "can't know size of download, giving up"); - } - } - - /** - * Check the HTTP response status and handle anything unusual (e.g. not - * 200/206). - */ - private void handleExceptionalStatus(State state, InnerState innerState, HttpResponse response) - throws StopRequest, RetryDownload { - int statusCode = response.getStatusLine().getStatusCode(); - if (statusCode == 503 && mInfo.mNumFailed < Constants.MAX_RETRIES) { - handleServiceUnavailable(state, response); - } - if (statusCode == 301 || statusCode == 302 || statusCode == 303 || statusCode == 307) { - handleRedirect(state, response, statusCode); - } - - int expectedStatus = innerState.mContinuingDownload ? 206 - : DownloaderService.STATUS_SUCCESS; - if (statusCode != expectedStatus) { - handleOtherStatus(state, innerState, statusCode); - } else { - // no longer redirected - state.mRedirectCount = 0; - } - } - - /** - * Handle a status that we don't know how to deal with properly. - */ - private void handleOtherStatus(State state, InnerState innerState, int statusCode) - throws StopRequest { - int finalStatus; - if (DownloaderService.isStatusError(statusCode)) { - finalStatus = statusCode; - } else if (statusCode >= 300 && statusCode < 400) { - finalStatus = DownloaderService.STATUS_UNHANDLED_REDIRECT; - } else if (innerState.mContinuingDownload && statusCode == DownloaderService.STATUS_SUCCESS) { - finalStatus = DownloaderService.STATUS_CANNOT_RESUME; - } else { - finalStatus = DownloaderService.STATUS_UNHANDLED_HTTP_CODE; - } - throw new StopRequest(finalStatus, "http error " + statusCode); - } - - /** - * Handle a 3xx redirect status. - */ - private void handleRedirect(State state, HttpResponse response, int statusCode) - throws StopRequest, RetryDownload { - if (Constants.LOGVV) { - Log.v(Constants.TAG, "got HTTP redirect " + statusCode); - } - if (state.mRedirectCount >= Constants.MAX_REDIRECTS) { - throw new StopRequest(DownloaderService.STATUS_TOO_MANY_REDIRECTS, "too many redirects"); - } - Header header = response.getFirstHeader("Location"); - if (header == null) { - return; - } - if (Constants.LOGVV) { - Log.v(Constants.TAG, "Location :" + header.getValue()); - } - - String newUri; - try { - newUri = new URI(mInfo.mUri).resolve(new URI(header.getValue())).toString(); - } catch (URISyntaxException ex) { - if (Constants.LOGV) { - Log.d(Constants.TAG, "Couldn't resolve redirect URI " + header.getValue() - + " for " + mInfo.mUri); - } - throw new StopRequest(DownloaderService.STATUS_HTTP_DATA_ERROR, - "Couldn't resolve redirect URI"); - } - ++state.mRedirectCount; - state.mRequestUri = newUri; - if (statusCode == 301 || statusCode == 303) { - // use the new URI for all future requests (should a retry/resume be - // necessary) - state.mNewUri = newUri; - } - throw new RetryDownload(); - } - - /** - * Add headers for this download to the HTTP request to allow for resume. - */ - private void addRequestHeaders(InnerState innerState, HttpGet request) { - if (innerState.mContinuingDownload) { - if (innerState.mHeaderETag != null) { - request.addHeader("If-Match", innerState.mHeaderETag); - } - request.addHeader("Range", "bytes=" + innerState.mBytesSoFar + "-"); - } - } - - /** - * Handle a 503 Service Unavailable status by processing the Retry-After - * header. - */ - private void handleServiceUnavailable(State state, HttpResponse response) throws StopRequest { - if (Constants.LOGVV) { - Log.v(Constants.TAG, "got HTTP response code 503"); - } - state.mCountRetry = true; - Header header = response.getFirstHeader("Retry-After"); - if (header != null) { - try { - if (Constants.LOGVV) { - Log.v(Constants.TAG, "Retry-After :" + header.getValue()); - } - state.mRetryAfter = Integer.parseInt(header.getValue()); - if (state.mRetryAfter < 0) { - state.mRetryAfter = 0; - } else { - if (state.mRetryAfter < Constants.MIN_RETRY_AFTER) { - state.mRetryAfter = Constants.MIN_RETRY_AFTER; - } else if (state.mRetryAfter > Constants.MAX_RETRY_AFTER) { - state.mRetryAfter = Constants.MAX_RETRY_AFTER; - } - state.mRetryAfter += Helpers.sRandom.nextInt(Constants.MIN_RETRY_AFTER + 1); - state.mRetryAfter *= 1000; - } - } catch (NumberFormatException ex) { - // ignored - retryAfter stays 0 in this case. - } - } - throw new StopRequest(DownloaderService.STATUS_WAITING_TO_RETRY, - "got 503 Service Unavailable, will retry later"); - } - - /** - * Send the request to the server, handling any I/O exceptions. - */ - private HttpResponse sendRequest(State state, AndroidHttpClient client, HttpGet request) - throws StopRequest { - try { - return client.execute(request); - } catch (IllegalArgumentException ex) { - throw new StopRequest(DownloaderService.STATUS_HTTP_DATA_ERROR, - "while trying to execute request: " + ex.toString(), ex); - } catch (IOException ex) { - logNetworkState(); - throw new StopRequest(getFinalStatusForHttpError(state), - "while trying to execute request: " + ex.toString(), ex); - } - } - - private int getFinalStatusForHttpError(State state) { - if (mService.getNetworkAvailabilityState(mDB) != DownloaderService.NETWORK_OK) { - return DownloaderService.STATUS_WAITING_FOR_NETWORK; - } else if (mInfo.mNumFailed < Constants.MAX_RETRIES) { - state.mCountRetry = true; - return DownloaderService.STATUS_WAITING_TO_RETRY; - } else { - Log.w(Constants.TAG, "reached max retries for " + mInfo.mNumFailed); - return DownloaderService.STATUS_HTTP_DATA_ERROR; - } - } - - /** - * Prepare the destination file to receive data. If the file already exists, - * we'll set up appropriately for resumption. - */ - private void setupDestinationFile(State state, InnerState innerState) - throws StopRequest { - if (state.mFilename != null) { // only true if we've already run a - // thread for this download - if (!Helpers.isFilenameValid(state.mFilename)) { - // this should never happen - throw new StopRequest(DownloaderService.STATUS_FILE_ERROR, - "found invalid internal destination filename"); - } - // We're resuming a download that got interrupted - File f = new File(state.mFilename); - if (f.exists()) { - long fileLength = f.length(); - if (fileLength == 0) { - // The download hadn't actually started, we can restart from - // scratch - f.delete(); - state.mFilename = null; - } else if (mInfo.mETag == null) { - // This should've been caught upon failure - f.delete(); - throw new StopRequest(DownloaderService.STATUS_CANNOT_RESUME, - "Trying to resume a download that can't be resumed"); - } else { - // All right, we'll be able to resume this download - try { - state.mStream = new FileOutputStream(state.mFilename, true); - } catch (FileNotFoundException exc) { - throw new StopRequest(DownloaderService.STATUS_FILE_ERROR, - "while opening destination for resuming: " + exc.toString(), exc); - } - innerState.mBytesSoFar = (int) fileLength; - if (mInfo.mTotalBytes != -1) { - innerState.mHeaderContentLength = Long.toString(mInfo.mTotalBytes); - } - innerState.mHeaderETag = mInfo.mETag; - innerState.mContinuingDownload = true; - } - } - } - - if (state.mStream != null) { - closeDestination(state); - } - } - - /** - * Stores information about the completed download, and notifies the - * initiating application. - */ - private void notifyDownloadCompleted( - int status, boolean countRetry, int retryAfter, int redirectCount, boolean gotData, - String filename) { - updateDownloadDatabase( - status, countRetry, retryAfter, redirectCount, gotData, filename); - if (DownloaderService.isStatusCompleted(status)) { - // TBD: send status update? - } - } - - private void updateDownloadDatabase( - int status, boolean countRetry, int retryAfter, int redirectCount, boolean gotData, - String filename) { - mInfo.mStatus = status; - mInfo.mRetryAfter = retryAfter; - mInfo.mRedirectCount = redirectCount; - mInfo.mLastMod = System.currentTimeMillis(); - if (!countRetry) { - mInfo.mNumFailed = 0; - } else if (gotData) { - mInfo.mNumFailed = 1; - } else { - mInfo.mNumFailed++; - } - mDB.updateDownload(mInfo); - } - -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java deleted file mode 100644 index 627bf3eedd..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java +++ /dev/null @@ -1,1341 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader.impl; - -import com.google.android.vending.expansion.downloader.Constants; -import com.google.android.vending.expansion.downloader.DownloadProgressInfo; -import com.google.android.vending.expansion.downloader.DownloaderServiceMarshaller; -import com.google.android.vending.expansion.downloader.Helpers; -import com.google.android.vending.expansion.downloader.IDownloaderClient; -import com.google.android.vending.expansion.downloader.IDownloaderService; -import com.google.android.vending.expansion.downloader.IStub; -import com.google.android.vending.licensing.AESObfuscator; -import com.google.android.vending.licensing.APKExpansionPolicy; -import com.google.android.vending.licensing.LicenseChecker; -import com.google.android.vending.licensing.LicenseCheckerCallback; -import com.google.android.vending.licensing.Policy; - -import android.app.AlarmManager; -import android.app.PendingIntent; -import android.app.Service; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager.NameNotFoundException; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; -import android.net.wifi.WifiManager; -import android.os.Handler; -import android.os.IBinder; -import android.os.Messenger; -import android.os.SystemClock; -import android.provider.Settings.Secure; -import android.telephony.TelephonyManager; -import android.util.Log; - -import java.io.File; - -/** - * Performs the background downloads requested by applications that use the - * Downloads provider. This service does not run as a foreground task, so - * Android may kill it off at will, but it will try to restart itself if it can. - * Note that Android by default will kill off any process that has an open file - * handle on the shared (SD Card) partition if the partition is unmounted. - */ -public abstract class DownloaderService extends CustomIntentService implements IDownloaderService { - - public DownloaderService() { - super("LVLDownloadService"); - } - - private static final String LOG_TAG = "LVLDL"; - - // the following NETWORK_* constants are used to indicates specific reasons - // for disallowing a - // download from using a network, since specific causes can require special - // handling - - /** - * The network is usable for the given download. - */ - public static final int NETWORK_OK = 1; - - /** - * There is no network connectivity. - */ - public static final int NETWORK_NO_CONNECTION = 2; - - /** - * The download exceeds the maximum size for this network. - */ - public static final int NETWORK_UNUSABLE_DUE_TO_SIZE = 3; - - /** - * The download exceeds the recommended maximum size for this network, the - * user must confirm for this download to proceed without WiFi. - */ - public static final int NETWORK_RECOMMENDED_UNUSABLE_DUE_TO_SIZE = 4; - - /** - * The current connection is roaming, and the download can't proceed over a - * roaming connection. - */ - public static final int NETWORK_CANNOT_USE_ROAMING = 5; - - /** - * The app requesting the download specific that it can't use the current - * network connection. - */ - public static final int NETWORK_TYPE_DISALLOWED_BY_REQUESTOR = 6; - - /** - * For intents used to notify the user that a download exceeds a size - * threshold, if this extra is true, WiFi is required for this download - * size; otherwise, it is only recommended. - */ - public static final String EXTRA_IS_WIFI_REQUIRED = "isWifiRequired"; - public static final String EXTRA_FILE_NAME = "downloadId"; - - /** - * Used with DOWNLOAD_STATUS - */ - public static final String EXTRA_STATUS_STATE = "ESS"; - public static final String EXTRA_STATUS_TOTAL_SIZE = "ETS"; - public static final String EXTRA_STATUS_CURRENT_FILE_SIZE = "CFS"; - public static final String EXTRA_STATUS_TOTAL_PROGRESS = "TFP"; - public static final String EXTRA_STATUS_CURRENT_PROGRESS = "CFP"; - - public static final String ACTION_DOWNLOADS_CHANGED = "downloadsChanged"; - - /** - * Broadcast intent action sent by the download manager when a download - * completes. - */ - public final static String ACTION_DOWNLOAD_COMPLETE = "lvldownloader.intent.action.DOWNLOAD_COMPLETE"; - - /** - * Broadcast intent action sent by the download manager when download status - * changes. - */ - public final static String ACTION_DOWNLOAD_STATUS = "lvldownloader.intent.action.DOWNLOAD_STATUS"; - - /* - * Lists the states that the download manager can set on a download to - * notify applications of the download progress. The codes follow the HTTP - * families:<br> 1xx: informational<br> 2xx: success<br> 3xx: redirects (not - * used by the download manager)<br> 4xx: client errors<br> 5xx: server - * errors - */ - - /** - * Returns whether the status is informational (i.e. 1xx). - */ - public static boolean isStatusInformational(int status) { - return (status >= 100 && status < 200); - } - - /** - * Returns whether the status is a success (i.e. 2xx). - */ - public static boolean isStatusSuccess(int status) { - return (status >= 200 && status < 300); - } - - /** - * Returns whether the status is an error (i.e. 4xx or 5xx). - */ - public static boolean isStatusError(int status) { - return (status >= 400 && status < 600); - } - - /** - * Returns whether the status is a client error (i.e. 4xx). - */ - public static boolean isStatusClientError(int status) { - return (status >= 400 && status < 500); - } - - /** - * Returns whether the status is a server error (i.e. 5xx). - */ - public static boolean isStatusServerError(int status) { - return (status >= 500 && status < 600); - } - - /** - * Returns whether the download has completed (either with success or - * error). - */ - public static boolean isStatusCompleted(int status) { - return (status >= 200 && status < 300) - || (status >= 400 && status < 600); - } - - /** - * This download hasn't stated yet - */ - public static final int STATUS_PENDING = 190; - - /** - * This download has started - */ - public static final int STATUS_RUNNING = 192; - - /** - * This download has been paused by the owning app. - */ - public static final int STATUS_PAUSED_BY_APP = 193; - - /** - * This download encountered some network error and is waiting before - * retrying the request. - */ - public static final int STATUS_WAITING_TO_RETRY = 194; - - /** - * This download is waiting for network connectivity to proceed. - */ - public static final int STATUS_WAITING_FOR_NETWORK = 195; - - /** - * This download is waiting for a Wi-Fi connection to proceed or for - * permission to download over cellular. - */ - public static final int STATUS_QUEUED_FOR_WIFI_OR_CELLULAR_PERMISSION = 196; - - /** - * This download is waiting for a Wi-Fi connection to proceed. - */ - public static final int STATUS_QUEUED_FOR_WIFI = 197; - - /** - * This download has successfully completed. Warning: there might be other - * status values that indicate success in the future. Use isSucccess() to - * capture the entire category. - * - * @hide - */ - public static final int STATUS_SUCCESS = 200; - - /** - * The requested URL is no longer available - */ - public static final int STATUS_FORBIDDEN = 403; - - /** - * The file was delivered incorrectly - */ - public static final int STATUS_FILE_DELIVERED_INCORRECTLY = 487; - - /** - * The requested destination file already exists. - */ - public static final int STATUS_FILE_ALREADY_EXISTS_ERROR = 488; - - /** - * Some possibly transient error occurred, but we can't resume the download. - */ - public static final int STATUS_CANNOT_RESUME = 489; - - /** - * This download was canceled - * - * @hide - */ - public static final int STATUS_CANCELED = 490; - - /** - * This download has completed with an error. Warning: there will be other - * status values that indicate errors in the future. Use isStatusError() to - * capture the entire category. - */ - public static final int STATUS_UNKNOWN_ERROR = 491; - - /** - * This download couldn't be completed because of a storage issue. - * Typically, that's because the filesystem is missing or full. Use the more - * specific {@link #STATUS_INSUFFICIENT_SPACE_ERROR} and - * {@link #STATUS_DEVICE_NOT_FOUND_ERROR} when appropriate. - * - * @hide - */ - public static final int STATUS_FILE_ERROR = 492; - - /** - * This download couldn't be completed because of an HTTP redirect response - * that the download manager couldn't handle. - * - * @hide - */ - public static final int STATUS_UNHANDLED_REDIRECT = 493; - - /** - * This download couldn't be completed because of an unspecified unhandled - * HTTP code. - * - * @hide - */ - public static final int STATUS_UNHANDLED_HTTP_CODE = 494; - - /** - * This download couldn't be completed because of an error receiving or - * processing data at the HTTP level. - * - * @hide - */ - public static final int STATUS_HTTP_DATA_ERROR = 495; - - /** - * This download couldn't be completed because of an HttpException while - * setting up the request. - * - * @hide - */ - public static final int STATUS_HTTP_EXCEPTION = 496; - - /** - * This download couldn't be completed because there were too many - * redirects. - * - * @hide - */ - public static final int STATUS_TOO_MANY_REDIRECTS = 497; - - /** - * This download couldn't be completed due to insufficient storage space. - * Typically, this is because the SD card is full. - * - * @hide - */ - public static final int STATUS_INSUFFICIENT_SPACE_ERROR = 498; - - /** - * This download couldn't be completed because no external storage device - * was found. Typically, this is because the SD card is not mounted. - * - * @hide - */ - public static final int STATUS_DEVICE_NOT_FOUND_ERROR = 499; - - /** - * This download is allowed to run. - * - * @hide - */ - public static final int CONTROL_RUN = 0; - - /** - * This download must pause at the first opportunity. - * - * @hide - */ - public static final int CONTROL_PAUSED = 1; - - /** - * This download is visible but only shows in the notifications while it's - * in progress. - * - * @hide - */ - public static final int VISIBILITY_VISIBLE = 0; - - /** - * This download is visible and shows in the notifications while in progress - * and after completion. - * - * @hide - */ - public static final int VISIBILITY_VISIBLE_NOTIFY_COMPLETED = 1; - - /** - * This download doesn't show in the UI or in the notifications. - * - * @hide - */ - public static final int VISIBILITY_HIDDEN = 2; - - /** - * Bit flag for {@link #setAllowedNetworkTypes} corresponding to - * {@link ConnectivityManager#TYPE_MOBILE}. - */ - public static final int NETWORK_MOBILE = 1 << 0; - - /** - * Bit flag for {@link #setAllowedNetworkTypes} corresponding to - * {@link ConnectivityManager#TYPE_WIFI}. - */ - public static final int NETWORK_WIFI = 1 << 1; - - private final static String TEMP_EXT = ".tmp"; - - /** - * Service thread status - */ - private static boolean sIsRunning; - - @Override - public IBinder onBind(Intent paramIntent) { - Log.d(Constants.TAG, "Service Bound"); - return this.mServiceMessenger.getBinder(); - } - - /** - * Network state. - */ - private boolean mIsConnected; - private boolean mIsFailover; - private boolean mIsCellularConnection; - private boolean mIsRoaming; - private boolean mIsAtLeast3G; - private boolean mIsAtLeast4G; - private boolean mStateChanged; - - /** - * Download state - */ - private int mControl; - private int mStatus; - - public boolean isWiFi() { - return mIsConnected && !mIsCellularConnection; - } - - /** - * Bindings to important services - */ - private ConnectivityManager mConnectivityManager; - private WifiManager mWifiManager; - - /** - * Package we are downloading for (defaults to package of application) - */ - private PackageInfo mPackageInfo; - - /** - * Byte counts - */ - long mBytesSoFar; - long mTotalLength; - int mFileCount; - - /** - * Used for calculating time remaining and speed - */ - long mBytesAtSample; - long mMillisecondsAtSample; - float mAverageDownloadSpeed; - - /** - * Our binding to the network state broadcasts - */ - private BroadcastReceiver mConnReceiver; - final private IStub mServiceStub = DownloaderServiceMarshaller.CreateStub(this); - final private Messenger mServiceMessenger = mServiceStub.getMessenger(); - private Messenger mClientMessenger; - private DownloadNotification mNotification; - private PendingIntent mPendingIntent; - private PendingIntent mAlarmIntent; - - /** - * Updates the network type based upon the type and subtype returned from - * the connectivity manager. Subtype is only used for cellular signals. - * - * @param type - * @param subType - */ - private void updateNetworkType(int type, int subType) { - switch (type) { - case ConnectivityManager.TYPE_WIFI: - case ConnectivityManager.TYPE_ETHERNET: - case ConnectivityManager.TYPE_BLUETOOTH: - mIsCellularConnection = false; - mIsAtLeast3G = false; - mIsAtLeast4G = false; - break; - case ConnectivityManager.TYPE_WIMAX: - mIsCellularConnection = true; - mIsAtLeast3G = true; - mIsAtLeast4G = true; - break; - case ConnectivityManager.TYPE_MOBILE: - mIsCellularConnection = true; - switch (subType) { - case TelephonyManager.NETWORK_TYPE_1xRTT: - case TelephonyManager.NETWORK_TYPE_CDMA: - case TelephonyManager.NETWORK_TYPE_EDGE: - case TelephonyManager.NETWORK_TYPE_GPRS: - case TelephonyManager.NETWORK_TYPE_IDEN: - mIsAtLeast3G = false; - mIsAtLeast4G = false; - break; - case TelephonyManager.NETWORK_TYPE_HSDPA: - case TelephonyManager.NETWORK_TYPE_HSUPA: - case TelephonyManager.NETWORK_TYPE_HSPA: - case TelephonyManager.NETWORK_TYPE_EVDO_0: - case TelephonyManager.NETWORK_TYPE_EVDO_A: - case TelephonyManager.NETWORK_TYPE_UMTS: - mIsAtLeast3G = true; - mIsAtLeast4G = false; - break; - case TelephonyManager.NETWORK_TYPE_LTE: // 4G - case TelephonyManager.NETWORK_TYPE_EHRPD: // 3G ++ interop - // with 4G - case TelephonyManager.NETWORK_TYPE_HSPAP: // 3G ++ but - // marketed as - // 4G - mIsAtLeast3G = true; - mIsAtLeast4G = true; - break; - default: - mIsCellularConnection = false; - mIsAtLeast3G = false; - mIsAtLeast4G = false; - } - } - } - - private void updateNetworkState(NetworkInfo info) { - boolean isConnected = mIsConnected; - boolean isFailover = mIsFailover; - boolean isCellularConnection = mIsCellularConnection; - boolean isRoaming = mIsRoaming; - boolean isAtLeast3G = mIsAtLeast3G; - if (null != info) { - mIsRoaming = info.isRoaming(); - mIsFailover = info.isFailover(); - mIsConnected = info.isConnected(); - updateNetworkType(info.getType(), info.getSubtype()); - } else { - mIsRoaming = false; - mIsFailover = false; - mIsConnected = false; - updateNetworkType(-1, -1); - } - mStateChanged = (mStateChanged || isConnected != mIsConnected - || isFailover != mIsFailover - || isCellularConnection != mIsCellularConnection - || isRoaming != mIsRoaming || isAtLeast3G != mIsAtLeast3G); - if (Constants.LOGVV) { - if (mStateChanged) { - Log.v(LOG_TAG, "Network state changed: "); - Log.v(LOG_TAG, "Starting State: " + - (isConnected ? "Connected " : "Not Connected ") + - (isCellularConnection ? "Cellular " : "WiFi ") + - (isRoaming ? "Roaming " : "Local ") + - (isAtLeast3G ? "3G+ " : "<3G ")); - Log.v(LOG_TAG, "Ending State: " + - (mIsConnected ? "Connected " : "Not Connected ") + - (mIsCellularConnection ? "Cellular " : "WiFi ") + - (mIsRoaming ? "Roaming " : "Local ") + - (mIsAtLeast3G ? "3G+ " : "<3G ")); - - if (isServiceRunning()) { - if (mIsRoaming) { - mStatus = STATUS_WAITING_FOR_NETWORK; - mControl = CONTROL_PAUSED; - } else if (mIsCellularConnection) { - DownloadsDB db = DownloadsDB.getDB(this); - int flags = db.getFlags(); - if (0 == (flags & FLAGS_DOWNLOAD_OVER_CELLULAR)) { - mStatus = STATUS_QUEUED_FOR_WIFI; - mControl = CONTROL_PAUSED; - } - } - } - - } - } - } - - /** - * Polls the network state, setting the flags appropriately. - */ - void pollNetworkState() { - if (null == mConnectivityManager) { - mConnectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); - } - if (null == mWifiManager) { - mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); - } - if (mConnectivityManager == null) { - Log.w(Constants.TAG, - "couldn't get connectivity manager to poll network state"); - } else { - NetworkInfo activeInfo = mConnectivityManager - .getActiveNetworkInfo(); - updateNetworkState(activeInfo); - } - } - - public static final int NO_DOWNLOAD_REQUIRED = 0; - public static final int LVL_CHECK_REQUIRED = 1; - public static final int DOWNLOAD_REQUIRED = 2; - - public static final String EXTRA_PACKAGE_NAME = "EPN"; - public static final String EXTRA_PENDING_INTENT = "EPI"; - public static final String EXTRA_MESSAGE_HANDLER = "EMH"; - - /** - * Returns true if the LVL check is required - * - * @param db a downloads DB synchronized with the latest state - * @param pi the package info for the project - * @return returns true if the filenames need to be returned - */ - private static boolean isLVLCheckRequired(DownloadsDB db, PackageInfo pi) { - // we need to update the LVL check and get a successful status to - // proceed - if (db.mVersionCode != pi.versionCode) { - return true; - } - return false; - } - - /** - * Careful! Only use this internally. - * - * @return whether we think the service is running - */ - private static synchronized boolean isServiceRunning() { - return sIsRunning; - } - - private static synchronized void setServiceRunning(boolean isRunning) { - sIsRunning = isRunning; - } - - public static int startDownloadServiceIfRequired(Context context, - Intent intent, Class<?> serviceClass) throws NameNotFoundException { - final PendingIntent pendingIntent = (PendingIntent) intent - .getParcelableExtra(EXTRA_PENDING_INTENT); - return startDownloadServiceIfRequired(context, pendingIntent, - serviceClass); - } - - public static int startDownloadServiceIfRequired(Context context, - PendingIntent pendingIntent, Class<?> serviceClass) - throws NameNotFoundException - { - String packageName = context.getPackageName(); - String className = serviceClass.getName(); - - return startDownloadServiceIfRequired(context, pendingIntent, - packageName, className); - } - - /** - * Starts the download if necessary. This function starts a flow that does ` - * many things. 1) Checks to see if the APK version has been checked and the - * metadata database updated 2) If the APK version does not match, checks - * the new LVL status to see if a new download is required 3) If the APK - * version does match, then checks to see if the download(s) have been - * completed 4) If the downloads have been completed, returns - * NO_DOWNLOAD_REQUIRED The idea is that this can be called during the - * startup of an application to quickly ascertain if the application needs - * to wait to hear about any updated APK expansion files. Note that this - * does mean that the application MUST be run for the first time with a - * network connection, even if Market delivers all of the files. - * - * @param context - * @param thisIntent - * @return true if the app should wait for more guidance from the - * downloader, false if the app can continue - * @throws NameNotFoundException - */ - public static int startDownloadServiceIfRequired(Context context, - PendingIntent pendingIntent, String classPackage, String className) - throws NameNotFoundException { - // first: do we need to do an LVL update? - // we begin by getting our APK version from the package manager - final PackageInfo pi = context.getPackageManager().getPackageInfo( - context.getPackageName(), 0); - - int status = NO_DOWNLOAD_REQUIRED; - - // the database automatically reads the metadata for version code - // and download status when the instance is created - DownloadsDB db = DownloadsDB.getDB(context); - - // we need to update the LVL check and get a successful status to - // proceed - if (isLVLCheckRequired(db, pi)) { - status = LVL_CHECK_REQUIRED; - } - // we don't have to update LVL. do we still have a download to start? - if (db.mStatus == 0) { - DownloadInfo[] infos = db.getDownloads(); - if (null != infos) { - for (DownloadInfo info : infos) { - if (!Helpers.doesFileExist(context, info.mFileName, info.mTotalBytes, true)) { - status = DOWNLOAD_REQUIRED; - db.updateStatus(-1); - break; - } - } - } - } else { - status = DOWNLOAD_REQUIRED; - } - switch (status) { - case DOWNLOAD_REQUIRED: - case LVL_CHECK_REQUIRED: - Intent fileIntent = new Intent(); - fileIntent.setClassName(classPackage, className); - fileIntent.putExtra(EXTRA_PENDING_INTENT, pendingIntent); - context.startService(fileIntent); - break; - } - return status; - } - - @Override - public void requestAbortDownload() { - mControl = CONTROL_PAUSED; - mStatus = STATUS_CANCELED; - } - - @Override - public void requestPauseDownload() { - mControl = CONTROL_PAUSED; - mStatus = STATUS_PAUSED_BY_APP; - } - - @Override - public void setDownloadFlags(int flags) { - DownloadsDB.getDB(this).updateFlags(flags); - } - - @Override - public void requestContinueDownload() { - if (mControl == CONTROL_PAUSED) { - mControl = CONTROL_RUN; - } - Intent fileIntent = new Intent(this, this.getClass()); - fileIntent.putExtra(EXTRA_PENDING_INTENT, mPendingIntent); - this.startService(fileIntent); - } - - public abstract String getPublicKey(); - - public abstract byte[] getSALT(); - - public abstract String getAlarmReceiverClassName(); - - private class LVLRunnable implements Runnable { - LVLRunnable(Context context, PendingIntent intent) { - mContext = context; - mPendingIntent = intent; - } - - final Context mContext; - - @Override - public void run() { - setServiceRunning(true); - mNotification.onDownloadStateChanged(IDownloaderClient.STATE_FETCHING_URL); - String deviceId = Secure.getString(mContext.getContentResolver(), - Secure.ANDROID_ID); - - final APKExpansionPolicy aep = new APKExpansionPolicy(mContext, - new AESObfuscator(getSALT(), mContext.getPackageName(), deviceId)); - - // reset our policy back to the start of the world to force a - // re-check - aep.resetPolicy(); - - // let's try and get the OBB file from LVL first - // Construct the LicenseChecker with a Policy. - final LicenseChecker checker = new LicenseChecker(mContext, aep, - getPublicKey() // Your public licensing key. - ); - checker.checkAccess(new LicenseCheckerCallback() { - - @Override - public void allow(int reason) { - try { - int count = aep.getExpansionURLCount(); - DownloadsDB db = DownloadsDB.getDB(mContext); - int status = 0; - if (count != 0) { - for (int i = 0; i < count; i++) { - String currentFileName = aep - .getExpansionFileName(i); - if (null != currentFileName) { - DownloadInfo di = new DownloadInfo(i, - currentFileName, mContext.getPackageName()); - - long fileSize = aep.getExpansionFileSize(i); - if (handleFileUpdated(db, i, currentFileName, - fileSize)) { - status |= -1; - di.resetDownload(); - di.mUri = aep.getExpansionURL(i); - di.mTotalBytes = fileSize; - di.mStatus = status; - db.updateDownload(di); - } else { - // we need to read the download - // information - // from - // the database - DownloadInfo dbdi = db - .getDownloadInfoByFileName(di.mFileName); - if (null == dbdi) { - // the file exists already and is - // the - // correct size - // was delivered by Market or - // through - // another mechanism - Log.d(LOG_TAG, "file " + di.mFileName - + " found. Not downloading."); - di.mStatus = STATUS_SUCCESS; - di.mTotalBytes = fileSize; - di.mCurrentBytes = fileSize; - di.mUri = aep.getExpansionURL(i); - db.updateDownload(di); - } else if (dbdi.mStatus != STATUS_SUCCESS) { - // we just update the URL - dbdi.mUri = aep.getExpansionURL(i); - db.updateDownload(dbdi); - status |= -1; - } - } - } - } - } - // first: do we need to do an LVL update? - // we begin by getting our APK version from the package - // manager - PackageInfo pi; - try { - pi = mContext.getPackageManager().getPackageInfo( - mContext.getPackageName(), 0); - db.updateMetadata(pi.versionCode, status); - Class<?> serviceClass = DownloaderService.this.getClass(); - switch (startDownloadServiceIfRequired(mContext, mPendingIntent, - serviceClass)) { - case NO_DOWNLOAD_REQUIRED: - mNotification - .onDownloadStateChanged(IDownloaderClient.STATE_COMPLETED); - break; - case LVL_CHECK_REQUIRED: - // DANGER WILL ROBINSON! - Log.e(LOG_TAG, "In LVL checking loop!"); - mNotification - .onDownloadStateChanged(IDownloaderClient.STATE_FAILED_UNLICENSED); - throw new RuntimeException( - "Error with LVL checking and database integrity"); - case DOWNLOAD_REQUIRED: - // do nothing. the download will notify the - // application - // when things are done - break; - } - } catch (NameNotFoundException e1) { - e1.printStackTrace(); - throw new RuntimeException( - "Error with getting information from package name"); - } - } finally { - setServiceRunning(false); - } - } - - @Override - public void dontAllow(int reason) { - try - { - switch (reason) { - case Policy.NOT_LICENSED: - mNotification - .onDownloadStateChanged(IDownloaderClient.STATE_FAILED_UNLICENSED); - break; - case Policy.RETRY: - mNotification - .onDownloadStateChanged(IDownloaderClient.STATE_FAILED_FETCHING_URL); - break; - } - } finally { - setServiceRunning(false); - } - - } - - @Override - public void applicationError(int errorCode) { - try { - mNotification - .onDownloadStateChanged(IDownloaderClient.STATE_FAILED_FETCHING_URL); - } finally { - setServiceRunning(false); - } - } - - }); - - } - - }; - - /** - * Updates the LVL information from the server. - * - * @param context - */ - public void updateLVL(final Context context) { - Context c = context.getApplicationContext(); - Handler h = new Handler(c.getMainLooper()); - h.post(new LVLRunnable(c, mPendingIntent)); - } - - /** - * The APK has been updated and a filename has been sent down from the - * Market call. If the file has the same name as the previous file, we do - * nothing as the file is guaranteed to be the same. If the file does not - * have the same name, we download it if it hasn't already been delivered by - * Market. - * - * @param index the index of the file from market (0 = main, 1 = patch) - * @param filename the name of the new file - * @param fileSize the size of the new file - * @return - */ - public boolean handleFileUpdated(DownloadsDB db, int index, - String filename, long fileSize) { - DownloadInfo di = db.getDownloadInfoByFileName(filename); - if (null != di) { - String oldFile = di.mFileName; - // cleanup - if (null != oldFile) { - if (filename.equals(oldFile)) { - return false; - } - - // remove partially downloaded file if it is there - String deleteFile = Helpers.generateSaveFileName(this, oldFile); - File f = new File(deleteFile); - if (f.exists()) - f.delete(); - } - } - return !Helpers.doesFileExist(this, filename, fileSize, true); - } - - private void scheduleAlarm(long wakeUp) { - AlarmManager alarms = (AlarmManager) getSystemService(Context.ALARM_SERVICE); - if (alarms == null) { - Log.e(Constants.TAG, "couldn't get alarm manager"); - return; - } - - if (Constants.LOGV) { - Log.v(Constants.TAG, "scheduling retry in " + wakeUp + "ms"); - } - - String className = getAlarmReceiverClassName(); - Intent intent = new Intent(Constants.ACTION_RETRY); - intent.putExtra(EXTRA_PENDING_INTENT, mPendingIntent); - intent.setClassName(this.getPackageName(), - className); - mAlarmIntent = PendingIntent.getBroadcast(this, 0, intent, - PendingIntent.FLAG_ONE_SHOT); - alarms.set( - AlarmManager.RTC_WAKEUP, - System.currentTimeMillis() + wakeUp, mAlarmIntent - ); - } - - private void cancelAlarms() { - if (null != mAlarmIntent) { - AlarmManager alarms = (AlarmManager) getSystemService(Context.ALARM_SERVICE); - if (alarms == null) { - Log.e(Constants.TAG, "couldn't get alarm manager"); - return; - } - alarms.cancel(mAlarmIntent); - mAlarmIntent = null; - } - } - - /** - * We use this to track network state, such as when WiFi, Cellular, etc. is - * enabled when downloads are paused or in progress. - */ - private class InnerBroadcastReceiver extends BroadcastReceiver { - final Service mService; - - InnerBroadcastReceiver(Service service) { - mService = service; - } - - @Override - public void onReceive(Context context, Intent intent) { - pollNetworkState(); - if (mStateChanged - && !isServiceRunning()) { - Log.d(Constants.TAG, "InnerBroadcastReceiver Called"); - Intent fileIntent = new Intent(context, mService.getClass()); - fileIntent.putExtra(EXTRA_PENDING_INTENT, mPendingIntent); - // send a new intent to the service - context.startService(fileIntent); - } - } - }; - - /** - * This is the main thread for the Downloader. This thread is responsible - * for queuing up downloads and other goodness. - */ - @Override - protected void onHandleIntent(Intent intent) { - setServiceRunning(true); - try { - // the database automatically reads the metadata for version code - // and download status when the instance is created - DownloadsDB db = DownloadsDB.getDB(this); - final PendingIntent pendingIntent = (PendingIntent) intent - .getParcelableExtra(EXTRA_PENDING_INTENT); - - if (null != pendingIntent) - { - mNotification.setClientIntent(pendingIntent); - mPendingIntent = pendingIntent; - } else if (null != mPendingIntent) { - mNotification.setClientIntent(mPendingIntent); - } else { - Log.e(LOG_TAG, "Downloader started in bad state without notification intent."); - return; - } - - // when the LVL check completes, a successful response will update - // the service - if (isLVLCheckRequired(db, mPackageInfo)) { - updateLVL(this); - return; - } - - // get each download - DownloadInfo[] infos = db.getDownloads(); - mBytesSoFar = 0; - mTotalLength = 0; - mFileCount = infos.length; - for (DownloadInfo info : infos) { - // We do an (simple) integrity check on each file, just to make - // sure - if (info.mStatus == STATUS_SUCCESS) { - // verify that the file matches the state - if (!Helpers.doesFileExist(this, info.mFileName, info.mTotalBytes, true)) { - info.mStatus = 0; - info.mCurrentBytes = 0; - } - } - // get aggregate data - mTotalLength += info.mTotalBytes; - mBytesSoFar += info.mCurrentBytes; - } - - // loop through all downloads and fetch them - pollNetworkState(); - if (null == mConnReceiver) { - - /** - * We use this to track network state, such as when WiFi, - * Cellular, etc. is enabled when downloads are paused or in - * progress. - */ - mConnReceiver = new InnerBroadcastReceiver(this); - IntentFilter intentFilter = new IntentFilter( - ConnectivityManager.CONNECTIVITY_ACTION); - intentFilter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION); - registerReceiver(mConnReceiver, intentFilter); - } - - for (DownloadInfo info : infos) { - long startingCount = info.mCurrentBytes; - - if (info.mStatus != STATUS_SUCCESS) { - DownloadThread dt = new DownloadThread(info, this, mNotification); - cancelAlarms(); - scheduleAlarm(Constants.ACTIVE_THREAD_WATCHDOG); - dt.run(); - cancelAlarms(); - } - db.updateFromDb(info); - boolean setWakeWatchdog = false; - int notifyStatus; - switch (info.mStatus) { - case STATUS_FORBIDDEN: - // the URL is out of date - updateLVL(this); - return; - case STATUS_SUCCESS: - mBytesSoFar += info.mCurrentBytes - startingCount; - db.updateMetadata(mPackageInfo.versionCode, 0); - continue; - case STATUS_FILE_DELIVERED_INCORRECTLY: - // we may be on a network that is returning us a web - // page on redirect - notifyStatus = IDownloaderClient.STATE_PAUSED_NETWORK_SETUP_FAILURE; - info.mCurrentBytes = 0; - db.updateDownload(info); - setWakeWatchdog = true; - break; - case STATUS_PAUSED_BY_APP: - notifyStatus = IDownloaderClient.STATE_PAUSED_BY_REQUEST; - break; - case STATUS_WAITING_FOR_NETWORK: - case STATUS_WAITING_TO_RETRY: - notifyStatus = IDownloaderClient.STATE_PAUSED_NETWORK_UNAVAILABLE; - setWakeWatchdog = true; - break; - case STATUS_QUEUED_FOR_WIFI_OR_CELLULAR_PERMISSION: - case STATUS_QUEUED_FOR_WIFI: - // look for more detail here - if (null != mWifiManager) { - if (!mWifiManager.isWifiEnabled()) { - notifyStatus = IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION; - setWakeWatchdog = true; - break; - } - } - notifyStatus = IDownloaderClient.STATE_PAUSED_NEED_CELLULAR_PERMISSION; - setWakeWatchdog = true; - break; - case STATUS_CANCELED: - notifyStatus = IDownloaderClient.STATE_FAILED_CANCELED; - setWakeWatchdog = true; - break; - - case STATUS_INSUFFICIENT_SPACE_ERROR: - notifyStatus = IDownloaderClient.STATE_FAILED_SDCARD_FULL; - setWakeWatchdog = true; - break; - - case STATUS_DEVICE_NOT_FOUND_ERROR: - notifyStatus = IDownloaderClient.STATE_PAUSED_SDCARD_UNAVAILABLE; - setWakeWatchdog = true; - break; - - default: - notifyStatus = IDownloaderClient.STATE_FAILED; - break; - } - if (setWakeWatchdog) { - scheduleAlarm(Constants.WATCHDOG_WAKE_TIMER); - } else { - cancelAlarms(); - } - // failure or pause state - mNotification.onDownloadStateChanged(notifyStatus); - return; - } - - // all downloads complete - mNotification.onDownloadStateChanged(IDownloaderClient.STATE_COMPLETED); - } finally { - setServiceRunning(false); - } - } - - @Override - public void onDestroy() { - if (null != mConnReceiver) { - unregisterReceiver(mConnReceiver); - mConnReceiver = null; - } - mServiceStub.disconnect(this); - super.onDestroy(); - } - - public int getNetworkAvailabilityState(DownloadsDB db) { - if (mIsConnected) { - if (!mIsCellularConnection) - return NETWORK_OK; - int flags = db.mFlags; - if (mIsRoaming) - return NETWORK_CANNOT_USE_ROAMING; - if (0 != (flags & FLAGS_DOWNLOAD_OVER_CELLULAR)) { - return NETWORK_OK; - } else { - return NETWORK_TYPE_DISALLOWED_BY_REQUESTOR; - } - } - return NETWORK_NO_CONNECTION; - } - - @Override - public void onCreate() { - super.onCreate(); - try { - mPackageInfo = getPackageManager().getPackageInfo( - getPackageName(), 0); - ApplicationInfo ai = getApplicationInfo(); - CharSequence applicationLabel = getPackageManager().getApplicationLabel(ai); - mNotification = new DownloadNotification(this, applicationLabel); - - } catch (NameNotFoundException e) { - e.printStackTrace(); - } - } - - /** - * Exception thrown from methods called by generateSaveFile() for any fatal - * error. - */ - public static class GenerateSaveFileError extends Exception { - private static final long serialVersionUID = 3465966015408936540L; - int mStatus; - String mMessage; - - public GenerateSaveFileError(int status, String message) { - mStatus = status; - mMessage = message; - } - } - - /** - * Returns the filename (where the file should be saved) from info about a - * download - */ - public String generateTempSaveFileName(String fileName) { - String path = Helpers.getSaveFilePath(this) - + File.separator + fileName + TEMP_EXT; - return path; - } - - /** - * Creates a filename (where the file should be saved) from info about a - * download. - */ - public String generateSaveFile(String filename, long filesize) - throws GenerateSaveFileError { - String path = generateTempSaveFileName(filename); - File expPath = new File(path); - if (!Helpers.isExternalMediaMounted()) { - Log.d(Constants.TAG, "External media not mounted: " + path); - throw new GenerateSaveFileError(STATUS_DEVICE_NOT_FOUND_ERROR, - "external media is not yet mounted"); - - } - if (expPath.exists()) { - Log.d(Constants.TAG, "File already exists: " + path); - throw new GenerateSaveFileError(STATUS_FILE_ALREADY_EXISTS_ERROR, - "requested destination file already exists"); - } - if (Helpers.getAvailableBytes(Helpers.getFilesystemRoot(path)) < filesize) { - throw new GenerateSaveFileError(STATUS_INSUFFICIENT_SPACE_ERROR, - "insufficient space on external storage"); - } - return path; - } - - /** - * @return a non-localized string appropriate for logging corresponding to - * one of the NETWORK_* constants. - */ - public String getLogMessageForNetworkError(int networkError) { - switch (networkError) { - case NETWORK_RECOMMENDED_UNUSABLE_DUE_TO_SIZE: - return "download size exceeds recommended limit for mobile network"; - - case NETWORK_UNUSABLE_DUE_TO_SIZE: - return "download size exceeds limit for mobile network"; - - case NETWORK_NO_CONNECTION: - return "no network connection available"; - - case NETWORK_CANNOT_USE_ROAMING: - return "download cannot use the current network connection because it is roaming"; - - case NETWORK_TYPE_DISALLOWED_BY_REQUESTOR: - return "download was requested to not use the current network type"; - - default: - return "unknown error with network connectivity"; - } - } - - public int getControl() { - return mControl; - } - - public int getStatus() { - return mStatus; - } - - /** - * Calculating a moving average for the speed so we don't get jumpy - * calculations for time etc. - */ - static private final float SMOOTHING_FACTOR = 0.005f; - - public void notifyUpdateBytes(long totalBytesSoFar) { - long timeRemaining; - long currentTime = SystemClock.uptimeMillis(); - if (0 != mMillisecondsAtSample) { - // we have a sample. - long timePassed = currentTime - mMillisecondsAtSample; - long bytesInSample = totalBytesSoFar - mBytesAtSample; - float currentSpeedSample = (float) bytesInSample / (float) timePassed; - if (0 != mAverageDownloadSpeed) { - mAverageDownloadSpeed = SMOOTHING_FACTOR * currentSpeedSample - + (1 - SMOOTHING_FACTOR) * mAverageDownloadSpeed; - } else { - mAverageDownloadSpeed = currentSpeedSample; - } - timeRemaining = (long) ((mTotalLength - totalBytesSoFar) / mAverageDownloadSpeed); - } else { - timeRemaining = -1; - } - mMillisecondsAtSample = currentTime; - mBytesAtSample = totalBytesSoFar; - mNotification.onDownloadProgress( - new DownloadProgressInfo(mTotalLength, - totalBytesSoFar, - timeRemaining, - mAverageDownloadSpeed) - ); - - } - - @Override - protected boolean shouldStop() { - // the database automatically reads the metadata for version code - // and download status when the instance is created - DownloadsDB db = DownloadsDB.getDB(this); - if (db.mStatus == 0) { - return true; - } - return false; - } - - @Override - public void requestDownloadStatus() { - mNotification.resendState(); - } - - @Override - public void onClientUpdated(Messenger clientMessenger) { - this.mClientMessenger = clientMessenger; - mNotification.setMessenger(mClientMessenger); - } - -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java deleted file mode 100755 index 250299c400..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java +++ /dev/null @@ -1,510 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader.impl; - -import android.content.ContentValues; -import android.content.Context; -import android.database.Cursor; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteDoneException; -import android.database.sqlite.SQLiteOpenHelper; -import android.database.sqlite.SQLiteStatement; -import android.provider.BaseColumns; -import android.util.Log; - -public class DownloadsDB { - private static final String DATABASE_NAME = "DownloadsDB"; - private static final int DATABASE_VERSION = 7; - public static final String LOG_TAG = DownloadsDB.class.getName(); - final SQLiteOpenHelper mHelper; - SQLiteStatement mGetDownloadByIndex; - SQLiteStatement mUpdateCurrentBytes; - private static DownloadsDB mDownloadsDB; - long mMetadataRowID = -1; - int mVersionCode = -1; - int mStatus = -1; - int mFlags; - - static public synchronized DownloadsDB getDB(Context paramContext) { - if (null == mDownloadsDB) { - return new DownloadsDB(paramContext); - } - return mDownloadsDB; - } - - private SQLiteStatement getDownloadByIndexStatement() { - if (null == mGetDownloadByIndex) { - mGetDownloadByIndex = mHelper.getReadableDatabase().compileStatement( - "SELECT " + BaseColumns._ID + " FROM " - + DownloadColumns.TABLE_NAME + " WHERE " - + DownloadColumns.INDEX + " = ?"); - } - return mGetDownloadByIndex; - } - - private SQLiteStatement getUpdateCurrentBytesStatement() { - if (null == mUpdateCurrentBytes) { - mUpdateCurrentBytes = mHelper.getReadableDatabase().compileStatement( - "UPDATE " + DownloadColumns.TABLE_NAME + " SET " + DownloadColumns.CURRENTBYTES - + " = ?" + - " WHERE " + DownloadColumns.INDEX + " = ?"); - } - return mUpdateCurrentBytes; - } - - private DownloadsDB(Context paramContext) { - this.mHelper = new DownloadsContentDBHelper(paramContext); - final SQLiteDatabase sqldb = mHelper.getReadableDatabase(); - // Query for the version code, the row ID of the metadata (for future - // updating) the status and the flags - Cursor cur = sqldb.rawQuery("SELECT " + - MetadataColumns.APKVERSION + "," + - BaseColumns._ID + "," + - MetadataColumns.DOWNLOAD_STATUS + "," + - MetadataColumns.FLAGS + - " FROM " - + MetadataColumns.TABLE_NAME + " LIMIT 1", null); - if (null != cur && cur.moveToFirst()) { - mVersionCode = cur.getInt(0); - mMetadataRowID = cur.getLong(1); - mStatus = cur.getInt(2); - mFlags = cur.getInt(3); - cur.close(); - } - mDownloadsDB = this; - } - - protected DownloadInfo getDownloadInfoByFileName(String fileName) { - final SQLiteDatabase sqldb = mHelper.getReadableDatabase(); - Cursor itemcur = null; - try { - itemcur = sqldb.query(DownloadColumns.TABLE_NAME, DC_PROJECTION, - DownloadColumns.FILENAME + " = ?", - new String[] { - fileName - }, null, null, null); - if (null != itemcur && itemcur.moveToFirst()) { - return getDownloadInfoFromCursor(itemcur); - } - } finally { - if (null != itemcur) - itemcur.close(); - } - return null; - } - - public long getIDForDownloadInfo(final DownloadInfo di) { - return getIDByIndex(di.mIndex); - } - - public long getIDByIndex(int index) { - SQLiteStatement downloadByIndex = getDownloadByIndexStatement(); - downloadByIndex.clearBindings(); - downloadByIndex.bindLong(1, index); - try { - return downloadByIndex.simpleQueryForLong(); - } catch (SQLiteDoneException e) { - return -1; - } - } - - public void updateDownloadCurrentBytes(final DownloadInfo di) { - SQLiteStatement downloadCurrentBytes = getUpdateCurrentBytesStatement(); - downloadCurrentBytes.clearBindings(); - downloadCurrentBytes.bindLong(1, di.mCurrentBytes); - downloadCurrentBytes.bindLong(2, di.mIndex); - downloadCurrentBytes.execute(); - } - - public void close() { - this.mHelper.close(); - } - - protected static class DownloadsContentDBHelper extends SQLiteOpenHelper { - DownloadsContentDBHelper(Context paramContext) { - super(paramContext, DATABASE_NAME, null, DATABASE_VERSION); - } - - private String createTableQueryFromArray(String paramString, - String[][] paramArrayOfString) { - StringBuilder localStringBuilder = new StringBuilder(); - localStringBuilder.append("CREATE TABLE "); - localStringBuilder.append(paramString); - localStringBuilder.append(" ("); - int i = paramArrayOfString.length; - for (int j = 0;; j++) { - if (j >= i) { - localStringBuilder - .setLength(localStringBuilder.length() - 1); - localStringBuilder.append(");"); - return localStringBuilder.toString(); - } - String[] arrayOfString = paramArrayOfString[j]; - localStringBuilder.append(' '); - localStringBuilder.append(arrayOfString[0]); - localStringBuilder.append(' '); - localStringBuilder.append(arrayOfString[1]); - localStringBuilder.append(','); - } - } - - /** - * These two arrays must match and have the same order. For every Schema - * there must be a corresponding table name. - */ - static final private String[][][] sSchemas = { - DownloadColumns.SCHEMA, MetadataColumns.SCHEMA - }; - - static final private String[] sTables = { - DownloadColumns.TABLE_NAME, MetadataColumns.TABLE_NAME - }; - - /** - * Goes through all of the tables in sTables and drops each table if it - * exists. Altered to no longer make use of reflection. - */ - private void dropTables(SQLiteDatabase paramSQLiteDatabase) { - for (String table : sTables) { - try { - paramSQLiteDatabase.execSQL("DROP TABLE IF EXISTS " + table); - } catch (Exception localException) { - localException.printStackTrace(); - } - } - } - - /** - * Goes through all of the tables in sTables and creates a database with - * the corresponding schema described in sSchemas. Altered to no longer - * make use of reflection. - */ - public void onCreate(SQLiteDatabase paramSQLiteDatabase) { - int numSchemas = sSchemas.length; - for (int i = 0; i < numSchemas; i++) { - try { - String[][] schema = (String[][]) sSchemas[i]; - paramSQLiteDatabase.execSQL(createTableQueryFromArray( - sTables[i], schema)); - } catch (Exception localException) { - while (true) - localException.printStackTrace(); - } - } - } - - public void onUpgrade(SQLiteDatabase paramSQLiteDatabase, - int paramInt1, int paramInt2) { - Log.w(DownloadsContentDBHelper.class.getName(), - "Upgrading database from version " + paramInt1 + " to " - + paramInt2 + ", which will destroy all old data"); - dropTables(paramSQLiteDatabase); - onCreate(paramSQLiteDatabase); - } - } - - public static class MetadataColumns implements BaseColumns { - public static final String APKVERSION = "APKVERSION"; - public static final String DOWNLOAD_STATUS = "DOWNLOADSTATUS"; - public static final String FLAGS = "DOWNLOADFLAGS"; - - public static final String[][] SCHEMA = { - { - BaseColumns._ID, "INTEGER PRIMARY KEY" - }, - { - APKVERSION, "INTEGER" - }, { - DOWNLOAD_STATUS, "INTEGER" - }, - { - FLAGS, "INTEGER" - } - }; - public static final String TABLE_NAME = "MetadataColumns"; - public static final String _ID = "MetadataColumns._id"; - } - - public static class DownloadColumns implements BaseColumns { - public static final String INDEX = "FILEIDX"; - public static final String URI = "URI"; - public static final String FILENAME = "FN"; - public static final String ETAG = "ETAG"; - - public static final String TOTALBYTES = "TOTALBYTES"; - public static final String CURRENTBYTES = "CURRENTBYTES"; - public static final String LASTMOD = "LASTMOD"; - - public static final String STATUS = "STATUS"; - public static final String CONTROL = "CONTROL"; - public static final String NUM_FAILED = "FAILCOUNT"; - public static final String RETRY_AFTER = "RETRYAFTER"; - public static final String REDIRECT_COUNT = "REDIRECTCOUNT"; - - public static final String[][] SCHEMA = { - { - BaseColumns._ID, "INTEGER PRIMARY KEY" - }, - { - INDEX, "INTEGER UNIQUE" - }, { - URI, "TEXT" - }, - { - FILENAME, "TEXT UNIQUE" - }, { - ETAG, "TEXT" - }, - { - TOTALBYTES, "INTEGER" - }, { - CURRENTBYTES, "INTEGER" - }, - { - LASTMOD, "INTEGER" - }, { - STATUS, "INTEGER" - }, - { - CONTROL, "INTEGER" - }, { - NUM_FAILED, "INTEGER" - }, - { - RETRY_AFTER, "INTEGER" - }, { - REDIRECT_COUNT, "INTEGER" - } - }; - public static final String TABLE_NAME = "DownloadColumns"; - public static final String _ID = "DownloadColumns._id"; - } - - private static final String[] DC_PROJECTION = { - DownloadColumns.FILENAME, - DownloadColumns.URI, DownloadColumns.ETAG, - DownloadColumns.TOTALBYTES, DownloadColumns.CURRENTBYTES, - DownloadColumns.LASTMOD, DownloadColumns.STATUS, - DownloadColumns.CONTROL, DownloadColumns.NUM_FAILED, - DownloadColumns.RETRY_AFTER, DownloadColumns.REDIRECT_COUNT, - DownloadColumns.INDEX - }; - - private static final int FILENAME_IDX = 0; - private static final int URI_IDX = 1; - private static final int ETAG_IDX = 2; - private static final int TOTALBYTES_IDX = 3; - private static final int CURRENTBYTES_IDX = 4; - private static final int LASTMOD_IDX = 5; - private static final int STATUS_IDX = 6; - private static final int CONTROL_IDX = 7; - private static final int NUM_FAILED_IDX = 8; - private static final int RETRY_AFTER_IDX = 9; - private static final int REDIRECT_COUNT_IDX = 10; - private static final int INDEX_IDX = 11; - - /** - * This function will add a new file to the database if it does not exist. - * - * @param di DownloadInfo that we wish to store - * @return the row id of the record to be updated/inserted, or -1 - */ - public boolean updateDownload(DownloadInfo di) { - ContentValues cv = new ContentValues(); - cv.put(DownloadColumns.INDEX, di.mIndex); - cv.put(DownloadColumns.FILENAME, di.mFileName); - cv.put(DownloadColumns.URI, di.mUri); - cv.put(DownloadColumns.ETAG, di.mETag); - cv.put(DownloadColumns.TOTALBYTES, di.mTotalBytes); - cv.put(DownloadColumns.CURRENTBYTES, di.mCurrentBytes); - cv.put(DownloadColumns.LASTMOD, di.mLastMod); - cv.put(DownloadColumns.STATUS, di.mStatus); - cv.put(DownloadColumns.CONTROL, di.mControl); - cv.put(DownloadColumns.NUM_FAILED, di.mNumFailed); - cv.put(DownloadColumns.RETRY_AFTER, di.mRetryAfter); - cv.put(DownloadColumns.REDIRECT_COUNT, di.mRedirectCount); - return updateDownload(di, cv); - } - - public boolean updateDownload(DownloadInfo di, ContentValues cv) { - long id = di == null ? -1 : getIDForDownloadInfo(di); - try { - final SQLiteDatabase sqldb = mHelper.getWritableDatabase(); - if (id != -1) { - if (1 != sqldb.update(DownloadColumns.TABLE_NAME, - cv, DownloadColumns._ID + " = " + id, null)) { - return false; - } - } else { - return -1 != sqldb.insert(DownloadColumns.TABLE_NAME, - DownloadColumns.URI, cv); - } - } catch (android.database.sqlite.SQLiteException ex) { - ex.printStackTrace(); - } - return false; - } - - public int getLastCheckedVersionCode() { - return mVersionCode; - } - - public boolean isDownloadRequired() { - final SQLiteDatabase sqldb = mHelper.getReadableDatabase(); - Cursor cur = sqldb.rawQuery("SELECT Count(*) FROM " - + DownloadColumns.TABLE_NAME + " WHERE " - + DownloadColumns.STATUS + " <> 0", null); - try { - if (null != cur && cur.moveToFirst()) { - return 0 == cur.getInt(0); - } - } finally { - if (null != cur) - cur.close(); - } - return true; - } - - public int getFlags() { - return mFlags; - } - - public boolean updateFlags(int flags) { - if (mFlags != flags) { - ContentValues cv = new ContentValues(); - cv.put(MetadataColumns.FLAGS, flags); - if (updateMetadata(cv)) { - mFlags = flags; - return true; - } else { - return false; - } - } else { - return true; - } - }; - - public boolean updateStatus(int status) { - if (mStatus != status) { - ContentValues cv = new ContentValues(); - cv.put(MetadataColumns.DOWNLOAD_STATUS, status); - if (updateMetadata(cv)) { - mStatus = status; - return true; - } else { - return false; - } - } else { - return true; - } - }; - - public boolean updateMetadata(ContentValues cv) { - final SQLiteDatabase sqldb = mHelper.getWritableDatabase(); - if (-1 == this.mMetadataRowID) { - long newID = sqldb.insert(MetadataColumns.TABLE_NAME, - MetadataColumns.APKVERSION, cv); - if (-1 == newID) - return false; - mMetadataRowID = newID; - } else { - if (0 == sqldb.update(MetadataColumns.TABLE_NAME, cv, - BaseColumns._ID + " = " + mMetadataRowID, null)) - return false; - } - return true; - } - - public boolean updateMetadata(int apkVersion, int downloadStatus) { - ContentValues cv = new ContentValues(); - cv.put(MetadataColumns.APKVERSION, apkVersion); - cv.put(MetadataColumns.DOWNLOAD_STATUS, downloadStatus); - if (updateMetadata(cv)) { - mVersionCode = apkVersion; - mStatus = downloadStatus; - return true; - } else { - return false; - } - }; - - public boolean updateFromDb(DownloadInfo di) { - final SQLiteDatabase sqldb = mHelper.getReadableDatabase(); - Cursor cur = null; - try { - cur = sqldb.query(DownloadColumns.TABLE_NAME, DC_PROJECTION, - DownloadColumns.FILENAME + "= ?", - new String[] { - di.mFileName - }, null, null, null); - if (null != cur && cur.moveToFirst()) { - setDownloadInfoFromCursor(di, cur); - return true; - } - return false; - } finally { - if (null != cur) { - cur.close(); - } - } - } - - public void setDownloadInfoFromCursor(DownloadInfo di, Cursor cur) { - di.mUri = cur.getString(URI_IDX); - di.mETag = cur.getString(ETAG_IDX); - di.mTotalBytes = cur.getLong(TOTALBYTES_IDX); - di.mCurrentBytes = cur.getLong(CURRENTBYTES_IDX); - di.mLastMod = cur.getLong(LASTMOD_IDX); - di.mStatus = cur.getInt(STATUS_IDX); - di.mControl = cur.getInt(CONTROL_IDX); - di.mNumFailed = cur.getInt(NUM_FAILED_IDX); - di.mRetryAfter = cur.getInt(RETRY_AFTER_IDX); - di.mRedirectCount = cur.getInt(REDIRECT_COUNT_IDX); - } - - public DownloadInfo getDownloadInfoFromCursor(Cursor cur) { - DownloadInfo di = new DownloadInfo(cur.getInt(INDEX_IDX), - cur.getString(FILENAME_IDX), this.getClass().getPackage() - .getName()); - setDownloadInfoFromCursor(di, cur); - return di; - } - - public DownloadInfo[] getDownloads() { - final SQLiteDatabase sqldb = mHelper.getReadableDatabase(); - Cursor cur = null; - try { - cur = sqldb.query(DownloadColumns.TABLE_NAME, DC_PROJECTION, null, - null, null, null, null); - if (null != cur && cur.moveToFirst()) { - DownloadInfo[] retInfos = new DownloadInfo[cur.getCount()]; - int idx = 0; - do { - DownloadInfo di = getDownloadInfoFromCursor(cur); - retInfos[idx++] = di; - } while (cur.moveToNext()); - return retInfos; - } - return null; - } finally { - if (null != cur) { - cur.close(); - } - } - } - -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java deleted file mode 100644 index 3f440e9893..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader.impl; - -import android.text.format.Time; - -import java.util.Calendar; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Helper for parsing an HTTP date. - */ -public final class HttpDateTime { - - /* - * Regular expression for parsing HTTP-date. Wdy, DD Mon YYYY HH:MM:SS GMT - * RFC 822, updated by RFC 1123 Weekday, DD-Mon-YY HH:MM:SS GMT RFC 850, - * obsoleted by RFC 1036 Wdy Mon DD HH:MM:SS YYYY ANSI C's asctime() format - * with following variations Wdy, DD-Mon-YYYY HH:MM:SS GMT Wdy, (SP)D Mon - * YYYY HH:MM:SS GMT Wdy,DD Mon YYYY HH:MM:SS GMT Wdy, DD-Mon-YY HH:MM:SS - * GMT Wdy, DD Mon YYYY HH:MM:SS -HHMM Wdy, DD Mon YYYY HH:MM:SS Wdy Mon - * (SP)D HH:MM:SS YYYY Wdy Mon DD HH:MM:SS YYYY GMT HH can be H if the first - * digit is zero. Mon can be the full name of the month. - */ - private static final String HTTP_DATE_RFC_REGEXP = - "([0-9]{1,2})[- ]([A-Za-z]{3,9})[- ]([0-9]{2,4})[ ]" - + "([0-9]{1,2}:[0-9][0-9]:[0-9][0-9])"; - - private static final String HTTP_DATE_ANSIC_REGEXP = - "[ ]([A-Za-z]{3,9})[ ]+([0-9]{1,2})[ ]" - + "([0-9]{1,2}:[0-9][0-9]:[0-9][0-9])[ ]([0-9]{2,4})"; - - /** - * The compiled version of the HTTP-date regular expressions. - */ - private static final Pattern HTTP_DATE_RFC_PATTERN = - Pattern.compile(HTTP_DATE_RFC_REGEXP); - private static final Pattern HTTP_DATE_ANSIC_PATTERN = - Pattern.compile(HTTP_DATE_ANSIC_REGEXP); - - private static class TimeOfDay { - TimeOfDay(int h, int m, int s) { - this.hour = h; - this.minute = m; - this.second = s; - } - - int hour; - int minute; - int second; - } - - public static long parse(String timeString) - throws IllegalArgumentException { - - int date = 1; - int month = Calendar.JANUARY; - int year = 1970; - TimeOfDay timeOfDay; - - Matcher rfcMatcher = HTTP_DATE_RFC_PATTERN.matcher(timeString); - if (rfcMatcher.find()) { - date = getDate(rfcMatcher.group(1)); - month = getMonth(rfcMatcher.group(2)); - year = getYear(rfcMatcher.group(3)); - timeOfDay = getTime(rfcMatcher.group(4)); - } else { - Matcher ansicMatcher = HTTP_DATE_ANSIC_PATTERN.matcher(timeString); - if (ansicMatcher.find()) { - month = getMonth(ansicMatcher.group(1)); - date = getDate(ansicMatcher.group(2)); - timeOfDay = getTime(ansicMatcher.group(3)); - year = getYear(ansicMatcher.group(4)); - } else { - throw new IllegalArgumentException(); - } - } - - // FIXME: Y2038 BUG! - if (year >= 2038) { - year = 2038; - month = Calendar.JANUARY; - date = 1; - } - - Time time = new Time(Time.TIMEZONE_UTC); - time.set(timeOfDay.second, timeOfDay.minute, timeOfDay.hour, date, - month, year); - return time.toMillis(false /* use isDst */); - } - - private static int getDate(String dateString) { - if (dateString.length() == 2) { - return (dateString.charAt(0) - '0') * 10 - + (dateString.charAt(1) - '0'); - } else { - return (dateString.charAt(0) - '0'); - } - } - - /* - * jan = 9 + 0 + 13 = 22 feb = 5 + 4 + 1 = 10 mar = 12 + 0 + 17 = 29 apr = 0 - * + 15 + 17 = 32 may = 12 + 0 + 24 = 36 jun = 9 + 20 + 13 = 42 jul = 9 + 20 - * + 11 = 40 aug = 0 + 20 + 6 = 26 sep = 18 + 4 + 15 = 37 oct = 14 + 2 + 19 - * = 35 nov = 13 + 14 + 21 = 48 dec = 3 + 4 + 2 = 9 - */ - private static int getMonth(String monthString) { - int hash = Character.toLowerCase(monthString.charAt(0)) + - Character.toLowerCase(monthString.charAt(1)) + - Character.toLowerCase(monthString.charAt(2)) - 3 * 'a'; - switch (hash) { - case 22: - return Calendar.JANUARY; - case 10: - return Calendar.FEBRUARY; - case 29: - return Calendar.MARCH; - case 32: - return Calendar.APRIL; - case 36: - return Calendar.MAY; - case 42: - return Calendar.JUNE; - case 40: - return Calendar.JULY; - case 26: - return Calendar.AUGUST; - case 37: - return Calendar.SEPTEMBER; - case 35: - return Calendar.OCTOBER; - case 48: - return Calendar.NOVEMBER; - case 9: - return Calendar.DECEMBER; - default: - throw new IllegalArgumentException(); - } - } - - private static int getYear(String yearString) { - if (yearString.length() == 2) { - int year = (yearString.charAt(0) - '0') * 10 - + (yearString.charAt(1) - '0'); - if (year >= 70) { - return year + 1900; - } else { - return year + 2000; - } - } else if (yearString.length() == 3) { - // According to RFC 2822, three digit years should be added to 1900. - int year = (yearString.charAt(0) - '0') * 100 - + (yearString.charAt(1) - '0') * 10 - + (yearString.charAt(2) - '0'); - return year + 1900; - } else if (yearString.length() == 4) { - return (yearString.charAt(0) - '0') * 1000 - + (yearString.charAt(1) - '0') * 100 - + (yearString.charAt(2) - '0') * 10 - + (yearString.charAt(3) - '0'); - } else { - return 1970; - } - } - - private static TimeOfDay getTime(String timeString) { - // HH might be H - int i = 0; - int hour = timeString.charAt(i++) - '0'; - if (timeString.charAt(i) != ':') - hour = hour * 10 + (timeString.charAt(i++) - '0'); - // Skip ':' - i++; - - int minute = (timeString.charAt(i++) - '0') * 10 - + (timeString.charAt(i++) - '0'); - // Skip ':' - i++; - - int second = (timeString.charAt(i++) - '0') * 10 - + (timeString.charAt(i++) - '0'); - - return new TimeOfDay(hour, minute, second); - } -} diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java deleted file mode 100644 index e3666e05b9..0000000000 --- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.vending.expansion.downloader.impl; - -import com.android.vending.expansion.downloader.R; -import com.google.android.vending.expansion.downloader.Helpers; - -import android.app.Notification; -import android.app.PendingIntent; -import android.content.Context; -import android.graphics.BitmapFactory; -import android.view.View; -import android.widget.RemoteViews; - -public class V3CustomNotification implements DownloadNotification.ICustomNotification { - - CharSequence mTitle; - CharSequence mTicker; - int mIcon; - long mTotalBytes = -1; - long mCurrentBytes = -1; - long mTimeRemaining; - PendingIntent mPendingIntent; - Notification mNotification = new Notification(); - - @Override - public void setIcon(int icon) { - mIcon = icon; - } - - @Override - public void setTitle(CharSequence title) { - mTitle = title; - } - - @Override - public void setTotalBytes(long totalBytes) { - mTotalBytes = totalBytes; - } - - @Override - public void setCurrentBytes(long currentBytes) { - mCurrentBytes = currentBytes; - } - - @Override - public Notification updateNotification(Context c) { - Notification n = mNotification; - - n.icon = mIcon; - - n.flags |= Notification.FLAG_ONGOING_EVENT; - - if (android.os.Build.VERSION.SDK_INT > 10) { - n.flags |= Notification.FLAG_ONLY_ALERT_ONCE; // only matters for - // Honeycomb - } - - // Build the RemoteView object - RemoteViews expandedView = new RemoteViews( - c.getPackageName(), - R.layout.status_bar_ongoing_event_progress_bar); - - expandedView.setTextViewText(R.id.title, mTitle); - // look at strings - expandedView.setViewVisibility(R.id.description, View.VISIBLE); - expandedView.setTextViewText(R.id.description, - Helpers.getDownloadProgressString(mCurrentBytes, mTotalBytes)); - expandedView.setViewVisibility(R.id.progress_bar_frame, View.VISIBLE); - expandedView.setProgressBar(R.id.progress_bar, - (int) (mTotalBytes >> 8), - (int) (mCurrentBytes >> 8), - mTotalBytes <= 0); - expandedView.setViewVisibility(R.id.time_remaining, View.VISIBLE); - expandedView.setTextViewText( - R.id.time_remaining, - c.getString(R.string.time_remaining_notification, - Helpers.getTimeRemaining(mTimeRemaining))); - expandedView.setTextViewText(R.id.progress_text, - Helpers.getDownloadProgressPercent(mCurrentBytes, mTotalBytes)); - expandedView.setImageViewResource(R.id.appIcon, mIcon); - n.contentView = expandedView; - n.contentIntent = mPendingIntent; - return n; - } - - @Override - public void setPendingIntent(PendingIntent contentIntent) { - mPendingIntent = contentIntent; - } - - @Override - public void setTicker(CharSequence ticker) { - mTicker = ticker; - } - - @Override - public void setTimeRemaining(long timeRemaining) { - mTimeRemaining = timeRemaining; - } - -} diff --git a/platform/android/libs/google_play_services/.classpath b/platform/android/libs/google_play_services/.classpath deleted file mode 100644 index 7bc01d9a9c..0000000000 --- a/platform/android/libs/google_play_services/.classpath +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="gen"/> - <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> - <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> - <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/> - <classpathentry kind="output" path="bin/classes"/> -</classpath> diff --git a/platform/android/libs/google_play_services/AndroidManifest.xml b/platform/android/libs/google_play_services/AndroidManifest.xml deleted file mode 100644 index aecd02b5d0..0000000000 --- a/platform/android/libs/google_play_services/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.google.android.gms" - android:versionCode="4323030" - android:versionName="4.3.23 (1069729-030)" > - - <uses-sdk android:minSdkVersion="9"/> - -</manifest> diff --git a/platform/android/libs/google_play_services/README.txt b/platform/android/libs/google_play_services/README.txt deleted file mode 100644 index 32f8d5eb85..0000000000 --- a/platform/android/libs/google_play_services/README.txt +++ /dev/null @@ -1,17 +0,0 @@ -Library Project including Google Play services client jar. - -This can be used by an Android project to use the API's provided -by Google Play services. - -There is technically no source, but the src folder is necessary -to ensure that the build system works. The content is actually -located in the libs/ directory. - - -USAGE: - -Make sure you import this Android library project into your IDE -and set this project as a dependency. - -Note that if you use proguard, you will want to include the -options from proguard.txt in your configuration.
\ No newline at end of file diff --git a/platform/android/libs/google_play_services/build.xml b/platform/android/libs/google_play_services/build.xml deleted file mode 100644 index 22ccf3aaf4..0000000000 --- a/platform/android/libs/google_play_services/build.xml +++ /dev/null @@ -1,92 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="google_play_services" default="help"> - - <!-- The local.properties file is created and updated by the 'android' tool. - It contains the path to the SDK. It should *NOT* be checked into - Version Control Systems. --> - <property file="local.properties" /> - - <!-- The ant.properties file can be created by you. It is only edited by the - 'android' tool to add properties to it. - This is the place to change some Ant specific build properties. - Here are some properties you may want to change/update: - - source.dir - The name of the source directory. Default is 'src'. - out.dir - The name of the output directory. Default is 'bin'. - - For other overridable properties, look at the beginning of the rules - files in the SDK, at tools/ant/build.xml - - Properties related to the SDK location or the project target should - be updated using the 'android' tool with the 'update' action. - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. - - --> - <property file="ant.properties" /> - - <!-- if sdk.dir was not set from one of the property file, then - get it from the ANDROID_HOME env var. - This must be done before we load project.properties since - the proguard config can use sdk.dir --> - <property environment="env" /> - <condition property="sdk.dir" value="${env.ANDROID_HOME}"> - <isset property="env.ANDROID_HOME" /> - </condition> - - <!-- The project.properties file is created and updated by the 'android' - tool, as well as ADT. - - This contains project specific properties such as project target, and library - dependencies. Lower level build properties are stored in ant.properties - (or in .classpath for Eclipse projects). - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. --> - <loadproperties srcFile="project.properties" /> - - <!-- quick check on sdk.dir --> - <fail - message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable." - unless="sdk.dir" - /> - - <!-- - Import per project custom build rules if present at the root of the project. - This is the place to put custom intermediary targets such as: - -pre-build - -pre-compile - -post-compile (This is typically used for code obfuscation. - Compiled code location: ${out.classes.absolute.dir} - If this is not done in place, override ${out.dex.input.absolute.dir}) - -post-package - -post-build - -pre-clean - --> - <import file="custom_rules.xml" optional="true" /> - - <!-- Import the actual build file. - - To customize existing targets, there are two options: - - Customize only one target: - - copy/paste the target into this file, *before* the - <import> task. - - customize it to your needs. - - Customize the whole content of build.xml - - copy/paste the content of the rules files (minus the top node) - into this file, replacing the <import> task. - - customize to your needs. - - *********************** - ****** IMPORTANT ****** - *********************** - In all cases you must update the value of version-tag below to read 'custom' instead of an integer, - in order to avoid having your file be overridden by tools such as "android update project" - --> - <!-- version-tag: 1 --> - <import file="${sdk.dir}/tools/ant/build.xml" /> - -</project> diff --git a/platform/android/libs/google_play_services/libs/google-play-services.jar b/platform/android/libs/google_play_services/libs/google-play-services.jar Binary files differdeleted file mode 100644 index 67d56476b6..0000000000 --- a/platform/android/libs/google_play_services/libs/google-play-services.jar +++ /dev/null diff --git a/platform/android/libs/google_play_services/libs/google-play-services.jar.properties b/platform/android/libs/google_play_services/libs/google-play-services.jar.properties deleted file mode 100644 index 429687b792..0000000000 --- a/platform/android/libs/google_play_services/libs/google-play-services.jar.properties +++ /dev/null @@ -1 +0,0 @@ -doc=../../../docs/reference diff --git a/platform/android/libs/google_play_services/proguard-project.txt b/platform/android/libs/google_play_services/proguard-project.txt deleted file mode 100644 index f2fe1559a2..0000000000 --- a/platform/android/libs/google_play_services/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/platform/android/libs/google_play_services/proguard.txt b/platform/android/libs/google_play_services/proguard.txt deleted file mode 100644 index 0c9693a2c0..0000000000 --- a/platform/android/libs/google_play_services/proguard.txt +++ /dev/null @@ -1,20 +0,0 @@ --keep class * extends java.util.ListResourceBundle { - protected Object[][] getContents(); -} - -# Keep SafeParcelable value, needed for reflection. This is required to support backwards -# compatibility of some classes. --keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable { - public static final *** NULL; -} - -# Keep the names of classes/members we need for client functionality. --keepnames @com.google.android.gms.common.annotation.KeepName class * --keepclassmembernames class * { - @com.google.android.gms.common.annotation.KeepName *; -} - -# Needed for Parcelable/SafeParcelable Creators to not get stripped --keepnames class * implements android.os.Parcelable { - public static final ** CREATOR; -}
\ No newline at end of file diff --git a/platform/android/libs/google_play_services/project.properties b/platform/android/libs/google_play_services/project.properties deleted file mode 100644 index 36f15941e2..0000000000 --- a/platform/android/libs/google_play_services/project.properties +++ /dev/null @@ -1,15 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-15 -android.library=true diff --git a/platform/android/libs/google_play_services/res/color/common_signin_btn_text_dark.xml b/platform/android/libs/google_play_services/res/color/common_signin_btn_text_dark.xml deleted file mode 100644 index a615ba2747..0000000000 --- a/platform/android/libs/google_play_services/res/color/common_signin_btn_text_dark.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item - android:state_pressed="true" - android:color="@color/common_signin_btn_dark_text_pressed" /> - <item - android:state_enabled="false" - android:state_focused="true" - android:color="@color/common_signin_btn_dark_text_disabled" /> - <item - android:state_focused="true" - android:color="@color/common_signin_btn_dark_text_focused" /> - <item - android:state_enabled="false" - android:color="@color/common_signin_btn_dark_text_disabled" /> - <item - android:color="@color/common_signin_btn_dark_text_default" /> -</selector> diff --git a/platform/android/libs/google_play_services/res/color/common_signin_btn_text_light.xml b/platform/android/libs/google_play_services/res/color/common_signin_btn_text_light.xml deleted file mode 100644 index 662066899b..0000000000 --- a/platform/android/libs/google_play_services/res/color/common_signin_btn_text_light.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item - android:state_pressed="true" - android:color="@color/common_signin_btn_light_text_pressed" /> - <item - android:state_enabled="false" - android:state_focused="true" - android:color="@color/common_signin_btn_light_text_disabled" /> - <item - android:state_focused="true" - android:color="@color/common_signin_btn_light_text_focused" /> - <item - android:state_enabled="false" - android:color="@color/common_signin_btn_light_text_disabled" /> - <item - android:color="@color/common_signin_btn_light_text_default" /> -</selector> diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_dark.9.png Binary files differdeleted file mode 100644 index 0f9e7917e0..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_dark.9.png Binary files differdeleted file mode 100644 index 570e432252..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_light.9.png Binary files differdeleted file mode 100644 index 570e432252..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_light.9.png Binary files differdeleted file mode 100644 index 0f9e7917e0..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_dark.9.png Binary files differdeleted file mode 100644 index f507b9f7da..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_light.9.png Binary files differdeleted file mode 100644 index d5625e5fc1..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_dark.9.png Binary files differdeleted file mode 100644 index aea3c0d168..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_light.9.png Binary files differdeleted file mode 100644 index 849e89f3aa..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_dark.9.png Binary files differdeleted file mode 100644 index f4ab2f2a51..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_light.9.png Binary files differdeleted file mode 100644 index 9fe611d684..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_dark.9.png Binary files differdeleted file mode 100644 index bbcde39cf0..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_dark.9.png Binary files differdeleted file mode 100644 index 53957b698f..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_light.9.png Binary files differdeleted file mode 100644 index 53957b698f..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_light.9.png Binary files differdeleted file mode 100644 index bbcde39cf0..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_dark.9.png Binary files differdeleted file mode 100644 index 000d12e8e3..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_light.9.png Binary files differdeleted file mode 100644 index d9279405c6..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_dark.9.png Binary files differdeleted file mode 100644 index 67f263c80e..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_light.9.png Binary files differdeleted file mode 100644 index 96324c52f9..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_dark.9.png Binary files differdeleted file mode 100644 index e4503128f6..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_light.9.png Binary files differdeleted file mode 100644 index fb94b77616..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_medium_off_client.png b/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_medium_off_client.png Binary files differdeleted file mode 100644 index 894f1b9f93..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_medium_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_small_off_client.png b/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_small_off_client.png Binary files differdeleted file mode 100644 index ac777614e6..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_small_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_standard_off_client.png b/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_standard_off_client.png Binary files differdeleted file mode 100644 index f1c32d3b9e..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_standard_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_tall_off_client.png b/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_tall_off_client.png Binary files differdeleted file mode 100644 index 08a4670c47..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_tall_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_dark.9.png Binary files differdeleted file mode 100644 index dddcbebf12..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_dark.9.png Binary files differdeleted file mode 100644 index 58b75bd7de..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_light.9.png Binary files differdeleted file mode 100644 index 58b75bd7de..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_light.9.png Binary files differdeleted file mode 100644 index dddcbebf12..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_dark.9.png Binary files differdeleted file mode 100644 index 7d9ed7834d..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_light.9.png Binary files differdeleted file mode 100644 index 0ca401d376..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_dark.9.png Binary files differdeleted file mode 100644 index f2c3f55717..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_light.9.png Binary files differdeleted file mode 100644 index 83b4fc9d6d..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_dark.9.png Binary files differdeleted file mode 100644 index dd74fe8761..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_light.9.png Binary files differdeleted file mode 100644 index b7dc7aac7e..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_dark.9.png Binary files differdeleted file mode 100644 index efdfe2e616..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_dark.9.png Binary files differdeleted file mode 100644 index c7650b09e3..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_light.9.png Binary files differdeleted file mode 100644 index c7650b09e3..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_light.9.png Binary files differdeleted file mode 100644 index efdfe2e616..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_dark.9.png Binary files differdeleted file mode 100644 index 8c76283e50..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_light.9.png Binary files differdeleted file mode 100644 index abd26bcd41..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_dark.9.png Binary files differdeleted file mode 100644 index 28181c338b..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_light.9.png Binary files differdeleted file mode 100644 index 34957fad5f..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_dark.9.png Binary files differdeleted file mode 100644 index e923ee9c75..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_light.9.png Binary files differdeleted file mode 100644 index 34cf6bbad5..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_medium_off_client.png b/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_medium_off_client.png Binary files differdeleted file mode 100644 index d7e5777153..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_medium_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_small_off_client.png b/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_small_off_client.png Binary files differdeleted file mode 100644 index af301c2dc9..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_small_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_standard_off_client.png b/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_standard_off_client.png Binary files differdeleted file mode 100644 index f43e965fb8..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_standard_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_tall_off_client.png b/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_tall_off_client.png Binary files differdeleted file mode 100644 index 0b2b5c9a98..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_tall_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_dark.9.png Binary files differdeleted file mode 100644 index 9044a118af..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_dark.9.png Binary files differdeleted file mode 100644 index e94a49b0ae..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_light.9.png Binary files differdeleted file mode 100644 index e94a49b0ae..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_light.9.png Binary files differdeleted file mode 100644 index 9044a118af..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_dark.9.png Binary files differdeleted file mode 100644 index bfe4f04639..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_light.9.png Binary files differdeleted file mode 100644 index 876884fad7..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_dark.9.png Binary files differdeleted file mode 100644 index b3e6dd5b40..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_light.9.png Binary files differdeleted file mode 100644 index 5a888f28f5..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_dark.9.png Binary files differdeleted file mode 100644 index d0f7b4cbf3..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_light.9.png Binary files differdeleted file mode 100644 index 0db6b06450..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_dark.9.png Binary files differdeleted file mode 100644 index d182b5e2c3..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_dark.9.png Binary files differdeleted file mode 100644 index 47e2aeaf32..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_light.9.png Binary files differdeleted file mode 100644 index 47e2aeaf32..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_light.9.png Binary files differdeleted file mode 100644 index d182b5e2c3..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_dark.9.png Binary files differdeleted file mode 100644 index 64e9706874..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_light.9.png Binary files differdeleted file mode 100644 index 0fd8cdda14..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_dark.9.png Binary files differdeleted file mode 100644 index 3427b47681..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_light.9.png Binary files differdeleted file mode 100644 index 31e38c4c12..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_dark.9.png Binary files differdeleted file mode 100644 index e6a7880730..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_light.9.png Binary files differdeleted file mode 100644 index 972962dcfd..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_medium_off_client.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_medium_off_client.png Binary files differdeleted file mode 100644 index bb933092be..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_medium_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_small_off_client.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_small_off_client.png Binary files differdeleted file mode 100644 index 6174fcd9b1..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_small_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_standard_off_client.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_standard_off_client.png Binary files differdeleted file mode 100644 index 6a4c298e2d..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_standard_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_tall_off_client.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_tall_off_client.png Binary files differdeleted file mode 100644 index f68e9133bb..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_tall_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_dark.9.png Binary files differdeleted file mode 100644 index c97f349fae..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_dark.9.png Binary files differdeleted file mode 100644 index 34cbff115c..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_light.9.png Binary files differdeleted file mode 100644 index 34cbff115c..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_light.9.png Binary files differdeleted file mode 100644 index c97f349fae..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_dark.9.png Binary files differdeleted file mode 100644 index 702c49b74c..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_light.9.png Binary files differdeleted file mode 100644 index 06ad5a5ae7..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_dark.9.png Binary files differdeleted file mode 100644 index af160fc73b..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_light.9.png Binary files differdeleted file mode 100644 index c647fb4ce8..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_dark.9.png Binary files differdeleted file mode 100644 index fd0a4312b4..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_light.9.png Binary files differdeleted file mode 100644 index f8ce5a6aca..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_dark.9.png Binary files differdeleted file mode 100644 index b491f629fd..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_dark.9.png Binary files differdeleted file mode 100644 index 777c8d6408..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_light.9.png Binary files differdeleted file mode 100644 index 777c8d6408..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_light.9.png Binary files differdeleted file mode 100644 index b491f629fd..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_dark.9.png Binary files differdeleted file mode 100644 index c8a8f1cbdf..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_light.9.png Binary files differdeleted file mode 100644 index bcd0d0caf4..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_dark.9.png Binary files differdeleted file mode 100644 index ac75dad52e..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_light.9.png Binary files differdeleted file mode 100644 index c19afad669..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_dark.9.png Binary files differdeleted file mode 100644 index c49044185a..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_dark.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_light.9.png Binary files differdeleted file mode 100644 index c52be7455e..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_light.9.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_medium_off_client.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_medium_off_client.png Binary files differdeleted file mode 100644 index 4f23739dc3..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_medium_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_small_off_client.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_small_off_client.png Binary files differdeleted file mode 100644 index 8ffa1d72e6..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_small_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_standard_off_client.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_standard_off_client.png Binary files differdeleted file mode 100644 index 4d81cf40cd..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_standard_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_tall_off_client.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_tall_off_client.png Binary files differdeleted file mode 100644 index fab5a79b45..0000000000 --- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_tall_off_client.png +++ /dev/null diff --git a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_dark.xml b/platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_dark.xml deleted file mode 100644 index dd1cf679fe..0000000000 --- a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_dark.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item - android:state_pressed="true" - android:drawable="@drawable/common_signin_btn_icon_pressed_dark" /> - <item - android:state_enabled="false" - android:state_focused="true" - android:drawable="@drawable/common_signin_btn_icon_disabled_focus_dark" /> - <item - android:state_focused="true" - android:drawable="@drawable/common_signin_btn_icon_focus_dark" /> - <item - android:state_enabled="false" - android:drawable="@drawable/common_signin_btn_icon_disabled_dark" /> - <item - android:drawable="@drawable/common_signin_btn_icon_normal_dark" /> -</selector> diff --git a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_light.xml b/platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_light.xml deleted file mode 100644 index abf412bda8..0000000000 --- a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_light.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item - android:state_pressed="true" - android:drawable="@drawable/common_signin_btn_icon_pressed_light" /> - <item - android:state_enabled="false" - android:state_focused="true" - android:drawable="@drawable/common_signin_btn_icon_disabled_focus_light" /> - <item - android:state_focused="true" - android:drawable="@drawable/common_signin_btn_icon_focus_light" /> - <item - android:state_enabled="false" - android:drawable="@drawable/common_signin_btn_icon_disabled_light" /> - <item - android:drawable="@drawable/common_signin_btn_icon_normal_light" /> -</selector> diff --git a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_dark.xml b/platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_dark.xml deleted file mode 100644 index 2d92217cdf..0000000000 --- a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_dark.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item - android:state_pressed="true" - android:drawable="@drawable/common_signin_btn_text_pressed_dark" /> - <item - android:state_enabled="false" - android:state_focused="true" - android:drawable="@drawable/common_signin_btn_text_disabled_focus_dark" /> - <item - android:state_focused="true" - android:drawable="@drawable/common_signin_btn_text_focus_dark" /> - <item - android:state_enabled="false" - android:drawable="@drawable/common_signin_btn_text_disabled_dark" /> - <item - android:drawable="@drawable/common_signin_btn_text_normal_dark" /> -</selector> diff --git a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_light.xml b/platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_light.xml deleted file mode 100644 index 810c02112d..0000000000 --- a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_light.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item - android:state_pressed="true" - android:drawable="@drawable/common_signin_btn_text_pressed_light" /> - <item - android:state_enabled="false" - android:state_focused="true" - android:drawable="@drawable/common_signin_btn_text_disabled_focus_light" /> - <item - android:state_focused="true" - android:drawable="@drawable/common_signin_btn_text_focus_light" /> - <item - android:state_enabled="false" - android:drawable="@drawable/common_signin_btn_text_disabled_light" /> - <item - android:drawable="@drawable/common_signin_btn_text_normal_light" /> -</selector> diff --git a/platform/android/libs/google_play_services/res/values-af/strings.xml b/platform/android/libs/google_play_services/res/values-af/strings.xml deleted file mode 100644 index 1b211f5076..0000000000 --- a/platform/android/libs/google_play_services/res/values-af/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Kry Google Play-dienste"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Hierdie program sal nie loop sonder Google Play-dienste nie, wat nie op jou foon is nie."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Hierdie program sal nie loop sonder Google Play-dienste nie, wat nie op jou tablet is nie."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Kry Google Play-dienste"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Aktiveer Google Play-dienste"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Hierdie program sal nie werk tensy jy Google Play-dienste aktiveer nie."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Aktiveer Google Play-dienste"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Dateer Google Play-dienste op"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Hierdie program sal nie loop nie, tensy jy Google Play-dienste opdateer."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Netwerkfout"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"\'n Dataverbinding is nodig om aan Google Play-dienste te koppel."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Ongeldige rekening"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Die gespesifiseerde rekening bestaan nie op hierdie toestel nie. Kies asseblief \'n ander rekening."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Onbekende probleem met Google Play-dienste."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play-dienste"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play-dienste, waarop sommige van jou programme staatmaak, werk nie met jou toestel nie. Kontak asseblief die vervaardiger vir bystand."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Dit lyk of die datum op die toestel verkeerd is. Gaan asseblief die datum op die toestel na."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Dateer op"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Meld aan"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Meld aan met Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"\'n Program het probeer om \'n slegte weergawe van Google Play-dienste te gebruik."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"\'n Program vereis dat Google Play-dienste geaktiveer word."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"\'n Program vereis dat Google Play-dienste geïnstalleer word."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"\'n Program vereis \'n opdatering vir Google Play-dienste."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play-dienstefout"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Versoek deur <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-am/strings.xml b/platform/android/libs/google_play_services/res/values-am/strings.xml deleted file mode 100644 index 2585210fe0..0000000000 --- a/platform/android/libs/google_play_services/res/values-am/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play አገልግሎቶችን አግኝ"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"ይህ መተግበሪያ ያለ Google Play አገልግሎቶች አይሰራም፣ እነሱ ደግሞ ስልክዎ ላይ የሉም።"</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"ይህ መተግበሪያ ያለ Google Play አገልግሎቶች አይሰራም፣ እነሱ ደግሞ ጡባዊዎ ላይ የሉም።"</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play አገልግሎቶችን አግኝ"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play አገልግሎቶችን አንቃ"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Google Play አገልግሎቶችን እስካላነቁ ድረስ ይህ መተግበሪያ አይሰራም።"</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play አገልግሎቶችን አንቃ"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play አገልግሎቶችን ያዘምኑ"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Google Play አገልግሎቶችን እስኪያዘምኑ ድረስ ይህ መተግበሪያ አይሰራም።"</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"የአውታረ መረብ ስህተት"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"ከGoogle Play አገልግሎቶች ጋር ለመገናኘት የውሂብ ግንኙነት ያስፈልጋል።"</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"ልክ ያልሆነ መለያ"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"የተገለጸው መለያ በዚህ መሣሪያ ላይ የለም። እባክው የተለየ መለያ ይምረጡ።"</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"በGoogle Play አገልግሎቶች ላይ ያልታወቀ ችግር።"</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play አገልግሎቶች"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"የGoogle Play አገልግሎቶች፣ አንዳንድ መተግበሪያዎችዎ በእሱ ላይ ጥገኛ የሆኑት፣ በመሣሪያዎ አይደገፍም። እባክዎ ለእርዳታ አምራቹን ያግኙ።"</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"በመሣሪያው ላይ ያለው ቀን ትክክል አይመስልም። እባክዎ በመሣሪያው ላይ ያለውን ቀን ያረጋግጡ።"</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"ያዘምኑ"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"ግባ"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"በGoogle ይግቡ"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"መተግበሪያው የGoogle Play አገልግሎቶችን መጥፎ ስሪት ለመጠቀም ሞክሯል።"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"መተግበሪያው Google Play አገልግሎቶች እንዲነቁ ይፈልጋል።"</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"መተግበሪያው Google Play አገልግሎቶች እንዲጫኑ ይፈልጋል።"</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"መተግበሪያው Google Play አገልግሎቶች እንዲዘምን ይፈልጋል።"</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"የGoogle Play አገልግሎቶች ስህተት"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"በ<xliff:g id="APP_NAME">%1$s</xliff:g> የተጠየቀ"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-ar/strings.xml b/platform/android/libs/google_play_services/res/values-ar/strings.xml deleted file mode 100644 index 9451b37181..0000000000 --- a/platform/android/libs/google_play_services/res/values-ar/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"الحصول على خدمات Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"لن يتم تشغيل هذا التطبيق بدون خدمات Google Play، والتي لا تتوفر في هاتفك."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"لن يتم تشغيل هذا التطبيق بدون خدمات Google Play، والتي لا تتوفر في جهازك اللوحي."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"الحصول على خدمات Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"تمكين خدمات Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"لن يعمل هذا التطبيق ما لم يتم تمكين خدمات Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"تمكين خدمات Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"تحديث خدمات Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"لن يتم تشغيل هذا التطبيق ما لم تحدِّث خدمات Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"خطأ في الشبكة"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"يتطلب الاتصال بخدمات Google Play وجود اتصال بيانات."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"حساب غير صالح"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"الحساب الذي تمّ تحديده غير موجود على الجهاز. يُرجى اختيار حساب آخر."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"حدثت مشكلة غير معروفة في خدمات Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"خدمات Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"خدمات Google Play التي تستجيب لها بعض تطبيقاتك لا تعمل على جهازك. يُرجى الاتصال بجهة التصنيع للحصول على المساعدة."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"يبدو أن التاريخ على الجهاز غير صحيح. الرجاء التحقق من التاريخ على الجهاز."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"تحديث"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"تسجيل الدخول"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"تسجيل الدخول باستخدام Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"يحاول أحد التطبيقات استخدام إصدار غير صالح من خدمات Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"يتطلب أحد التطبيقات تمكين خدمات Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"يتطلب أحد التطبيقات تثبيت خدمات Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"يتطلب أحد التطبيقات تحديث خدمات Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"خطأ في خدمات Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"تم الطلب عن طريق <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-be/strings.xml b/platform/android/libs/google_play_services/res/values-be/strings.xml deleted file mode 100644 index 81382d1c0f..0000000000 --- a/platform/android/libs/google_play_services/res/values-be/strings.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Атрымаць службы Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Гэта прыкладанне не будзе працаваць без службаў Google Play, якіх няма ў вашым тэлефоне."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Гэта прыкладанне не будзе працаваць без службаў Google Play, якіх няма на вашым планшэце."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Атрымаць службы Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Уключыць службы Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Гэта прыкладанне не будзе працаваць, пакуль вы не ўключыце службы Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Уключыць службы Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Абнаўленне службаў Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Гэта прыкладанне не будзе працаваць падчас абнаўлення службаў Google Play."</string> - <!-- no translation found for common_google_play_services_network_error_title (3827284619958211114) --> - <skip /> - <!-- no translation found for common_google_play_services_network_error_text (9038847255613537209) --> - <skip /> - <!-- no translation found for common_google_play_services_invalid_account_title (1066672360770936753) --> - <skip /> - <!-- no translation found for common_google_play_services_invalid_account_text (4983316348021735578) --> - <skip /> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Невядомая праблема са службамі Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Службы Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Службы Google Play, да якiх прывязаны некаторыя прыкладаннi, не падтрымлiваюцца на вашай прыладзе. Па дапамогу звярнiцеся да вытворцы."</string> - <!-- no translation found for common_google_play_services_unsupported_date_text (4725396522367789365) --> - <skip /> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Абнавіць"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Увайсцi"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Увайсці ў Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Прыкладанне паспрабавала скарыстацца сапсаванай версіяй службаў Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Прыкладанне патрабуе ўключэння службаў Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Прыкладанне патрабуе ўсталявання службаў Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Прыкладанне патрабуе абнаўлення службаў Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Памылка службаў Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Запытана прыкладаннем <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-bg/strings.xml b/platform/android/libs/google_play_services/res/values-bg/strings.xml deleted file mode 100644 index bb8da3c105..0000000000 --- a/platform/android/libs/google_play_services/res/values-bg/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Изтегляне на услугите за Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Това приложение няма да се изпълнява без услугите за Google Play, които липсват в телефона ви."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Това приложение няма да се изпълнява без услугите за Google Play, които липсват в таблета ви."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Услуги за Google Play: Изтегл."</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Активиране на услугите за Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Това приложение няма да работи, освен ако не активирате услугите за Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Услуги за Google Play: Актив."</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Актуализиране на услугите за Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Това приложение няма да се изпълнява, освен ако не актуализирате услугите за Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Грешка в мрежата"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"За свързване с услугите за Google Play се изисква връзка за данни."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Невалиден профил"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Посоченият профил не съществува на това устройство. Моля, изберете друг."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Неизвестен проблем с услугите за Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Услуги за Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Услугите за Google Play, на които разчитат някои от приложенията ви, не се поддържат от устройството ви. Моля, свържете се с производителя за помощ."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Изглежда, че датата на устройството е неправилна. Моля, проверете я."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Актуализиране"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Вход"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Вход с Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Приложение опита да ползва неправилна версия на услуг. за Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Приложение изисква активирането на услугите за Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Приложение изисква инсталирането на услугите за Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Приложение изисква актуализирането на услугите за Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Грешка в услугите за Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Заявено от <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-ca/strings.xml b/platform/android/libs/google_play_services/res/values-ca/strings.xml deleted file mode 100644 index 5b63e86af7..0000000000 --- a/platform/android/libs/google_play_services/res/values-ca/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Baixa els serveis de Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Aquesta aplicació no s\'executarà si el telèfon no té instal·lats els serveis de Google Play."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Aquesta aplicació no funcionarà si la tauleta no té instal·lats els serveis de Google Play."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Baixa els serveis de Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Activa els serveis de Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Aquesta aplicació no funcionarà si no actives els serveis de Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Activa els serveis de Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Actualitza els serveis de Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Aquesta aplicació no s\'executarà si no actualitzes els serveis de Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Error de xarxa"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Es requereix una connexió de dades per connectar amb els serveis de Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Compte no vàlid"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"El compte especificat no existeix en aquest dispositiu. Tria un compte diferent."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Error desconegut relacionat amb els serveis de Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Serveis de Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"El teu dispositiu no és compatible amb els serveis de Google Play, en què es basen les teves aplicacions. Per obtenir assistència, contacta amb el fabricant."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Sembla que la data del dispositiu no és correcta. Comprova-la."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Actualitza"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Inicia sessió"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Inicia sessió amb Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Una aplic. ha intentat utilitzar una versió errònia de serveis de Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Una aplicació requereix que s\'activin els serveis de Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Una aplicació requereix que s\'instal·lin els serveis de Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Una aplicació requereix que s\'actualitzin els serveis de Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Error dels serveis de Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Sol·licitada per <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-cs/strings.xml b/platform/android/libs/google_play_services/res/values-cs/strings.xml deleted file mode 100644 index 1b5423b039..0000000000 --- a/platform/android/libs/google_play_services/res/values-cs/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Instalovat služby Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ke spuštění této aplikace jsou potřeba služby Google Play, které v telefonu nemáte."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ke spuštění této aplikace jsou potřeba služby Google Play, které v tabletu nemáte."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Instalovat služby Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Aktivovat služby Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ke spuštění této aplikace je třeba aktivovat služby Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Aktivovat služby Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Aktualizace služeb Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ke spuštění této aplikace je třeba aktualizovat služby Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Chyba sítě"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Připojení ke službám Google Play vyžaduje datové připojení."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Neplatný účet"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Zadaný účet v tomto zařízení neexistuje. Zvolte prosím jiný účet."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Nastal neznámý problém se službami Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Služby Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Některé vaše aplikace vyžadují služby Google Play, které ve vašem zařízení nejsou podporovány. S žádostí o pomoc se prosím obraťte na výrobce."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Datum v zařízení není správně nastaveno. Zkontrolujte prosím datum."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Aktualizovat"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Přihlásit se"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Přihlásit se účtem Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikace se pokusila použít nesprávnou verzi Služeb Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Aplikace vyžaduje aktivované Služby Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Aplikace vyžaduje instalaci Služeb Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Aplikace vyžaduje aktualizaci Služeb Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Chyba služeb Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Požadováno aplikací <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-da/strings.xml b/platform/android/libs/google_play_services/res/values-da/strings.xml deleted file mode 100644 index daa2160d3b..0000000000 --- a/platform/android/libs/google_play_services/res/values-da/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Hent Google Play-tjenester"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Denne app kan ikke køre uden Google Play-tjenester, som mangler på din telefon."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Denne app kan ikke køre uden Google Play-tjenester, som mangler på din tablet."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Hent Google Play-tjenester"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Aktivér Google Play-tjenester"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Denne app virker ikke, medmindre du aktiverer Google Play-tjenester."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Aktivér Google Play-tjenester"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Opdater Google Play-tjenester"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Denne app kan ikke køre, medmindre du opdaterer Google Play-tjenester."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Netværksfejl"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Der kræves en dataforbindelse for at oprette forbindelse til Google Play-tjenester."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Ugyldig konto"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Den angivne konto findes ikke på denne enhed. Vælg en anden konto."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Ukendt problem med Google Play-tjenester."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play-tjenester"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play-tjenester, som nogle af dine applikationer er afhængige af, understøttes ikke af din enhed. Kontakt producenten for at få hjælp."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Datoen på enheden ser ud til at være forkert. Husk at kontrollere datoen på enheden."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Opdater"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Log ind"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Log ind med Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"En applikation forsøgte at bruge en defekt version af Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"En applikation kræver, at Google Play er aktiveret."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"En applikation kræver, at Google Play er installeret."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"En applikation kræver en opdatering af Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Fejl i Google Play-tjenester"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Anmodning fra <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-de/strings.xml b/platform/android/libs/google_play_services/res/values-de/strings.xml deleted file mode 100644 index df8e88e9e2..0000000000 --- a/platform/android/libs/google_play_services/res/values-de/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play-Dienste installieren"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Zur Nutzung dieser App sind Google Play-Dienste erforderlich, die auf Ihrem Telefon nicht installiert sind."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Zur Nutzung dieser App sind Google Play-Dienste erforderlich, die auf Ihrem Tablet nicht installiert sind."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play-Dienste installieren"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play-Dienste aktivieren"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Diese App funktioniert nur, wenn Sie die Google Play-Dienste aktivieren."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play-Dienste aktivieren"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play-Dienste aktualisieren"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Diese App wird nur ausgeführt, wenn Sie die Google Play-Dienste aktualisieren."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Netzwerkfehler"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Um eine Verbindung zu den Google Play-Diensten herzustellen, ist eine Datenverbindung erforderlich."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Ungültiges Konto"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Das angegebene Konto ist auf diesem Gerät nicht vorhanden. Bitte wählen Sie ein anderes Konto aus."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Unbekanntes Problem mit Google Play-Diensten"</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play-Dienste"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play-Dienste, auf denen einige Ihrer Apps basieren, werden von diesem Gerät nicht unterstützt. Wenden Sie sich für weitere Informationen an den Hersteller."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Das Datum auf dem Gerät scheint falsch zu sein. Bitte überprüfen Sie das Datum auf dem Gerät."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Aktualisieren"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Anmelden"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Über Google anmelden"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"App versuchte, defekte Google Play-Dienste-Version zu verwenden"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"App erfordert aktivierte Google Play-Dienste"</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"App erfordert die Installation von Google Play-Diensten"</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"App erfordert ein Update für Google Play-Dienste"</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Fehler bei Google Play-Diensten"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Angefordert von <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-el/strings.xml b/platform/android/libs/google_play_services/res/values-el/strings.xml deleted file mode 100644 index 13a5dc5ef3..0000000000 --- a/platform/android/libs/google_play_services/res/values-el/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Λήψη υπηρεσιών Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Αυτή η εφαρμογή δεν θα εκτελεστεί χωρίς τις υπηρεσίες Google Play, οι οποίες λείπουν από το τηλέφωνό σας."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Αυτή η εφαρμογή δεν θα εκτελεστεί χωρίς τις υπηρεσίες Google Play, οι οποίες λείπουν από το tablet σας."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Λήψη υπηρεσιών Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Ενεργοποίηση υπηρεσιών Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Αυτή η εφαρμογή δεν θα λειτουργήσει εάν δεν έχετε ενεργοποιήσει τις υπηρεσίες Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Ενεργοπ. υπηρεσιών Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Ενημέρωση υπηρεσιών Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Αυτή η εφαρμογή θα εκτελεστεί αφού ενημερώσετε τις υπηρεσίες Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Σφάλμα δικτύου"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Απαιτείται σύνδεση δεδομένων για να συνδεθείτε με τις Υπηρεσίες Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Μη έγκυρος λογαριασμός"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Ο συγκεκριμένος λογαριασμός δεν υπάρχει σε αυτήν τη συσκευή. Επιλέξτε έναν διαφορετικό λογαριασμό."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Άγνωστο πρόβλημα με τις υπηρεσίες Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Υπηρεσίες Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Οι υπηρεσίες Google Play, στις οποίες βασίζονται ορισμένες από τις εφαρμογές σας, δεν υποστηρίζονται στη συσκευή σας. Επικοινωνήστε με τον κατασκευαστή για υποστήριξη."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Η ημερομηνία στη συσκευή φαίνεται λανθασμένη. Ελέγξτε την ημερομηνία στη συσκευή."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Ενημέρωση"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Σύνδεση"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Συνδεθείτε στο Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Απόπειρα χρήσης ακατάλληλης έκδοσης Υπηρεσιών Google Play από εφαρμογή"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Μια εφαρμογή απαιτεί τις Υπηρεσίες Google Play για ενεργοποίηση."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Μια εφαρμογή απαιτεί την εγκατάσταση των Υπηρεσιών Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Μια εφαρμογή απαιτεί μια ενημέρωση για τις Υπηρεσίες Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Σφάλμα υπηρεσιών Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Υποβλήθηκε αίτημα από την εφαρμογή <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-en-rGB/strings.xml b/platform/android/libs/google_play_services/res/values-en-rGB/strings.xml deleted file mode 100644 index 106d390b3e..0000000000 --- a/platform/android/libs/google_play_services/res/values-en-rGB/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Get Google Play services"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"This app won\'t run without Google Play services, which are missing from your phone."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"This app won\'t run without Google Play services, which are missing from your tablet."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Get Google Play services"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Enable Google Play services"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"This app won\'t work unless you enable Google Play services."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Enable Google Play services"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Update Google Play services"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"This app won\'t run unless you update Google Play services."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Network Error"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"A data connection is required to connect to Google Play services."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Invalid Account"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"The specified account does not exist on this device. Please choose a different account."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Unknown issue with Google Play services."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play services"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play services, which some of your applications rely on, is not supported by your device. Please contact the manufacturer for assistance."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"The date on the device appears to be incorrect. Please check the date on the device."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Update"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Sign in"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Sign in with Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"An application attempted to use a bad version of Google Play Services."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"An application requires Google Play Services to be enabled."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"An application requires installation of Google Play Services."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"An application requires an update for Google Play Services."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play services error"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Requested by <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-en-rIN/strings.xml b/platform/android/libs/google_play_services/res/values-en-rIN/strings.xml deleted file mode 100644 index 106d390b3e..0000000000 --- a/platform/android/libs/google_play_services/res/values-en-rIN/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Get Google Play services"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"This app won\'t run without Google Play services, which are missing from your phone."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"This app won\'t run without Google Play services, which are missing from your tablet."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Get Google Play services"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Enable Google Play services"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"This app won\'t work unless you enable Google Play services."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Enable Google Play services"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Update Google Play services"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"This app won\'t run unless you update Google Play services."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Network Error"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"A data connection is required to connect to Google Play services."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Invalid Account"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"The specified account does not exist on this device. Please choose a different account."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Unknown issue with Google Play services."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play services"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play services, which some of your applications rely on, is not supported by your device. Please contact the manufacturer for assistance."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"The date on the device appears to be incorrect. Please check the date on the device."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Update"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Sign in"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Sign in with Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"An application attempted to use a bad version of Google Play Services."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"An application requires Google Play Services to be enabled."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"An application requires installation of Google Play Services."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"An application requires an update for Google Play Services."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play services error"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Requested by <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-es-rUS/strings.xml b/platform/android/libs/google_play_services/res/values-es-rUS/strings.xml deleted file mode 100644 index 6be905908c..0000000000 --- a/platform/android/libs/google_play_services/res/values-es-rUS/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Obtener Google Play Services"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Esta aplicación no se ejecutará si no instalasGoogle Play Services en tu dispositivo."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Esta aplicación no se ejecutará si no instalas Google Play Services en tu tablet."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Descargar Google Play Services"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Activar Google Play Services"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Esta aplicación no funcionará si no activas Google Play Services."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Activar Google Play Services"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Actualizar Google Play Services"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Esta aplicación no se ejecutará si no actualizas Google Play Services."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Error de red"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Se necesita una conexión de datos para establecer conexión con Google Play Services."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Cuenta no válida"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"La cuenta especificada no existe en este dispositivo. Elige otra cuenta."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Error desconocido relacionado con Google Play Services"</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play Services"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play Services, del cual dependen algunas de tus aplicaciones, no es compatible con tu dispositivo. Comunícate con el fabricante para obtener ayuda."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Parece que la fecha del dispositivo es incorrecta. ¿Puedes revisarla?"</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Actualizar"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Acceder"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Acceder con Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Una aplic. intentó usar una versión no válida de Google Play Services"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Una aplicación requiere que se active Google Play Services"</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Una aplicación requiere que se instale Google Play Services"</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Una aplicación requiere que se actualice Google Play Services"</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Error de Google Play Services"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Solicitada por <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-es/strings.xml b/platform/android/libs/google_play_services/res/values-es/strings.xml deleted file mode 100644 index ed32995cf2..0000000000 --- a/platform/android/libs/google_play_services/res/values-es/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Descargar servicios de Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Esta aplicación no se ejecutará si tu teléfono no tiene instalados los servicios de Google Play."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Esta aplicación no se ejecutará si tu tablet no tiene instalados los servicios de Google Play."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Descargar servicios de Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Habilitar servicios de Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Esta aplicación no funcionará si no habilitas los servicios de Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Habilitar servicios de Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Actualizar servicios de Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Esta aplicación no se ejecutará si no actualizas los servicios de Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Error de red"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Se necesita una conexión de datos para establecer conexión con los servicios de Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Cuenta no válida"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"La cuenta especificada no existe en este dispositivo. Selecciona otra cuenta."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Error desconocido relacionado con los servicios de Google Play"</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Servicios de Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Tu dispositivo no es compatible con los servicios de Google Play, de los cuales dependen tus aplicaciones. Para obtener asistencia, ponte en contacto el fabricante."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Parece que la fecha del dispositivo es incorrecta. Compruébala."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Actualizar"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Iniciar sesión"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Iniciar sesión con Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Una aplicación intentó usar versión incorrecta de servicios de Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Una aplicación requiere que se habiliten los servicios de Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Una aplicación requiere que se instalen los servicios de Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Una aplicación requiere que se actualicen los servicios de Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Error de los servicios de Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Solicitada por <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-et-rEE/strings.xml b/platform/android/libs/google_play_services/res/values-et-rEE/strings.xml deleted file mode 100644 index 281caff497..0000000000 --- a/platform/android/libs/google_play_services/res/values-et-rEE/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Hankige Google Play teenused"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Selle rakenduse käitamiseks on vaja Google Play teenuseid, mida teie telefonis pole."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Selle rakenduse käitamiseks on vaja Google Play teenuseid, mida teie tahvelarvutis pole."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Hankige Google Play teenused"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Lubage Google Play teenused"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"See rakendus ei tööta, kui te ei luba Google Play teenuseid."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Lubage Google Play teenused"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Värskendage Google Play teenuseid"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Seda rakendust ei saa käitada, kui te ei värskenda Google Play teenuseid."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Võrgu viga"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play teenustega ühenduse loomiseks on vajalik andmesideühendus."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Vale konto"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Määratud kontot pole selles seadmes olemas. Valige muu konto."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play teenuste tundmatu probleem."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play teenused"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Teie seade ei toeta Google Play teenuseid, millele mõni teie rakendustest toetub. Abi saamiseks võtke ühendust tootjaga."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Seadme kuupäev paistab olevat vale. Kontrollige seadme kuupäeva."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Värskenda"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Logi sisse"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Logi sisse Google\'iga"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Rakendus püüdis kasutada Google Play teenuste sobimatut versiooni."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Rakenduse kasutamiseks peavad olema lubatud Google Play teenused."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Rakenduse kasutamiseks peavad olema installitud Google Play teenused."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Rakenduse kasutamiseks tuleb värskendada Google Play teenuseid."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Viga Google Play teenustes"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Päringu esitas: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-fa/strings.xml b/platform/android/libs/google_play_services/res/values-fa/strings.xml deleted file mode 100644 index 87e10d189c..0000000000 --- a/platform/android/libs/google_play_services/res/values-fa/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"دریافت خدمات Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"این برنامه بدون خدمات Google Play اجرا نمیشود، این خدمات در تلفن شما وجود ندارد."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"این برنامه بدون خدمات Google Play اجرا نمیشود، این خدمات در رایانهٔ لوحی شما وجود ندارد."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"دریافت خدمات Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"فعال کردن خدمات Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"تا زمانیکه خدمات Google Play را فعال نکنید این برنامه کار نمیکند."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"فعال کردن خدمات Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"بهروزرسانی خدمات Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"تا زمانیکه خدمات Google Play را بهروز نکنید این برنامه کار نمیکند."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"خطای شبکه"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"برای اتصال به خدمات Google Play اتصال داده لازم است."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"حساب نامعتبر"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"حسابی که تعیین کردید در این دستگاه وجود ندارد. لطفاً حساب دیگری را انتخاب کنید."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"مشکل نامشخص در خدمات Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"خدمات Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"خدمات Google Play، که برخی از برنامههای شما به آن وابسته است، توسط دستگاه شما پشتیبانی نمیشود. لطفاً برای دریافت کمک با سازنده تماس بگیرید."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"تاریخ روی دستگاه ظاهراً اشتباه است. لطفاً تاریخ روی دستگاه را بررسی کنید."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"بهروزرسانی"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"ورود به سیستم"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"ورود به سیستم با Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"برنامهای تلاش کرد از نسخه نادرستی از خدمات Google Play استفاده کند."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"برنامهای به فعال کردن خدمات Google Play نیاز دارد."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"برنامهای به نصب خدمات Google Play نیاز دارد."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"برنامهای به بهروزرسانی خدمات Google Play نیاز دارد."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"خطا در خدمات Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"درخواست توسط <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-fi/strings.xml b/platform/android/libs/google_play_services/res/values-fi/strings.xml deleted file mode 100644 index 00d3ceb215..0000000000 --- a/platform/android/libs/google_play_services/res/values-fi/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Asenna Google Play -palvelut"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Tämä sovellus ei toimi ilman Google Play -palveluita, jotka puuttuvat puhelimesta."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Tämä sovellus ei toimi ilman Google Play -palveluita, jotka puuttuvat tablet-laitteesta."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Asenna Google Play -palvelut"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Ota Google Play -palvelut käyttöön"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Tämä sovellus ei toimi, ellet ota Google Play -palveluita käyttöön."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Ota Google Play -palv. käyttöön"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Päivitä Google Play -palvelut"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Tämä sovellus ei toimi, ellet päivitä Google Play -palveluita."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Verkkovirhe"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play -palveluiden käyttöön tarvitaan tietoliikenneyhteys."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Tili ei kelpaa"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Kyseistä tiliä ei ole tällä laitteella. Valitse toinen tili."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Tuntematon ongelma käytettäessä Google Play -palveluita."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play -palvelut"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play -palveluita, joita osa sovelluksistasi käyttää, ei tueta laitteellasi. Pyydä ohjeita laitteen valmistajalta."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Laitteen päivämäärä vaikuttaa virheelliseltä. Tarkista laitteen päivämäärä."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Päivitä"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Kirjaudu"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Kirjaudu Google-tiliin"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Sovellus yritti käyttää virheellistä Google Play -palveluiden versiota"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Ota käyttöön Google Play -palvelut, jotta sovellus toimii."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Asenna Google Play -palvelut, jotta sovellus toimii."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Päivitä Google Play -palvelut, jotta sovellus toimii."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Virhe Google Play -palveluissa"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Pyynnön teki <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-fr-rCA/strings.xml b/platform/android/libs/google_play_services/res/values-fr-rCA/strings.xml deleted file mode 100644 index e915fe4067..0000000000 --- a/platform/android/libs/google_play_services/res/values-fr-rCA/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Installer les services Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre téléphone."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre tablette."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Installer les services Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Activer les services Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Cette application ne fonctionnera pas tant que vous n\'aurez pas activé les services Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Activer les services Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Mettre à jour les services Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Cette application ne fonctionnera pas tant que vous n\'aurez pas mis à jour les services Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Erreur réseau"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Vous devez disposer d\'une connexion de données pour utiliser les services Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Compte erroné"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Le compte indiqué n\'existe pas sur cet appareil. Veuillez sélectionner un autre compte."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problème inconnu avec les services Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Services Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Les services Google Play, dont dépendent certaines de vos applications, ne sont pas compatibles avec votre appareil. Veuillez contacter le fabricant pour obtenir de l\'aide."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"La date sur l\'appareil semble incorrecte. Veuillez la vérifier."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Mettre à jour"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Connexion"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Se connecter via Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Une application requiert une version valide des services Google Play"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Une application requiert l\'activation des services Google Play"</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Une application requiert l\'installation des services Google Play"</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Une application requiert la mise à jour des services Google Play"</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Erreur liée aux services Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Demandée par <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-fr/strings.xml b/platform/android/libs/google_play_services/res/values-fr/strings.xml deleted file mode 100644 index 321b28370b..0000000000 --- a/platform/android/libs/google_play_services/res/values-fr/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Installer les services Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre téléphone."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre tablette."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Installer services Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Activer les services Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Cette application ne fonctionnera pas tant que vous n\'aurez pas activé les services Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Activer services Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Mettre à jour les services Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Cette application ne fonctionnera pas tant que vous n\'aurez pas mis à jour les services Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Erreur réseau"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Vous devez disposer d\'une connexion de données pour utiliser les services Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Compte erroné"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Le compte indiqué n\'existe pas sur cet appareil. Veuillez sélectionner un autre compte."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problème inconnu avec les services Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Services Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Les services Google Play, dont dépendent certaines de vos applications, ne sont pas compatibles avec votre appareil. Veuillez contacter le fabricant pour obtenir de l\'aide."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"La date sur l\'appareil semble incorrecte. Veuillez la vérifier."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Mettre à jour"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Connexion"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Se connecter avec Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Une application requiert une version valide des services Google Play"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Une application requiert l\'activation des services Google Play"</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Une application requiert l\'installation des services Google Play"</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Une application requiert la mise à jour des services Google Play"</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Erreur liée aux services Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Demandée par <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-hi/strings.xml b/platform/android/libs/google_play_services/res/values-hi/strings.xml deleted file mode 100644 index b36feb00a7..0000000000 --- a/platform/android/libs/google_play_services/res/values-hi/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play सेवाएं पाएं"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"यह ऐप्स Google Play सेवाओं के बिना नहीं चलेगा, जो आपके फ़ोन में नहीं हैं."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"यह ऐप्स Google Play सेवाओं के बिना नहीं चलेगा, जो आपके टेबलेट में नहीं हैं."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play सेवाएं पाएं"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play सेवाएं सक्षम करें"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"जब तक आप Google Play सेवाएं सक्षम नहीं करते, तब तक यह ऐप्स कार्य नहीं करेगा."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play सेवाएं सक्षम करें"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play सेवाएं से नई जानकारी"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"जब तक आप Google Play सेवाओं से नई जानकारी नहीं लेते हैं, तब तक यह ऐप्स नहीं चलेगा."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"नेटवर्क त्रुटि"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play सेवाओं से कनेक्ट करने के लिए डेटा कनेक्शन की आवश्यकता है."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"अमान्य खाता"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"निर्दिष्ट खाता इस उपकरण पर मौजूद नहीं है. कृपया कोई भिन्न खाता चुनें."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play सेवाओं के साथ अज्ञात समस्या."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play सेवाएं"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play सेवाएं, जिन पर आपके कुछ ऐप्स निर्भर करते हैं, आपके उपकरण द्वारा समर्थित नहीं हैं. कृपया सहायता के लिए निर्माता से संपर्क करें."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"उपकरण का दिनांक गलत प्रतीत हो रहा है. कृपया उपकरण का दिनांक जांचें."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"नई जानकारी पाएं"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"प्रवेश करें"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Google से प्रवेश करें"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"ऐप्स ने Google Play सेवाओं के खराब संस्करण के उपयोग का प्रयास किया."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"ऐप्स के लिए Google Play सेवाओं को सक्षम किए जाने की आवश्यकता है."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"ऐप्स के लिए Google Play सेवाओं के इंस्टॉलेशन की आवश्यकता है."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"ऐप्स के लिए Google Play सेवाओं में Google Play से नई जानकारी की आवश्यकता है."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play सेवाएं त्रुटि"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"<xliff:g id="APP_NAME">%1$s</xliff:g> द्वारा अनुरोधित"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-hr/strings.xml b/platform/android/libs/google_play_services/res/values-hr/strings.xml deleted file mode 100644 index b7d462d882..0000000000 --- a/platform/android/libs/google_play_services/res/values-hr/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Preuzmi usluge za Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ova aplikacija neće funkcionirati bez usluga za Google Play, koje nisu instalirane na vašem telefonu."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ova aplikacija neće funkcionirati bez usluga za Google Play, koje nisu instalirane na vašem tabletnom računalu."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Preuzmi usluge za Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Omogući usluge za Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ova aplikacija neće raditi ako ne omogućite usluge za Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Omogući usluge za Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Ažuriraj usluge za Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ova se aplikacija neće pokrenuti ako ne ažurirate usluge za Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Mrežna pogreška"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Potrebna je podatkovna veza za povezivanje s uslugama Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Nevažeći račun"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Navedeni račun ne postoji na ovom uređaju. Odaberite neki drugi račun."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Nepoznata poteškoća s uslugama za Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Usluge za Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Usluge za Google Play, koje su potrebne za funkcioniranje nekih vaših aplikacija, nisu podržane na vašem uređaju. Pomoć potražite od proizvođača."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Čini se da datum na uređaju nije točan. Provjerite datum na uređaju."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Ažuriranje"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Prijava"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Prijava uslugom Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikacija je pokušala upotrijebiti lošu verziju Usluga za Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Aplikacija zahtijeva omogućavanje Usluga za Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Aplikacija zahtijeva instaliranje Usluga za Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Aplikacija zahtijeva ažuriranje Usluga za Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Pogreška usluga za Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Zahtijeva aplikacija <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-hu/strings.xml b/platform/android/libs/google_play_services/res/values-hu/strings.xml deleted file mode 100644 index cd15ad328f..0000000000 --- a/platform/android/libs/google_play_services/res/values-hu/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Play Szolgáltatások telepítése"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Az alkalmazás működéséhez a Google Play Szolgáltatások szükségesek, ezek nincsenek telepítve a telefonon."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Az alkalmazás működéséhez a Google Play Szolgáltatások szükségesek, ezek nincsenek telepítve a táblagépen."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Play Szolgáltatások telepítése"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play Szolgáltatások aktiválása"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Az alkalmazás csak akkor fog működni, ha engedélyezi a Google Play Szolgáltatásokat."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Play Szolgáltatások aktiválása"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Play Szolgáltatások frissítése"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Az alkalmazás csak akkor fog működni, ha frissíti a Google Play Szolgáltatásokat."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Hálózati hiba"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"A Google Play Szolgáltatásokhoz történő kapcsolódáshoz adatkapcsolat szükséges."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Érvénytelen fiók"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"A megadott fiók nem létezik ezen az eszközön. Kérjük, válasszon másik fiókot."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Ismeretlen hiba a Google Play Szolgáltatásokban."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play Szolgáltatások"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"A Google Play Szolgáltatásokat, amelyre egyes alkalmazások támaszkodnak, nem támogatja az eszköz. Segítségért forduljon az eszköz gyártójához."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Az eszközön beállított dátum helytelen. Kérjük, ellenőrizze azt."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Frissítés"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Belépés"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Google-bejelentkezés"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Egy alkalmazás a Play Szolgáltatások rossz verzióját akarta használni."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Egy alkalmazás kéri a Google Play Szolgáltatások engedélyezését."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Egy alkalmazás kéri a Google Play Szolgáltatások telepítését."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Egy alkalmazás kéri a Google Play Szolgáltatások frissítését."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play szolgáltatási hiba"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Igénylő: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-hy-rAM/strings.xml b/platform/android/libs/google_play_services/res/values-hy-rAM/strings.xml deleted file mode 100644 index d89be9bf64..0000000000 --- a/platform/android/libs/google_play_services/res/values-hy-rAM/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Տեղադրեք Google Play ծառայությունները"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Այս հավելվածը չի գործարկվի առանց Google Play ծառայությունների, որոնք բացակայում են ձեր հեռախոսում:"</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Այս հավելվածը չի գործարկվի առանց Google Play ծառայությունների, որոնք բացակայում են ձեր գրասալիկում:"</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Տեղադրել Google Play ծառայությունները"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Միացնել Google Play ծառայությունները"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Այս ծրագիրը չի աշխատի, եթե դուք չմիացնեք Google Play ծառայությունները:"</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Միացնել Google Play ծառայությունները"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Նորացրեք Google Play ծառայությունները"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Այս ծրագիրը չի գործարկվի, եթե դուք չնորացնեք Google Play ծառայությունները:"</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Ցանցի սխալ կա"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Պահանջվում է տվյալների կապ` Google Play ծառայություններին միանալու համար:"</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Հաշիվն անվավեր է"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Նշված հաշիվը գոյություն չունի այս սարքում: Ընտրեք այլ հաշիվ:"</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Անհայտ խնդիր՝ Google Play ծառայություններում:"</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play ծառայություններ"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play ծառայությունները, որոնց ապավինում են ձեր ծրագրերից որոշները, չեն աջակցվում ձեր սարքի կողմից: Խնդրում ենք կապվել արտադրողի հետ օգնության համար:"</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Սարքի ամսաթիվը կարծես սխալ է: Ստուգեք սարքի ամսաթիվը:"</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Նորացնել"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Մուտք գործել"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Մուտք գործեք Google-ով"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Հավելվածը փորձել է կիրառել Google Play ծառայությունների վատ տարբերակը:"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Հավելվածը պահանջում է միացնել Google Play ծառայությունները:"</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Հավելվածը պահանջում է տեղադրել Google Play ծառայությունները:"</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Հավելվածը պահանջում է թարմացնել Google Play ծառայությունները:"</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play ծառայությունների սխալ"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"<xliff:g id="APP_NAME">%1$s</xliff:g>-ի հարցմամբ"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-in/strings.xml b/platform/android/libs/google_play_services/res/values-in/strings.xml deleted file mode 100644 index 526b84a816..0000000000 --- a/platform/android/libs/google_play_services/res/values-in/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Dapatkan layanan Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Aplikasi ini tidak akan berjalan tanpa layanan Google Play, yang tidak ada di ponsel Anda."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Aplikasi ini tidak akan berjalan tanpa layanan Google Play, yang tidak ada di tablet Anda."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Dapatkan layanan Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Aktifkan layanan Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Aplikasi ini tidak akan bekerja sampai Anda mengaktifkan layanan Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Aktifkan layanan Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Perbarui layanan Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Aplikasi ini tidak akan berjalan sampai Anda memperbarui layanan Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Kesalahan Jaringan"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Sambungan data diperlukan untuk tersambung ke layanan Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Akun Tidak Valid"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Akun yang ditentukan tidak ada di perangkat ini. Pilih akun lain."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Masalah tidak diketahui pada layanan Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Layanan Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Layanan Google Play, yang diandalkan oleh beberapa aplikasi Anda, tidak didukung oleh perangkat Anda. Hubungi pabrikan untuk mendapatkan bantuan."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Tampaknya tanggal di perangkat salah. Periksa tanggal di perangkat."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Perbarui"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Masuk"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Masuk dengan Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikasi mencoba menggunakan versi Layanan Google Play yang rusak."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Aplikasi membutuhkan Layanan Google Play untuk dapat diaktifkan."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Aplikasi membutuhkan pemasangan Layanan Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Aplikasi membutuhkan pembaruan untuk Layanan Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Kesalahan layanan Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Diminta oleh <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-it/strings.xml b/platform/android/libs/google_play_services/res/values-it/strings.xml deleted file mode 100644 index f3c9f1fa5c..0000000000 --- a/platform/android/libs/google_play_services/res/values-it/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Installa Google Play Services"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"L\'app non funzionerà senza Google Play Services, non presente sul tuo telefono."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"L\'app non funzionerà senza Google Play Services, non presente sul tuo tablet."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Installa Google Play Services"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Attiva Google Play Services"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"L\'app non funzionerà se non attivi Google Play Services."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Attiva Google Play Services"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Aggiorna Google Play Services"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"L\'app non funzionerà se non aggiorni Google Play Services."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Errore di rete"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"È necessaria una connessione dati per connettersi a Google Play Services."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Account non valido"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"L\'account specificato non esiste su questo dispositivo. Scegli un altro account."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problema sconosciuto con Google Play Services."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play Services"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"La piattaforma Google Play Services, su cui sono basate alcune delle tue applicazioni, non è supportata dal dispositivo in uso. Per assistenza, contatta il produttore."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"La data sul dispositivo sembra sbagliata. Controllala."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Aggiorna"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Accedi"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Accedi con Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Un\'app ha tentato di usare una versione non valida di Play Services."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Un\'applicazione richiede l\'attivazione di Google Play Services."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Un\'applicazione richiede l\'installazione di Google Play Services."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Un\'applicazione richiede un aggiornamento di Google Play Services."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Errore Google Play Services"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Richiesta da <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-iw/strings.xml b/platform/android/libs/google_play_services/res/values-iw/strings.xml deleted file mode 100644 index 7474e53506..0000000000 --- a/platform/android/libs/google_play_services/res/values-iw/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"קבל את שירותי Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"אפליקציה זו לא תפעל ללא שירותי Google Play, החסרים בטלפון שלך."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"אפליקציה זו לא תפעל ללא שירותי Google Play, החסרים בטאבלט שלך."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"קבל את שירותי Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"הפעלת שירותי Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"אפליקציה זו לא תעבוד אם לא תפעיל את שירותי Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"הפעל את שירותי Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"עדכון שירותי Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"אפליקציה זו לא תפעל אם לא תעדכן את שירותי Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"שגיאת רשת."</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"דרוש חיבור נתונים כדי להתחבר לשירותי Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"חשבון לא חוקי"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"החשבון שצוין לא קיים במכשיר זה. בחר חשבון אחר."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"בעיה לא ידועה בשירותי Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"שירותי Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"שירותי Google Play, שחלק מהאפליקציות שלך מתבססות עליהם, אינם נתמכים על ידי המכשיר שברשותך. צור קשר עם היצרן לקבלת סיוע."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"נראה שהתאריך במכשיר שגוי. בדוק את התאריך במכשיר."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"עדכן"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"היכנס"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"היכנס באמצעות Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"יש אפליקציה שניסתה להשתמש בגרסה שגויה של שירותי Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"יש אפליקציה המחייבת הפעלה של שירותי Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"יש אפליקציה המחייבת התקנה של שירותי Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"יש אפליקציה המחייבת עדכון של שירותי Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"שגיאה בשירותי Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"התבקשה על ידי <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-ja/strings.xml b/platform/android/libs/google_play_services/res/values-ja/strings.xml deleted file mode 100644 index 0d8b606230..0000000000 --- a/platform/android/libs/google_play_services/res/values-ja/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Play開発者サービスの入手"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"このアプリの実行にはGoogle Play開発者サービスが必要ですが、お使いの携帯端末にはインストールされていません。"</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"このアプリの実行にはGoogle Play開発者サービスが必要ですが、お使いのタブレットにはインストールされていません。"</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Play開発者サービスの入手"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Play開発者サービスの有効化"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"このアプリの実行には、Google Play開発者サービスの有効化が必要です。"</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Play開発者サービスの有効化"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Play開発者サービスの更新"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"このアプリの実行には、Google Play開発者サービスの更新が必要です。"</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"ネットワークエラー"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play開発者サービスに接続するには、データ接続が必要です。"</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"無効なアカウント"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"指定したアカウントはこの端末上に存在しません。別のアカウントを選択してください。"</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play開発者サービスで原因不明の問題が発生しました。"</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play開発者サービス"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"一部のアプリが使用しているGoogle Play開発者サービスは、お使いの端末ではサポートされていません。詳しくは、端末メーカーまでお問い合わせください。"</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"端末上の日付が正しくないようです。端末上の日付をご確認ください。"</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"更新"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"ログイン"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Googleでログイン"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"アプリはGoogle Play開発者サービスの不適切なバージョンを使用しようとしました。"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"アプリではGoogle Play開発者サービスを有効にする必要があります。"</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"アプリではGoogle Play開発者サービスをインストールする必要があります。"</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"アプリではGoogle Play開発者サービスをアップデートする必要があります。"</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play開発者サービスのエラー"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"<xliff:g id="APP_NAME">%1$s</xliff:g>によるリクエスト"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-ka-rGE/strings.xml b/platform/android/libs/google_play_services/res/values-ka-rGE/strings.xml deleted file mode 100644 index 8a2c74aa98..0000000000 --- a/platform/android/libs/google_play_services/res/values-ka-rGE/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play სერვისების მიღება"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"ეს აპი ვერ გაეშვება Google Play სერვისების გარეშე, რაც თქვენს ტელეფონზე ვერ იძებნება."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"ეს აპი ვერ გაეშვება Google Play სერვისების გარეშე, რაც თქვენს ტელეფონზე ვერ იძებნება."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play სერვისების მიღება"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play სერვისების გააქტიურება"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"ეს აპი არ იმუშავებს, თუ არ გაააქტიურებთ Google Play სერვისებს."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play სერვისების გააქტიურება"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play სერვისების განახლება"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"ეს აპი ვერ გაეშვება, თუ Google Play სერვისებს არ განაახლებთ."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"ქსელის შეცდომა"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play Services-თან დასაკავშირებლად მონაცემთა გადაცემა აუცილებელია."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"ანგარიში არასწორია"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"მითითებული ანგარიში ამ მოწყობილობაზე არ არსებობს. გთხოვთ, აირჩიოთ სხვა ანგარიში."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play სერვისებთან დაკავშირებით უცნობი შეფერხება წარმოიშვა."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play სერვისები"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play სერვისები, რაც თქვენს ზოგიერთ აპს ჭირდება, თქვენს მოწყობილობაზე მხარდაჭერილი არ არის. გთხოვთ, დაუკავშირდეთ მწარმოებელს დახმარებისათვის."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"როგორც ჩანს, მოწყობილობის თარიღი არასწორია. გთხოვთ, შეამოწმოთ მოწყობილობის თარიღი."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"განახლება"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"შესვლა"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Google-ით შესვლა"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"აპლიკაცია შეეცადა გამოეყენებინა Google Play სერვისების არასწორი ვერსია."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"აპლიკაცია საჭიროებს გააქტიურებულ Google Play Services."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"აპლიკაცია საჭიროებს Google Play Services-ის ინსტალაციას."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"აპლიკაცია საჭიროებს Google Play Services-ის განახლებას."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play სერვისების შეცდომა"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"მომთხოვნი: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-km-rKH/strings.xml b/platform/android/libs/google_play_services/res/values-km-rKH/strings.xml deleted file mode 100644 index afebf30875..0000000000 --- a/platform/android/libs/google_play_services/res/values-km-rKH/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"ទទួលសេវាកម្មកម្សាន្ត Google"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"កម្មវិធីនេះនឹងមិនដំណើរការទេបើគ្មានសេវាកម្មកម្សាន្ត Google ដែលទូរស័ព្ទរបស់អ្នកមិនមាន។"</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"កម្មវិធីនេះនឹងមិនដំណើរការទេបើគ្មានសេវាកម្មកម្សាន្ត Google ដែលកុំព្យូទ័របន្ទះរបស់អ្នកមិនមាន។"</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"ទទួលសេវាកម្មកម្សាន្ត Google"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"បើកសេវាកម្មកម្សាន្ត Google"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"កម្មវិធីនេះនឹងមិនដំណើរការទេ លុះត្រាតែអ្នកបើកសេវាកម្មកម្សាន្ត Google ។"</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"បើកសេវាកម្មកម្សាន្ត Google"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"ធ្វើបច្ចុប្បន្នភាពសេវាកម្មកម្សាន្ត Google"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"កម្មវិធីនេះនឹងមិនដំណើរការទេ លុះត្រាតែអ្នកធ្វើបច្ចុប្បន្នភាពសេវាកម្មកម្សាន្ត Google ។"</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"កំហុសបណ្ដាញ"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"បានទាមទារការតភ្ជាប់ទិន្នន័យ ដើម្បីភ្ជាប់សេវាកម្មឃ្លាំងកម្មវិធី។"</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"គណនីមិនត្រឹមត្រូវ"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"គណនីដែលបានបញ្ជាក់មិនមាននៅលើឧបករណ៍នេះទេ។ សូមជ្រើសគណនីផ្សេង។"</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"មិនស្គាល់បញ្ហាជាមួយសេវាកម្មកម្សាន្ត Google ។"</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"សេវាកម្មកម្សាន្ត Google"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"សេវាកម្មកម្សាន្ត Google អាស្រ័យលើកម្មវិធីរបស់អ្នក មិនត្រូវបានគាំទ្រដោយឧបករណ៍របស់អ្នក។ សូមទាក់ទងក្រុមហ៊ុនផលិតសម្រាប់ជំនួយ។"</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"កាលបរិច្ឆេទលើឧបករណ៍បង្ហាញថាមិនត្រឹមត្រូវ។ សូមពិនិត្យកាលបរិច្ឆេទលើឧបករណ៍។"</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"ធ្វើបច្ចុប្បន្នភាព"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"ចូល"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"ចូលដោយប្រើ Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"កម្មវិធីព្យាយាមប្រើកំណែមិនល្អរបស់សេវាកម្មឃ្លាំកម្មវិធី។"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"កម្មវិធីទាមទារបើកសេវាកម្មឃ្លាំងកម្មវិធី។"</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"កម្មវិធីទាមទារការដំឡើងសេវាកម្មឃ្លាំងកម្មវិធី។"</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"កម្មវិធីទាមទារធ្វើបច្ចុប្បន្នភាពសេវាកម្មឃ្លាំងកម្មវិធី។"</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"កំហុសសេវាកម្មកម្សាន្ត Google"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"បានស្នើដោយ <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-ko/strings.xml b/platform/android/libs/google_play_services/res/values-ko/strings.xml deleted file mode 100644 index e37f1fd02a..0000000000 --- a/platform/android/libs/google_play_services/res/values-ko/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play 서비스 설치"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"휴대전화에 Google Play 서비스가 설치되어 있어야 이 앱이 실행됩니다."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"태블릿에 Google Play 서비스가 설치되어 있어야 이 앱이 실행됩니다."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play 서비스 설치"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play 서비스 사용"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Google Play 서비스를 사용하도록 설정해야 이 앱이 작동합니다."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play 서비스 사용"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play 서비스 업데이트"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Google Play 서비스를 업데이트해야만 이 앱이 실행됩니다."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"네트워크 오류"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play 서비스에 연결하려면 데이터 연결이 필요합니다."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"올바르지 않은 계정"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"지정한 계정이 이 기기에 존재하지 않습니다. 다른 계정을 선택하세요."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play 서비스에 알 수 없는 문제가 발생했습니다."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play 서비스"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"일부 사용자 애플리케이션에 필요한 Google Play 서비스가 사용자 기기에서 지원되지 않습니다. 기기 제조업체에 문의하시기 바랍니다."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"기기의 날짜가 잘못된 것 같습니다. 기기의 날짜를 확인해 주세요."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"업데이트"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"로그인"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Google 계정으로 로그인"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"애플리케이션에서 잘못된 버전의 Google Play 서비스를 사용하려고 했습니다."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Google Play 서비스를 사용하도록 설정해야 하는 애플리케이션입니다."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Google Play 서비스를 설치해야 하는 애플리케이션입니다."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Google Play 서비스를 업데이트해야 하는 애플리케이션입니다."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play 서비스 오류"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"<xliff:g id="APP_NAME">%1$s</xliff:g>에서 요청"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-lo-rLA/strings.xml b/platform/android/libs/google_play_services/res/values-lo-rLA/strings.xml deleted file mode 100644 index 32bcb0b92b..0000000000 --- a/platform/android/libs/google_play_services/res/values-lo-rLA/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"ຕິດຕັ້ງບໍລິການ Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"ແອັບຯນີ້ຈະບໍ່ສາມາດເຮັດວຽກໄດ້ໂດຍທີ່ບໍ່ມີບໍລິການ Google Play ເຊິ່ງຂາດຫາຍໄປໃນໂທລະສັບຂອງທ່ານ."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"ແອັບຯນີ້ຈະບໍ່ສາມາດເຮັດວຽກໄດ້ໂດຍທີ່ບໍ່ມີບໍລິການ Google Play ເຊິ່ງຂາດຫາຍໄປໃນແທັບເລັດຂອງທ່ານ."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"ຕິດຕັ້ງບໍລິການ Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"ເປີດໃຊ້ບໍລິການ Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"ແອັບຯນີ້ຈະບໍ່ສາມາດເຮັດວຽກໄດ້ຈົນກວ່າທ່ານຈະເປີດໃຊ້ບໍລິການ Google Play"</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"ເປີດໃຊ້ບໍລິການ Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"ອັບເດດບໍລິການ Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"ແອັບຯນີ້ຈະບໍ່ສາມາດເຮັດວຽກໄດ້ຈົນກວ່າທ່ານຈະອັບເດດບໍລິການ Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"ເຄືອຂ່າຍຜິດພາດ"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"ຕ້ອງໃຊ້ການເຊື່ອມຕໍ່ອິນເຕີເນັດເພື່ອໃຊ້ Google Play Services."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"ບັນຊີບໍ່ຖືກຕ້ອງ"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"ບັນຊີທີ່ເລືອກບໍ່ມີໃນອຸປະກອນນີ້. ກະລຸນາເລືອກບັນຊີອື່ນ."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"ມີປັນຫາທີ່ບໍ່ຄາດຄິດໃນບໍລິການ Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"ບໍລິການ Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"ບໍລິການ Google Play ທີ່ບາງແອັບພລິເຄຊັນຂອງທ່ານຕ້ອງອາໄສນັ້ນ ບໍ່ຖືກຮອງຮັບໃນອຸປະກອນຂອງທ່ານ. ກະລຸນາຕິດຕໍ່ຜູ້ຜະລິດສຳລັບການແນະນຳ."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"ວັນທີຂອງອຸປະກອນບໍ່ຖືກຕ້ອງ. ກະລຸນາກວດສອບວັນທີຂອງອຸປະກອນຂອງທ່ານ."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"ອັບເດດ"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"ເຂົ້າສູ່ລະບົບ"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"ເຂົ້າສູ່ລະບົບດ້ວຍ Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"ແອັບພລິເຄຊັນໄດ້ພະຍາຍາມໃຊ້ Google Play Services ເວີຊັນທີ່ບໍ່ສາມາດໃຊ້ໄດ້."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"ແອັບພລິເຄຊັນຕ້ອງການເປີດນຳໃຊ້ Google Play Services."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"ແອັບພລິເຄຊັນຕ້ອງການໃຫ້ຕິດຕັ້ງ Google Play Services."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"ແອັບພລິເຄຊັນຕ້ອງການອັບເດດ Google Play Services."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"ບໍລິການ Google Play ຜິດພາດ"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"ຮ້ອງຂໍໂດຍ <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-lt/strings.xml b/platform/android/libs/google_play_services/res/values-lt/strings.xml deleted file mode 100644 index 73de5fa9aa..0000000000 --- a/platform/android/libs/google_play_services/res/values-lt/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Gauti „Google Play“ paslaugų"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ši programa neveiks be „Google Play“ paslaugų, kurios neįdiegtos telefone."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ši programa neveiks be „Google Play“ paslaugų, kurios neįdiegtos planšetiniame kompiuteryje."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Gauti „Google Play“ paslaugų"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Įgalinti „Google Play“ paslaugas"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ši programa neveiks, jei neįgalinsite „Google Play“ paslaugų."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Įgal. „Google Play“ paslaugas"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Atnaujinti „Google Play“ paslaugas"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ši programa neveiks, jei neatnaujinsite „Google Play“ paslaugų."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Tinklo klaida"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Norint prisijungti prie „Google Play“ paslaugų reikia duomenų ryšio."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Netinkama paskyra"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Nurodytos paskyros šiame įrenginyje nėra. Pasirinkite kitą paskyrą."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Nežinoma „Google Play“ paslaugų problema."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"„Google Play“ paslaugos"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Jūsų įrenginys nepalaiko „Google Play“ paslaugų, kuriomis remiasi kai kurios programos. Jei reikia pagalbos, susisiekite su gamintoju."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Įrenginyje nurodyta data neteisinga. Patikrinkite įrenginyje nurodytą datą."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Atnaujinti"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Prisij."</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Prisij. naud. „Google“"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Programa bandė naudotis netinkama „Google Play“ paslaugų versija."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Norint naudoti programą būtina įgalinti „Google Play“ paslaugas."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Norint naudoti programą būtina įdiegti „Google Play“ paslaugas."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Norint naudoti programą būtina atnaujinti „Google Play“ paslaugas."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"„Google Play“ paslaugų klaida"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Užklausą pateikė „<xliff:g id="APP_NAME">%1$s</xliff:g>“"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-lv/strings.xml b/platform/android/libs/google_play_services/res/values-lv/strings.xml deleted file mode 100644 index 9e4b6ee6bd..0000000000 --- a/platform/android/libs/google_play_services/res/values-lv/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play pakalpojumu iegūšana"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Lai šī lietotne darbotos, tālrunī ir jāinstalē Google Play pakalpojumi."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Lai šī lietotne darbotos, planšetdatorā ir jāinstalē Google Play pakalpojumi."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Iegūt Google Play pakalpojumus"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play pakalpojumu iespējošana"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Lai šī lietotne darbotos, iespējojiet Google Play pakalpojumus."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Iespējot Google Play pakalpojumus"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play pakalpojumu atjaunināšana"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Lai šī lietotne darbotos, atjauniniet Google Play pakalpojumus."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Tīkla kļūda"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Lai izveidotu savienojumu ar Google Play pakalpojumiem, ir nepieciešams datu savienojums."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Nederīgs konts"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Norādītais konts šajā ierīcē nepastāv. Lūdzu, izvēlieties citu kontu."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Nezināma problēma ar Google Play pakalpojumiem."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play pakalpojumi"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Jūsu ierīce neatbalsta Google Play pakalpojumus, kuri nepieciešami dažu jūsu lietojumprogrammu darbībai. Lūdzu, sazinieties ar ražotāju, lai saņemtu palīdzību."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Šķiet, ka ierīcē ir iestatīts nepareizs datums. Lūdzu, pārbaudiet ierīces datumu."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Atjaunināt"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Pierakst."</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Pierakstīties Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Lietojumpr. mēģināja izmantot nederīgu Google Play pakalp. versiju."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Lai lietojumprogramma darbotos, ir jāiespējo Google Play pakalpojumi."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Lai lietojumprogramma darbotos, ir jāinstalē Google Play pakalpojumi."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Lai lietojumprogramma darbotos, jāatjaunina Google Play pakalpojumi."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play pakalpojumu kļūda"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Pieprasījums no lietotnes <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-mn-rMN/strings.xml b/platform/android/libs/google_play_services/res/values-mn-rMN/strings.xml deleted file mode 100644 index 1743256a11..0000000000 --- a/platform/android/libs/google_play_services/res/values-mn-rMN/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play үйлчилгээ авах"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Таны утсанд байхгүй байгаа Google Play үйлчилгээг идэвхжүүлж байж энэ апп-г ажиллуулах боломжтой."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Таны таблетэд байхгүй Google Play үйлчилгээг идэвхжүүлж байж энэ апп-г ажиллуулах боломжтой."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play үйлчилгээ авах"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play үйлчилгээг идэвхжүүлэх"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Та Google Play үйлчилгээг идэвхжүүлж байж энэ апп-г ажиллуулах боломжтой."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play үйлчилгээг идэвхжүүлэх"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play үйлчилгээг шинэчлэх"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Та Google Play үйлчилгээг шинэчлэхгүй бол энэ апп ажиллах боломжгүй."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Сүлжээний алдаа"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play үйлчилгээнд холбогдохын тулд дата холболт шаардлагатай."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Буруу акаунт"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Заасан акаунт энэ төхөөрөмж дээр байхгүй байна. Өөр акаунт сонгоно уу."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play үйлчилгээтэй холбоотой тодорхойгүй алдаа."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play үйлчилгээ"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Таны зарим аппликешнүүдийн хамаардаг Google Play үйлчилгээ таны төхөөрөмжид дэмжигдэхгүй байна. Тусламж авахын тулд үйлдвэрлэгчтэй холбоо барина уу."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Төхөөрөмжийн огноо буруу байгаа бололтой. Төхөөрөмжийн огноог шалгана уу."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Шинэчлэх"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Нэвтрэх"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Google-р нэвтрэх:"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Аппликешн Google Play Үйлчилгээний муу хувилбарыг ашиглахыг оролдлоо."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Аппликешн Google Play Үйлчилгээг идэвхжүүлсэн байхыг шаардана."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Аппликешн Google Play Үйлчилгээг суулгахыг шаардана."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Аппликешн Google Play Үйлчилгээг шинэчлэхийг шаардана."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play үйлчилгээний алдаа"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Хүсэлт гаргасан <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-ms-rMY/strings.xml b/platform/android/libs/google_play_services/res/values-ms-rMY/strings.xml deleted file mode 100644 index 8e8a4b9b8a..0000000000 --- a/platform/android/libs/google_play_services/res/values-ms-rMY/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Dapatkan perkhidmatan Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Apl ini tidak akan berfungsi tanpa perkhidmatan Google Play dan apl ini tiada pada telefon anda."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Apl ini tidak akan berfungsi tanpa perkhidmatan Google Play dan apl ini tiada pada tablet anda."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Dapatkan perkhidmatan Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Dayakan perkhidmatan Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Apl ini tidak akan berfungsi kecuali anda mendayakan perkhidmatan Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Dayakan perkhidmatan Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Kemas kini perkhidmatan Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Apl ini tidak akan berfungsi kecuali anda mengemas kini perkhidmatan Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Ralat Rangkaian"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Sambungan data diperlukan untuk menyambung ke perkhidmatan Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Akaun Tidak Sah"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Akaun yang dinyatakan tidak wujud pada peranti ini. Sila pilih akaun yang lain."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Isu tidak diketahui dengan perkhidmatan Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Perkhidmatan Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Peranti anda tidak menyokong perkhidmatan Google Play, sedangkan sesetengah aplikasi anda memerlukannya. Sila hubungi pengilang untuk bantuan."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Tarikh pada peranti kelihatan tidak betul. Sila semak tarikh pada peranti."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Kemas kini"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Log masuk"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Log masuk dengan Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikasi cuba menggunakan versi Perkhidmatan Google Play yang rosak."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Perkhidmatan Google Play perlu didayakan untuk menggunakan aplikasi."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Perkhidmatan Google Play perlu dipasang untuk mengguankan aplikasi."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Perkhidmatan Google Play perlu dikemas kini untuk menggunakan aplikasi."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Ralat perkhidmatan Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Diminta oleh <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-nb/strings.xml b/platform/android/libs/google_play_services/res/values-nb/strings.xml deleted file mode 100644 index 1e16bbb6d2..0000000000 --- a/platform/android/libs/google_play_services/res/values-nb/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Installer Google Play Tjenester"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Denne appen kan ikke kjøres uten Google Play Tjenester, som ikke er installert på telefonen din."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Denne appen kan ikke kjøres uten Google Play Tjenester, som ikke er installert på nettbrettet ditt."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Installer Google Play Tjenester"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Aktiver Google Play Tjenester"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Denne appen fungerer ikke med mindre du aktiverer Google Play Tjenester."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Aktiver Google Play Tjenester"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Oppdater Google Play Tjenester"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Denne appen kan ikke kjøres før du oppdaterer Google Play Tjenester."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Nettverksfeil"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Du må ha datatilkobling for å koble deg til Google Play-tjenester."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Ugyldig konto"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Den angitte kontoen finnes ikke på enheten. Velg en annen konto."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Det oppsto et ukjent problem med Google Play Tjenester."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play-tjenester"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play Tjenester, som noen av appene er avhengige av, støttes ikke av enheten. Ta kontakt med produsenten for å få hjelp."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Datoen på enheten ser ut til å være feil. Sjekk datoen på enheten."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Oppdater"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Logg på"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Logg inn med Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"En app prøvde å bruke en skadet versjon av Google Play Tjenester."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"En app krever Google Play Tjenester for å aktiveres."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"En app krever at Google Play Tjenester installeres."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"En app krever at Google Play Tjenester oppdateres."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play Tjenester-feil"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Forespurt av <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-nl/strings.xml b/platform/android/libs/google_play_services/res/values-nl/strings.xml deleted file mode 100644 index f38db5fcdb..0000000000 --- a/platform/android/libs/google_play_services/res/values-nl/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play-services ophalen"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Deze app kan niet worden uitgevoerd zonder Google Play-services die ontbreken op uw telefoon."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Deze app kan niet worden uitgevoerd zonder Google Play-services die ontbreken op uw tablet."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play-services ophalen"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play-services inschakelen"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Deze app werkt niet, tenzij u Google Play-services inschakelt."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play-services inschak."</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play-services bijwerken"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Deze app kan niet worden uitgevoerd, tenzij u Google Play-services bijwerkt."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Netwerkfout"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Er is een gegevensverbinding nodig om verbinding te kunnen maken met Google Play-services."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Ongeldig account"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Het gespecificeerde account bestaat niet op dit apparaat. Kies een ander account."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Onbekend probleem met Google Play-services."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play-services"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play-services, dat vereist is voor een aantal van uw applicaties, wordt niet ondersteund door uw apparaat. Neem contact op met de fabrikant voor ondersteuning."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"De datum op het apparaat lijkt onjuist. Controleer de datum op het apparaat."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Bijwerken"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Inloggen"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Inloggen met Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Onjuiste versie van Google Play-services wordt gebruikt."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Google Play-services moet zijn ingeschakeld voor een applicatie."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Google Play-services moet zijn geïnstalleerd voor een applicatie."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Google Play-services moet worden geüpdatet voor een applicatie."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Fout met Google Play-services"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Aangevraagd door <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-pl/strings.xml b/platform/android/libs/google_play_services/res/values-pl/strings.xml deleted file mode 100644 index 5eba15ff3a..0000000000 --- a/platform/android/libs/google_play_services/res/values-pl/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Pobierz Usługi Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ta aplikacja nie będzie działać bez Usług Google Play, których nie masz na telefonie."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ta aplikacja nie będzie działać bez Usług Google Play, których nie masz na tablecie."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Pobierz Usługi Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Włącz Usługi Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ta aplikacja nie będzie działać, jeśli nie włączysz Usług Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Włącz Usługi Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Aktualizuj Usługi Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ta aplikacja nie będzie działać, jeśli nie zaktualizujesz Usług Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Błąd sieci"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Korzystanie z usług Google Play wymaga połączenia z internetem."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Nieprawidłowe konto"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Podanego konta nie ma na tym urządzeniu. Wybierz inne konto."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Nieznany problem z Usługami Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Usługi Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Usługi Google Play, od których zależy działanie niektórych aplikacji, nie są obsługiwane na Twoim urządzeniu. Skontaktuj się z producentem, by uzyskać pomoc."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Data ustawiona na urządzeniu wydaje się nieprawidłowa. Sprawdź datę ustawioną na urządzeniu."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Aktualizuj"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Zaloguj się"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Zaloguj się przez Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikacja próbowała skorzystać z nieprawidłowej wersji Usług Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Aplikacja wymaga włączenia Usług Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Aplikacja wymaga zainstalowania Usług Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Aplikacja wymaga aktualizacji Usług Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Błąd usług Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Żądanie z aplikacji <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-pt-rBR/strings.xml b/platform/android/libs/google_play_services/res/values-pt-rBR/strings.xml deleted file mode 100644 index 6db462d709..0000000000 --- a/platform/android/libs/google_play_services/res/values-pt-rBR/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Instale o Google Play Services"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu telefone."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu tablet."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Instalar o Google Play Services"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Ative o Google Play Services"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Este aplicativo só funciona com o Google Play Services ativado."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Ativar o Google Play Services"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Atualize o Google Play Services"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Este aplicativo só funciona com uma versão atualizada do Google Play Services."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Erro na rede"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"É necessária uma conexão de dados para conectar ao Google Play Services."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Conta inválida"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"A conta especificada não existe no dispositivo. Escolha outra conta."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problema desconhecido com o Google Play Services."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Play Services"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"O Google Play Services, necessário para alguns dos aplicativos, não é compatível com seu dispositivo. Entre em contato com o fabricante para obter assistência."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"A data no dispositivo parece incorreta. Verifique a data no dispositivo."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Atualizar"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Login"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Fazer login com o Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Um aplicativo tentou usar uma versão errada do Google Play Services."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Um aplicativo requer a ativação do Google Play Services."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Um aplicativo requer a instalação do Google Play Services."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Um aplicativo requer a atualização do Google Play Services."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Ocorreu um erro no Google Play Services"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Solicitado por <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-pt-rPT/strings.xml b/platform/android/libs/google_play_services/res/values-pt-rPT/strings.xml deleted file mode 100644 index 0ceafcb95f..0000000000 --- a/platform/android/libs/google_play_services/res/values-pt-rPT/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Obter serviços do Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Esta aplicação não será executada sem os serviços do Google Play, que estão em falta no seu telemóvel."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Esta aplicação não será executada sem os serviços do Google Play, que estão em falta no seu tablet."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Obter serviços do Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Ativar serviços do Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Esta aplicação não funcionará enquanto não ativar os serviços do Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Ativar serviços do Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Atualizar serviços do Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Esta aplicação não será executada enquanto não atualizar os serviços do Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Erro de Rede"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"É necessária uma ligação de dados para se ligar aos Serviços do Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Conta Inválida"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"A conta especificada não existe neste dispositivo. Escolha uma conta diferente."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problema desconhecido nos serviços do Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Serviços do Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Os serviços do Google Play, dos quais dependem algumas das suas aplicações, não são suportados pelo seu dispositivo. Contacte o fabricante para obter assistência."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"A data no dispositivo parece estar incorreta. Verifique a data no dispositivo."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Atualizar"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Inic. ses."</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Inic. sessão com o Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplicação tentou utiliz. versão incorreta dos Serviços do Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Uma aplicação necessita da ativação dos Serviços do Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Uma aplicação necessita da instalação dos Serviços do Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Uma aplicação necessita da atualização dos Serviços do Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Erro dos serviços do Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Solicitado por <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-pt/strings.xml b/platform/android/libs/google_play_services/res/values-pt/strings.xml deleted file mode 100644 index 6db462d709..0000000000 --- a/platform/android/libs/google_play_services/res/values-pt/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Instale o Google Play Services"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu telefone."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu tablet."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Instalar o Google Play Services"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Ative o Google Play Services"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Este aplicativo só funciona com o Google Play Services ativado."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Ativar o Google Play Services"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Atualize o Google Play Services"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Este aplicativo só funciona com uma versão atualizada do Google Play Services."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Erro na rede"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"É necessária uma conexão de dados para conectar ao Google Play Services."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Conta inválida"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"A conta especificada não existe no dispositivo. Escolha outra conta."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problema desconhecido com o Google Play Services."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Play Services"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"O Google Play Services, necessário para alguns dos aplicativos, não é compatível com seu dispositivo. Entre em contato com o fabricante para obter assistência."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"A data no dispositivo parece incorreta. Verifique a data no dispositivo."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Atualizar"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Login"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Fazer login com o Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Um aplicativo tentou usar uma versão errada do Google Play Services."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Um aplicativo requer a ativação do Google Play Services."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Um aplicativo requer a instalação do Google Play Services."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Um aplicativo requer a atualização do Google Play Services."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Ocorreu um erro no Google Play Services"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Solicitado por <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-ro/strings.xml b/platform/android/libs/google_play_services/res/values-ro/strings.xml deleted file mode 100644 index eb428964ec..0000000000 --- a/platform/android/libs/google_play_services/res/values-ro/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Descărcaţi Servicii Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Această aplicaţie nu poate rula fără Servicii Google Play, care lipsesc de pe telefon."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Această aplicaţie nu poate rula fără Servicii Google Play, care lipsesc de pe tabletă."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Obţineţi Servicii Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Activaţi Servicii Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Această aplicaţie nu va funcţiona decât dacă activaţi Servicii Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Activaţi Servicii Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Actualizaţi Servicii Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Această aplicaţie nu poate rula decât dacă actualizaţi Servicii Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Eroare de reţea"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Este necesară o conexiune de date pentru a vă conecta la serviciile Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Cont nevalid"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Contul menționat nu există pe acest dispozitiv. Alegeți alt cont."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problemă necunoscută privind Servicii Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Servicii Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Gadgetul nu acceptă serviciile Google Play, pe care se bazează unele dintre aplicații. Pentru asistență, contactați producătorul gadgetului."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Data de pe dispozitiv pare să fie incorectă. Verificați data de pe dispozitiv."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Actualizaţi"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Conectați"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Conectați-vă cu Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplicația a încercat să utilizeze o vers. Servicii Google Play greșită"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"O aplicație necesită activarea Serviciilor Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"O aplicație necesită instalarea Serviciilor Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"O aplicație necesită o actualizare pentru Servicii Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Eroare Servicii Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Solicitată de <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-ru/strings.xml b/platform/android/libs/google_play_services/res/values-ru/strings.xml deleted file mode 100644 index c784aae95c..0000000000 --- a/platform/android/libs/google_play_services/res/values-ru/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Установите Сервисы Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Для работы этого приложения требуется установить Сервисы Google Play."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Для работы этого приложения требуется установить Сервисы Google Play."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Установить"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Включите Сервисы Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Для работы этого приложения требуется включить Сервисы Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Включить"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Обновите Сервисы Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Для работы этого приложения требуется обновить Сервисы Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Ошибка сети"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Для работы с Google Play требуется подключение к сети."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Недействительный аккаунт"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Этого аккаунта нет на устройстве. Выберите другой."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Неизвестная ошибка с Сервисами Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Сервисы Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Сервисы Google Play, необходимые для работы некоторых приложений, не поддерживаются на вашем устройстве. Обратитесь к производителю."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Проверьте правильность даты, указанной на устройстве."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Обновить"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Войти"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Войти в аккаунт Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Версия сервисов Google Play неисправна"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Для работы приложения требуется включить сервисы Google Play"</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Для работы приложения требуется установить сервисы Google Play"</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Для работы приложения требуется обновить сервисы Google Play"</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Ошибка сервисов Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Запрос от приложения \"<xliff:g id="APP_NAME">%1$s</xliff:g>\""</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-sk/strings.xml b/platform/android/libs/google_play_services/res/values-sk/strings.xml deleted file mode 100644 index 125d87f6da..0000000000 --- a/platform/android/libs/google_play_services/res/values-sk/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Inštalovať služby Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Na spustenie tejto aplikácie sa vyžadujú služby Google Play, ktoré v telefóne nemáte."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Na spustenie tejto aplikácie sa vyžadujú služby Google Play, ktoré v tablete nemáte."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Inštalovať služby Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Povoliť služby Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Táto aplikácia bude fungovať až po povolení služieb Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Povoliť služby Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Aktualizovať služby Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Túto aplikáciu bude možné spustiť až po aktualizácii služieb Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Chyba siete"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Pripojenie k službám Google Play si vyžaduje dátové pripojenie."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Neplatný účet"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Zadaný účet v tomto zariadení neexistuje. Vyberte iný účet."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Neznámy problém so službami Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Služby Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Niektoré vaše aplikácie vyžadujú služby Google Play, ktoré vo vašom zariadení nie sú podporované. Ak potrebujete pomoc, kontaktujte výrobcu."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Dátum nastavený v zariadení sa zdá byť nesprávny. Skontrolujte ho."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Aktualizovať"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Prihlásiť sa"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Prihlásiť sa do účtu Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikácia sa pokúsila použiť nesprávnu verziu služieb Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Aplikácia vyžaduje povolenie služieb Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Aplikácia vyžaduje inštaláciu služieb Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Aplikácia vyžaduje aktualizáciu služieb Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Chyba služieb Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Vyžiadané aplikáciou <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-sl/strings.xml b/platform/android/libs/google_play_services/res/values-sl/strings.xml deleted file mode 100644 index df5821f94c..0000000000 --- a/platform/android/libs/google_play_services/res/values-sl/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Namestite storitve Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ta aplikacija ne deluje brez storitev Google Play, ki jih ni v telefonu."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ta aplikacija ne deluje brez storitev Google Play, ki jih ni v tabličnem računalniku."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Namestite storitve Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Omogočite storitve Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Aplikacija ne bo delovala, če ne omogočite storitev Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Omogočite storitve Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Posodobite storitve Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ta aplikacija ne deluje, če ne posodobite storitev Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Omrežna napaka"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Za povezavo s storitvami Google Play potrebujete internetno povezavo."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Neveljaven račun"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"V tej napravi ne obstaja navedeni račun. Izberite drugega."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Neznana težava s storitvami Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Storitve Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Vaša naprava na podpira storitev Google Play, ki jih potrebujejo nekatere od vaših aplikacij. Za pomoč se obrnite na izdelovalca."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Videti je, da je datum v napravi napačen. Preverite ga."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Posodobi"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Prijava"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Prijavite se v Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikacija je poskusila uporabiti napačno različico Storitev Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Za delovanje aplikacije morate omogočiti Storitve Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Za delovanje aplikacije morate namestiti Storitve Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Za delovanje aplikacije morate posodobiti Storitve Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Napaka storitev Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Zahtevala aplikacija <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-sr/strings.xml b/platform/android/libs/google_play_services/res/values-sr/strings.xml deleted file mode 100644 index ad0b549547..0000000000 --- a/platform/android/libs/google_play_services/res/values-sr/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Преузимање Google Play услуга"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ова апликација не може да се покрене без Google Play услуга, које недостају на телефону."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ова апликација не може да се покрене без Google Play услуга, које недостају на таблету."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Преузми Google Play услуге"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Омогућавање Google Play услуга"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ова апликација неће функционисати ако не омогућите Google Play услуге."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Омогући Google Play услуге"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Ажурирање Google Play услуга"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ова апликација не може да се покрене ако не ажурирате Google Play услуге."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Грешка на мрежи"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"За повезивање са Google Play услугама потребна је веза за пренос података."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Неважећи налог"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Наведени налог не постоји на овом уређају. Одаберите други налог."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Непознат проблем са Google Play услугама."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play услуге"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play услуге, које су потребне за функционисање неких од апликација, нису подржане на уређају. Контактирајте произвођача да бисте добили помоћ."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Изгледа да су подаци на уређају нетачни. Проверите датум на уређају."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Ажурирај"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Пријави ме"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Пријави ме преко Google-а"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Апликација је покушала да користи лошу верзију Google Play услуга."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Апликација захтева да Google Play услуге буду омогућене."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Апликација захтева инсталирање Google Play услуга."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Апликација захтева ажурирање Google Play услуга."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Грешка Google Play услуга"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Захтева <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-sv/strings.xml b/platform/android/libs/google_play_services/res/values-sv/strings.xml deleted file mode 100644 index 6a10395f4b..0000000000 --- a/platform/android/libs/google_play_services/res/values-sv/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Hämta Google Play Tjänster"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Den här appen kan inte köras utan Google Play Tjänster, som saknas på mobilen."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Den här appen kan inte köras utan Google Play Tjänster, som saknas på surfplattan."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Hämta Google Play Tjänster"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Aktivera Google Play Tjänster"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Du måste aktivera Google Play Tjänster för att den här appen ska fungera."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Aktivera Google Play Tjänster"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Uppdatera Google Play Tjänster"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Du måste uppdatera Google Play Tjänster innan du kan köra den här appen."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Nätverksfel"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"En dataanslutning krävs för att ansluta till Google Plays tjänster."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Ogiltigt konto"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Det angivna kontot finns inte på den här enheten. Välj ett annat konto."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Okänt problem med Google Play Tjänster"</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play-tjänster"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Några av dina appar använder Google Play-tjänster som inte stöds av din enhet. Kontakta tillverkaren om du vill ha hjälp."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Datumet på enheten verkar inte vara rätt. Kontrollera datumet på enheten."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Uppdatera"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Logga in"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Logga in med Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"En olämplig version av Google Play Tjänster anropades av en app."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Google Play Tjänster måste aktiveras för en att app ska fungera."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Google Play Tjänster måste installeras för att en app ska fungera."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Google Play Tjänster måste uppdateras för en app ska fungera."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Fel på Google Play Tjänster"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Begärdes av <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-sw/strings.xml b/platform/android/libs/google_play_services/res/values-sw/strings.xml deleted file mode 100644 index 7f29bf5f2e..0000000000 --- a/platform/android/libs/google_play_services/res/values-sw/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Pata huduma za Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Programu hii haiwezi kuendeshwa bila huduma za Google Play, ambazo hazipo kwenye simu yako."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Programu hii haiwezi kufanya kazi bila huduma za Google Play, ambazo hazipatikani kwenye kompyuta kibao yako."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Pata huduma za Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Wezesha huduma za Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Programu hii haitafanya kazi mpaka utakapowezesha huduma za Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Wezesha huduma za Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Sasisha huduma za Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Programu hii haiwezi kuendeshwa mpaka utakaposasisha huduma za Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Hitilafu ya Mtandao"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Muunganisho wa data unahitajika ili kuunganisha kwenye huduma za Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Akaunti Batili"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Akaunti iliyobainishwa haipo kwenye kifaa hiki. Tafadhali chagua akaunti tofauti."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Suala lisilojulikana na huduma za Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Huduma za Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Huduma za Google Play, ambazo baadhi ya programu zako zinategemea, si linganifu na kifaa chako. Tafadhali wasiliana na mtengenezaji kwa usaidizi."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Inaeonekana tarehe ya kifaa sio sahihi. Tafadhali angalia tarehe ya kifaa."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Sasisha"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Ingia"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Ingia ukitumia Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Programu ilijaribu kutumia toleo baya la Huduma za Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Programu inahitaji Huduma za Google Play ili kuwashwa."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Programu inahitaji usakinishaji wa Huduma za Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Programu inahitaji sasisho la Huduma za Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Hitilafu kwenye Huduma za Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Imeombwa na <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-th/strings.xml b/platform/android/libs/google_play_services/res/values-th/strings.xml deleted file mode 100644 index 6f098fe801..0000000000 --- a/platform/android/libs/google_play_services/res/values-th/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"รับบริการ Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"แอปพลิเคชันนี้จะไม่ทำงานหากไม่มีบริการ Google Play ซึ่งไม่มีในโทรศัพท์ของคุณ"</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"แอปพลิเคชันนี้จะไม่ทำงานหากไม่มีบริการ Google Play ซึ่งไม่มีในแท็บเล็ตของคุณ"</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"รับบริการ Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"เปิดใช้งานบริการ Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"แอปพลิเคชันนี้จะไม่ทำงานจนกว่าคุณจะเปิดใช้งานบริการ Google Play"</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"เปิดใช้งานบริการ Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"อัปเดตบริการ Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"แอปพลิเคชันนี้จะไม่ทำงานจนกว่าคุณจะอัปเดตบริการ Google Play"</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"ข้อผิดพลาดของเครือข่าย"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"ต้องมีการเขื่อมต่อข้อมูลเพื่อเชื่อมต่อกับบริการ Google Play"</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"บัญชีไม่ถูกต้อง"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"บัญชีที่ระบุไม่มีอยู่บนอุปกรณ์นี้ โปรดเลือกบัญชีอื่น"</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"ปัญหาที่ไม่รู้จักของบริการ Google Play"</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"บริการ Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"บริการ Google Play ซึ่งใช้งานในบางแอปพลิเคชัน ไม่ได้รับการสนับสนุนโดยอุปกรณ์ของคุณ โปรดติดต่อผู้ผลิตเพื่อขอรับความช่วยเหลือ"</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"วันที่บนอุปกรณ์ไม่ถูกต้อง โปรดตรวจสอบวันที่บนอุปกรณ์"</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"อัปเดต"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"ลงชื่อใช้"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"ลงชื่อเข้าใช้ด้วย Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"แอปพลิเคชันหนึ่งพยายามใช้เวอร์ชันที่ไม่เหมาะสมของบริการ Google Play"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"แอปพลิเคชันหนึ่งจำเป็นต้องมีบริการ Google Play เพื่อเปิดใช้งาน"</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"แอปพลิเคชันหนึ่งจำเป็นต้องมีการติดตั้งบริการ Google Play"</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"แอปพลิเคชันหนึ่งจำเป็นต้องมีการอัปเดตสำหรับบริการ Google Play"</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"ข้อผิดพลาดของบริการ Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"ขอโดย <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-tl/strings.xml b/platform/android/libs/google_play_services/res/values-tl/strings.xml deleted file mode 100644 index 337f73c0cd..0000000000 --- a/platform/android/libs/google_play_services/res/values-tl/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Kumuha ng mga serbisyo ng Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Hindi tatakbo ang app na ito nang wala ang mga serbisyo ng Google Play, na wala sa iyong telepono."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Hindi gagana ang app na ito nang wala ang mga serbisyo ng Google Play, na wala sa iyong tablet."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Kumuha ng Google Play services"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Paganahin ang Google Play services"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Hindi gagana ang app na ito maliban kung papaganahin mo ang mga serbisyo ng Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Enable Google Play services"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"I-update ang mga serbisyo ng Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Hindi gagana ang app na ito maliban kung i-a-update mo ang mga serbisyo ng Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"May Error sa Network"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Kailangan ng koneksyon ng data upang makakonekta sa mga serbisyo ng Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Di-wasto ang Account"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Hindi umiiral ang tinukoy na account sa device na ito. Mangyaring pumili ng ibang account."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"May hindi alam na isyu sa mga serbisyo ng Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Mga serbisyo ng Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Ang mga serbisyo ng Google Play, kung saan nakadepende ang ilan sa iyong mga application, ay hindi sinusuportahan ng iyong device. Mangyaring makipag-ugnay sa manufacturer para sa tulong."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Mukhang hindi tama ang petsa sa device. Pakisuri ang petsa sa device."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"I-update"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Sign in"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Mag-sign in sa Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"May app na sumubok ng maling bersyon ng Mga Serbisyo ng Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Kailangan ng application na na-enable ang Mga Serbisyo ng Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Kailangan ng application na ma-install ang Serbisyo ng Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Kailangan ng application na i-update ang Mga Serbisyo ng Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Error sa mga serbisyo ng Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Hiniling ng <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-tr/strings.xml b/platform/android/libs/google_play_services/res/values-tr/strings.xml deleted file mode 100644 index 17e61e5fcb..0000000000 --- a/platform/android/libs/google_play_services/res/values-tr/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play hizmetlerini edinin"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Google Play Hizmetleri telefonunuzda yok ve bu uygulama Google Play Hizmetleri olmadan çalışmaz."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Google Play Hizmetleri tabletinizde yok ve bu uygulama Google Play Hizmetleri olmadan çalışmaz."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play hizmetlerini edin"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play hizmetlerini etkinleştir"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Bu uygulama, Google Play Hizmetleri etkinleştirilmeden çalışmaz"</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play hizmetlerini etkinleştir"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play hizmetlerini güncelle"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Bu uygulama Google Play Hizmetleri güncellenmeden çalışmaz."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Ağ Hatası"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play hizmetlerine bağlanmak için bir veri bağlantısı gerekiyor."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Geçersiz Hesap"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Belirtilen hesap bu cihazda mevcut değil. Lütfen farklı bir hesap seçin."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play hizmetleriyle ilgili bilinmeyen sorun."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play hizmetleri"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Cihazınız, uygulamalarınızdan bazıları için gerekli olan Google Play hizmetlerini desteklemiyor. Lütfen yardım için üreticiyle iletişim kurun."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Cihazdaki tarih doğru görünmüyor. Lütfen cihazda ayarlı tarihi kontrol edin."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Güncelle"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Oturum aç"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Google\'da oturum aç"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Bir uygulama, Google Play Hizmetleri\'nin bozuk bir sürümünü kullanmayı denedi."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Bir uygulama, Google Play Hizmetleri\'nin etkin olmasını gerektiriyor."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Bir uygulama, Google Play Hizmetleri\'nin yüklenmesini gerektiriyor."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Bir uygulama, Google Play Hizmetleri için bir güncelleme gerektiriyor."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play hizmetleri hatası"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"İstekte bulunan: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-uk/strings.xml b/platform/android/libs/google_play_services/res/values-uk/strings.xml deleted file mode 100644 index d657aea68d..0000000000 --- a/platform/android/libs/google_play_services/res/values-uk/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Установити Google Play Послуги"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ця програма не запуститься без Google Play Послуг, яких немає у вашому телефоні."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ця програма не запуститься без Google Play Послуг, яких немає на вашому планшетному ПК."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Установити Google Play Послуги"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Увімкнути Google Play Послуги"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ця програма не працюватиме, поки ви не ввімкнете Google Play Послуги."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Увімкнути Google Play Послуги"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Оновити Google Play Послуги"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ця програма не запуститься, поки ви не оновите Google Play Послуги."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Помилка мережі"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Для під’єднання до сервісів Google Play потрібне з’єднання з мережею."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Недійсний обліковий запис"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Указаний обліковий запис не існує на цьому пристрої. Виберіть інший обліковий запис."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play Послуги – невідома проблема."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Сервіси Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Ваш пристрій не підтримує Сервіси Google Play, від яких залежить робота деяких програм. Зверніться по допомогу до виробника."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Схоже, на пристрої вказано неправильну дату. Перевірте її."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Оновити"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Увійти"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Увійти в обл.запис Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Програма спробувала застосувати хибну версію Сервісів Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Щоб програма працювала, потрібно ввімкнути Сервіси Google Play."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Щоб програма працювала, потрібно встановити Сервіси Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Щоб програма працювала, потрібно оновити Сервіси Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Помилка Сервісів Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Запит від програми <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-vi/strings.xml b/platform/android/libs/google_play_services/res/values-vi/strings.xml deleted file mode 100644 index a0434a08ac..0000000000 --- a/platform/android/libs/google_play_services/res/values-vi/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Cài đặt dịch vụ của Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ứng dụng này sẽ không chạy nếu không có dịch vụ của Google Play. Điện thoại của bạn bị thiếu dịch vụ này."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ứng dụng này sẽ không chạy nếu không có dịch vụ của Google Play. Máy tính bảng của bạn bị thiếu dịch vụ này."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Cài đặt dịch vụ của Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Bật dịch vụ của Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ứng dụng này sẽ không hoạt động trừ khi bạn bật dịch vụ của Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Bật dịch vụ của Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Cập nhật dịch vụ của Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ứng dụng này sẽ không chạy trừ khi bạn cập nhật dịch vụ của Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Lỗi mạng"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Cần có kết nối dữ liệu để kết nối với các dịch vụ của Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Tài khoản không hợp lệ"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Tài khoản đã chỉ định không tồn tại trên thiết bị này. Vui lòng chọn một tài khoản khác."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Sự cố không xác định với dịch vụ của Google Play."</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Dịch vụ của Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Các dịch vụ của Google Play mà một số ứng dụng của bạn dựa vào không được thiết bị của bạn hỗ trợ. Vui lòng liên hệ với nhà sản xuất để được hỗ trợ."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Ngày trên thiết bị có vẻ không chính xác. Vui lòng kiểm tra ngày trên thiết bị."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Cập nhật"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Đăng nhập"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Đăng nhập bằng Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Ứng dụng đã cố sử dụng phiên bản không đúng của Dịch vụ của Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Ứng dụng yêu cầu Dịch vụ của Google Play phải được bật."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Ứng dụng yêu cầu cài đặt Dịch vụ của Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Ứng dụng yêu cầu cập nhật dành cho Dịch vụ Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Lỗi dịch vụ của Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Được yêu cầu bởi <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-zh-rCN/strings.xml b/platform/android/libs/google_play_services/res/values-zh-rCN/strings.xml deleted file mode 100644 index 4339e3eb01..0000000000 --- a/platform/android/libs/google_play_services/res/values-zh-rCN/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"获取 Google Play 服务"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"您的手机中没有 Google Play 服务,您必须先安装该服务才能运行此应用。"</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"您的平板电脑中没有 Google Play 服务,您必须先安装该服务才能运行此应用。"</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"获取 Google Play 服务"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"启用 Google Play 服务"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"您必须先启用 Google Play 服务才能运行此应用。"</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"启用 Google Play 服务"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"更新 Google Play 服务"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"您必须先更新 Google Play 服务才能运行此应用。"</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"网络错误"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"您必须有数据网络连接才能接入 Google Play 服务。"</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"无效帐户"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"此设备上不存在指定的帐户,请选择其他帐户。"</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play 服务出现未知问题。"</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play 服务"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"您的设备不支持部分应用所依赖的 Google Play 服务。请与设备制造商联系,以寻求帮助。"</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"设备上的日期似乎不正确,请在设备上检查日期。"</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"更新"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"登录"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"使用 Google 帐户登录"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"某个应用尝试使用的 Google Play 服务版本有误。"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"某个应用要求启用 Google Play 服务。"</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"某个应用要求安装 Google Play 服务。"</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"某个应用要求更新 Google Play 服务。"</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play 服务出错"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"由“<xliff:g id="APP_NAME">%1$s</xliff:g>”发出"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-zh-rHK/strings.xml b/platform/android/libs/google_play_services/res/values-zh-rHK/strings.xml deleted file mode 100644 index abe6cf1457..0000000000 --- a/platform/android/libs/google_play_services/res/values-zh-rHK/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"取得 Google Play 服務"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"您的手機未安裝 Google Play 服務,安裝後才能執行這個應用程式。"</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"您的平板電腦未安裝 Google Play 服務,安裝後才能執行這個應用程式。"</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"取得 Google Play 服務"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"啟用 Google Play 服務"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"您必須啟用 Google Play 服務,才能執行這個應用程式。"</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"啟用 Google Play 服務"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"更新 Google Play 服務"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"您必須更新 Google Play 服務,才能執行這個應用程式。"</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"網絡錯誤"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"要連接 Google Play 服務,必需數據連線。"</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"無效的帳戶"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"這個裝置上沒有您指定的帳戶,請選擇其他帳戶。"</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play 服務出現不明問題。"</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play 服務"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"您的裝置不支援部分應用程式所需的 Google Play 服務。如需協助,請與您的裝置製造商聯絡。"</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"裝置上的日期看來不正確,請檢查裝置上的日期。"</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"更新"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"登入"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"登入 Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"應用程式嘗試使用錯誤版本的「Google Play 服務」。"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"必須啟用「Google Play 服務」,才能使用應用程式。"</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"必須安裝「Google Play 服務」,才能使用應用程式。"</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"必須更新「Google Play 服務」,才能使用應用程式。"</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play 服務錯誤"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"「<xliff:g id="APP_NAME">%1$s</xliff:g>」提出要求"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-zh-rTW/strings.xml b/platform/android/libs/google_play_services/res/values-zh-rTW/strings.xml deleted file mode 100644 index a66018ab52..0000000000 --- a/platform/android/libs/google_play_services/res/values-zh-rTW/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"取得 Google Play 服務"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"您的手機並未安裝 Google Play 服務,所以無法執行這個應用程式。"</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"您的平板電腦並未安裝 Google Play 服務,所以無法執行這個應用程式。"</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"取得 Google Play 服務"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"啟用 Google Play 服務"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"您必須啟用 Google Play 服務,這個應用程式才能運作。"</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"啟用 Google Play 服務"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"更新 Google Play 服務"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"您必須更新 Google Play 服務,才能執行這個應用程式。"</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"網路錯誤"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"需要數據連線才能連上 Google Play 服務。"</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"無效的帳戶"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"這個裝置上沒有您所指定的帳戶,請選擇其他帳戶。"</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play 服務發生不明問題。"</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play 服務"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"您的裝置不支援部分應用程式所需的 Google Play 服務。如需協助,請與您的裝置製造商聯絡。"</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"裝置上的日期似乎不正確,請檢查裝置上的日期。"</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"更新"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"登入"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"使用 Google 帳戶登入"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"應用程式嘗試使用的 Google Play 服務版本有誤。"</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"應用程式需要啟用 Google Play 服務。"</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"應用程式需要安裝 Google Play 服務。"</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"應用程式需要更新 Google Play 服務。"</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play 服務錯誤"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"提出要求的應用程式:<xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values-zu/strings.xml b/platform/android/libs/google_play_services/res/values-zu/strings.xml deleted file mode 100644 index 572d9a52c4..0000000000 --- a/platform/android/libs/google_play_services/res/values-zu/strings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="common_google_play_services_install_title" msgid="26645092511305524">"Thola amasevisi e-Google Play"</string> - <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Lolu hlelo lokusebenza ngeke lusebenze ngaphandle kwamasevisi e-Google Play, angekho efonini yakho."</string> - <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Lolu hlelo lokusebenza ngeke lusebenze ngaphandle kwamasevisi e-Google Play, angekho kuthebulethi yakho."</string> - <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Thola amasevisi e-Google Play"</string> - <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Nika amandla amasevisi e-Google Play"</string> - <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Lolu hlelo lokusebenza ngeke lusebenze ngaphandle nje kokuthi unike amandla amasevisi e-Google Play."</string> - <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Nika amandla amasevisi e-Google Play"</string> - <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Buyekeza amasevisi e-Google Play"</string> - <string name="common_google_play_services_update_text" msgid="448354684997260580">"Lolu hlelo lokusebenza ngeke lusebenze ngaphandle nje kokuthi ubuyekeze amasevisi e-Google Play."</string> - <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Iphutha lenethiwekhi"</string> - <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Kudingeka ukuxhumeka kwedatha ukuze kuxhunyekwe kumasevisi we-Google Play."</string> - <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"I-Akhawunti engavumelekile"</string> - <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"I-Akhawunti ecacisiwe ayikho kule divayisi. Sicela ukhethe i-akhawunti ehlukile."</string> - <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Indaba engaziwa yamasevisi we-Google Play"</string> - <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Amasevisi we-Google Play"</string> - <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Amasevisi we-Google Play, okungukuthi ezinye izinhlelo zakho zithembele kuwo, awasekelwe yidivayisi yakho. Sicela uxhumane nomkhiqizi ukuze uthole usizo."</string> - <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Idethi kudivayisi ibonakala ingalungile. Sicela uhlole idethi kudivayisi."</string> - <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Isibuyekezo"</string> - <string name="common_signin_button_text" msgid="9071884888741449141">"Ngena ngemvume"</string> - <string name="common_signin_button_text_long" msgid="2429381841831957106">"Ngena ngemvume nge-Google"</string> - - <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Uhlelo lokusebenza luzame ukusebenzisa inguqulo embi yamasevisi we-Google Play."</string> - <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Uhlelo lokusebenza ludinga amasevisi we-Google Play ukuze anikwe amandla."</string> - <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Uhlelo lokusebenza ludinga ukufakwa kwamasevisi we-Google Play."</string> - <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Uhlelo lokusebenza ludinga isibuyekezo samasevisi we-Google Play."</string> - <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Iphutha lamasevisi we-Google Play"</string> - <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Kucelwe yi-<xliff:g id="APP_NAME">%1$s</xliff:g>"</string> -</resources> diff --git a/platform/android/libs/google_play_services/res/values/ads_attrs.xml b/platform/android/libs/google_play_services/res/values/ads_attrs.xml deleted file mode 100644 index 4e97a734a6..0000000000 --- a/platform/android/libs/google_play_services/res/values/ads_attrs.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2013 Google Inc. All Rights Reserved. --> -<resources> - <declare-styleable name="AdsAttrs"> - <!-- - The size of the ad. It must be one of BANNER, FULL_BANNER, LEADERBOARD, - MEDIUM_RECTANGLE, SMART_BANNER, WIDE_SKYSCRAPER, or - <width>x<height>. - --> - <attr name="adSize" format="string"/> - - <!-- - A comma-separated list of the supported ad sizes. The sizes must be one of - BANNER, FULL_BANNER, LEADERBOARD, MEDIUM_RECTANGLE, SMART_BANNER, - WIDE_SKYSCRAPER, or <width>x<height>. - --> - <attr name="adSizes" format="string"/> - - <!-- The ad unit ID. --> - <attr name="adUnitId" format="string"/> - </declare-styleable> -</resources> diff --git a/platform/android/libs/google_play_services/res/values/colors.xml b/platform/android/libs/google_play_services/res/values/colors.xml deleted file mode 100644 index 6b2740a509..0000000000 --- a/platform/android/libs/google_play_services/res/values/colors.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<resources> - <!-- Sign-in Button Colors --> - <color name="common_signin_btn_dark_text_default">@android:color/white</color> - <color name="common_signin_btn_dark_text_pressed">@android:color/white</color> - <color name="common_signin_btn_dark_text_disabled">#FFAAAAAA</color> - <color name="common_signin_btn_dark_text_focused">@android:color/white</color> - <color name="common_signin_btn_light_text_default">#FF737373</color> - <color name="common_signin_btn_light_text_pressed">@android:color/white</color> - <color name="common_signin_btn_light_text_disabled">#FFAAAAAA</color> - <color name="common_signin_btn_light_text_focused">#FF737373</color> - <color name="common_signin_btn_default_background">#FFDD4B39</color> - <color name="common_action_bar_splitter">#d2d2d2</color> -</resources>
\ No newline at end of file diff --git a/platform/android/libs/google_play_services/res/values/maps_attrs.xml b/platform/android/libs/google_play_services/res/values/maps_attrs.xml deleted file mode 100644 index aaf65c529e..0000000000 --- a/platform/android/libs/google_play_services/res/values/maps_attrs.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2012 Google Inc. All Rights Reserved. --> -<resources> - <declare-styleable name="MapAttrs"> - <attr name="mapType" format="enum"> - <enum name="none" value="0"/> - <enum name="normal" value="1"/> - <enum name="satellite" value="2"/> - <enum name="terrain" value="3"/> - <enum name="hybrid" value="4"/> - </attr> - <attr name="cameraBearing" format="float"/> - <attr name="cameraTargetLat" format="float"/> - <attr name="cameraTargetLng" format="float"/> - <attr name="cameraTilt" format="float"/> - <attr name="cameraZoom" format="float"/> - <attr name="uiCompass" format="boolean"/> - <attr name="uiRotateGestures" format="boolean"/> - <attr name="uiScrollGestures" format="boolean"/> - <attr name="uiTiltGestures" format="boolean"/> - <attr name="uiZoomControls" format="boolean"/> - <attr name="uiZoomGestures" format="boolean"/> - <attr name="useViewLifecycle" format="boolean"/> - <attr name="zOrderOnTop" format="boolean"/> - </declare-styleable> -</resources> diff --git a/platform/android/libs/google_play_services/res/values/strings.xml b/platform/android/libs/google_play_services/res/values/strings.xml deleted file mode 100644 index 3e8731e056..0000000000 --- a/platform/android/libs/google_play_services/res/values/strings.xml +++ /dev/null @@ -1,111 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - - <!-- Title of confirmation dialog informing user that they need to install - Google Play services (from Play Store) [CHAR LIMIT=40] --> - <string name="common_google_play_services_install_title" msgid="7215213145546190223">Get Google Play services</string> - - <!-- (For phones) Message in confirmation dialog informing user that - they need to install Google Play services (from Play Store) [CHAR LIMIT=NONE] --> - <string name="common_google_play_services_install_text_phone" msgid="2122112764540849864">This app won\'t run without Google Play services, which are missing from your phone.</string> - - <!-- (For tablets) Message in confirmation dialog informing user that - they need to install Google Play services (from Play Store) [CHAR LIMIT=NONE] --> - <string name="common_google_play_services_install_text_tablet" msgid="7351599665250191022">This app won\'t run without Google Play services, which are missing from your tablet.</string> - - <!-- Button in confirmation dialog for installing Google Play services [CHAR LIMIT=40] --> - <string name="common_google_play_services_install_button" msgid="7153882981874058840">Get Google Play services</string> - - <!-- Title of confirmation dialog informing user they need to enable - Google Play services in application settings [CHAR LIMIT=40] --> - <string name="common_google_play_services_enable_title" msgid="5122002158466380389">Enable Google Play services</string> - - <!-- Message in confirmation dialog informing user they need to enable - Google Play services in application settings [CHAR LIMIT=NONE] --> - <string name="common_google_play_services_enable_text" msgid="227660514972886228">This app won\'t work unless you enable Google Play services.</string> - - <!-- Button in confirmation dialog to enable Google Play services. Clicking it - will direct user to application settings of Google Play services where they - can enable it [CHAR LIMIT=40] --> - <string name="common_google_play_services_enable_button" msgid="2523291102206661146">Enable Google Play services</string> - - <!-- Title of confirmation dialog informing user that they need to update - Google Play services (from Play Store) [CHAR LIMIT=40] --> - <string name="common_google_play_services_update_title" msgid="1788179980625863495">Update Google Play services</string> - - <!-- Message in confirmation dialog informing user that they need to update - Google Play services (from Play Store) [CHAR LIMIT=NONE] --> - <string name="common_google_play_services_update_text" msgid="9053896323427875356">This app won\'t run unless you update Google Play services.</string> - - <!-- Title of confirmation dialog informing the user that a network error occurred. [CHAR LIMIT=40] --> - <string name="common_google_play_services_network_error_title">Network Error</string> - - <!-- Message in confirmation dialog informing the user that a network error occurred. [CHAR LIMIT=NONE] --> - <string name="common_google_play_services_network_error_text">A data connection is required to connect to Google Play services.</string> - - <!-- Title of confirmation dialog informing the user that they provided an invalid account. [CHAR LIMIT=40] --> - <string name="common_google_play_services_invalid_account_title">Invalid Account</string> - - <!-- Message in confirmation dialog informing the user that they provided an invalid account. [CHAR LIMIT=NONE] --> - <string name="common_google_play_services_invalid_account_text">The specified account does not exist on this device. Please choose a different account.</string> - - <!-- Message in confirmation dialog informing user there is an unknown issue in Google Play - services [CHAR LIMIT=NONE] --> - <string name="common_google_play_services_unknown_issue">Unknown issue with Google Play services.</string> - - <!-- Title of confirmation dialog informing user that Google Play services is not supported on their device [CHAR LIMIT=40] --> - <string name="common_google_play_services_unsupported_title">Google Play services</string> - - <!-- Message in confirmation dialog informing user that Google Play services is not supported on their device [CHAR LIMIT=NONE] --> - <string name="common_google_play_services_unsupported_text">Google Play services, which some of your applications rely on, is not supported by your device. Please contact the manufacturer for assistance.</string> - - <!-- Message in confirmation dialog informing user that date on the device is not correct, - causing certificate checks to fail. [CHAR LIMIT=NONE] --> - <string name="common_google_play_services_unsupported_date_text">The date on the device appears to be incorrect. Please check the date on the device.</string> - - <!-- Button in confirmation dialog for updating Google Play services [CHAR LIMIT=40] --> - <string name="common_google_play_services_update_button" msgid="6556509956452265614">Update</string> - - <!-- Sign-in button text [CHAR LIMIT=15] --> - <string name="common_signin_button_text">Sign in</string> - - <!-- Long form sign-in button text [CHAR LIMIT=30] --> - <string name="common_signin_button_text_long">Sign in with Google</string> - - - <!-- Auth client code resources (prefix with auth_client --><skip /> - <!-- Title for notification shown when a bad version of GooglePlayServices - has been installed and needs correction for an application to work. - [CHAR LIMIT=70] --> - <string name="auth_client_using_bad_version_title"> - An application attempted to use a bad version of Google Play Services. - </string> - <!-- Title for notification shown when GooglePlayServices needs to be - enabled for a application to work. [CHAR LIMIT=70] --> - <string name="auth_client_needs_enabling_title"> - An application requires Google Play Services to be enabled. - </string> - <!-- Title for notification shown when GooglePlayServices needs to be - installed for a application to work. [CHAR LIMIT=70] --> - <string name="auth_client_needs_installation_title"> - An application requires installation of Google Play Services. - </string> - <!-- Title for notification shown when GooglePlayServices needs to be - udpated for a application to work. [CHAR LIMIT=70] --> - <string name="auth_client_needs_update_title"> - An application requires an update for Google Play Services. - </string> - - <!-- Title for notification shown when GooglePlayServices is unavailable [CHAR LIMIT=42] --> - <string name="auth_client_play_services_err_notification_msg">Google Play services error</string> - - <!-- Requested by string saying which app requested the notification. [CHAR LIMIT=42] --> - <string name="auth_client_requested_by_msg">Requested by <xliff:g id="app_name">%1$s</xliff:g></string> - <!-- End Auth client resources --><skip /> - - <!-- Location client code resources (prefix with location_client) --> - - <string name="location_client_powered_by_google">Powered by Google</string> - - <!-- End location client resources --> -</resources> diff --git a/platform/android/libs/google_play_services/res/values/version.xml b/platform/android/libs/google_play_services/res/values/version.xml deleted file mode 100644 index 1e7fd4e7ef..0000000000 --- a/platform/android/libs/google_play_services/res/values/version.xml +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <integer name="google_play_services_version">4323000</integer> -</resources> diff --git a/platform/android/libs/google_play_services/src/android/UnusedStub.java b/platform/android/libs/google_play_services/src/android/UnusedStub.java deleted file mode 100644 index d546b0ba9f..0000000000 --- a/platform/android/libs/google_play_services/src/android/UnusedStub.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package android; - -// Stub java file to make inclusion into some IDE's work. -public final class UnusedStub { - private UnusedStub() { } -} diff --git a/platform/android/libs/play_licensing/AndroidManifest.xml b/platform/android/libs/play_licensing/AndroidManifest.xml deleted file mode 100644 index c7849130c3..0000000000 --- a/platform/android/libs/play_licensing/AndroidManifest.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2010 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.google.android.vending.licensing" - android:versionCode="2" - android:versionName="1.5"> - <!-- Devices >= 3 have version of Android Market that supports licensing. --> - <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="15" /> - <!-- Required permission to check licensing. --> - <uses-permission android:name="com.android.vending.CHECK_LICENSE" /> -</manifest> diff --git a/platform/android/libs/play_licensing/build.xml b/platform/android/libs/play_licensing/build.xml deleted file mode 100644 index 0e800d6b9b..0000000000 --- a/platform/android/libs/play_licensing/build.xml +++ /dev/null @@ -1,92 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="play_licensing" default="help"> - - <!-- The local.properties file is created and updated by the 'android' tool. - It contains the path to the SDK. It should *NOT* be checked into - Version Control Systems. --> - <property file="local.properties" /> - - <!-- The ant.properties file can be created by you. It is only edited by the - 'android' tool to add properties to it. - This is the place to change some Ant specific build properties. - Here are some properties you may want to change/update: - - source.dir - The name of the source directory. Default is 'src'. - out.dir - The name of the output directory. Default is 'bin'. - - For other overridable properties, look at the beginning of the rules - files in the SDK, at tools/ant/build.xml - - Properties related to the SDK location or the project target should - be updated using the 'android' tool with the 'update' action. - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. - - --> - <property file="ant.properties" /> - - <!-- if sdk.dir was not set from one of the property file, then - get it from the ANDROID_HOME env var. - This must be done before we load project.properties since - the proguard config can use sdk.dir --> - <property environment="env" /> - <condition property="sdk.dir" value="${env.ANDROID_HOME}"> - <isset property="env.ANDROID_HOME" /> - </condition> - - <!-- The project.properties file is created and updated by the 'android' - tool, as well as ADT. - - This contains project specific properties such as project target, and library - dependencies. Lower level build properties are stored in ant.properties - (or in .classpath for Eclipse projects). - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. --> - <loadproperties srcFile="project.properties" /> - - <!-- quick check on sdk.dir --> - <fail - message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable." - unless="sdk.dir" - /> - - <!-- - Import per project custom build rules if present at the root of the project. - This is the place to put custom intermediary targets such as: - -pre-build - -pre-compile - -post-compile (This is typically used for code obfuscation. - Compiled code location: ${out.classes.absolute.dir} - If this is not done in place, override ${out.dex.input.absolute.dir}) - -post-package - -post-build - -pre-clean - --> - <import file="custom_rules.xml" optional="true" /> - - <!-- Import the actual build file. - - To customize existing targets, there are two options: - - Customize only one target: - - copy/paste the target into this file, *before* the - <import> task. - - customize it to your needs. - - Customize the whole content of build.xml - - copy/paste the content of the rules files (minus the top node) - into this file, replacing the <import> task. - - customize to your needs. - - *********************** - ****** IMPORTANT ****** - *********************** - In all cases you must update the value of version-tag below to read 'custom' instead of an integer, - in order to avoid having your file be overridden by tools such as "android update project" - --> - <!-- version-tag: 1 --> - <import file="${sdk.dir}/tools/ant/build.xml" /> - -</project> diff --git a/platform/android/libs/play_licensing/proguard-project.txt b/platform/android/libs/play_licensing/proguard-project.txt deleted file mode 100644 index f2fe1559a2..0000000000 --- a/platform/android/libs/play_licensing/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/platform/android/libs/play_licensing/project.properties b/platform/android/libs/play_licensing/project.properties deleted file mode 100644 index f28bc833e1..0000000000 --- a/platform/android/libs/play_licensing/project.properties +++ /dev/null @@ -1,12 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -android.library=true -# Project target. -target=android-15 diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index e5d11bef69..207e4499bc 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/os_android.h b/platform/android/os_android.h index 94c6250ae8..3e42db8fb1 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/platform_config.h b/platform/android/platform_config.h index 1e7d066bb9..143f16c1fa 100644 --- a/platform/android/platform_config.h +++ b/platform/android/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/project.properties.template b/platform/android/project.properties.template deleted file mode 100644 index 00cacd72bc..0000000000 --- a/platform/android/project.properties.template +++ /dev/null @@ -1,15 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -#android.library=true -target=android-19 diff --git a/platform/android/thread_jandroid.cpp b/platform/android/thread_jandroid.cpp index 9314a1c013..1425e23c73 100644 --- a/platform/android/thread_jandroid.cpp +++ b/platform/android/thread_jandroid.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/thread_jandroid.h b/platform/android/thread_jandroid.h index 051f4e2c3d..c8ad6c8735 100644 --- a/platform/android/thread_jandroid.h +++ b/platform/android/thread_jandroid.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/audio_driver_bb10.cpp b/platform/bb10/audio_driver_bb10.cpp index f12625d3b8..ef8adaf061 100644 --- a/platform/bb10/audio_driver_bb10.cpp +++ b/platform/bb10/audio_driver_bb10.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/audio_driver_bb10.h b/platform/bb10/audio_driver_bb10.h index 82774bc533..0148448511 100644 --- a/platform/bb10/audio_driver_bb10.h +++ b/platform/bb10/audio_driver_bb10.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/bbutil.h b/platform/bb10/bbutil.h index 8df513cb7d..bc422cd9b9 100644 --- a/platform/bb10/bbutil.h +++ b/platform/bb10/bbutil.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/godot_bb10.cpp b/platform/bb10/godot_bb10.cpp index f7e154d647..cba9d200cb 100644 --- a/platform/bb10/godot_bb10.cpp +++ b/platform/bb10/godot_bb10.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/os_bb10.cpp b/platform/bb10/os_bb10.cpp index c8e7ae561e..d2a350cf83 100644 --- a/platform/bb10/os_bb10.cpp +++ b/platform/bb10/os_bb10.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/os_bb10.h b/platform/bb10/os_bb10.h index 28149c15b5..a0481d1190 100644 --- a/platform/bb10/os_bb10.h +++ b/platform/bb10/os_bb10.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/payment_service.cpp b/platform/bb10/payment_service.cpp index f01230796f..77ec122b3b 100644 --- a/platform/bb10/payment_service.cpp +++ b/platform/bb10/payment_service.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/payment_service.h b/platform/bb10/payment_service.h index 5036ca6660..856b8df306 100644 --- a/platform/bb10/payment_service.h +++ b/platform/bb10/payment_service.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/platform_config.h b/platform/bb10/platform_config.h index 38fc934ae4..143f16c1fa 100644 --- a/platform/bb10/platform_config.h +++ b/platform/bb10/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/flash/dir_access_flash.cpp b/platform/flash/dir_access_flash.cpp index 4b8992f9d6..443242fd99 100644 --- a/platform/flash/dir_access_flash.cpp +++ b/platform/flash/dir_access_flash.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/platform/flash/dir_access_flash.h b/platform/flash/dir_access_flash.h index 1378a6e56f..482120775d 100644 --- a/platform/flash/dir_access_flash.h +++ b/platform/flash/dir_access_flash.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/platform/flash/rasterizer_flash.cpp b/platform/flash/rasterizer_flash.cpp index 121baa333c..a36890e3d8 100644 --- a/platform/flash/rasterizer_flash.cpp +++ b/platform/flash/rasterizer_flash.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/platform/flash/rasterizer_flash.h b/platform/flash/rasterizer_flash.h index 1a2c540faa..1caf7f2c44 100644 --- a/platform/flash/rasterizer_flash.h +++ b/platform/flash/rasterizer_flash.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/platform/haiku/audio_driver_media_kit.cpp b/platform/haiku/audio_driver_media_kit.cpp index 3fabe4f96f..c7eed1c7cd 100644 --- a/platform/haiku/audio_driver_media_kit.cpp +++ b/platform/haiku/audio_driver_media_kit.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -118,8 +118,7 @@ void AudioDriverMediaKit::unlock() { } void AudioDriverMediaKit::finish() { - if (player) - delete player; + delete player; if (samples_in) { memdelete_arr(samples_in); diff --git a/platform/haiku/audio_driver_media_kit.h b/platform/haiku/audio_driver_media_kit.h index a23ec447f1..cdaf602831 100644 --- a/platform/haiku/audio_driver_media_kit.h +++ b/platform/haiku/audio_driver_media_kit.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/haiku_direct_window.cpp b/platform/haiku/haiku_direct_window.cpp index 3914ee272a..184d64f840 100644 --- a/platform/haiku/haiku_direct_window.cpp +++ b/platform/haiku/haiku_direct_window.cpp @@ -16,9 +16,7 @@ HaikuDirectWindow::HaikuDirectWindow(BRect p_frame) HaikuDirectWindow::~HaikuDirectWindow() { - if (update_runner) { - delete update_runner; - } + delete update_runner; } void HaikuDirectWindow::SetHaikuGLView(HaikuGLView* p_view) { diff --git a/platform/iphone/Appirater.h b/platform/iphone/Appirater.h index f0bf2c01d5..6ff25532f7 100644 --- a/platform/iphone/Appirater.h +++ b/platform/iphone/Appirater.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/app_delegate.h b/platform/iphone/app_delegate.h index 0d20f886cc..54bfe78cf7 100644 --- a/platform/iphone/app_delegate.h +++ b/platform/iphone/app_delegate.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index e5bd7a96b4..8a3dfe0623 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/audio_driver_iphone.cpp b/platform/iphone/audio_driver_iphone.cpp index a95cb436a7..0916c31f36 100644 --- a/platform/iphone/audio_driver_iphone.cpp +++ b/platform/iphone/audio_driver_iphone.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/audio_driver_iphone.h b/platform/iphone/audio_driver_iphone.h index 5d406940a3..0b143adf94 100644 --- a/platform/iphone/audio_driver_iphone.h +++ b/platform/iphone/audio_driver_iphone.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/game_center.h b/platform/iphone/game_center.h index 8f180d1638..62477a0da2 100644 --- a/platform/iphone/game_center.h +++ b/platform/iphone/game_center.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/game_center.mm b/platform/iphone/game_center.mm index 4cb7a20a7f..3756b58699 100644 --- a/platform/iphone/game_center.mm +++ b/platform/iphone/game_center.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/gl_view.h b/platform/iphone/gl_view.h index ca2d1d25ae..e69ddc839a 100755 --- a/platform/iphone/gl_view.h +++ b/platform/iphone/gl_view.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index f19e16f3f6..88361e87e4 100755 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/godot_iphone.cpp b/platform/iphone/godot_iphone.cpp index f0cb929429..2ecfe1545e 100644 --- a/platform/iphone/godot_iphone.cpp +++ b/platform/iphone/godot_iphone.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/icloud.h b/platform/iphone/icloud.h index ca21f62ba1..c772555835 100644 --- a/platform/iphone/icloud.h +++ b/platform/iphone/icloud.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/icloud.mm b/platform/iphone/icloud.mm index 518385992d..449670667f 100644 --- a/platform/iphone/icloud.mm +++ b/platform/iphone/icloud.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/in_app_store.h b/platform/iphone/in_app_store.h index 585cd19538..bd4215231e 100644 --- a/platform/iphone/in_app_store.h +++ b/platform/iphone/in_app_store.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/in_app_store.mm b/platform/iphone/in_app_store.mm index f689123c81..fec007b7b6 100644 --- a/platform/iphone/in_app_store.mm +++ b/platform/iphone/in_app_store.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 0bc8378662..b60da43374 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h index 06a67b0cfd..631c9d6452 100644 --- a/platform/iphone/os_iphone.h +++ b/platform/iphone/os_iphone.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/platform_config.h b/platform/iphone/platform_config.h index d18ef437b0..e40f670185 100644 --- a/platform/iphone/platform_config.h +++ b/platform/iphone/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/rasterizer_iphone.cpp b/platform/iphone/rasterizer_iphone.cpp index d2a0777af8..29364d091a 100644 --- a/platform/iphone/rasterizer_iphone.cpp +++ b/platform/iphone/rasterizer_iphone.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/rasterizer_iphone.h b/platform/iphone/rasterizer_iphone.h index 2a630e597a..add656b190 100644 --- a/platform/iphone/rasterizer_iphone.h +++ b/platform/iphone/rasterizer_iphone.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/sem_iphone.cpp b/platform/iphone/sem_iphone.cpp index 36baa40427..e9c54a002e 100644 --- a/platform/iphone/sem_iphone.cpp +++ b/platform/iphone/sem_iphone.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/sem_iphone.h b/platform/iphone/sem_iphone.h index 7a57b5dd99..bfeaf244e5 100644 --- a/platform/iphone/sem_iphone.h +++ b/platform/iphone/sem_iphone.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/view_controller.h b/platform/iphone/view_controller.h index 0cee2f6fbf..52c8ac9953 100644 --- a/platform/iphone/view_controller.h +++ b/platform/iphone/view_controller.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/view_controller.mm b/platform/iphone/view_controller.mm index f98fb7c355..647ded30a7 100644 --- a/platform/iphone/view_controller.mm +++ b/platform/iphone/view_controller.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/audio_driver_javascript.cpp b/platform/javascript/audio_driver_javascript.cpp index cc053cf136..1b949e64f9 100644 --- a/platform/javascript/audio_driver_javascript.cpp +++ b/platform/javascript/audio_driver_javascript.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/audio_driver_javascript.h b/platform/javascript/audio_driver_javascript.h index 0356ca87f9..c674a8566e 100644 --- a/platform/javascript/audio_driver_javascript.h +++ b/platform/javascript/audio_driver_javascript.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/audio_server_javascript.cpp b/platform/javascript/audio_server_javascript.cpp index a2c6740eaf..fbd5d2e1c0 100644 --- a/platform/javascript/audio_server_javascript.cpp +++ b/platform/javascript/audio_server_javascript.cpp @@ -33,7 +33,7 @@ void AudioServerJavascript::sample_set_description(RID p_sample, const String& p } -String AudioServerJavascript::sample_get_description(RID p_sample, const String& p_description) const{ +String AudioServerJavascript::sample_get_description(RID p_sample) const{ return String(); } diff --git a/platform/javascript/audio_server_javascript.h b/platform/javascript/audio_server_javascript.h index 450237d324..1dc90c48ee 100644 --- a/platform/javascript/audio_server_javascript.h +++ b/platform/javascript/audio_server_javascript.h @@ -95,7 +95,7 @@ public: virtual RID sample_create(SampleFormat p_format, bool p_stereo, int p_length); virtual void sample_set_description(RID p_sample, const String& p_description); - virtual String sample_get_description(RID p_sample, const String& p_description) const; + virtual String sample_get_description(RID p_sample) const; virtual SampleFormat sample_get_format(RID p_sample) const; virtual bool sample_is_stereo(RID p_sample) const; diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index acbcbb4652..c769d2082a 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/export/export.h b/platform/javascript/export/export.h index a126675983..2105141e58 100644 --- a/platform/javascript/export/export.h +++ b/platform/javascript/export/export.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/javascript_main.cpp b/platform/javascript/javascript_main.cpp index fb87dc848e..e66110b655 100644 --- a/platform/javascript/javascript_main.cpp +++ b/platform/javascript/javascript_main.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index ae97bf990b..7bb47881a3 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h index 1e925fb8df..61eecd8f32 100644 --- a/platform/javascript/os_javascript.h +++ b/platform/javascript/os_javascript.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/platform_config.h b/platform/javascript/platform_config.h index 1e7d066bb9..143f16c1fa 100644 --- a/platform/javascript/platform_config.h +++ b/platform/javascript/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/audio_driver_nacl.cpp b/platform/nacl/audio_driver_nacl.cpp index 27197ad2b2..dac9521487 100644 --- a/platform/nacl/audio_driver_nacl.cpp +++ b/platform/nacl/audio_driver_nacl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/audio_driver_nacl.h b/platform/nacl/audio_driver_nacl.h index be5a4cba67..d14e60717a 100644 --- a/platform/nacl/audio_driver_nacl.h +++ b/platform/nacl/audio_driver_nacl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/context_gl_nacl.cpp b/platform/nacl/context_gl_nacl.cpp index 8ba3fe49d2..ce2f25b69f 100644 --- a/platform/nacl/context_gl_nacl.cpp +++ b/platform/nacl/context_gl_nacl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/context_gl_nacl.h b/platform/nacl/context_gl_nacl.h index 18da070e35..82b9ba0775 100644 --- a/platform/nacl/context_gl_nacl.h +++ b/platform/nacl/context_gl_nacl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/geturl_handler.cpp b/platform/nacl/geturl_handler.cpp index 40583891a9..6be82f3f5a 100644 --- a/platform/nacl/geturl_handler.cpp +++ b/platform/nacl/geturl_handler.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/geturl_handler.h b/platform/nacl/geturl_handler.h index 901210febd..c310ed942d 100644 --- a/platform/nacl/geturl_handler.h +++ b/platform/nacl/geturl_handler.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/godot_module.cpp b/platform/nacl/godot_module.cpp index 490edf62cd..5c558f5ece 100644 --- a/platform/nacl/godot_module.cpp +++ b/platform/nacl/godot_module.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/godot_nacl.cpp b/platform/nacl/godot_nacl.cpp index 7302a0b5d5..d8447390c1 100644 --- a/platform/nacl/godot_nacl.cpp +++ b/platform/nacl/godot_nacl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/nacl_keycodes.h b/platform/nacl/nacl_keycodes.h index b8ff5874cf..45dba075db 100644 --- a/platform/nacl/nacl_keycodes.h +++ b/platform/nacl/nacl_keycodes.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/opengl_context.cpp b/platform/nacl/opengl_context.cpp index 285e8df9ce..ae72e4ddbb 100644 --- a/platform/nacl/opengl_context.cpp +++ b/platform/nacl/opengl_context.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/opengl_context.h b/platform/nacl/opengl_context.h index 6c73873f4b..f03a4b3e53 100644 --- a/platform/nacl/opengl_context.h +++ b/platform/nacl/opengl_context.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/os_nacl.cpp b/platform/nacl/os_nacl.cpp index b282209d72..de6a15525b 100644 --- a/platform/nacl/os_nacl.cpp +++ b/platform/nacl/os_nacl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -144,8 +144,7 @@ void OSNacl::finalize_core() { if (mempool_dynamic) memdelete( mempool_dynamic ); - if (mempool_static) - delete mempool_static; + delete mempool_static; }; diff --git a/platform/nacl/os_nacl.h b/platform/nacl/os_nacl.h index e033abb68d..689aa07e20 100644 --- a/platform/nacl/os_nacl.h +++ b/platform/nacl/os_nacl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/pepper_main.cpp b/platform/nacl/pepper_main.cpp index 406d84419b..fe10db19a9 100644 --- a/platform/nacl/pepper_main.cpp +++ b/platform/nacl/pepper_main.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/nacl/platform_config.h b/platform/nacl/platform_config.h index 1e7d066bb9..143f16c1fa 100644 --- a/platform/nacl/platform_config.h +++ b/platform/nacl/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/audio_driver_osx.cpp b/platform/osx/audio_driver_osx.cpp index 6904b7a398..a74303e6c2 100644 --- a/platform/osx/audio_driver_osx.cpp +++ b/platform/osx/audio_driver_osx.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/audio_driver_osx.h b/platform/osx/audio_driver_osx.h index bcf6b23864..92893c64dc 100644 --- a/platform/osx/audio_driver_osx.h +++ b/platform/osx/audio_driver_osx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/context_gl_osx.cpp b/platform/osx/context_gl_osx.cpp index f856e1e4a8..df1c14c643 100644 --- a/platform/osx/context_gl_osx.cpp +++ b/platform/osx/context_gl_osx.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/context_gl_osx.h b/platform/osx/context_gl_osx.h index 770ec74737..4a94c20c00 100644 --- a/platform/osx/context_gl_osx.h +++ b/platform/osx/context_gl_osx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/dir_access_osx.h b/platform/osx/dir_access_osx.h index abd66cbba8..caeeaf643c 100644 --- a/platform/osx/dir_access_osx.h +++ b/platform/osx/dir_access_osx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/dir_access_osx.mm b/platform/osx/dir_access_osx.mm index cc7db44929..e345bea60a 100644 --- a/platform/osx/dir_access_osx.mm +++ b/platform/osx/dir_access_osx.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/godot_main_osx.mm b/platform/osx/godot_main_osx.mm index 92fa6ddbc2..391fd1f74a 100644 --- a/platform/osx/godot_main_osx.mm +++ b/platform/osx/godot_main_osx.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/godot_osx.h b/platform/osx/godot_osx.h index 270ba9966f..de363d8483 100644 --- a/platform/osx/godot_osx.h +++ b/platform/osx/godot_osx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/godot_osx.mm b/platform/osx/godot_osx.mm index 39119393ff..0c32016216 100644 --- a/platform/osx/godot_osx.mm +++ b/platform/osx/godot_osx.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index e8277688ac..a1fd34def7 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 5a06d4b0e7..2690ee3ba9 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1056,6 +1056,33 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi void OS_OSX::finalize() { CFNotificationCenterRemoveObserver(CFNotificationCenterGetDistributedCenter(), NULL, kTISNotifySelectedKeyboardInputSourceChanged, NULL); + delete_main_loop(); + + spatial_sound_server->finish(); + memdelete(spatial_sound_server); + spatial_sound_2d_server->finish(); + memdelete(spatial_sound_2d_server); + + + memdelete(input); + + memdelete(sample_manager); + + audio_server->finish(); + memdelete(audio_server); + + visual_server->finish(); + memdelete(visual_server); + memdelete(rasterizer); + + physics_server->finish(); + memdelete(physics_server); + + physics_2d_server->finish(); + memdelete(physics_2d_server); + + screens.clear(); + } @@ -1068,6 +1095,8 @@ void OS_OSX::set_main_loop( MainLoop * p_main_loop ) { void OS_OSX::delete_main_loop() { + if (!main_loop) + return; memdelete(main_loop); main_loop=NULL; } diff --git a/platform/osx/platform_config.h b/platform/osx/platform_config.h index 6a1e9c8bae..085f13df73 100644 --- a/platform/osx/platform_config.h +++ b/platform/osx/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/sem_osx.cpp b/platform/osx/sem_osx.cpp index be70bedf84..6909097fec 100644 --- a/platform/osx/sem_osx.cpp +++ b/platform/osx/sem_osx.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/sem_osx.h b/platform/osx/sem_osx.h index 65bed7397f..ec5ddac4e0 100644 --- a/platform/osx/sem_osx.h +++ b/platform/osx/sem_osx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/server/godot_server.cpp b/platform/server/godot_server.cpp index 41e48302c4..db6c13633d 100644 --- a/platform/server/godot_server.cpp +++ b/platform/server/godot_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index 8b831140d6..f042318f78 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/server/os_server.h b/platform/server/os_server.h index b3410f7955..2487c7b3fb 100644 --- a/platform/server/os_server.h +++ b/platform/server/os_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/server/platform_config.h b/platform/server/platform_config.h index 43dda9e64e..72b10a0fb2 100644 --- a/platform/server/platform_config.h +++ b/platform/server/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/SCsub b/platform/windows/SCsub index 2db3d0f51e..914cee0fa1 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -24,4 +24,4 @@ env.Program('#bin/godot',['godot_win.cpp']+common_win,PROGSUFFIX=env["PROGSUFFIX if (env['vsproj'])=="yes": env.vs_srcs = env.vs_srcs + ["platform/windows/godot_win.cpp"] for x in common_win: - env.vs_srcs = env.vs_srcs + ["platform/windows/" + x] + env.vs_srcs = env.vs_srcs + ["platform/windows/" + str(x)] diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp index 5a9c8edc63..e671101432 100644 --- a/platform/windows/context_gl_win.cpp +++ b/platform/windows/context_gl_win.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/context_gl_win.h b/platform/windows/context_gl_win.h index 5397676c8e..af15ad2659 100644 --- a/platform/windows/context_gl_win.h +++ b/platform/windows/context_gl_win.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/ctxgl_procaddr.cpp b/platform/windows/ctxgl_procaddr.cpp index 6e5f53eb96..1072197f89 100644 --- a/platform/windows/ctxgl_procaddr.cpp +++ b/platform/windows/ctxgl_procaddr.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/ctxgl_procaddr.h b/platform/windows/ctxgl_procaddr.h index 916b480639..2118e20e02 100644 --- a/platform/windows/ctxgl_procaddr.h +++ b/platform/windows/ctxgl_procaddr.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/detect.py b/platform/windows/detect.py index a1366e7630..c00d94a4fb 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -262,7 +262,7 @@ def configure(env): env.Append(CCFLAGS=["/I"+DIRECTX_PATH+"/Include"]) env.Append(LIBPATH=[DIRECTX_PATH+"/Lib/x86"]) env['ENV'] = os.environ; - env["x86_opt_vc"]=True + env["x86_opt_vc"]=env["bits"]!="64" else: # Workaround for MinGW. See: diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index 9cfd475091..899edde087 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/godot_win.cpp b/platform/windows/godot_win.cpp index fe39051670..fa7989c726 100644 --- a/platform/windows/godot_win.cpp +++ b/platform/windows/godot_win.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/joystick.cpp b/platform/windows/joystick.cpp index bda092de53..f4fb09820f 100644 --- a/platform/windows/joystick.cpp +++ b/platform/windows/joystick.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/joystick.h b/platform/windows/joystick.h index 4c706b3766..332e86fbb8 100644 --- a/platform/windows/joystick.h +++ b/platform/windows/joystick.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -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/windows/key_mapping_win.cpp b/platform/windows/key_mapping_win.cpp index f07b7c6eaa..07d5f32253 100644 --- a/platform/windows/key_mapping_win.cpp +++ b/platform/windows/key_mapping_win.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/key_mapping_win.h b/platform/windows/key_mapping_win.h index 288fcdd8de..da649d0115 100644 --- a/platform/windows/key_mapping_win.h +++ b/platform/windows/key_mapping_win.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/lang_table.h b/platform/windows/lang_table.h index bfdf2b6ebe..c9551b2d38 100644 --- a/platform/windows/lang_table.h +++ b/platform/windows/lang_table.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 1eef643579..6f19f8bdfe 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1144,8 +1144,7 @@ void OS_Windows::finalize_core() { if (mempool_dynamic) memdelete( mempool_dynamic ); - if (mempool_static) - delete mempool_static; + delete mempool_static; TCPServerWinsock::cleanup(); @@ -1681,10 +1680,16 @@ uint64_t OS_Windows::get_unix_time() const { return (*(uint64_t*)&ft - *(uint64_t*)&fep) / 10000000; }; -uint64_t OS_Windows::get_system_time_msec() const { +uint64_t OS_Windows::get_system_time_secs() const { SYSTEMTIME st; GetSystemTime(&st); - return st.wMilliseconds; + FILETIME ft; + SystemTimeToFileTime(&st,&ft); + uint64_t ret; + ret=ft.dwHighDateTime; + ret<<=32; + ret|=ft.dwLowDateTime; + return ret; } void OS_Windows::delay_usec(uint32_t p_usec) const { @@ -2099,6 +2104,13 @@ String OS_Windows::get_data_dir() const { } +bool OS_Windows::is_joy_known(int p_device) { + return input->is_joy_mapped(p_device); +} + +String OS_Windows::get_joy_guid(int p_device) const { + return input->get_joy_guid_remapped(p_device); +} OS_Windows::OS_Windows(HINSTANCE _hInstance) { diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 977e25f2d2..e433d5cc11 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -231,7 +231,7 @@ public: virtual Time get_time(bool utc) const; virtual TimeZoneInfo get_time_zone_info() const; virtual uint64_t get_unix_time() const; - virtual uint64_t get_system_time_msec() const; + virtual uint64_t get_system_time_secs() const; virtual bool can_draw() const; virtual Error set_cwd(const String& p_cwd); @@ -270,6 +270,9 @@ public: virtual bool get_swap_ok_cancel() { return true; } + virtual bool is_joy_known(int p_device); + virtual String get_joy_guid(int p_device) const; + OS_Windows(HINSTANCE _hInstance); ~OS_Windows(); diff --git a/platform/windows/platform_config.h b/platform/windows/platform_config.h index e6b561552e..55f6b5547e 100644 --- a/platform/windows/platform_config.h +++ b/platform/windows/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/stream_peer_winsock.cpp b/platform/windows/stream_peer_winsock.cpp index 5bc3e34107..fcf0cb1640 100644 --- a/platform/windows/stream_peer_winsock.cpp +++ b/platform/windows/stream_peer_winsock.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/stream_peer_winsock.h b/platform/windows/stream_peer_winsock.h index 5dd836aa0c..bbff661490 100644 --- a/platform/windows/stream_peer_winsock.h +++ b/platform/windows/stream_peer_winsock.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/tcp_server_winsock.cpp b/platform/windows/tcp_server_winsock.cpp index cc689d9dcf..dd1cf43f3b 100644 --- a/platform/windows/tcp_server_winsock.cpp +++ b/platform/windows/tcp_server_winsock.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/tcp_server_winsock.h b/platform/windows/tcp_server_winsock.h index 2516123908..bd6a05c74d 100644 --- a/platform/windows/tcp_server_winsock.h +++ b/platform/windows/tcp_server_winsock.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/winrt/os_winrt.cpp b/platform/winrt/os_winrt.cpp index 24be2f47e7..f507c1aae7 100644 --- a/platform/winrt/os_winrt.cpp +++ b/platform/winrt/os_winrt.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -345,8 +345,7 @@ void OSWinrt::finalize_core() { if (mempool_dynamic) memdelete( mempool_dynamic ); - if (mempool_static) - delete mempool_static; + delete mempool_static; } diff --git a/platform/winrt/os_winrt.h b/platform/winrt/os_winrt.h index 5719426f9f..3fbb4a4c1b 100644 --- a/platform/winrt/os_winrt.h +++ b/platform/winrt/os_winrt.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp index 3db1f6da25..89bd5f58ff 100644 --- a/platform/x11/context_gl_x11.cpp +++ b/platform/x11/context_gl_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/context_gl_x11.h b/platform/x11/context_gl_x11.h index 8b81db9160..56404d0fae 100644 --- a/platform/x11/context_gl_x11.h +++ b/platform/x11/context_gl_x11.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 0226c8b8c0..e035c72993 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -55,6 +55,7 @@ def get_opts(): ('use_sanitizer','Use llvm compiler sanitize address','no'), ('use_leak_sanitizer','Use llvm compiler sanitize memory leaks','no'), ('pulseaudio','Detect & Use pulseaudio','yes'), + ('gamepad','Gamepad support, requires libudev and libevdev','yes'), ('new_wm_api', 'Use experimental window management API','no'), ('debug_release', 'Add debug symbols to release version','no'), ] @@ -145,23 +146,33 @@ def configure(env): env.Append(CPPPATH=['#tools/freetype/freetype/include']) - - env.Append(CPPFLAGS=['-DOPENGL_ENABLED','-DGLEW_ENABLED']) - if platform.system() == 'Linux': + + if os.system("pkg-config --exists alsa")==0: + print("Enabling ALSA") env.Append(CPPFLAGS=["-DALSA_ENABLED"]) env.Append(LIBS=['asound']) - - if not os.system("pkg-config --exists libudev"): - if not os.system("pkg-config --exists libevdev"): - print("Enabling udev/evdev") - env.Append(CPPFLAGS=["-DJOYDEV_ENABLED"]) - env.ParseConfig('pkg-config libudev --cflags --libs') - env.ParseConfig('pkg-config libevdev --cflags --libs') - else: - print("libevdev development libraries not found, disabling gamepad support") + else: + print("ALSA libraries not found, disabling driver") + + if (env["gamepad"]=="yes" and platform.system() == "Linux"): + # pkg-config returns 0 when the lib exists... + found_udev = not os.system("pkg-config --exists libudev") + found_evdev = not os.system("pkg-config --exists libevdev") + + if (found_udev and found_evdev): + print("Enabling gamepad support with udev/evdev") + env.Append(CPPFLAGS=["-DJOYDEV_ENABLED"]) + env.ParseConfig('pkg-config libudev --cflags --libs') + env.ParseConfig('pkg-config libevdev --cflags --libs') else: - print("libudev development libraries not found, disabling gamepad support") + if (not found_udev): + print("libudev development libraries not found") + if (not found_evdev): + print("libevdev development libraries not found") + print("Some libraries are missing for the required gamepad support, aborting!") + print("Install the mentioned libraries or build with 'gamepad=no' to disable gamepad support.") + sys.exit(255) if (env["pulseaudio"]=="yes"): if not os.system("pkg-config --exists libpulse-simple"): diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp index f90d40fa5c..ee83da25c1 100644 --- a/platform/x11/godot_x11.cpp +++ b/platform/x11/godot_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/joystick_linux.cpp b/platform/x11/joystick_linux.cpp index cc806f6f78..6eb3671bc0 100644 --- a/platform/x11/joystick_linux.cpp +++ b/platform/x11/joystick_linux.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,15 +45,20 @@ static const char* ignore_str = "/dev/input/js"; joystick_linux::Joystick::Joystick() { fd = -1; dpad = 0; + dev = NULL; + devpath = ""; } void joystick_linux::Joystick::reset() { - num_buttons = 0; - num_axes = 0; 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; } } @@ -225,20 +230,23 @@ static String _hex_str(uint8_t p_byte) { void joystick_linux::setup_joystick_properties(int p_id) { Joystick* joy = &joysticks[p_id]; - libevdev* dev = joy->dev; + + int num_buttons = 0; + int num_axes = 0; + for (int i = BTN_JOYSTICK; i < KEY_MAX; ++i) { if (libevdev_has_event_code(dev, EV_KEY, i)) { - joy->key_map[i] = joy->num_buttons++; + joy->key_map[i] = num_buttons++; } } for (int i = BTN_MISC; i < BTN_JOYSTICK; ++i) { if (libevdev_has_event_code(dev, EV_KEY, i)) { - joy->key_map[i] = joy->num_buttons++; + joy->key_map[i] = num_buttons++; } } for (int i = 0; i < ABS_MISC; ++i) { @@ -249,7 +257,7 @@ void joystick_linux::setup_joystick_properties(int p_id) { } if (libevdev_has_event_code(dev, EV_ABS, i)) { - joy->abs_map[i] = joy->num_axes++; + joy->abs_map[i] = num_axes++; } } } @@ -387,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; } @@ -395,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 1064a6f841..ee9bd0352a 100644 --- a/platform/x11/joystick_linux.h +++ b/platform/x11/joystick_linux.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -54,10 +54,9 @@ private: }; struct Joystick { + InputDefault::JoyAxis curr_axis[MAX_ABS]; int key_map[MAX_KEY - BT_MISC]; int abs_map[MAX_ABS]; - int num_buttons; - int num_axes; int dpad; int fd; diff --git a/platform/x11/key_mapping_x11.cpp b/platform/x11/key_mapping_x11.cpp index 9c68ac1a2c..48f415a730 100644 --- a/platform/x11/key_mapping_x11.cpp +++ b/platform/x11/key_mapping_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/key_mapping_x11.h b/platform/x11/key_mapping_x11.h index 7ab883878f..979d8a112f 100644 --- a/platform/x11/key_mapping_x11.h +++ b/platform/x11/key_mapping_x11.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 0afab6442b..82df8dff60 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -447,6 +447,11 @@ void OS_X11::finalize() { // memdelete(debugger_connection_console); //} +#ifdef JOYDEV_ENABLED + memdelete(joystick); +#endif + memdelete(input); + memdelete(sample_manager); audio_server->finish(); @@ -461,10 +466,6 @@ void OS_X11::finalize() { physics_2d_server->finish(); memdelete(physics_2d_server); -#ifdef JOYDEV_ENABLED - memdelete(joystick); -#endif - memdelete(input); XUnmapWindow( x11_display, x11_window ); XDestroyWindow( x11_display, x11_window ); @@ -618,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 { @@ -886,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; } @@ -1763,6 +1774,14 @@ void OS_X11::run() { main_loop->finish(); } +bool OS_X11::is_joy_known(int p_device) { + return input->is_joy_mapped(p_device); +} + +String OS_X11::get_joy_guid(int p_device) const { + return input->get_joy_guid_remapped(p_device); +} + OS_X11::OS_X11() { #ifdef RTAUDIO_ENABLED diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index eee3e40136..91dbeac284 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -222,6 +222,10 @@ public: virtual void move_window_to_foreground(); virtual void alert(const String& p_alert,const String& p_title="ALERT!"); + + virtual bool is_joy_known(int p_device); + virtual String get_joy_guid(int p_device) const; + void run(); OS_X11(); diff --git a/platform/x11/platform_config.h b/platform/x11/platform_config.h index 1556b56058..aac50c27c2 100644 --- a/platform/x11/platform_config.h +++ b/platform/x11/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,6 +31,7 @@ #endif #if defined(__FreeBSD__) || defined(__OpenBSD__) #include <stdlib.h> +#define PTHREAD_BSD_SET_NAME #endif #define GLES2_INCLUDE_H "gl_context/glew.h" diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 458246671c..1ed508aed3 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/animated_sprite.h b/scene/2d/animated_sprite.h index 425f516b14..da4f1b99af 100644 --- a/scene/2d/animated_sprite.h +++ b/scene/2d/animated_sprite.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index 5038752b22..50a115174d 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -383,7 +383,11 @@ void Area2D::_clear_monitoring() { Object *obj = ObjectDB::get_instance(E->key()); Node *node = obj ? obj->cast_to<Node>() : NULL; - ERR_CONTINUE(!node); + + if (!node) //node may have been deleted in previous frame, this should not be an error + continue; + //ERR_CONTINUE(!node); + if (!E->get().in_tree) continue; @@ -416,13 +420,13 @@ void Area2D::_notification(int p_what) { void Area2D::set_enable_monitoring(bool p_enable) { - if (locked) { - ERR_EXPLAIN("This function can't be used during the in/out signal."); - } - ERR_FAIL_COND(locked); if (p_enable==monitoring) return; + if (locked) { + ERR_EXPLAIN("Function blocked during in/out signal. Use call_deferred(\"set_enable_monitoring\",true/false)"); + } + ERR_FAIL_COND(locked); monitoring=p_enable; diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h index 2b74655109..7f3f9c93cf 100644 --- a/scene/2d/area_2d.h +++ b/scene/2d/area_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index b7b99f935a..67c1733759 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -503,7 +503,7 @@ void Camera2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_camera_pos"),&Camera2D::get_camera_pos); ObjectTypeDB::bind_method(_MD("get_camera_screen_center"),&Camera2D::get_camera_screen_center); - ObjectTypeDB::bind_method(_MD("set_zoom"),&Camera2D::set_zoom); + ObjectTypeDB::bind_method(_MD("set_zoom","zoom"),&Camera2D::set_zoom); ObjectTypeDB::bind_method(_MD("get_zoom"),&Camera2D::get_zoom); diff --git a/scene/2d/camera_2d.h b/scene/2d/camera_2d.h index dcf98d4295..3c51bbf220 100644 --- a/scene/2d/camera_2d.h +++ b/scene/2d/camera_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 275e4d0304..35b453d71d 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -389,8 +389,8 @@ Matrix32 CanvasItem::get_global_transform_with_canvas() const { if (last_valid->canvas_layer) return last_valid->canvas_layer->get_transform() * xform; - else - return xform; + else if (is_inside_tree()) + return get_viewport()->get_canvas_transform() * xform; } Matrix32 CanvasItem::get_global_transform() const { @@ -548,6 +548,7 @@ void CanvasItem::_notification(int p_what) { get_parent()->cast_to<CanvasItem>()->children_items.erase(C); C=NULL; } + global_invalid=true; } break; case NOTIFICATION_DRAW: { @@ -773,7 +774,7 @@ void CanvasItem::draw_set_transform(const Point2& p_offset, float p_rot, const S Matrix32 xform(p_rot,p_offset); xform.scale_basis(p_scale); - VisualServer::get_singleton()->canvas_item_set_transform(canvas_item,xform); + VisualServer::get_singleton()->canvas_item_add_set_transform(canvas_item,xform); } void CanvasItem::draw_polygon(const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, Ref<Texture> p_texture) { @@ -1080,7 +1081,7 @@ void CanvasItem::_bind_methods() { ObjectTypeDB::bind_method(_MD("draw_line","from","to","color","width"),&CanvasItem::draw_line,DEFVAL(1.0)); ObjectTypeDB::bind_method(_MD("draw_rect","rect","color"),&CanvasItem::draw_rect); ObjectTypeDB::bind_method(_MD("draw_circle","pos","radius","color"),&CanvasItem::draw_circle); - ObjectTypeDB::bind_method(_MD("draw_texture","texture:Texture","pos"),&CanvasItem::draw_texture); + ObjectTypeDB::bind_method(_MD("draw_texture","texture:Texture","pos","modulate"),&CanvasItem::draw_texture,DEFVAL(Color(1,1,1,1))); ObjectTypeDB::bind_method(_MD("draw_texture_rect","texture:Texture","rect","tile","modulate","transpose"),&CanvasItem::draw_texture_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); ObjectTypeDB::bind_method(_MD("draw_texture_rect_region","texture:Texture","rect","src_rect","modulate","transpose"),&CanvasItem::draw_texture_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false)); ObjectTypeDB::bind_method(_MD("draw_style_box","style_box:StyleBox","rect"),&CanvasItem::draw_style_box); diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h index 4c0386b953..5d10523261 100644 --- a/scene/2d/canvas_item.h +++ b/scene/2d/canvas_item.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -197,7 +197,7 @@ public: void set_blend_mode(BlendMode p_blend_mode); BlendMode get_blend_mode() const; - void set_light_mask(int p_light_mask); + virtual void set_light_mask(int p_light_mask); int get_light_mask() const; void set_opacity(float p_opacity); diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp index 82dd8012a5..77203a7110 100644 --- a/scene/2d/canvas_modulate.cpp +++ b/scene/2d/canvas_modulate.cpp @@ -5,10 +5,19 @@ void CanvasModulate::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_CANVAS) { - VS::get_singleton()->canvas_set_modulate(get_canvas(),color); + if (is_visible()) + VS::get_singleton()->canvas_set_modulate(get_canvas(),color); } else if (p_what==NOTIFICATION_EXIT_CANVAS) { - VS::get_singleton()->canvas_set_modulate(get_canvas(),Color(1,1,1,1)); + if (is_visible()) + VS::get_singleton()->canvas_set_modulate(get_canvas(),Color(1,1,1,1)); + } else if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { + + if (is_visible()) { + VS::get_singleton()->canvas_set_modulate(get_canvas(),color); + } else { + VS::get_singleton()->canvas_set_modulate(get_canvas(),Color(1,1,1,1)); + } } } diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index 8b8caf13d3..9b0c24ffd6 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h index 473f13d0ff..fc50c5c7cd 100644 --- a/scene/2d/collision_object_2d.h +++ b/scene/2d/collision_object_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index 616d3da7c9..2a40a6207d 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,7 +30,7 @@ #include "collision_object_2d.h" #include "scene/resources/concave_polygon_shape_2d.h" #include "scene/resources/convex_polygon_shape_2d.h" - +#include "triangulator.h" void CollisionPolygon2D::_add_to_collision_object(Object *p_obj) { if (unparenting || !can_update_body) @@ -48,7 +48,7 @@ void CollisionPolygon2D::_add_to_collision_object(Object *p_obj) { //here comes the sun, lalalala //decompose concave into multiple convex polygons and add them - Vector< Vector<Vector2> > decomp = Geometry::decompose_polygon(polygon); + Vector< Vector<Vector2> > decomp = _decompose_in_convex(); shape_from=co->get_shape_count(); for(int i=0;i<decomp.size();i++) { Ref<ConvexPolygonShape2D> convex = memnew( ConvexPolygonShape2D ); @@ -106,6 +106,51 @@ void CollisionPolygon2D::_update_parent() { co->_update_shapes_from_children(); } +Vector< Vector<Vector2> > CollisionPolygon2D::_decompose_in_convex() { + + Vector< Vector<Vector2> > decomp; +#if 0 + //fast but imprecise triangulator, gave us problems + decomp = Geometry::decompose_polygon(polygon); +#else + + List<TriangulatorPoly> in_poly,out_poly; + + TriangulatorPoly inp; + inp.Init(polygon.size()); + for(int i=0;i<polygon.size();i++) { + inp.GetPoint(i)=polygon[i]; + } + inp.SetOrientation(TRIANGULATOR_CCW); + in_poly.push_back(inp); + TriangulatorPartition tpart; + if (tpart.ConvexPartition_HM(&in_poly,&out_poly)==0) { //failed! + ERR_PRINT("Convex decomposing failed!"); + return decomp; + } + + decomp.resize(out_poly.size()); + int idx=0; + + for(List<TriangulatorPoly>::Element*I = out_poly.front();I;I=I->next()) { + + TriangulatorPoly& tp = I->get(); + + decomp[idx].resize(tp.GetNumPoints()); + + for(int i=0;i<tp.GetNumPoints();i++) { + + decomp[idx][i]=tp.GetPoint(i); + } + + idx++; + } + +#endif + + return decomp; +} + void CollisionPolygon2D::_notification(int p_what) { @@ -152,10 +197,11 @@ void CollisionPolygon2D::_notification(int p_what) { Vector2 n = polygon[(i+1)%polygon.size()]; draw_line(p,n,Color(0.9,0.2,0.0,0.8),3); } -//#define DEBUG_DECOMPOSE +#define DEBUG_DECOMPOSE #if defined(TOOLS_ENABLED) && defined (DEBUG_DECOMPOSE) - Vector< Vector<Vector2> > decomp = Geometry::decompose_polygon(polygon); + Vector< Vector<Vector2> > decomp = _decompose_in_convex(); + Color c(0.4,0.9,0.1); for(int i=0;i<decomp.size();i++) { @@ -257,10 +303,10 @@ void CollisionPolygon2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_polygon","polygon"),&CollisionPolygon2D::set_polygon); ObjectTypeDB::bind_method(_MD("get_polygon"),&CollisionPolygon2D::get_polygon); - ObjectTypeDB::bind_method(_MD("set_build_mode"),&CollisionPolygon2D::set_build_mode); + ObjectTypeDB::bind_method(_MD("set_build_mode","build_mode"),&CollisionPolygon2D::set_build_mode); ObjectTypeDB::bind_method(_MD("get_build_mode"),&CollisionPolygon2D::get_build_mode); - ObjectTypeDB::bind_method(_MD("set_trigger"),&CollisionPolygon2D::set_trigger); + ObjectTypeDB::bind_method(_MD("set_trigger","trigger"),&CollisionPolygon2D::set_trigger); ObjectTypeDB::bind_method(_MD("is_trigger"),&CollisionPolygon2D::is_trigger); ObjectTypeDB::bind_method(_MD("_set_shape_range","shape_range"),&CollisionPolygon2D::_set_shape_range); diff --git a/scene/2d/collision_polygon_2d.h b/scene/2d/collision_polygon_2d.h index 4bc9713c8a..b2bd4d189d 100644 --- a/scene/2d/collision_polygon_2d.h +++ b/scene/2d/collision_polygon_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -63,6 +63,7 @@ protected: void _set_shape_range(const Vector2& p_range); Vector2 _get_shape_range() const; + Vector< Vector<Vector2> > _decompose_in_convex(); protected: diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index 56f68ae634..405310450b 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/collision_shape_2d.h b/scene/2d/collision_shape_2d.h index 82e1137174..b14dad73ba 100644 --- a/scene/2d/collision_shape_2d.h +++ b/scene/2d/collision_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp index adb2904a0a..053fc2c9c2 100644 --- a/scene/2d/joints_2d.cpp +++ b/scene/2d/joints_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -164,11 +164,17 @@ void PinJoint2D::_notification(int p_what) { switch(p_what) { case NOTIFICATION_DRAW: { - if (is_inside_tree() && get_tree()->is_editor_hint()) { - draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3); - draw_line(Point2(0,-10),Point2(0,+10),Color(0.7,0.6,0.0,0.5),3); + if (!is_inside_tree()) + break; + + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) { + break; } + + + draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3); + draw_line(Point2(0,-10),Point2(0,+10),Color(0.7,0.6,0.0,0.5),3); } break; } @@ -241,13 +247,17 @@ void GrooveJoint2D::_notification(int p_what) { switch(p_what) { case NOTIFICATION_DRAW: { - if (is_inside_tree() && get_tree()->is_editor_hint()) { + if (!is_inside_tree()) + break; - draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3); - draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3); - draw_line(Point2(0,0),Point2(0,length),Color(0.7,0.6,0.0,0.5),3); - draw_line(Point2(-10,initial_offset),Point2(+10,initial_offset),Color(0.8,0.8,0.9,0.5),5); + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) { + break; } + + draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3); + draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3); + draw_line(Point2(0,0),Point2(0,length),Color(0.7,0.6,0.0,0.5),3); + draw_line(Point2(-10,initial_offset),Point2(+10,initial_offset),Color(0.8,0.8,0.9,0.5),5); } break; } } @@ -339,12 +349,17 @@ void DampedSpringJoint2D::_notification(int p_what) { switch(p_what) { case NOTIFICATION_DRAW: { - if (is_inside_tree() && get_tree()->is_editor_hint()) { - draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3); - draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3); - draw_line(Point2(0,0),Point2(0,length),Color(0.7,0.6,0.0,0.5),3); + if (!is_inside_tree()) + break; + + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) { + break; } + + draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3); + draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3); + draw_line(Point2(0,0),Point2(0,length),Color(0.7,0.6,0.0,0.5),3); } break; } } diff --git a/scene/2d/joints_2d.h b/scene/2d/joints_2d.h index d468f3a6b5..52ffd86e7c 100644 --- a/scene/2d/joints_2d.h +++ b/scene/2d/joints_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index a2112c7d37..9715afeaa4 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -34,10 +34,19 @@ Rect2 Light2D::get_item_rect() const { } +void Light2D::_update_light_visibility() { + + if (!is_inside_tree()) + return; + + VS::get_singleton()->canvas_light_set_enabled(canvas_light,enabled && is_visible()); +} + void Light2D::set_enabled( bool p_enabled) { - VS::get_singleton()->canvas_light_set_enabled(canvas_light,p_enabled); + enabled=p_enabled; + _update_light_visibility(); } bool Light2D::is_enabled() const { @@ -253,16 +262,22 @@ void Light2D::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { VS::get_singleton()->canvas_light_attach_to_canvas( canvas_light, get_canvas() ); + _update_light_visibility(); } if (p_what==NOTIFICATION_TRANSFORM_CHANGED) { VS::get_singleton()->canvas_light_set_transform( canvas_light, get_global_transform()); } + if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { + + _update_light_visibility(); + } if (p_what==NOTIFICATION_EXIT_TREE) { VS::get_singleton()->canvas_light_attach_to_canvas( canvas_light, RID() ); + _update_light_visibility(); } } diff --git a/scene/2d/light_2d.h b/scene/2d/light_2d.h index 0828d9ac33..ca437769e7 100644 --- a/scene/2d/light_2d.h +++ b/scene/2d/light_2d.h @@ -35,6 +35,7 @@ private: Ref<Texture> texture; Vector2 texture_offset; + void _update_light_visibility(); protected: void _notification(int p_what); diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp index 6ebd499f71..d98bed0ea3 100644 --- a/scene/2d/light_occluder_2d.cpp +++ b/scene/2d/light_occluder_2d.cpp @@ -93,12 +93,17 @@ void LightOccluder2D::_notification(int p_what) { VS::get_singleton()->canvas_light_occluder_attach_to_canvas(occluder,get_canvas()); VS::get_singleton()->canvas_light_occluder_set_transform(occluder,get_global_transform()); + VS::get_singleton()->canvas_light_occluder_set_enabled(occluder,is_visible()); } if (p_what==NOTIFICATION_TRANSFORM_CHANGED) { VS::get_singleton()->canvas_light_occluder_set_transform(occluder,get_global_transform()); } + if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { + + VS::get_singleton()->canvas_light_occluder_set_enabled(occluder,is_visible()); + } if (p_what==NOTIFICATION_DRAW) { diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index b7d51730a0..c7542407cb 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -494,7 +494,26 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect open_list.erase(least_cost_poly); } - + { + Polygon *p=end_poly; + int idx=0; + + while(true) { + int prev = p->prev_edge; + int prev_n = (p->prev_edge+1)%p->edges.size(); + Vector2 point = (_get_vertex(p->edges[prev].point) + _get_vertex(p->edges[prev_n].point))*0.5; + String points; + for(int i=0;i<p->edges.size();i++) { + if (i>0) + points+=", "; + points+=_get_vertex(p->edges[i].point); + } + //print_line("poly "+itos(idx++)+" - "+points); + p = p->edges[prev].C; + if (p==begin_poly) + break; + } + } if (found_route) { Vector<Vector2> path; @@ -538,22 +557,29 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect bool skip=false; - /* print_line("-----\nAPEX: "+(apex_point-end_point)); + /* + print_line("-----\nAPEX: "+(apex_point-end_point)); print_line("LEFT:"); print_line("\tPortal: "+(portal_left-end_point)); print_line("\tPoint: "+(left-end_point)); - print_line("\tFree: "+itos(CLOCK_TANGENT(apex_point,portal_left,left) >= 0)); + print_line("\tLeft Tangent: "+rtos(CLOCK_TANGENT(apex_point,portal_left,left))); + print_line("\tLeft Distance: "+rtos(portal_left.distance_squared_to(apex_point))); + print_line("\tLeft Test: "+rtos(CLOCK_TANGENT(apex_point,left,portal_right))); print_line("RIGHT:"); print_line("\tPortal: "+(portal_right-end_point)); print_line("\tPoint: "+(right-end_point)); - print_line("\tFree: "+itos(CLOCK_TANGENT(apex_point,portal_right,right) <= 0)); -*/ + print_line("\tRight Tangent: "+rtos(CLOCK_TANGENT(apex_point,portal_right,right))); + print_line("\tRight Distance: "+rtos(portal_right.distance_squared_to(apex_point))); + print_line("\tRight Test: "+rtos(CLOCK_TANGENT(apex_point,right,portal_left))); + */ + if (CLOCK_TANGENT(apex_point,portal_left,left) >= 0){ //process if (portal_left.distance_squared_to(apex_point)<CMP_EPSILON || CLOCK_TANGENT(apex_point,left,portal_right) > 0) { left_poly=p; portal_left=left; + //print_line("***ADVANCE LEFT"); } else { //_clip_path(path,apex_poly,portal_right,right_poly); @@ -568,6 +594,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect path.push_back(apex_point); skip=true; //print_line("addpoint left"); + //print_line("***CLIP LEFT"); } } @@ -576,6 +603,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect if (portal_right.distance_squared_to(apex_point)<CMP_EPSILON || CLOCK_TANGENT(apex_point,right,portal_left) < 0) { right_poly=p; portal_right=right; + //print_line("***ADVANCE RIGHT"); } else { //_clip_path(path,apex_poly,portal_left,left_poly); @@ -589,6 +617,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect if (path[path.size()-1].distance_to(apex_point)>CMP_EPSILON) path.push_back(apex_point); //print_line("addpoint right"); + //print_line("***CLIP RIGHT"); } } diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index 792f079ab0..4c00d8cec9 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -273,7 +273,7 @@ void NavigationPolygonInstance::set_enabled(bool p_enabled) { if (navpoly.is_valid()) { - nav_id = navigation->navpoly_create(navpoly,get_relative_transform(navigation),this); + nav_id = navigation->navpoly_create(navpoly,get_relative_transform_to_parent(navigation),this); } } @@ -309,7 +309,7 @@ void NavigationPolygonInstance::_notification(int p_what) { if (enabled && navpoly.is_valid()) { - nav_id = navigation->navpoly_create(navpoly,get_relative_transform(navigation),this); + nav_id = navigation->navpoly_create(navpoly,get_relative_transform_to_parent(navigation),this); } break; } @@ -321,7 +321,7 @@ void NavigationPolygonInstance::_notification(int p_what) { case NOTIFICATION_TRANSFORM_CHANGED: { if (navigation && nav_id!=-1) { - navigation->navpoly_set_transform(nav_id,get_relative_transform(navigation)); + navigation->navpoly_set_transform(nav_id,get_relative_transform_to_parent(navigation)); } } break; @@ -409,7 +409,7 @@ void NavigationPolygonInstance::set_navigation_polygon(const Ref<NavigationPolyg } if (navigation && navpoly.is_valid() && enabled) { - nav_id = navigation->navpoly_create(navpoly,get_relative_transform(navigation),this); + nav_id = navigation->navpoly_create(navpoly,get_relative_transform_to_parent(navigation),this); } //update_gizmo(); _change_notify("navpoly"); diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 52b112f090..7ef81306b6 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -333,17 +333,18 @@ int Node2D::get_z() const{ return z; } -Matrix32 Node2D::get_relative_transform(const Node *p_parent) const { +Matrix32 Node2D::get_relative_transform_to_parent(const Node *p_parent) const { if (p_parent==this) return Matrix32(); Node2D *parent_2d = get_parent()->cast_to<Node2D>(); + ERR_FAIL_COND_V(!parent_2d,Matrix32()); if (p_parent==parent_2d) return get_transform(); else - return parent_2d->get_relative_transform(p_parent) * get_transform(); + return parent_2d->get_relative_transform_to_parent(p_parent) * get_transform(); } @@ -394,9 +395,9 @@ void Node2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_z_as_relative","enable"),&Node2D::set_z_as_relative); ObjectTypeDB::bind_method(_MD("is_z_relative"),&Node2D::is_z_relative); - ObjectTypeDB::bind_method(_MD("edit_set_pivot"),&Node2D::edit_set_pivot); + ObjectTypeDB::bind_method(_MD("edit_set_pivot","pivot"),&Node2D::edit_set_pivot); - ObjectTypeDB::bind_method(_MD("get_relative_transform"),&Node2D::get_relative_transform); + ObjectTypeDB::bind_method(_MD("get_relative_transform_to_parent","parent"),&Node2D::get_relative_transform_to_parent); ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"transform/pos"),_SCS("set_pos"),_SCS("get_pos")); ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"transform/rot",PROPERTY_HINT_RANGE,"-1440,1440,0.1"),_SCS("_set_rotd"),_SCS("_get_rotd")); diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h index 8efce33cda..49d616fc1f 100644 --- a/scene/2d/node_2d.h +++ b/scene/2d/node_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -99,7 +99,7 @@ public: void set_z_as_relative(bool p_enabled); bool is_z_relative() const; - Matrix32 get_relative_transform(const Node *p_parent) const; + Matrix32 get_relative_transform_to_parent(const Node *p_parent) const; diff --git a/scene/2d/node_2d_singleton.cpp b/scene/2d/node_2d_singleton.cpp index 361edf7587..b26804fedf 100644 --- a/scene/2d/node_2d_singleton.cpp +++ b/scene/2d/node_2d_singleton.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/node_2d_singleton.h b/scene/2d/node_2d_singleton.h index 6a21db2221..0aa6bbf992 100644 --- a/scene/2d/node_2d_singleton.h +++ b/scene/2d/node_2d_singleton.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/parallax_background.cpp b/scene/2d/parallax_background.cpp index 8bb4eb55ba..7f2e9efd96 100644 --- a/scene/2d/parallax_background.cpp +++ b/scene/2d/parallax_background.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -193,7 +193,7 @@ void ParallaxBackground::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_limit_begin"),&ParallaxBackground::get_limit_begin); ObjectTypeDB::bind_method(_MD("set_limit_end","ofs"),&ParallaxBackground::set_limit_end); ObjectTypeDB::bind_method(_MD("get_limit_end"),&ParallaxBackground::get_limit_end); - ObjectTypeDB::bind_method(_MD("set_ignore_camera_zoom"), &ParallaxBackground::set_ignore_camera_zoom); + ObjectTypeDB::bind_method(_MD("set_ignore_camera_zoom","ignore"), &ParallaxBackground::set_ignore_camera_zoom); ObjectTypeDB::bind_method(_MD("is_ignore_camera_zoom"), &ParallaxBackground::is_ignore_camera_zoom); diff --git a/scene/2d/parallax_background.h b/scene/2d/parallax_background.h index 8dede07a16..bdaf7d241f 100644 --- a/scene/2d/parallax_background.h +++ b/scene/2d/parallax_background.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index 70612d7c9a..7a898e43c9 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/parallax_layer.h b/scene/2d/parallax_layer.h index 8fe2846897..6c24a9b9f7 100644 --- a/scene/2d/parallax_layer.h +++ b/scene/2d/parallax_layer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index 8f805ceba2..5b13c32d93 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -697,7 +697,7 @@ bool Particles2D::is_emitting() const { void Particles2D::set_amount(int p_amount) { - ERR_FAIL_INDEX(p_amount,1024); + ERR_FAIL_INDEX(p_amount,1024+1); particles.resize(p_amount); } @@ -719,7 +719,7 @@ float Particles2D::get_emit_timeout() const { void Particles2D::set_lifetime(float p_lifetime) { - ERR_FAIL_INDEX(p_lifetime,3600); + ERR_FAIL_INDEX(p_lifetime,3600+1); lifetime=p_lifetime; } @@ -994,6 +994,15 @@ DVector<Vector2> Particles2D::get_emission_points() const{ return emission_points; } +void Particles2D::reset() { + + for(int i=0;i<particles.size();i++) { + particles[i].active=false; + } + time=0; + active_count=0; +} + void Particles2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_emitting","active"),&Particles2D::set_emitting); @@ -1057,6 +1066,7 @@ void Particles2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles2D::get_color_phase_pos); ObjectTypeDB::bind_method(_MD("pre_process","time"),&Particles2D::pre_process); + ObjectTypeDB::bind_method(_MD("reset"),&Particles2D::reset); ObjectTypeDB::bind_method(_MD("set_use_local_space","enable"),&Particles2D::set_use_local_space); ObjectTypeDB::bind_method(_MD("is_using_local_space"),&Particles2D::is_using_local_space); diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h index 4ee0fcf8da..101395589e 100644 --- a/scene/2d/particles_2d.h +++ b/scene/2d/particles_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -248,6 +248,7 @@ public: DVector<Vector2> get_emission_points() const; void pre_process(float p_delta); + void reset(); Particles2D(); }; diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 8f110b3931..bd7415aa04 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,9 +31,13 @@ void Path2D::_notification(int p_what) { - if (p_what==NOTIFICATION_DRAW && curve.is_valid() && is_inside_tree() && get_tree()->is_editor_hint()) { + if (p_what==NOTIFICATION_DRAW && curve.is_valid()) { //draw the curve!! + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_navigation_hint()) { + return; + } + for(int i=0;i<curve->get_point_count();i++) { Vector2 prev_p=curve->get_point_pos(i); @@ -70,6 +74,8 @@ void Path2D::set_curve(const Ref<Curve2D>& p_curve) { curve->connect("changed",this,"_curve_changed"); } + _curve_changed(); + } Ref<Curve2D> Path2D::get_curve() const{ diff --git a/scene/2d/path_2d.h b/scene/2d/path_2d.h index c9114c5d7d..486a8ac9ac 100644 --- a/scene/2d/path_2d.h +++ b/scene/2d/path_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index c30921eb69..cc2e5c0d72 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -310,14 +310,20 @@ void RigidBody2D::_body_enter_tree(ObjectID p_id) { ERR_FAIL_COND(!E); ERR_FAIL_COND(E->get().in_scene); + contact_monitor->locked=true; + E->get().in_scene=true; emit_signal(SceneStringNames::get_singleton()->body_enter,node); + for(int i=0;i<E->get().shapes.size();i++) { emit_signal(SceneStringNames::get_singleton()->body_enter_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape); } + contact_monitor->locked=false; + + } void RigidBody2D::_body_exit_tree(ObjectID p_id) { @@ -329,11 +335,18 @@ void RigidBody2D::_body_exit_tree(ObjectID p_id) { ERR_FAIL_COND(!E); ERR_FAIL_COND(!E->get().in_scene); E->get().in_scene=false; + + contact_monitor->locked=true; + emit_signal(SceneStringNames::get_singleton()->body_exit,node); + for(int i=0;i<E->get().shapes.size();i++) { emit_signal(SceneStringNames::get_singleton()->body_exit_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape); } + + contact_monitor->locked=false; + } void RigidBody2D::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,int p_local_shape) { @@ -439,6 +452,8 @@ void RigidBody2D::_direct_state_changed(Object *p_state) { if (contact_monitor) { + contact_monitor->locked=true; + //untag all int rc=0; for( Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) { @@ -520,6 +535,8 @@ void RigidBody2D::_direct_state_changed(Object *p_state) { _body_inout(1,toadd[i].id,toadd[i].shape,toadd[i].local_shape); } + contact_monitor->locked=false; + } set_block_transform_notify(true); // don't want notify (would feedback loop) @@ -803,6 +820,11 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) { if (!p_enabled) { + if (contact_monitor->locked) { + ERR_EXPLAIN("Can't disable contact monitoring during in/out callback. Use call_deferred(\"set_contact_monitor\",false) instead"); + } + ERR_FAIL_COND(contact_monitor->locked); + for(Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) { //clean up mess @@ -813,6 +835,7 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) { } else { contact_monitor = memnew( ContactMonitor ); + contact_monitor->locked=false; } } @@ -1250,7 +1273,7 @@ void KinematicBody2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_collider_velocity"),&KinematicBody2D::get_collider_velocity); ObjectTypeDB::bind_method(_MD("get_collider:Object"),&KinematicBody2D::_get_collider); ObjectTypeDB::bind_method(_MD("get_collider_shape"),&KinematicBody2D::get_collider_shape); - ObjectTypeDB::bind_method(_MD("get_collider_metadata"),&KinematicBody2D::get_collider_metadata); + ObjectTypeDB::bind_method(_MD("get_collider_metadata:Variant"),&KinematicBody2D::get_collider_metadata); ObjectTypeDB::bind_method(_MD("set_collision_margin","pixels"),&KinematicBody2D::set_collision_margin); ObjectTypeDB::bind_method(_MD("get_collision_margin","pixels"),&KinematicBody2D::get_collision_margin); diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h index b70fdd59cf..999e63dd5d 100644 --- a/scene/2d/physics_body_2d.h +++ b/scene/2d/physics_body_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -190,7 +190,7 @@ private: struct ContactMonitor { - + bool locked; Map<ObjectID,BodyState> body_map; }; diff --git a/scene/2d/position_2d.cpp b/scene/2d/position_2d.cpp index f1591b5242..c293305cb2 100644 --- a/scene/2d/position_2d.cpp +++ b/scene/2d/position_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/position_2d.h b/scene/2d/position_2d.h index 16404e6ce8..23821e62d4 100644 --- a/scene/2d/position_2d.h +++ b/scene/2d/position_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index 4a199e3418..4a774b0198 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/ray_cast_2d.h b/scene/2d/ray_cast_2d.h index 8c3ce8b3b3..54ec42c53e 100644 --- a/scene/2d/ray_cast_2d.h +++ b/scene/2d/ray_cast_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp index 0fbd140cfb..6dcd980822 100644 --- a/scene/2d/remote_transform_2d.cpp +++ b/scene/2d/remote_transform_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/remote_transform_2d.h b/scene/2d/remote_transform_2d.h index 506bde8cd8..4a5f5f72ea 100644 --- a/scene/2d/remote_transform_2d.h +++ b/scene/2d/remote_transform_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/sample_player_2d.cpp b/scene/2d/sample_player_2d.cpp index ec17ffc55e..bf09130238 100644 --- a/scene/2d/sample_player_2d.cpp +++ b/scene/2d/sample_player_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/sample_player_2d.h b/scene/2d/sample_player_2d.h index c0f2734ad1..eddf84f77b 100644 --- a/scene/2d/sample_player_2d.h +++ b/scene/2d/sample_player_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index 0c3987e6b1..fac94f19dc 100644 --- a/scene/2d/screen_button.cpp +++ b/scene/2d/screen_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -102,6 +102,10 @@ void TouchScreenButton::_notification(int p_what) { action_id=-1; } } break; + case NOTIFICATION_EXIT_TREE: { + if (is_pressed()) + Input::get_singleton()->action_release(action); + } break; } } @@ -161,7 +165,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) { if (finger_pressed==-1 || p_event.screen_touch.index==finger_pressed) { - Point2 coord = (get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); + Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); bool touched=false; if (bitmask.is_valid()) { @@ -238,7 +242,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) { if (finger_pressed!=-1) return; //already fingering - Point2 coord = (get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); + Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); bool touched=false; if (bitmask.is_valid()) { diff --git a/scene/2d/screen_button.h b/scene/2d/screen_button.h index 159b829079..ff3b50bf5e 100644 --- a/scene/2d/screen_button.h +++ b/scene/2d/screen_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/sound_player_2d.cpp b/scene/2d/sound_player_2d.cpp index 0eb18866af..41ce87faf9 100644 --- a/scene/2d/sound_player_2d.cpp +++ b/scene/2d/sound_player_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/sound_player_2d.h b/scene/2d/sound_player_2d.h index a376cdbed7..0e75887235 100644 --- a/scene/2d/sound_player_2d.h +++ b/scene/2d/sound_player_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index 89d9966958..001a1366a9 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/sprite.h b/scene/2d/sprite.h index ad782e746b..cbcaec9aeb 100644 --- a/scene/2d/sprite.h +++ b/scene/2d/sprite.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 1d48a9c8a0..179d1f451a 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -118,7 +118,7 @@ void TileMap::_update_quadrant_transform() { Matrix32 nav_rel; if (navigation) - nav_rel = get_relative_transform(navigation); + nav_rel = get_relative_transform_to_parent(navigation); for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) { @@ -223,6 +223,14 @@ void TileMap::_fix_cell_transform(Matrix32& xform,const Cell& p_cell, const Vect Size2 s=p_sc; Vector2 offset = p_offset; + if (s.y > s.x) { + if ((p_cell.flip_h && (p_cell.flip_v || p_cell.transpose)) || (p_cell.flip_v && !p_cell.transpose)) + offset.y += s.y - s.x; + } else if (s.y < s.x) { + if ((p_cell.flip_v && (p_cell.flip_h || p_cell.transpose)) || (p_cell.flip_h && !p_cell.transpose)) + offset.x += s.x - s.y; + } + if (p_cell.transpose) { SWAP(xform.elements[0].x, xform.elements[0].y); SWAP(xform.elements[1].x, xform.elements[1].y); @@ -261,7 +269,7 @@ void TileMap::_update_dirty_quadrants() { Vector2 tcenter = cell_size/2; Matrix32 nav_rel; if (navigation) - nav_rel = get_relative_transform(navigation); + nav_rel = get_relative_transform_to_parent(navigation); Vector2 qofs; @@ -333,6 +341,8 @@ void TileMap::_update_dirty_quadrants() { Matrix32 xform; xform.set_origin( q.pos ); vs->canvas_item_set_transform( canvas_item, xform ); + vs->canvas_item_set_light_mask(canvas_item,get_light_mask()); + q.canvas_items.push_back(canvas_item); if (debug_shapes) { @@ -374,13 +384,28 @@ void TileMap::_update_dirty_quadrants() { rect.pos=offset.floor(); rect.size=s; + if (rect.size.y > rect.size.x) { + if ((c.flip_h && (c.flip_v || c.transpose)) || (c.flip_v && !c.transpose)) + tile_ofs.y += rect.size.y - rect.size.x; + } else if (rect.size.y < rect.size.x) { + if ((c.flip_v && (c.flip_h || c.transpose)) || (c.flip_h && !c.transpose)) + tile_ofs.x += rect.size.x - rect.size.y; + } + /* rect.size.x+=fp_adjust; rect.size.y+=fp_adjust;*/ - if (c.flip_h) + if (c.transpose) + SWAP(tile_ofs.x, tile_ofs.y); + + if (c.flip_h) { rect.size.x=-rect.size.x; - if (c.flip_v) + tile_ofs.x=-tile_ofs.x; + } + if (c.flip_v) { rect.size.y=-rect.size.y; + tile_ofs.y=-tile_ofs.y; + } Vector2 center_ofs; @@ -1105,7 +1130,16 @@ int TileMap::get_occluder_light_mask() const{ return occluder_light_mask; } +void TileMap::set_light_mask(int p_light_mask) { + + CanvasItem::set_light_mask(p_light_mask); + for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) { + for (List<RID>::Element *F=E->get().canvas_items.front();F;F=F->next()) { + VisualServer::get_singleton()->canvas_item_set_light_mask(F->get(),get_light_mask()); + } + } +} void TileMap::_bind_methods() { diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index 4676d1ef7a..14cb52b736 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -253,6 +253,8 @@ public: void set_occluder_light_mask(int p_mask); int get_occluder_light_mask() const; + virtual void set_light_mask(int p_light_mask); + void clear(); TileMap(); diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index dc72c9a267..60fa7f69c8 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/visibility_notifier_2d.h b/scene/2d/visibility_notifier_2d.h index 1f7e4c6d45..6ec24fd4d0 100644 --- a/scene/2d/visibility_notifier_2d.h +++ b/scene/2d/visibility_notifier_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index 47cebd25a2..7d4235e051 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/area.h b/scene/3d/area.h index 529a116937..c250d27fb1 100644 --- a/scene/3d/area.h +++ b/scene/3d/area.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/body_shape.cpp b/scene/3d/body_shape.cpp index b54cbfe0f9..3a47371de3 100644 --- a/scene/3d/body_shape.cpp +++ b/scene/3d/body_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -402,7 +402,7 @@ int CollisionShape::_get_update_shape_index() const{ void CollisionShape::_bind_methods() { //not sure if this should do anything - ObjectTypeDB::bind_method(_MD("resource_changed"),&CollisionShape::resource_changed); + ObjectTypeDB::bind_method(_MD("resource_changed","resource"),&CollisionShape::resource_changed); ObjectTypeDB::bind_method(_MD("set_shape","shape"),&CollisionShape::set_shape); ObjectTypeDB::bind_method(_MD("get_shape"),&CollisionShape::get_shape); ObjectTypeDB::bind_method(_MD("_add_to_collision_object"),&CollisionShape::_add_to_collision_object); diff --git a/scene/3d/body_shape.h b/scene/3d/body_shape.h index 6c0b89da56..dd005c0edd 100644 --- a/scene/3d/body_shape.h +++ b/scene/3d/body_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/bone_attachment.cpp b/scene/3d/bone_attachment.cpp index 9cc1719f94..1628ccc15e 100644 --- a/scene/3d/bone_attachment.cpp +++ b/scene/3d/bone_attachment.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/bone_attachment.h b/scene/3d/bone_attachment.h index ca36cc3694..f1c27a9650 100644 --- a/scene/3d/bone_attachment.h +++ b/scene/3d/bone_attachment.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index dce5060a44..3e78fef147 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -125,7 +125,7 @@ bool Camera::_get(const StringName& p_name,Variant &r_ret) const { r_ret= int(keep_aspect); else if (p_name=="current") { - if (is_inside_tree() && get_tree()->is_editor_hint()) { + if (is_inside_tree() && get_tree()->is_node_being_edited(this)) { r_ret=current; } else { r_ret=is_current(); @@ -192,12 +192,11 @@ void Camera::_update_camera() { // here goes listener stuff // if (viewport_ptr && is_inside_scene() && is_current()) -// viewport_ptr->_camera_transform_changed_notify(); +// get_viewport()->_camera_transform_changed_notify(); if (is_inside_tree() && is_current()) { - if (viewport_ptr) { - viewport_ptr->_camera_transform_changed_notify(); - } + get_viewport()->_camera_transform_changed_notify(); + } if (is_current() && get_world().is_valid()) { @@ -213,29 +212,10 @@ void Camera::_notification(int p_what) { case NOTIFICATION_ENTER_WORLD: { - viewport_ptr=NULL; - - { //find viewport stuff - Node *parent=get_parent(); - while(parent) { - - Viewport* viewport = parent->cast_to<Viewport>(); - - if (viewport) { - viewport_ptr=viewport; - break; - } - parent=parent->get_parent(); - } - - } - - camera_group = "_vp_cameras"+itos(get_viewport()->get_instance_ID()); - add_to_group(camera_group); - if (viewport_ptr) - viewport_ptr->cameras.insert(this); - if (current) + bool first_camera = get_viewport()->cameras.size()==0; + get_viewport()->cameras.insert(this); + if (!get_tree()->is_node_being_edited(this) && (current || first_camera)) make_current(); @@ -246,17 +226,17 @@ void Camera::_notification(int p_what) { } break; case NOTIFICATION_EXIT_WORLD: { - if (is_current()) { - clear_current(); - current=true; //keep it true + if (!get_tree()->is_node_being_edited(this)) { + if (is_current()) { + clear_current(); + current=true; //keep it true - } else { - current=false; + } else { + current=false; + } } - if (viewport_ptr) - viewport_ptr->cameras.erase(this); - viewport_ptr=NULL; - remove_from_group(camera_group); + + get_viewport()->cameras.erase(this); } break; @@ -324,25 +304,12 @@ void Camera::make_current() { if (!is_inside_tree()) return; - if (viewport_ptr) { - viewport_ptr->_set_camera(this); - } + get_viewport()->_set_camera(this); //get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,camera_group,"_camera_make_current",this); } -void Camera::_camera_make_next_current(Node *p_exclude) { - - if (this==p_exclude) - return; - if (!is_inside_tree()) - return; - if (get_viewport()->get_camera()!=NULL) - return; - - make_current(); -} void Camera::clear_current() { @@ -351,12 +318,20 @@ void Camera::clear_current() { if (!is_inside_tree()) return; - if (viewport_ptr) { - if (viewport_ptr->get_camera()==this) { - viewport_ptr->_set_camera(NULL); - //a group is used beause this needs to be in order to be deterministic - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,camera_group,"_camera_make_next_current",this); + if (get_viewport()->get_camera()==this) { + get_viewport()->_set_camera(NULL); + //a group is used beause this needs to be in order to be deterministic + + for (Set<Camera*>::Element *E=get_viewport()->cameras.front();E;E=E->next()) { + if (this==E->get()) + continue; + if (!E->get()->is_inside_tree()) + continue; + if (get_viewport()->get_camera()!=NULL) + return; + + E->get()->make_current(); } } @@ -364,9 +339,9 @@ void Camera::clear_current() { bool Camera::is_current() const { - if (is_inside_tree()) { - if (viewport_ptr) - return viewport_ptr->get_camera()==this; + if (is_inside_tree() && !get_tree()->is_node_being_edited(this)) { + + return get_viewport()->get_camera()==this; } else return current; @@ -481,12 +456,12 @@ Vector3 Camera::project_local_ray_normal(const Point2& p_pos) const { #if 0 - Size2 viewport_size = viewport_ptr->get_visible_rect().size; + Size2 viewport_size = get_viewport()->get_visible_rect().size; Vector2 cpos = p_pos; #else - Size2 viewport_size = viewport_ptr->get_camera_rect_size(); - Vector2 cpos = viewport_ptr->get_camera_coords(p_pos); + Size2 viewport_size = get_viewport()->get_camera_rect_size(); + Vector2 cpos = get_viewport()->get_camera_coords(p_pos); #endif Vector3 ray; @@ -514,12 +489,12 @@ Vector3 Camera::project_ray_origin(const Point2& p_pos) const { } #if 0 - Size2 viewport_size = viewport_ptr->get_visible_rect().size; + Size2 viewport_size = get_viewport()->get_visible_rect().size; Vector2 cpos = p_pos; #else - Size2 viewport_size = viewport_ptr->get_camera_rect_size(); - Vector2 cpos = viewport_ptr->get_camera_coords(p_pos); + Size2 viewport_size = get_viewport()->get_camera_rect_size(); + Vector2 cpos = get_viewport()->get_camera_coords(p_pos); #endif ERR_FAIL_COND_V( viewport_size.y == 0, Vector3() ); @@ -566,7 +541,7 @@ Point2 Camera::unproject_position(const Vector3& p_pos) const { ERR_FAIL_COND_V(!is_inside_tree(),Vector2()); } - Size2 viewport_size = viewport_ptr->get_visible_rect().size; + Size2 viewport_size = get_viewport()->get_visible_rect().size; CameraMatrix cm; @@ -597,7 +572,7 @@ Vector3 Camera::project_position(const Point2& p_point) const { ERR_FAIL_COND_V(!is_inside_tree(),Vector3()); } - Size2 viewport_size = viewport_ptr->get_visible_rect().size; + Size2 viewport_size = get_viewport()->get_visible_rect().size; CameraMatrix cm; @@ -692,7 +667,6 @@ void Camera::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_environment:Environment"),&Camera::get_environment); ObjectTypeDB::bind_method(_MD("set_keep_aspect_mode","mode"),&Camera::set_keep_aspect_mode); ObjectTypeDB::bind_method(_MD("get_keep_aspect_mode"),&Camera::get_keep_aspect_mode); - ObjectTypeDB::bind_method(_MD("_camera_make_next_current"),&Camera::_camera_make_next_current); //ObjectTypeDB::bind_method( _MD("_camera_make_current"),&Camera::_camera_make_current ); BIND_CONSTANT( PROJECTION_PERSPECTIVE ); @@ -745,7 +719,7 @@ Vector<Plane> Camera::get_frustum() const { ERR_FAIL_COND_V(!is_inside_world(),Vector<Plane>()); - Size2 viewport_size = viewport_ptr->get_visible_rect().size; + Size2 viewport_size = get_viewport()->get_visible_rect().size; CameraMatrix cm; if (mode==PROJECTION_PERSPECTIVE) cm.set_perspective(fov,viewport_size.get_aspect(),near,far,keep_aspect==KEEP_WIDTH); @@ -789,7 +763,6 @@ Camera::Camera() { near=0; far=0; current=false; - viewport_ptr=NULL; force_change=false; mode=PROJECTION_PERSPECTIVE; set_perspective(60.0,0.1,100.0); diff --git a/scene/3d/camera.h b/scene/3d/camera.h index e21f4865ec..02ca6ffb9a 100644 --- a/scene/3d/camera.h +++ b/scene/3d/camera.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -68,18 +68,15 @@ private: RID camera; RID scenario_id; - String camera_group; + //String camera_group; uint32_t layers; - Viewport *viewport_ptr; Ref<Environment> environment; virtual bool _can_gizmo_scale() const; virtual RES _get_gizmo_geometry() const; - void _camera_make_next_current(Node *p_exclude); - //void _camera_make_current(Node *p_camera); friend class Viewport; diff --git a/scene/3d/character_camera.cpp b/scene/3d/character_camera.cpp index 19332bd056..2b22026fe9 100644 --- a/scene/3d/character_camera.cpp +++ b/scene/3d/character_camera.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/character_camera.h b/scene/3d/character_camera.h index 99b41c6eda..d636b4b1a5 100644 --- a/scene/3d/character_camera.h +++ b/scene/3d/character_camera.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp index 5ecadb48b8..b50878da07 100644 --- a/scene/3d/collision_object.cpp +++ b/scene/3d/collision_object.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/collision_object.h b/scene/3d/collision_object.h index 548c9fb85b..f8daeb3ed2 100644 --- a/scene/3d/collision_object.h +++ b/scene/3d/collision_object.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp index bb0a1fca12..3b14e1d767 100644 --- a/scene/3d/collision_polygon.cpp +++ b/scene/3d/collision_polygon.cpp @@ -236,7 +236,7 @@ void CollisionPolygon::_bind_methods() { ObjectTypeDB::bind_method(_MD("_add_to_collision_object"),&CollisionPolygon::_add_to_collision_object); - ObjectTypeDB::bind_method(_MD("set_build_mode"),&CollisionPolygon::set_build_mode); + ObjectTypeDB::bind_method(_MD("set_build_mode","build_mode"),&CollisionPolygon::set_build_mode); ObjectTypeDB::bind_method(_MD("get_build_mode"),&CollisionPolygon::get_build_mode); ObjectTypeDB::bind_method(_MD("set_depth","depth"),&CollisionPolygon::set_depth); diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp index f44713e8a0..96306d1180 100644 --- a/scene/3d/interpolated_camera.cpp +++ b/scene/3d/interpolated_camera.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/interpolated_camera.h b/scene/3d/interpolated_camera.h index a8ed649c42..dbe84327fb 100644 --- a/scene/3d/interpolated_camera.h +++ b/scene/3d/interpolated_camera.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 9f9c87b675..18463742c6 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -487,9 +487,9 @@ bool Light::is_editor_only() const{ void Light::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_parameter","variable","value"), &Light::set_parameter ); - ObjectTypeDB::bind_method(_MD("get_parameter"), &Light::get_parameter ); + ObjectTypeDB::bind_method(_MD("get_parameter","variable"), &Light::get_parameter ); ObjectTypeDB::bind_method(_MD("set_color","color","value"), &Light::set_color ); - ObjectTypeDB::bind_method(_MD("get_color"), &Light::get_color ); + ObjectTypeDB::bind_method(_MD("get_color","color"), &Light::get_color ); ObjectTypeDB::bind_method(_MD("set_project_shadows","enable"), &Light::set_project_shadows ); ObjectTypeDB::bind_method(_MD("has_project_shadows"), &Light::has_project_shadows ); ObjectTypeDB::bind_method(_MD("set_projector","projector:Texture"), &Light::set_projector ); diff --git a/scene/3d/light.h b/scene/3d/light.h index fb77ac9e64..b74085b7a9 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp index 62b32729c3..997d2dea7c 100644 --- a/scene/3d/mesh_instance.cpp +++ b/scene/3d/mesh_instance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/mesh_instance.h b/scene/3d/mesh_instance.h index 76a0eeea60..f26ef52000 100644 --- a/scene/3d/mesh_instance.h +++ b/scene/3d/mesh_instance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp index cd620ff447..0e97a97943 100644 --- a/scene/3d/multimesh_instance.cpp +++ b/scene/3d/multimesh_instance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/multimesh_instance.h b/scene/3d/multimesh_instance.h index be6b3677e2..7cd9a8ea82 100644 --- a/scene/3d/multimesh_instance.h +++ b/scene/3d/multimesh_instance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/optimized_spatial_scene.cpp b/scene/3d/optimized_spatial_scene.cpp index 85c1b79a9a..27631c7a74 100644 --- a/scene/3d/optimized_spatial_scene.cpp +++ b/scene/3d/optimized_spatial_scene.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/optimized_spatial_scene.h b/scene/3d/optimized_spatial_scene.h index a55b5235da..e1e6e14f73 100644 --- a/scene/3d/optimized_spatial_scene.h +++ b/scene/3d/optimized_spatial_scene.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 6868646c48..dfd5c38266 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -422,14 +422,14 @@ void Particles::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_variable","variable","value"),&Particles::set_variable); ObjectTypeDB::bind_method(_MD("get_variable","variable"),&Particles::get_variable); ObjectTypeDB::bind_method(_MD("set_randomness","variable","randomness"),&Particles::set_randomness); - ObjectTypeDB::bind_method(_MD("get_randomness"),&Particles::get_randomness); + ObjectTypeDB::bind_method(_MD("get_randomness","variable"),&Particles::get_randomness); ObjectTypeDB::bind_method(_MD("set_color_phase_pos","phase","pos"),&Particles::set_color_phase_pos); ObjectTypeDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles::get_color_phase_pos); ObjectTypeDB::bind_method(_MD("set_color_phase_color","phase","color"),&Particles::set_color_phase_color); ObjectTypeDB::bind_method(_MD("get_color_phase_color","phase"),&Particles::get_color_phase_color); ObjectTypeDB::bind_method(_MD("set_material","material:Material"),&Particles::set_material); ObjectTypeDB::bind_method(_MD("get_material:Material"),&Particles::get_material); - ObjectTypeDB::bind_method(_MD("set_emit_timeout"),&Particles::set_emit_timeout); + ObjectTypeDB::bind_method(_MD("set_emit_timeout","timeout"),&Particles::set_emit_timeout); ObjectTypeDB::bind_method(_MD("get_emit_timeout"),&Particles::get_emit_timeout); ObjectTypeDB::bind_method(_MD("set_height_from_velocity","enable"),&Particles::set_height_from_velocity); ObjectTypeDB::bind_method(_MD("has_height_from_velocity"),&Particles::has_height_from_velocity); diff --git a/scene/3d/particles.h b/scene/3d/particles.h index 260573fe5f..b9cae332e2 100644 --- a/scene/3d/particles.h +++ b/scene/3d/particles.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp index 9cd41b25f6..d6cd3da7c3 100644 --- a/scene/3d/path.cpp +++ b/scene/3d/path.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/path.h b/scene/3d/path.h index 1b40ec413d..2e3573df3e 100644 --- a/scene/3d/path.h +++ b/scene/3d/path.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index de50484a1e..1a2665b6ad 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -207,6 +207,9 @@ void RigidBody::_body_enter_tree(ObjectID p_id) { ERR_FAIL_COND(E->get().in_tree); E->get().in_tree=true; + + contact_monitor->locked=true; + emit_signal(SceneStringNames::get_singleton()->body_enter,node); for(int i=0;i<E->get().shapes.size();i++) { @@ -214,6 +217,9 @@ void RigidBody::_body_enter_tree(ObjectID p_id) { emit_signal(SceneStringNames::get_singleton()->body_enter_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape); } + contact_monitor->locked=false; + + } void RigidBody::_body_exit_tree(ObjectID p_id) { @@ -225,11 +231,18 @@ void RigidBody::_body_exit_tree(ObjectID p_id) { ERR_FAIL_COND(!E); ERR_FAIL_COND(!E->get().in_tree); E->get().in_tree=false; + + contact_monitor->locked=true; + emit_signal(SceneStringNames::get_singleton()->body_exit,node); + for(int i=0;i<E->get().shapes.size();i++) { emit_signal(SceneStringNames::get_singleton()->body_exit_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape); } + + contact_monitor->locked=false; + } void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,int p_local_shape) { @@ -317,6 +330,8 @@ void RigidBody::_direct_state_changed(Object *p_state) { if (contact_monitor) { + contact_monitor->locked=true; + //untag all int rc=0; for( Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) { @@ -396,6 +411,8 @@ void RigidBody::_direct_state_changed(Object *p_state) { _body_inout(1,toadd[i].id,toadd[i].shape,toadd[i].local_shape); } + contact_monitor->locked=false; + } set_ignore_transform_notification(true); @@ -648,6 +665,11 @@ void RigidBody::set_contact_monitor(bool p_enabled) { if (!p_enabled) { + if (contact_monitor->locked) { + ERR_EXPLAIN("Can't disable contact monitoring during in/out callback. Use call_deferred(\"set_contact_monitor\",false) instead"); + } + ERR_FAIL_COND(contact_monitor->locked); + for(Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) { //clean up mess @@ -658,6 +680,8 @@ void RigidBody::set_contact_monitor(bool p_enabled) { } else { contact_monitor = memnew( ContactMonitor ); + contact_monitor->locked=false; + } } diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h index 0e63b77118..da79d63f00 100644 --- a/scene/3d/physics_body.h +++ b/scene/3d/physics_body.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -175,7 +175,7 @@ private: struct ContactMonitor { - + bool locked; Map<ObjectID,BodyState> body_map; }; diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp index f4facb7c3f..3f03b2aab3 100644 --- a/scene/3d/physics_joint.cpp +++ b/scene/3d/physics_joint.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -141,7 +141,7 @@ void Joint::_notification(int p_what) { case NOTIFICATION_EXIT_TREE: { if (joint.is_valid()) { _update_joint(true); - PhysicsServer::get_singleton()->free(joint); + //PhysicsServer::get_singleton()->free(joint); joint=RID(); } } break; diff --git a/scene/3d/physics_joint.h b/scene/3d/physics_joint.h index 3f5a0e91a6..55c26f296e 100644 --- a/scene/3d/physics_joint.h +++ b/scene/3d/physics_joint.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/portal.cpp b/scene/3d/portal.cpp index 34499578aa..84f94402d5 100644 --- a/scene/3d/portal.cpp +++ b/scene/3d/portal.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/portal.h b/scene/3d/portal.h index 14c1275312..388eac4dd3 100644 --- a/scene/3d/portal.h +++ b/scene/3d/portal.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/position_3d.cpp b/scene/3d/position_3d.cpp index d692c0f249..27130cbe6a 100644 --- a/scene/3d/position_3d.cpp +++ b/scene/3d/position_3d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/position_3d.h b/scene/3d/position_3d.h index 265c0b48c7..6bac540fcb 100644 --- a/scene/3d/position_3d.h +++ b/scene/3d/position_3d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/proximity_group.cpp b/scene/3d/proximity_group.cpp index 334246b033..a2182302a0 100644 --- a/scene/3d/proximity_group.cpp +++ b/scene/3d/proximity_group.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/proximity_group.h b/scene/3d/proximity_group.h index 35e3f3dd98..6d5c703827 100644 --- a/scene/3d/proximity_group.h +++ b/scene/3d/proximity_group.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/quad.cpp b/scene/3d/quad.cpp index 43bde8dc61..1a7eeef180 100644 --- a/scene/3d/quad.cpp +++ b/scene/3d/quad.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/quad.h b/scene/3d/quad.h index 5ef4af8b81..be55b0d1c9 100644 --- a/scene/3d/quad.h +++ b/scene/3d/quad.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp index 5f2c8e0ba3..ab2c4fc8dc 100644 --- a/scene/3d/ray_cast.cpp +++ b/scene/3d/ray_cast.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/ray_cast.h b/scene/3d/ray_cast.h index 06e9e31396..520b4d5313 100644 --- a/scene/3d/ray_cast.h +++ b/scene/3d/ray_cast.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp index 2ae75b8b68..e358da136b 100644 --- a/scene/3d/room_instance.cpp +++ b/scene/3d/room_instance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/room_instance.h b/scene/3d/room_instance.h index 09fccc5ebc..c7df4ceadd 100644 --- a/scene/3d/room_instance.h +++ b/scene/3d/room_instance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/scenario_fx.cpp b/scene/3d/scenario_fx.cpp index 59c8b5e0df..2e22ab36d3 100644 --- a/scene/3d/scenario_fx.cpp +++ b/scene/3d/scenario_fx.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/scenario_fx.h b/scene/3d/scenario_fx.h index b877cccc19..a3c13e03a1 100644 --- a/scene/3d/scenario_fx.h +++ b/scene/3d/scenario_fx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp index cb81228dff..64133f67b5 100644 --- a/scene/3d/skeleton.cpp +++ b/scene/3d/skeleton.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h index 6678722d12..033f212a58 100644 --- a/scene/3d/skeleton.h +++ b/scene/3d/skeleton.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 7d48420a83..0c1e1e2d1c 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial.h b/scene/3d/spatial.h index b1e3a82868..23f1c6d103 100644 --- a/scene/3d/spatial.h +++ b/scene/3d/spatial.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_indexer.cpp b/scene/3d/spatial_indexer.cpp index 2f7aee5c67..d5be36b2cb 100644 --- a/scene/3d/spatial_indexer.cpp +++ b/scene/3d/spatial_indexer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_indexer.h b/scene/3d/spatial_indexer.h index bc19b54d8f..13ce8badea 100644 --- a/scene/3d/spatial_indexer.h +++ b/scene/3d/spatial_indexer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_player.cpp b/scene/3d/spatial_player.cpp index 5948c01ff8..c7cf03e284 100644 --- a/scene/3d/spatial_player.cpp +++ b/scene/3d/spatial_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_player.h b/scene/3d/spatial_player.h index 2f54497847..5a8687b854 100644 --- a/scene/3d/spatial_player.h +++ b/scene/3d/spatial_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_sample_player.cpp b/scene/3d/spatial_sample_player.cpp index 28b8fdd01e..7114fd4b77 100644 --- a/scene/3d/spatial_sample_player.cpp +++ b/scene/3d/spatial_sample_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_sample_player.h b/scene/3d/spatial_sample_player.h index 1d7bb8e238..9b3220458e 100644 --- a/scene/3d/spatial_sample_player.h +++ b/scene/3d/spatial_sample_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_stream_player.cpp b/scene/3d/spatial_stream_player.cpp index 7ed2335fcb..dfef0faf4b 100644 --- a/scene/3d/spatial_stream_player.cpp +++ b/scene/3d/spatial_stream_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -60,7 +60,7 @@ void SpatialStreamPlayer::sp_set_mix_rate(int p_rate){ bool SpatialStreamPlayer::sp_mix(int32_t *p_buffer,int p_frames) { - if (resampler.is_ready()) { + if (resampler.is_ready() && !paused) { return resampler.mix(p_buffer,p_frames); } @@ -332,7 +332,7 @@ void SpatialStreamPlayer::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_stream","stream:Stream"),&SpatialStreamPlayer::set_stream); ObjectTypeDB::bind_method(_MD("get_stream:Stream"),&SpatialStreamPlayer::get_stream); - ObjectTypeDB::bind_method(_MD("play"),&SpatialStreamPlayer::play,DEFVAL(0)); + ObjectTypeDB::bind_method(_MD("play","offset"),&SpatialStreamPlayer::play,DEFVAL(0)); ObjectTypeDB::bind_method(_MD("stop"),&SpatialStreamPlayer::stop); ObjectTypeDB::bind_method(_MD("is_playing"),&SpatialStreamPlayer::is_playing); diff --git a/scene/3d/spatial_stream_player.h b/scene/3d/spatial_stream_player.h index f2775a4982..0732b3fc10 100644 --- a/scene/3d/spatial_stream_player.h +++ b/scene/3d/spatial_stream_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/test_cube.cpp b/scene/3d/test_cube.cpp index 0acd1b3351..6440d95d55 100644 --- a/scene/3d/test_cube.cpp +++ b/scene/3d/test_cube.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/test_cube.h b/scene/3d/test_cube.h index 2dbd7c9856..21f2b3c794 100644 --- a/scene/3d/test_cube.h +++ b/scene/3d/test_cube.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp index ad62f6d809..60097ad482 100644 --- a/scene/3d/visibility_notifier.cpp +++ b/scene/3d/visibility_notifier.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/visibility_notifier.h b/scene/3d/visibility_notifier.h index 85c26bec94..a4709b7cf4 100644 --- a/scene/3d/visibility_notifier.h +++ b/scene/3d/visibility_notifier.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index 41e8b6bf54..723b0a9af5 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/visual_instance.h b/scene/3d/visual_instance.h index 3c69f09978..e49f4fb82f 100644 --- a/scene/3d/visual_instance.h +++ b/scene/3d/visual_instance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp index b1d6da7294..b1123897b2 100644 --- a/scene/animation/animation_cache.cpp +++ b/scene/animation/animation_cache.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/animation_cache.h b/scene/animation/animation_cache.h index e94530d924..c9b4ff298c 100644 --- a/scene/animation/animation_cache.h +++ b/scene/animation/animation_cache.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index b040e59d16..f6d058c2fd 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index 18cedee796..853526c80a 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index eeb2e6aa32..77d9f77bb5 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h index fb1c9016ff..0fec9a9551 100644 --- a/scene/animation/animation_tree_player.h +++ b/scene/animation/animation_tree_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/transitioner.cpp b/scene/animation/transitioner.cpp index d210f29db0..adcf73d489 100644 --- a/scene/animation/transitioner.cpp +++ b/scene/animation/transitioner.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/transitioner.h b/scene/animation/transitioner.h index dba83cddd8..8b7ec4f3fa 100644 --- a/scene/animation/transitioner.h +++ b/scene/animation/transitioner.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 73d93e50ec..31f30dd1d9 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/tween.h b/scene/animation/tween.h index d504c63d8a..f06ca1e9e7 100644 --- a/scene/animation/tween.h +++ b/scene/animation/tween.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/tween_interpolaters.cpp b/scene/animation/tween_interpolaters.cpp index 9128d220de..80588d643e 100644 --- a/scene/animation/tween_interpolaters.cpp +++ b/scene/animation/tween_interpolaters.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/audio/event_player.cpp b/scene/audio/event_player.cpp index 1bd692431d..b49b285f76 100644 --- a/scene/audio/event_player.cpp +++ b/scene/audio/event_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -312,16 +312,14 @@ void EventPlayer::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_pos"),&EventPlayer::get_pos); ObjectTypeDB::bind_method(_MD("seek_pos","time"),&EventPlayer::seek_pos); + ObjectTypeDB::bind_method(_MD("get_length"),&EventPlayer::get_length); + ObjectTypeDB::bind_method(_MD("set_autoplay","enabled"),&EventPlayer::set_autoplay); ObjectTypeDB::bind_method(_MD("has_autoplay"),&EventPlayer::has_autoplay); ObjectTypeDB::bind_method(_MD("set_channel_volume","idx","channel_volume"),&EventPlayer::set_channel_volume); - ObjectTypeDB::bind_method(_MD("get_channel_volume""idx"),&EventPlayer::get_channel_volume); - - ObjectTypeDB::bind_method(_MD("get_length"),&EventPlayer::get_length); - - - ObjectTypeDB::bind_method(_MD("get_channel_last_note_time"),&EventPlayer::get_channel_last_note_time); + ObjectTypeDB::bind_method(_MD("get_channel_volume","idx"),&EventPlayer::get_channel_volume); + ObjectTypeDB::bind_method(_MD("get_channel_last_note_time","idx"),&EventPlayer::get_channel_last_note_time); ObjectTypeDB::bind_method(_MD("_set_play","play"),&EventPlayer::_set_play); ObjectTypeDB::bind_method(_MD("_get_play"),&EventPlayer::_get_play); diff --git a/scene/audio/event_player.h b/scene/audio/event_player.h index 05e78040d2..c04e85fe77 100644 --- a/scene/audio/event_player.h +++ b/scene/audio/event_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/audio/sample_player.cpp b/scene/audio/sample_player.cpp index 7c0a926324..d7605ed1a9 100644 --- a/scene/audio/sample_player.cpp +++ b/scene/audio/sample_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/audio/sample_player.h b/scene/audio/sample_player.h index 75a01aff86..1821c671dc 100644 --- a/scene/audio/sample_player.h +++ b/scene/audio/sample_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/audio/sound_room_params.cpp b/scene/audio/sound_room_params.cpp index 8886113e03..bb2285c97f 100644 --- a/scene/audio/sound_room_params.cpp +++ b/scene/audio/sound_room_params.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/audio/sound_room_params.h b/scene/audio/sound_room_params.h index 8af2ae8c12..4ca1eae2ce 100644 --- a/scene/audio/sound_room_params.h +++ b/scene/audio/sound_room_params.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp index d08fdd0c76..f7cfc31b03 100644 --- a/scene/audio/stream_player.cpp +++ b/scene/audio/stream_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -58,7 +58,7 @@ void StreamPlayer::sp_set_mix_rate(int p_rate){ bool StreamPlayer::sp_mix(int32_t *p_buffer,int p_frames) { - if (resampler.is_ready()) { + if (resampler.is_ready() && !paused) { return resampler.mix(p_buffer,p_frames); } @@ -170,6 +170,7 @@ void StreamPlayer::stop() { stop_request=false; playback->stop(); resampler.flush(); + emit_signal("finished"); //set_idle_process(false); } @@ -333,7 +334,7 @@ void StreamPlayer::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_stream","stream:Stream"),&StreamPlayer::set_stream); ObjectTypeDB::bind_method(_MD("get_stream:Stream"),&StreamPlayer::get_stream); - ObjectTypeDB::bind_method(_MD("play"),&StreamPlayer::play,DEFVAL(0)); + ObjectTypeDB::bind_method(_MD("play","offset"),&StreamPlayer::play,DEFVAL(0)); ObjectTypeDB::bind_method(_MD("stop"),&StreamPlayer::stop); ObjectTypeDB::bind_method(_MD("is_playing"),&StreamPlayer::is_playing); @@ -378,6 +379,8 @@ void StreamPlayer::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/paused"), _SCS("set_paused"), _SCS("is_paused") ); ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") ); ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") ); + + ADD_SIGNAL(MethodInfo("finished")); } diff --git a/scene/audio/stream_player.h b/scene/audio/stream_player.h index 0a29e78de7..30840137e2 100644 --- a/scene/audio/stream_player.h +++ b/scene/audio/stream_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 0c63a3bc74..698dbce2b5 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/base_button.h b/scene/gui/base_button.h index e187a85eae..83c66326c5 100644 --- a/scene/gui/base_button.h +++ b/scene/gui/base_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp index b63b3de530..6fff90809e 100644 --- a/scene/gui/box_container.cpp +++ b/scene/gui/box_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/box_container.h b/scene/gui/box_container.h index c357814baf..6e63e8bdac 100644 --- a/scene/gui/box_container.h +++ b/scene/gui/box_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index edeb18bfc1..b9ce46d738 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -137,8 +137,10 @@ void Button::_notification(int p_what) { text_ofs.y+=font->get_ascent(); font->draw( ci, text_ofs.floor(), text, color,clip_text?text_clip:-1); if (!_icon.is_null()) { + + int valign = size.height-style->get_minimum_size().y; - _icon->draw(ci,Point2(style->get_offset().x, Math::floor( (size.height-_icon->get_height())/2.0 ) ),is_disabled()?Color(1,1,1,0.4):Color(1,1,1) ); + _icon->draw(ci,style->get_offset()+Point2(0, Math::floor( (valign-_icon->get_height())/2.0 ) ),is_disabled()?Color(1,1,1,0.4):Color(1,1,1) ); } diff --git a/scene/gui/button.h b/scene/gui/button.h index 690179b90c..bd244f5087 100644 --- a/scene/gui/button.h +++ b/scene/gui/button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/button_array.cpp b/scene/gui/button_array.cpp index b86e32dda7..9e3476899f 100644 --- a/scene/gui/button_array.cpp +++ b/scene/gui/button_array.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/button_array.h b/scene/gui/button_array.h index ea2c1e4968..39661eaabd 100644 --- a/scene/gui/button_array.h +++ b/scene/gui/button_array.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/button_group.cpp b/scene/gui/button_group.cpp index c92d7f2696..04ba5fc06d 100644 --- a/scene/gui/button_group.cpp +++ b/scene/gui/button_group.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/button_group.h b/scene/gui/button_group.h index 74e847e937..38c61991b7 100644 --- a/scene/gui/button_group.h +++ b/scene/gui/button_group.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/center_container.cpp b/scene/gui/center_container.cpp index 8a22a38980..844175e4c1 100644 --- a/scene/gui/center_container.cpp +++ b/scene/gui/center_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/center_container.h b/scene/gui/center_container.h index 4d8d06ac8c..dc95533525 100644 --- a/scene/gui/center_container.h +++ b/scene/gui/center_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp index 2aa82bc5f5..1381d6eb60 100644 --- a/scene/gui/check_box.cpp +++ b/scene/gui/check_box.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/check_box.h b/scene/gui/check_box.h index 171fd55351..95dd4891d4 100644 --- a/scene/gui/check_box.h +++ b/scene/gui/check_box.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/check_button.cpp b/scene/gui/check_button.cpp index d765aefe5e..ecaea251a5 100644 --- a/scene/gui/check_button.cpp +++ b/scene/gui/check_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/check_button.h b/scene/gui/check_button.h index b90bb31c2d..022ade2193 100644 --- a/scene/gui/check_button.h +++ b/scene/gui/check_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index c30d473610..7d6c986d96 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index 0756e88cf2..95c26a9c6f 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index 2ff51d22c4..920c6bf1e6 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/container.h b/scene/gui/container.h index 04d5d6ab36..1c7587c155 100644 --- a/scene/gui/container.h +++ b/scene/gui/container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index ec4886a6ac..5a8ecfeffe 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -862,6 +862,13 @@ bool Control::window_has_modal_stack() const { return data.window->window->modal_stack.size(); } +bool Control::is_window_modal_on_top() const { + + if (window_has_modal_stack()) + return data.window->window->modal_stack.back()->get()==this; + return false; +} + void Control::_window_cancel_tooltip() { window->tooltip=NULL; @@ -916,6 +923,7 @@ void Control::_window_show_tooltip() { void Control::_window_call_input(Control *p_control,const InputEvent& p_input) { +// _block(); while(p_control) { @@ -932,6 +940,9 @@ void Control::_window_call_input(Control *p_control,const InputEvent& p_input) { break; p_control=p_control->data.parent; } + + //_unblock(); + } void Control::_window_input_event(InputEvent p_event) { @@ -1067,6 +1078,7 @@ void Control::_window_input_event(InputEvent p_event) { Size2 pos = mpos; pos = window->focus_inv_xform.xform(pos); + window->mouse_over->drop_data(pos,window->drag_data); window->drag_data=Variant(); //change mouse accordingly diff --git a/scene/gui/control.h b/scene/gui/control.h index 09a4b48e6b..0ead632aab 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -270,6 +270,8 @@ public: void set_custom_minimum_size(const Size2& p_custom); Size2 get_custom_minimum_size() const; + bool is_window_modal_on_top() const; + bool is_window() const; Control *get_window() const; Control *get_parent_control() const; diff --git a/scene/gui/custom_button.cpp b/scene/gui/custom_button.cpp index 53a3bf0914..a70af05418 100644 --- a/scene/gui/custom_button.cpp +++ b/scene/gui/custom_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/custom_button.h b/scene/gui/custom_button.h index 49fcf7408f..2492750489 100644 --- a/scene/gui/custom_button.h +++ b/scene/gui/custom_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index efda8a66e1..9f08b6f845 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h index 67c574a420..7c06ded866 100644 --- a/scene/gui/dialogs.h +++ b/scene/gui/dialogs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 22e3a81e52..5b57395e58 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -49,14 +49,49 @@ void FileDialog::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { - refresh->set_icon(get_icon("Reload","EditorIcons")); + refresh->set_icon(get_icon("reload")); } if (p_what==NOTIFICATION_DRAW) { //RID ci = get_canvas_item(); //get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size())); - } + } + + if (p_what==NOTIFICATION_POPUP_HIDE) { + + set_process_unhandled_input(false); + } +} + +void FileDialog::_unhandled_input(const InputEvent& p_event) { + + if (p_event.type==InputEvent::KEY && is_window_modal_on_top()) { + + const InputEventKey &k=p_event.key; + + if (k.pressed) { + + bool handled=true; + + switch (k.scancode) { + + case KEY_H: { + + if (k.mod.command) { + set_show_hidden_files(!show_hidden_files); + } else { + handled=false; + } + + } break; + default: { handled=false; } + } + + if (handled) + accept_event(); + } + } } void FileDialog::set_enable_multiple_selection(bool p_enable) { @@ -114,6 +149,8 @@ void FileDialog::_post_popup() { else tree->grab_focus(); + set_process_unhandled_input(true); + } void FileDialog::_action_pressed() { @@ -628,6 +665,8 @@ bool FileDialog::default_show_hidden_files=false; void FileDialog::_bind_methods() { + ObjectTypeDB::bind_method(_MD("_unhandled_input"),&FileDialog::_unhandled_input); + ObjectTypeDB::bind_method(_MD("_tree_selected"),&FileDialog::_tree_selected); ObjectTypeDB::bind_method(_MD("_tree_db_selected"),&FileDialog::_tree_dc_selected); ObjectTypeDB::bind_method(_MD("_dir_entered"),&FileDialog::_dir_entered); @@ -650,7 +689,7 @@ void FileDialog::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_vbox:VBoxContainer"),&FileDialog::get_vbox); ObjectTypeDB::bind_method(_MD("set_access","access"),&FileDialog::set_access); ObjectTypeDB::bind_method(_MD("get_access"),&FileDialog::get_access); - ObjectTypeDB::bind_method(_MD("set_show_hidden_files"),&FileDialog::set_show_hidden_files); + ObjectTypeDB::bind_method(_MD("set_show_hidden_files","show"),&FileDialog::set_show_hidden_files); ObjectTypeDB::bind_method(_MD("is_showing_hidden_files"),&FileDialog::is_showing_hidden_files); ObjectTypeDB::bind_method(_MD("_select_drive"),&FileDialog::_select_drive); ObjectTypeDB::bind_method(_MD("_make_dir"),&FileDialog::_make_dir); diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h index 370088b215..b71a157fa7 100644 --- a/scene/gui/file_dialog.h +++ b/scene/gui/file_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -117,6 +117,8 @@ private: void _update_drives(); + void _unhandled_input(const InputEvent& p_event); + virtual void _post_popup(); protected: diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index 105f66f368..a514f1b3d7 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/grid_container.h b/scene/gui/grid_container.h index 8d8bc27293..588bb17fa1 100644 --- a/scene/gui/grid_container.h +++ b/scene/gui/grid_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 002e49cbcf..e8097c79a4 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/label.h b/scene/gui/label.h index 4ea9f5d377..3c14add60d 100644 --- a/scene/gui/label.h +++ b/scene/gui/label.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 10ba20a833..fdced3f62f 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -245,12 +245,26 @@ void LineEdit::_input_event(InputEvent p_event) { delete_char(); } } break; + case KEY_KP_4: { + if (k.unicode != 0) { + handled = false; + break; + } + // numlock disabled. fallthrough to key_left + } case KEY_LEFT: { shift_selection_check_pre(k.mod.shift); set_cursor_pos(get_cursor_pos()-1); shift_selection_check_post(k.mod.shift); } break; + case KEY_KP_6: { + if (k.unicode != 0) { + handled = false; + break; + } + // numlock disabled. fallthrough to key_right + } case KEY_RIGHT: { shift_selection_check_pre(k.mod.shift); @@ -271,12 +285,26 @@ void LineEdit::_input_event(InputEvent p_event) { } } break; + case KEY_KP_7: { + if (k.unicode != 0) { + handled = false; + break; + } + // numlock disabled. fallthrough to key_home + } case KEY_HOME: { shift_selection_check_pre(k.mod.shift); set_cursor_pos(0); shift_selection_check_post(k.mod.shift); } break; + case KEY_KP_1: { + if (k.unicode != 0) { + handled = false; + break; + } + // numlock disabled. fallthrough to key_end + } case KEY_END: { shift_selection_check_pre(k.mod.shift); @@ -287,26 +315,29 @@ void LineEdit::_input_event(InputEvent p_event) { default: { - if (k.unicode>=32 && k.scancode!=KEY_DELETE) { - - if (editable) { - selection_delete(); - CharType ucodestr[2]={(CharType)k.unicode,0}; - append_at_cursor(ucodestr); - emit_signal("text_changed",text); - _change_notify("text"); - } - - } else { - handled=false; - } + handled=false; } break; } - if (handled) + if (handled) { accept_event(); - else - return; + } else { + if (k.unicode>=32 && k.scancode!=KEY_DELETE) { + + if (editable) { + selection_delete(); + CharType ucodestr[2]={(CharType)k.unicode,0}; + append_at_cursor(ucodestr); + emit_signal("text_changed",text); + _change_notify("text"); + + accept_event(); + } + + } else { + return; + } + } selection.old_shift=k.mod.shift; diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h index f28136d66e..bf6459361a 100644 --- a/scene/gui/line_edit.h +++ b/scene/gui/line_edit.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/margin_container.cpp b/scene/gui/margin_container.cpp index f10ca6353a..fde5df6b72 100644 --- a/scene/gui/margin_container.cpp +++ b/scene/gui/margin_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/margin_container.h b/scene/gui/margin_container.h index 56f2344ea7..df9a5c9361 100644 --- a/scene/gui/margin_container.h +++ b/scene/gui/margin_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index be7a6b468a..26540843de 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/menu_button.h b/scene/gui/menu_button.h index 47e7382d34..2df632811f 100644 --- a/scene/gui/menu_button.h +++ b/scene/gui/menu_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 3cc5acc1a6..5c8e5a7381 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -304,7 +304,7 @@ void OptionButton::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_item_count"),&OptionButton::get_item_count); ObjectTypeDB::bind_method(_MD("add_separator"),&OptionButton::add_separator); ObjectTypeDB::bind_method(_MD("clear"),&OptionButton::clear); - ObjectTypeDB::bind_method(_MD("select"),&OptionButton::select); + ObjectTypeDB::bind_method(_MD("select","idx"),&OptionButton::select); ObjectTypeDB::bind_method(_MD("get_selected"),&OptionButton::get_selected); ObjectTypeDB::bind_method(_MD("get_selected_ID"),&OptionButton::get_selected_ID); ObjectTypeDB::bind_method(_MD("get_selected_metadata"),&OptionButton::get_selected_metadata); diff --git a/scene/gui/option_button.h b/scene/gui/option_button.h index 7d850479aa..34e2bdd384 100644 --- a/scene/gui/option_button.h +++ b/scene/gui/option_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/panel.cpp b/scene/gui/panel.cpp index d9ba20810b..d40daa972c 100644 --- a/scene/gui/panel.cpp +++ b/scene/gui/panel.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/panel.h b/scene/gui/panel.h index 7e6be62923..ee4bcd139e 100644 --- a/scene/gui/panel.h +++ b/scene/gui/panel.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/panel_container.cpp b/scene/gui/panel_container.cpp index 5ee061356e..bcf75b79f8 100644 --- a/scene/gui/panel_container.cpp +++ b/scene/gui/panel_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/panel_container.h b/scene/gui/panel_container.h index c09479241c..a40519c9f2 100644 --- a/scene/gui/panel_container.h +++ b/scene/gui/panel_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 5ce7e2e0d3..03ef50c491 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,6 +45,16 @@ void Popup::_notification(int p_what) { emit_signal("popup_hide"); } } + + if (p_what==NOTIFICATION_ENTER_TREE) { + //small helper to make editing of these easier in editor +#ifdef TOOLS_ENABLED + if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { + set_as_toplevel(false); + } +#endif + } + } void Popup::_fix_size() { diff --git a/scene/gui/popup.h b/scene/gui/popup.h index 6c72a3c82b..9c66e6d7bd 100644 --- a/scene/gui/popup.h +++ b/scene/gui/popup.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 9dc03272b2..a93d8e524f 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -898,7 +898,7 @@ void PopupMenu::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_item_icon","idx","icon"),&PopupMenu::set_item_icon); ObjectTypeDB::bind_method(_MD("set_item_accelerator","idx","accel"),&PopupMenu::set_item_accelerator); ObjectTypeDB::bind_method(_MD("set_item_metadata","idx","metadata"),&PopupMenu::set_item_metadata); - ObjectTypeDB::bind_method(_MD("set_item_checked","idx"),&PopupMenu::set_item_checked); + ObjectTypeDB::bind_method(_MD("set_item_checked","idx","checked"),&PopupMenu::set_item_checked); ObjectTypeDB::bind_method(_MD("set_item_disabled","idx","disabled"),&PopupMenu::set_item_disabled); ObjectTypeDB::bind_method(_MD("set_item_submenu","idx","submenu"),&PopupMenu::set_item_submenu); ObjectTypeDB::bind_method(_MD("set_item_as_separator","idx","enable"),&PopupMenu::set_item_as_separator); diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index 30223469a3..624f4f542a 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp index e7e2c88f4a..fc0e7be34f 100644 --- a/scene/gui/progress_bar.cpp +++ b/scene/gui/progress_bar.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/progress_bar.h b/scene/gui/progress_bar.h index 33b0d5c185..f50df346ac 100644 --- a/scene/gui/progress_bar.h +++ b/scene/gui/progress_bar.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index 7103ee651f..ffcdf98519 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,20 +48,20 @@ void Range::Shared::emit_value_changed() { } } -void Range::_changed_notify() { +void Range::_changed_notify(const char *p_what) { emit_signal("changed",shared->val); update(); - _change_notify(); + _change_notify(p_what); } -void Range::Shared::emit_changed() { +void Range::Shared::emit_changed(const char *p_what) { for (Set<Range*>::Element *E=owners.front();E;E=E->next()) { Range *r=E->get(); if (!r->is_inside_tree()) continue; - r->_changed_notify(); + r->_changed_notify(p_what); } } @@ -77,7 +77,11 @@ void Range::set_val(double p_val) { if (p_val<shared->min) p_val=shared->min; - + + //avoid to set -0 + if (p_val == 0) + p_val = 0; + if (shared->val==p_val) return; @@ -90,20 +94,20 @@ void Range::set_min(double p_min) { shared->min=p_min; set_val(shared->val); - shared->emit_changed(); + shared->emit_changed("range/min"); } void Range::set_max(double p_max) { shared->max=p_max; set_val(shared->val); - shared->emit_changed(); + shared->emit_changed("range/max"); } void Range::set_step(double p_step) { shared->step=p_step; - shared->emit_changed(); + shared->emit_changed("range/step"); } void Range::set_page(double p_page) { @@ -111,7 +115,7 @@ void Range::set_page(double p_page) { shared->page=p_page; set_val(shared->val); - shared->emit_changed(); + shared->emit_changed("range/page"); } double Range::get_val() const { @@ -216,11 +220,10 @@ void Range::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_val"),&Range::get_val); ObjectTypeDB::bind_method(_MD("get_value"),&Range::get_val); ObjectTypeDB::bind_method(_MD("get_min"),&Range::get_min); - ObjectTypeDB::bind_method(_MD("get_max"),&Range::get_max); - ObjectTypeDB::bind_method(_MD("get_step"),&Range::get_step); - ObjectTypeDB::bind_method(_MD("get_page"),&Range::get_page); - ObjectTypeDB::bind_method(_MD("get_unit_value"),&Range::get_unit_value); - ObjectTypeDB::bind_method(_MD("get_rounded_values"),&Range::get_rounded_values); + ObjectTypeDB::bind_method(_MD("get_max"),&Range::get_max); + ObjectTypeDB::bind_method(_MD("get_step"),&Range::get_step); + ObjectTypeDB::bind_method(_MD("get_page"),&Range::get_page); + ObjectTypeDB::bind_method(_MD("get_unit_value"),&Range::get_unit_value); ObjectTypeDB::bind_method(_MD("set_val","value"),&Range::set_val); ObjectTypeDB::bind_method(_MD("set_value","value"),&Range::set_val); ObjectTypeDB::bind_method(_MD("set_min","minimum"),&Range::set_min); @@ -228,7 +231,8 @@ void Range::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_step","step"),&Range::set_step); ObjectTypeDB::bind_method(_MD("set_page","pagesize"),&Range::set_page); ObjectTypeDB::bind_method(_MD("set_unit_value","value"),&Range::set_unit_value); - ObjectTypeDB::bind_method(_MD("set_rounded_values"),&Range::set_rounded_values); + ObjectTypeDB::bind_method(_MD("set_rounded_values","enabled"),&Range::set_rounded_values); + ObjectTypeDB::bind_method(_MD("is_rounded_values"),&Range::is_rounded_values); ObjectTypeDB::bind_method(_MD("set_exp_unit_value","enabled"),&Range::set_exp_unit_value); ObjectTypeDB::bind_method(_MD("is_unit_value_exp"),&Range::is_unit_value_exp); @@ -244,16 +248,18 @@ void Range::_bind_methods() { ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/page" ), _SCS("set_page"), _SCS("get_page") ); ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/value" ), _SCS("set_val"), _SCS("get_val") ); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "range/exp_edit" ), _SCS("set_exp_unit_value"), _SCS("is_unit_value_exp") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "rounded_values" ), _SCS("set_rounded_values"), _SCS("get_rounded_values") ); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "range/rounded" ), _SCS("set_rounded_values"), _SCS("is_rounded_values") ); } -void Range::set_rounded_values(bool p){ - _rounded_values = p; +void Range::set_rounded_values(bool p_enable) { + + _rounded_values = p_enable; } -bool Range::get_rounded_values() const{ - return _rounded_values; +bool Range::is_rounded_values() const { + + return _rounded_values; } void Range::set_exp_unit_value(bool p_enable) { diff --git a/scene/gui/range.h b/scene/gui/range.h index 48361ddb0e..d96ecdfb0b 100644 --- a/scene/gui/range.h +++ b/scene/gui/range.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,7 +44,7 @@ class Range : public Control { bool exp_unit_value; Set<Range*> owners; void emit_value_changed(); - void emit_changed(); + void emit_changed(const char *p_what=""); }; Shared *shared; @@ -55,7 +55,7 @@ class Range : public Control { void _share(Node *p_range); void _value_changed_notify(); - void _changed_notify(); + void _changed_notify(const char *p_what=""); protected: @@ -72,22 +72,23 @@ public: void set_step(double p_step); void set_page(double p_page); void set_unit_value(double p_value); - void set_rounded_values(bool); - + double get_val() const; double get_min() const; double get_max() const; double get_step() const; double get_page() const; double get_unit_value() const; - bool get_rounded_values() const; + + void set_rounded_values(bool p_enable); + bool is_rounded_values() const; void set_exp_unit_value(bool p_enable); bool is_unit_value_exp() const; void share(Range *p_range); void unshare(); - + Range(); ~Range(); diff --git a/scene/gui/reference_frame.cpp b/scene/gui/reference_frame.cpp index b90ea8292d..d037664a62 100644 --- a/scene/gui/reference_frame.cpp +++ b/scene/gui/reference_frame.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/reference_frame.h b/scene/gui/reference_frame.h index 8915b1df0c..5d3694e6e8 100644 --- a/scene/gui/reference_frame.h +++ b/scene/gui/reference_frame.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index c8ac816ffd..d4ac2652dc 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -123,6 +123,8 @@ void RichTextLabel::_process_line(ItemFrame *p_frame,const Vector2& p_ofs,int &y int wofs=margin; int spaces_size=0; + int align_ofs=0; + if (p_mode!=PROCESS_CACHE && align!=ALIGN_FILL) wofs+=line_ofs; @@ -153,7 +155,7 @@ void RichTextLabel::_process_line(ItemFrame *p_frame,const Vector2& p_ofs,int &y case ALIGN_LEFT: l.offset_caches.push_back(0); break;\ case ALIGN_CENTER: l.offset_caches.push_back(((p_width-margin)-used)/2); break;\ case ALIGN_RIGHT: l.offset_caches.push_back(((p_width-margin)-used)); break;\ - case ALIGN_FILL: l.offset_caches.push_back((p_width-margin)-used+spaces_size); break;\ + case ALIGN_FILL: l.offset_caches.push_back((p_width-margin)-used/*+spaces_size*/); break;\ }\ l.height_caches.push_back(line_height);\ l.space_caches.push_back(spaces);\ @@ -163,6 +165,7 @@ void RichTextLabel::_process_line(ItemFrame *p_frame,const Vector2& p_ofs,int &y spaces=0;\ spaces_size=0;\ wofs=begin;\ + align_ofs=0;\ if (p_mode!=PROCESS_CACHE) {\ lh=line<l.height_caches.size()?l.height_caches[line]:1;\ }\ @@ -279,6 +282,8 @@ if (m_height > line_height) {\ if (c[end]==' ') { + fw+=cw; + /* if (p_mode==PROCESS_CACHE) { fw+=cw; } else if (align==ALIGN_FILL && line<l.space_caches.size() && l.space_caches[line]>0) { @@ -287,7 +292,7 @@ if (m_height > line_height) {\ found_space=true; } else { fw+=cw; - } + }*/ } else { fw+=cw; } @@ -295,22 +300,26 @@ if (m_height > line_height) {\ end++; } - ENSURE_WIDTH(w); - //print_line("END: "+String::chr(c[end])+"."); if (end && c[end-1]==' ') { - spaces++; if (p_mode==PROCESS_CACHE) { spaces_size+=font->get_char_size(' ').width; + } else if (align==ALIGN_FILL) { + int ln = MIN(l.offset_caches.size()-1,line); + if (l.space_caches[ln]) { + align_ofs = spaces * l.offset_caches[ln] / l.space_caches[ln]; + } } + spaces++; + /* if (found_space) { int ln = MIN(l.offset_caches.size()-1,line); fw+=l.offset_caches[ln]/l.space_caches[ln]; - } + }*/ } @@ -335,7 +344,7 @@ if (m_height > line_height) {\ cw=tab_size*font->get_char_size(' ').width; } - if (p_click_pos.x-cw/2>p_ofs.x+pofs) { + if (p_click_pos.x-cw/2>p_ofs.x+align_ofs+pofs) { rchar=int((&c[i])-cf); //print_line("GOT: "+itos(rchar)); @@ -371,11 +380,11 @@ if (m_height > line_height) {\ cw = font->get_char_size(c[i],c[i+1]).x; draw_rect(Rect2(p_ofs.x+pofs,p_ofs.y+y,cw,lh),selection_bg); if (visible) - font->draw_char(ci,p_ofs+Point2(pofs,y+lh-(fh-ascent)),c[i],c[i+1],selection_fg); + font->draw_char(ci,p_ofs+Point2(align_ofs+pofs,y+lh-(fh-ascent)),c[i],c[i+1],selection_fg); } else { if (visible) - cw=font->draw_char(ci,p_ofs+Point2(pofs,y+lh-(fh-ascent)),c[i],c[i+1],color); + cw=font->draw_char(ci,p_ofs+Point2(align_ofs+pofs,y+lh-(fh-ascent)),c[i],c[i+1],color); } p_char_count++; @@ -391,7 +400,7 @@ if (m_height > line_height) {\ uc.a*=0.5; //VS::get_singleton()->canvas_item_add_line(ci,Point2(pofs,y+ascent+2),Point2(pofs+cw,y+ascent+2),uc); int uy = y+lh-fh+ascent+2; - VS::get_singleton()->canvas_item_add_line(ci,p_ofs+Point2(pofs,uy),p_ofs+Point2(pofs+cw,uy),uc); + VS::get_singleton()->canvas_item_add_line(ci,p_ofs+Point2(align_ofs+pofs,uy),p_ofs+Point2(align_ofs+pofs+cw,uy),uc); } ofs+=cw; } @@ -429,7 +438,7 @@ if (m_height > line_height) {\ bool visible = visible_characters<0 || p_char_count<visible_characters; if (p_mode==PROCESS_DRAW && visible) { - img->image->draw(ci,p_ofs+Point2(wofs,y+lh-font->get_descent()-img->image->get_height())); + img->image->draw(ci,p_ofs+Point2(align_ofs+wofs,y+lh-font->get_descent()-img->image->get_height())); } p_char_count++; @@ -475,6 +484,7 @@ if (m_height > line_height) {\ int vseparation=get_constant("table_vseparation"); Color ccolor = _find_color(table,p_base_color); Vector2 draw_ofs = Point2(wofs,y); + int max_y=get_size().height; if (p_mode==PROCESS_CACHE) { @@ -547,7 +557,7 @@ if (m_height > line_height) {\ - Point2 offset(hseparation,vseparation); + Point2 offset(align_ofs+hseparation,vseparation); int row_height=0; //draw using computed caches @@ -562,13 +572,22 @@ if (m_height > line_height) {\ int yofs=0; + int lines_h = frame->lines[frame->lines.size()-1].height_accum_cache - (frame->lines[0].height_accum_cache - frame->lines[0].height_cache); + int lines_ofs = p_ofs.y+offset.y+draw_ofs.y; + + bool visible = lines_ofs < get_size().height && lines_ofs+lines_h >=0; + for(int i=0;i<frame->lines.size();i++) { - if (p_mode==PROCESS_DRAW) { - _process_line(frame,p_ofs+offset+draw_ofs+Vector2(0,yofs),ly,table->columns[column].width,i,PROCESS_DRAW,cfont,ccolor); - } else if (p_mode==PROCESS_POINTER) { - _process_line(frame,p_ofs+offset+draw_ofs+Vector2(0,yofs),ly,table->columns[column].width,i,PROCESS_POINTER,cfont,ccolor,p_click_pos,r_click_item,r_click_char,r_outside); + + if (visible) { + if (p_mode==PROCESS_DRAW) { + _process_line(frame,p_ofs+offset+draw_ofs+Vector2(0,yofs),ly,table->columns[column].width,i,PROCESS_DRAW,cfont,ccolor); + } else if (p_mode==PROCESS_POINTER) { + _process_line(frame,p_ofs+offset+draw_ofs+Vector2(0,yofs),ly,table->columns[column].width,i,PROCESS_POINTER,cfont,ccolor,p_click_pos,r_click_item,r_click_char,r_outside); + } } + yofs+=frame->lines[i].height_cache; if (p_mode==PROCESS_CACHE) { frame->lines[i].height_accum_cache=offset.y+draw_ofs.y+frame->lines[i].height_cache; @@ -1929,7 +1948,7 @@ void RichTextLabel::_bind_methods() { ObjectTypeDB::bind_method(_MD("push_meta","data"),&RichTextLabel::push_meta); ObjectTypeDB::bind_method(_MD("push_underline"),&RichTextLabel::push_underline); ObjectTypeDB::bind_method(_MD("push_table","columns"),&RichTextLabel::push_table); - ObjectTypeDB::bind_method(_MD("set_table_column_expand","column","expand"),&RichTextLabel::set_table_column_expand); + ObjectTypeDB::bind_method(_MD("set_table_column_expand","column","expand","ratio"),&RichTextLabel::set_table_column_expand); ObjectTypeDB::bind_method(_MD("push_cell"),&RichTextLabel::push_cell); ObjectTypeDB::bind_method(_MD("pop"),&RichTextLabel::pop); @@ -1946,7 +1965,7 @@ void RichTextLabel::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_v_scroll"),&RichTextLabel::get_v_scroll); - ObjectTypeDB::bind_method(_MD("scroll_to_line"),&RichTextLabel::scroll_to_line); + ObjectTypeDB::bind_method(_MD("scroll_to_line","line"),&RichTextLabel::scroll_to_line); ObjectTypeDB::bind_method(_MD("set_tab_size","spaces"),&RichTextLabel::set_tab_size); ObjectTypeDB::bind_method(_MD("get_tab_size"),&RichTextLabel::get_tab_size); diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index bc45ded4ad..635fe87ad4 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index b1fd914fcd..0fd4286f38 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/scroll_bar.h b/scene/gui/scroll_bar.h index 367bc3eb53..a629ddc56c 100644 --- a/scene/gui/scroll_bar.h +++ b/scene/gui/scroll_bar.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index e5b5d531a0..a2fc038f9e 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/scroll_container.h b/scene/gui/scroll_container.h index b8d37be08c..50ae236714 100644 --- a/scene/gui/scroll_container.h +++ b/scene/gui/scroll_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/separator.cpp b/scene/gui/separator.cpp index 5e822a10ad..626b093a2f 100644 --- a/scene/gui/separator.cpp +++ b/scene/gui/separator.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/separator.h b/scene/gui/separator.h index 17e9c11e34..7a7dc92b93 100644 --- a/scene/gui/separator.h +++ b/scene/gui/separator.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index 78b5dabeb4..7ef9d4216b 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/slider.h b/scene/gui/slider.h index 5850c48ce3..f85e6d1807 100644 --- a/scene/gui/slider.h +++ b/scene/gui/slider.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 051a8dd018..38c61ded2c 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/spin_box.h b/scene/gui/spin_box.h index 1b3bc6d817..acaea822ab 100644 --- a/scene/gui/spin_box.h +++ b/scene/gui/spin_box.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp index a525eb121d..b0d089fcf3 100644 --- a/scene/gui/split_container.cpp +++ b/scene/gui/split_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/split_container.h b/scene/gui/split_container.h index d7f56c6fb4..c8cfa3d69b 100644 --- a/scene/gui/split_container.h +++ b/scene/gui/split_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 6fa701340d..91d0fc157e 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/tab_container.h b/scene/gui/tab_container.h index 602d248b46..979ce927a0 100644 --- a/scene/gui/tab_container.h +++ b/scene/gui/tab_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index 5f4215a1d5..a26acc9c05 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -65,8 +65,8 @@ Size2 Tabs::get_minimum_size() const { ms.height=MAX(bms.height+tab_bg->get_minimum_size().height,ms.height); } - if (tabs[i].close_button.is_valid()) { - Ref<Texture> cb=tabs[i].close_button; + if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i==current)) { + Ref<Texture> cb=get_icon("close"); Size2 bms = cb->get_size();//+get_stylebox("button")->get_minimum_size(); bms.width+=get_constant("hseparation"); ms.width+=bms.width; @@ -108,14 +108,6 @@ void Tabs::_input_event(const InputEvent& p_event) { for(int i=0;i<tabs.size();i++) { // test hovering tab to display close button if policy says so - if (cb_displaypolicy == SHOW_HOVER) { - int ofs=tabs[i].ofs_cache; - int size = tabs[i].ofs_cache; - if (pos.x >=tabs[i].ofs_cache && pos.x<tabs[i].ofs_cache+tabs[i].size_cache) { - hover=i; - } - } - // test hovering right button and close button if (tabs[i].rb_rect.has_point(pos)) { @@ -260,12 +252,14 @@ void Tabs::_notification(int p_what) { Ref<Font> font = get_font("font"); Color color_fg = get_color("font_color_fg"); Color color_bg = get_color("font_color_bg"); + Ref<Texture> close=get_icon("close"); int h = get_size().height; int label_valign_fg = get_constant("label_valign_fg"); int label_valign_bg = get_constant("label_valign_bg"); + int w=0; int mw = 0; @@ -277,32 +271,12 @@ void Tabs::_notification(int p_what) { for(int i=0;i<tabs.size();i++) { - Ref<Texture> tex = tabs[i].icon; - if (tex.is_valid()) { - if (tabs[i].text!="") - mw+=get_constant("hseparation"); + int sz = get_tab_width(i); + + tabs[i].ofs_cache=mw; + mw+=sz; - } - mw+=font->get_string_size(tabs[i].text).width; - if (current==i) - mw+=tab_fg->get_minimum_size().width; - else - mw+=tab_bg->get_minimum_size().width; - - if (tabs[i].right_button.is_valid()) { - Ref<Texture> rb=tabs[i].right_button; - Size2 bms = rb->get_size();//+get_stylebox("button")->get_minimum_size(); - bms.width+=get_constant("hseparation"); - - mw+=bms.width; - } - if (tabs[i].close_button.is_valid()) { - Ref<Texture> cb=tabs[i].close_button; - Size2 bms = cb->get_size();//+get_stylebox("button")->get_minimum_size(); - bms.width+=get_constant("hseparation"); - mw+=bms.width; - } } } @@ -364,56 +338,15 @@ void Tabs::_notification(int p_what) { } - // Close button - switch (cb_displaypolicy) { - case SHOW_ALWAYS: { - if (tabs[i].close_button.is_valid()) { - Ref<StyleBox> style = get_stylebox("button"); - Ref<Texture> rb=tabs[i].close_button; - - lsize+=get_constant("hseparation"); - //lsize+=style->get_margin(MARGIN_LEFT); - lsize+=rb->get_width(); - //lsize+=style->get_margin(MARGIN_RIGHT); - } - } break; - case SHOW_ACTIVE_ONLY: { - if (i==current) { - if (tabs[i].close_button.is_valid()) { - Ref<StyleBox> style = get_stylebox("button"); - Ref<Texture> rb=tabs[i].close_button; - - lsize+=get_constant("hseparation"); - //lsize+=style->get_margin(MARGIN_LEFT); - lsize+=rb->get_width(); - //lsize+=style->get_margin(MARGIN_RIGHT); - - } - } - } break; - case SHOW_HOVER: { - if (i==current || i==hover) { - if (tabs[i].close_button.is_valid()) { - Ref<StyleBox> style = get_stylebox("button"); - Ref<Texture> rb=tabs[i].close_button; - - lsize+=get_constant("hseparation"); - //lsize+=style->get_margin(MARGIN_LEFT); - lsize+=rb->get_width(); - //lsize+=style->get_margin(MARGIN_RIGHT); - - } - } - } break; - case SHOW_NEVER: // by default, never show close button - default: { - // do nothing - } break; + if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i==current)) { + lsize+=get_constant("hseparation"); + //lsize+=style->get_margin(MARGIN_LEFT); + lsize+=close->get_width(); + //lsize+=style->get_margin(MARGIN_RIGHT); } - if (w+lsize > limit) { max_drawn_tab=i-1; missing_right=true; @@ -487,100 +420,31 @@ void Tabs::_notification(int p_what) { } + if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i==current)) { + Ref<StyleBox> style = get_stylebox("button"); + Ref<Texture> cb=close; - // Close button - switch (cb_displaypolicy) { - case SHOW_ALWAYS: { - if (tabs[i].close_button.is_valid()) { - Ref<StyleBox> style = get_stylebox("button"); - Ref<Texture> cb=tabs[i].close_button; - - w+=get_constant("hseparation"); - - Rect2 cb_rect; - cb_rect.size=style->get_minimum_size()+cb->get_size(); - cb_rect.pos.x=w; - cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2; - - if (cb_hover==i) { - if (cb_pressing) - get_stylebox("button_pressed")->draw(ci,cb_rect); - else - style->draw(ci,cb_rect); - } + w+=get_constant("hseparation"); - //w+=style->get_margin(MARGIN_LEFT); + Rect2 cb_rect; + cb_rect.size=style->get_minimum_size()+cb->get_size(); + cb_rect.pos.x=w; + cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2; - cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) )); - w+=cb->get_width(); - //w+=style->get_margin(MARGIN_RIGHT); - tabs[i].cb_rect=cb_rect; - } - } break; - case SHOW_ACTIVE_ONLY: { - if (current==i) { - if (tabs[i].close_button.is_valid()) { - Ref<StyleBox> style = get_stylebox("button"); - Ref<Texture> cb=tabs[i].close_button; - - w+=get_constant("hseparation"); - - Rect2 cb_rect; - cb_rect.size=style->get_minimum_size()+cb->get_size(); - cb_rect.pos.x=w; - cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2; - - if (cb_hover==i) { - if (cb_pressing) - get_stylebox("button_pressed")->draw(ci,cb_rect); - else - style->draw(ci,cb_rect); - } - - //w+=style->get_margin(MARGIN_LEFT); - - cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) )); - w+=cb->get_width(); - //w+=style->get_margin(MARGIN_RIGHT); - tabs[i].cb_rect=cb_rect; - } - } - } break; - case SHOW_HOVER: { - if (current==i || hover==i) { - if (tabs[i].close_button.is_valid()) { - Ref<StyleBox> style = get_stylebox("button"); - Ref<Texture> cb=tabs[i].close_button; - - w+=get_constant("hseparation"); - - Rect2 cb_rect; - cb_rect.size=style->get_minimum_size()+cb->get_size(); - cb_rect.pos.x=w; - cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2; - - if (cb_hover==i) { - if (cb_pressing) - get_stylebox("button_pressed")->draw(ci,cb_rect); - else - style->draw(ci,cb_rect); - } - - //w+=style->get_margin(MARGIN_LEFT); - - cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) )); - w+=cb->get_width(); - //w+=style->get_margin(MARGIN_RIGHT); - tabs[i].cb_rect=cb_rect; - } + if (cb_hover==i) { + if (cb_pressing) + get_stylebox("button_pressed")->draw(ci,cb_rect); + else + style->draw(ci,cb_rect); } - } break; - case SHOW_NEVER: - default: { - // show nothing - } break; + //w+=style->get_margin(MARGIN_LEFT); + + cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) )); + w+=cb->get_width(); + //w+=style->get_margin(MARGIN_RIGHT); + tabs[i].cb_rect=cb_rect; } w+=sb->get_margin(MARGIN_RIGHT); @@ -687,20 +551,6 @@ Ref<Texture> Tabs::get_tab_right_button(int p_tab) const{ } -void Tabs::set_tab_close_button(int p_tab, const Ref<Texture>& p_close_button) { - ERR_FAIL_INDEX(p_tab, tabs.size()); - tabs[p_tab].close_button=p_close_button; - update(); - minimum_size_changed(); -} - - -Ref<Texture> Tabs::get_tab_close_button(int p_tab) const{ - - ERR_FAIL_INDEX_V(p_tab,tabs.size(),Ref<Texture>()); - return tabs[p_tab].close_button; - -} void Tabs::add_tab(const String& p_str,const Ref<Texture>& p_icon) { @@ -708,8 +558,6 @@ void Tabs::add_tab(const String& p_str,const Ref<Texture>& p_icon) { t.text=p_str; t.icon=p_icon; - t.close_button = get_icon("Close","EditorIcons"); - tabs.push_back(t); update(); @@ -741,10 +589,6 @@ void Tabs::remove_tab(int p_idx) { } -void Tabs::set_tab_close_display_policy(CloseButtonDisplayPolicy p_cb_displaypolicy) { - cb_displaypolicy = p_cb_displaypolicy; -} - void Tabs::set_tab_align(TabAlign p_align) { @@ -757,6 +601,94 @@ Tabs::TabAlign Tabs::get_tab_align() const { return tab_align; } +int Tabs::get_tab_width(int p_idx) const { + + ERR_FAIL_INDEX_V(p_idx,tabs.size(),0); + + Ref<StyleBox> tab_bg = get_stylebox("tab_bg"); + Ref<StyleBox> tab_fg = get_stylebox("tab_fg"); + Ref<Font> font = get_font("font"); + Ref<Texture> close=get_icon("close"); + + int x=0; + + Ref<Texture> tex = tabs[p_idx].icon; + if (tex.is_valid()) { + if (tabs[p_idx].text!="") + x+=get_constant("hseparation"); + + } + + + x+=font->get_string_size(tabs[p_idx].text).width; + if (current==p_idx) + x+=tab_fg->get_minimum_size().width; + else + x+=tab_bg->get_minimum_size().width; + + if (tabs[p_idx].right_button.is_valid()) { + print_line("has right"); + Ref<Texture> rb=tabs[p_idx].right_button; + Size2 bms = rb->get_size();//+get_stylebox("button")->get_minimum_size(); + bms.width+=get_constant("hseparation"); + + x+=bms.width; + } + + if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && p_idx==current)) { + + Size2 bms = close->get_size();//+get_stylebox("button")->get_minimum_size(); + bms.width+=get_constant("hseparation"); + x+=bms.width; + } + + return x; +} + +void Tabs::ensure_tab_visible(int p_idx) { + + if (!is_inside_tree()) + return; + + ERR_FAIL_INDEX(p_idx,tabs.size()); + + if (p_idx<=offset) { + offset=p_idx; + update(); + return; + } + + Ref<Texture> incr = get_icon("increment"); + Ref<Texture> decr = get_icon("decrement"); + + int limit=get_size().width-incr->get_width()-decr->get_width(); + + + + int x=0; + for(int i=0;i<tabs.size();i++) { + + if (i<offset) + continue; + + int sz = get_tab_width(i); + tabs[i].x_cache=x; + tabs[i].x_size_cache=sz; + x+=sz; + + } + + while(offset<tabs.size() && ( (tabs[p_idx].x_cache + tabs[p_idx].x_size_cache) - tabs[offset].x_cache) > limit) { + offset++; + } + + update(); +} + +void Tabs::set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy) { + cb_displaypolicy=p_policy; + update(); +} void Tabs::_bind_methods() { @@ -772,6 +704,7 @@ void Tabs::_bind_methods() { ObjectTypeDB::bind_method(_MD("add_tab","title","icon:Texture"),&Tabs::add_tab); ObjectTypeDB::bind_method(_MD("set_tab_align","align"),&Tabs::set_tab_align); ObjectTypeDB::bind_method(_MD("get_tab_align"),&Tabs::get_tab_align); + ObjectTypeDB::bind_method(_MD("ensure_tab_visible","idx"),&Tabs::ensure_tab_visible); ADD_SIGNAL(MethodInfo("tab_changed",PropertyInfo(Variant::INT,"tab"))); ADD_SIGNAL(MethodInfo("right_button_pressed",PropertyInfo(Variant::INT,"tab"))); @@ -784,10 +717,10 @@ void Tabs::_bind_methods() { BIND_CONSTANT( ALIGN_CENTER ); BIND_CONSTANT( ALIGN_RIGHT ); - BIND_CONSTANT( SHOW_ACTIVE_ONLY ); - BIND_CONSTANT( SHOW_ALWAYS ); - BIND_CONSTANT( SHOW_HOVER ); - BIND_CONSTANT( SHOW_NEVER ); + BIND_CONSTANT( CLOSE_BUTTON_SHOW_ACTIVE_ONLY ); + BIND_CONSTANT( CLOSE_BUTTON_SHOW_ALWAYS ); + BIND_CONSTANT( CLOSE_BUTTON_SHOW_NEVER ); + } @@ -801,7 +734,9 @@ Tabs::Tabs() { cb_hover=-1; cb_pressing=false; - cb_displaypolicy = SHOW_NEVER; // Default : no close button + cb_displaypolicy = CLOSE_BUTTON_SHOW_NEVER; // Default : no close button offset=0; max_drawn_tab=0; + + } diff --git a/scene/gui/tabs.h b/scene/gui/tabs.h index 48fbed1f76..7f85280853 100644 --- a/scene/gui/tabs.h +++ b/scene/gui/tabs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,10 +45,9 @@ public: enum CloseButtonDisplayPolicy { - SHOW_ALWAYS, - SHOW_ACTIVE_ONLY, - SHOW_HOVER, - SHOW_NEVER + CLOSE_BUTTON_SHOW_NEVER, + CLOSE_BUTTON_SHOW_ACTIVE_ONLY, + CLOSE_BUTTON_SHOW_ALWAYS, }; private: @@ -59,10 +58,13 @@ private: Ref<Texture> icon; int ofs_cache; int size_cache; + int x_cache; + int x_size_cache; + Ref<Texture> right_button; Rect2 rb_rect; - Ref<Texture> close_button; Rect2 cb_rect; + }; @@ -85,6 +87,8 @@ private: int hover; // hovered tab + int get_tab_width(int p_idx) const; + protected: void _input_event(const InputEvent& p_event); @@ -104,13 +108,11 @@ public: void set_tab_right_button(int p_tab,const Ref<Texture>& p_right_button); Ref<Texture> get_tab_right_button(int p_tab) const; - void set_tab_close_button(int p_tab, const Ref<Texture>& p_close_button); - Ref<Texture> get_tab_close_button(int p_tab) const; - void set_tab_close_display_policy(CloseButtonDisplayPolicy p_cb_displaypolicy); - void set_tab_align(TabAlign p_align); TabAlign get_tab_align() const; + void set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy); + int get_tab_count() const; void set_current_tab(int p_current); int get_current_tab() const; @@ -119,6 +121,8 @@ public: void clear_tabs(); + void ensure_tab_visible(int p_idx); + Size2 get_minimum_size() const; Tabs(); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 29969b65e6..7f7c8c023c 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -839,7 +839,7 @@ void TextEdit::_notification(int p_what) { } - if (cursor.column==str.length() && cursor.line==line) { + if (cursor.column==str.length() && cursor.line==line && (char_ofs+char_margin)>=xmargin_beg) { cursor_pos=Point2i( char_ofs+char_margin, ofs_y ); VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(1,get_row_height())),cache.font_color); @@ -1740,6 +1740,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { } } break; + case KEY_KP_4: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_left + } case KEY_LEFT: { if (k.mod.shift) @@ -1786,6 +1793,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { _post_shift_selection(); } break; + case KEY_KP_6: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_right + } case KEY_RIGHT: { if (k.mod.shift) @@ -1829,6 +1843,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { _post_shift_selection(); } break; + case KEY_KP_8: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_up + } case KEY_UP: { if (k.mod.shift) @@ -1849,6 +1870,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { _cancel_code_hint(); } break; + case KEY_KP_2: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_down + } case KEY_DOWN: { if (k.mod.shift) @@ -1937,6 +1965,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { update(); } break; + case KEY_KP_7: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_home + } #ifdef APPLE_STYLE_KEYS case KEY_HOME: { @@ -1950,18 +1985,6 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { _post_shift_selection(); } break; - case KEY_END: { - - if (k.mod.shift) - _pre_shift_selection(); - - cursor_set_line(text.size()-1); - - if (k.mod.shift) - _post_shift_selection(); - - } break; - #else case KEY_HOME: { @@ -1992,6 +2015,27 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { completion_hint=""; } break; +#endif + case KEY_KP_1: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_end + } +#ifdef APPLE_STYLE_KEYS + case KEY_END: { + + if (k.mod.shift) + _pre_shift_selection(); + + cursor_set_line(text.size()-1); + + if (k.mod.shift) + _post_shift_selection(); + + } break; +#else case KEY_END: { if (k.mod.shift) @@ -2009,6 +2053,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { } break; #endif + case KEY_KP_9: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_pageup + } case KEY_PAGEUP: { if (k.mod.shift) @@ -2024,6 +2075,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { } break; + case KEY_KP_3: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_pageup + } case KEY_PAGEDOWN: { if (k.mod.shift) @@ -3742,10 +3800,10 @@ void TextEdit::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_line_count"),&TextEdit::get_line_count); ObjectTypeDB::bind_method(_MD("get_text"),&TextEdit::get_text); - ObjectTypeDB::bind_method(_MD("get_line"),&TextEdit::get_line); + ObjectTypeDB::bind_method(_MD("get_line","line"),&TextEdit::get_line); - ObjectTypeDB::bind_method(_MD("cursor_set_column","column"),&TextEdit::cursor_set_column); - ObjectTypeDB::bind_method(_MD("cursor_set_line","line"),&TextEdit::cursor_set_line); + ObjectTypeDB::bind_method(_MD("cursor_set_column","column","adjust_viewport"),&TextEdit::cursor_set_column,DEFVAL(false)); + ObjectTypeDB::bind_method(_MD("cursor_set_line","line","adjust_viewport"),&TextEdit::cursor_set_line,DEFVAL(false)); ObjectTypeDB::bind_method(_MD("cursor_get_column"),&TextEdit::cursor_get_column); ObjectTypeDB::bind_method(_MD("cursor_get_line"),&TextEdit::cursor_get_line); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index f8e8ef3b9a..2ca5ab054a 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp index 7e6bf2cbdf..c885b2d73e 100644 --- a/scene/gui/texture_button.cpp +++ b/scene/gui/texture_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,22 +42,22 @@ Size2 TextureButton::get_minimum_size() const { else rscale= hover->get_size(); } else - rscale= pressed->get_size()*scale; + rscale=pressed->get_size(); } else rscale= normal->get_size(); - return rscale*scale; + return rscale*scale.abs(); } bool TextureButton::has_point(const Point2& p_point) const { - if (scale[0] <= 0 || scale[1] <= 0) { + if (scale[0] == 0 || scale[1] == 0) { return false; } - Point2 ppos = p_point/scale; + Point2 ppos = p_point/scale.abs(); if (click_mask.is_valid()) { diff --git a/scene/gui/texture_button.h b/scene/gui/texture_button.h index 49687986c4..0556df8061 100644 --- a/scene/gui/texture_button.h +++ b/scene/gui/texture_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/texture_frame.cpp b/scene/gui/texture_frame.cpp index 5a6bc86638..73fecf591a 100644 --- a/scene/gui/texture_frame.cpp +++ b/scene/gui/texture_frame.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/texture_frame.h b/scene/gui/texture_frame.h index 0ccbf5a591..f6fe6ae89d 100644 --- a/scene/gui/texture_frame.h +++ b/scene/gui/texture_frame.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp index c8930add6e..e05d35a81d 100644 --- a/scene/gui/texture_progress.cpp +++ b/scene/gui/texture_progress.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/texture_progress.h b/scene/gui/texture_progress.h index 7187fd5f07..a4bbd71e94 100644 --- a/scene/gui/texture_progress.h +++ b/scene/gui/texture_progress.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/tool_button.cpp b/scene/gui/tool_button.cpp index d5bcb73476..fd27800384 100644 --- a/scene/gui/tool_button.cpp +++ b/scene/gui/tool_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/tool_button.h b/scene/gui/tool_button.h index 648d776b51..f48d7d413c 100644 --- a/scene/gui/tool_button.h +++ b/scene/gui/tool_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 1b204cff65..8d28180490 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -672,7 +672,7 @@ void TreeItem::_bind_methods() { ObjectTypeDB::bind_method(_MD("clear_custom_bg_color","column"),&TreeItem::clear_custom_bg_color); ObjectTypeDB::bind_method(_MD("get_custom_bg_color","column"),&TreeItem::get_custom_bg_color); - ObjectTypeDB::bind_method(_MD("add_button","column","button:Texture"),&TreeItem::add_button); + ObjectTypeDB::bind_method(_MD("add_button","column","button:Texture","button_idx"),&TreeItem::add_button); ObjectTypeDB::bind_method(_MD("get_button_count","column"),&TreeItem::get_button_count); ObjectTypeDB::bind_method(_MD("get_button:Texture","column","button_idx"),&TreeItem::get_button); ObjectTypeDB::bind_method(_MD("erase_button","column","button_idx"),&TreeItem::erase_button); @@ -2128,8 +2128,7 @@ void Tree::_input_event(InputEvent p_event) { float diff_y = -b.relative_y; diff_y=Math::pow(ABS(diff_y),1.8)*SGN(diff_y); diff_y*=0.1; - range_drag_base=CLAMP(range_drag_base + c.step * diff_y, c.min, c.max); - + range_drag_base=CLAMP(range_drag_base + c.step * diff_y, c.min, c.max); popup_edited_item->set_range(popup_edited_item_col,range_drag_base); item_edited(popup_edited_item_col,popup_edited_item); @@ -3193,11 +3192,11 @@ void Tree::_bind_methods() { ObjectTypeDB::bind_method(_MD("create_item:TreeItem","parent:TreeItem"),&Tree::_create_item,DEFVAL((Object*)NULL)); ObjectTypeDB::bind_method(_MD("get_root:TreeItem"),&Tree::get_root); - ObjectTypeDB::bind_method(_MD("set_column_min_width"),&Tree::set_column_min_width); - ObjectTypeDB::bind_method(_MD("set_column_expand"),&Tree::set_column_expand); - ObjectTypeDB::bind_method(_MD("get_column_width"),&Tree::get_column_width); + ObjectTypeDB::bind_method(_MD("set_column_min_width","column","min_width"),&Tree::set_column_min_width); + ObjectTypeDB::bind_method(_MD("set_column_expand","column","expand"),&Tree::set_column_expand); + ObjectTypeDB::bind_method(_MD("get_column_width","column"),&Tree::get_column_width); - ObjectTypeDB::bind_method(_MD("set_hide_root"),&Tree::set_hide_root); + ObjectTypeDB::bind_method(_MD("set_hide_root","enable"),&Tree::set_hide_root); ObjectTypeDB::bind_method(_MD("get_next_selected:TreeItem","from:TreeItem"),&Tree::_get_next_selected); ObjectTypeDB::bind_method(_MD("get_selected:TreeItem"),&Tree::get_selected); ObjectTypeDB::bind_method(_MD("get_selected_column"),&Tree::get_selected_column); diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 55ccc16d01..54e6a9c6b9 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index 58683a07ad..517cd414c5 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -271,6 +271,7 @@ void VideoPlayer::set_paused(bool p_paused) { playback->set_paused(p_paused); set_process(!p_paused); }; + last_audio_time = 0; }; bool VideoPlayer::is_paused() const { diff --git a/scene/gui/video_player.h b/scene/gui/video_player.h index b14d3936b9..9ce1ba78f4 100644 --- a/scene/gui/video_player.h +++ b/scene/gui/video_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/io/resource_format_image.cpp b/scene/io/resource_format_image.cpp index f67d50b56c..c80975dbfe 100644 --- a/scene/io/resource_format_image.cpp +++ b/scene/io/resource_format_image.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/io/resource_format_image.h b/scene/io/resource_format_image.h index b5ec5a1200..6388aa641f 100644 --- a/scene/io/resource_format_image.h +++ b/scene/io/resource_format_image.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/io/resource_format_wav.cpp b/scene/io/resource_format_wav.cpp index 00b800b28b..9cf349eb7b 100644 --- a/scene/io/resource_format_wav.cpp +++ b/scene/io/resource_format_wav.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/io/resource_format_wav.h b/scene/io/resource_format_wav.h index a74da041c1..4918d5c2e7 100644 --- a/scene/io/resource_format_wav.h +++ b/scene/io/resource_format_wav.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp index ee3d7f5afd..e921795628 100644 --- a/scene/main/canvas_layer.cpp +++ b/scene/main/canvas_layer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/canvas_layer.h b/scene/main/canvas_layer.h index edd00c1a7a..809b3fae7f 100644 --- a/scene/main/canvas_layer.h +++ b/scene/main/canvas_layer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/misc.cpp b/scene/main/misc.cpp index 108621baa5..35d8b4cdfb 100644 --- a/scene/main/misc.cpp +++ b/scene/main/misc.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/misc.h b/scene/main/misc.h index e7894aa68d..1c5bc7208e 100644 --- a/scene/main/misc.h +++ b/scene/main/misc.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/node.cpp b/scene/main/node.cpp index a832162994..0780a4bdaf 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -802,6 +802,7 @@ void Node::remove_child(Node *p_child) { } ERR_FAIL_COND( idx==-1 ); + //ERR_FAIL_COND( p_child->data.blocked > 0 ); //if (data.scene) { does not matter @@ -856,7 +857,10 @@ Node *Node::_get_child_by_name(const StringName& p_name) const { Node *Node::_get_node(const NodePath& p_path) const { - ERR_FAIL_COND_V( !data.inside_tree && p_path.is_absolute(), NULL ); + if (!data.inside_tree && p_path.is_absolute()) { + ERR_EXPLAIN("Can't use get_node() with absolute paths from outside the active scene tree."); + ERR_FAIL_V(NULL); + } Node *current=NULL; Node *root=NULL; @@ -2001,7 +2005,7 @@ void Node::_bind_methods() { ObjectTypeDB::bind_method(_MD("is_greater_than","node:Node"),&Node::is_greater_than); ObjectTypeDB::bind_method(_MD("get_path"),&Node::get_path); ObjectTypeDB::bind_method(_MD("get_path_to","node:Node"),&Node::get_path_to); - ObjectTypeDB::bind_method(_MD("add_to_group","group"),&Node::add_to_group,DEFVAL(false)); + ObjectTypeDB::bind_method(_MD("add_to_group","group","persistent"),&Node::add_to_group,DEFVAL(false)); ObjectTypeDB::bind_method(_MD("remove_from_group","group"),&Node::remove_from_group); ObjectTypeDB::bind_method(_MD("is_in_group","group"),&Node::is_in_group); ObjectTypeDB::bind_method(_MD("move_child","child_node:Node","to_pos"),&Node::move_child); @@ -2063,6 +2067,8 @@ void Node::_bind_methods() { BIND_CONSTANT( NOTIFICATION_UNPARENTED ); BIND_CONSTANT( NOTIFICATION_PAUSED ); BIND_CONSTANT( NOTIFICATION_UNPAUSED ); + BIND_CONSTANT( NOTIFICATION_INSTANCED ); + BIND_CONSTANT( PAUSE_MODE_INHERIT ); diff --git a/scene/main/node.h b/scene/main/node.h index 196c4a06eb..4d05dd381c 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/resource_preloader.cpp b/scene/main/resource_preloader.cpp index f49f626e78..219eea770a 100644 --- a/scene/main/resource_preloader.cpp +++ b/scene/main/resource_preloader.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/resource_preloader.h b/scene/main/resource_preloader.h index b3e7496fb7..b06e558b59 100644 --- a/scene/main/resource_preloader.h +++ b/scene/main/resource_preloader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp index adf053f5c9..a18eb1249f 100644 --- a/scene/main/scene_main_loop.cpp +++ b/scene/main/scene_main_loop.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -620,6 +620,14 @@ void SceneTree::set_editor_hint(bool p_enabled) { editor_hint=p_enabled; } +bool SceneTree::is_node_being_edited(const Node* p_node) const { +#ifdef TOOLS_ENABLED + return editor_hint && edited_scene_root && edited_scene_root->is_a_parent_of(p_node); +#else + return false; +#endif +} + bool SceneTree::is_editor_hint() const { return editor_hint; @@ -965,6 +973,10 @@ Array SceneTree::_get_nodes_in_group(const StringName& p_group) { return ret; } +bool SceneTree::has_group(const StringName& p_identifier) const { + + return group_map.has(p_identifier); +} void SceneTree::get_nodes_in_group(const StringName& p_group,List<Node*> *p_list) { @@ -1586,9 +1598,10 @@ void SceneTree::_bind_methods() { ObjectTypeDB::bind_method(_MD("notify_group","call_flags","group","notification"),&SceneTree::notify_group); ObjectTypeDB::bind_method(_MD("set_group","call_flags","group","property","value"),&SceneTree::set_group); - ObjectTypeDB::bind_method(_MD("get_nodes_in_group"),&SceneTree::_get_nodes_in_group); + ObjectTypeDB::bind_method(_MD("get_nodes_in_group","group"),&SceneTree::_get_nodes_in_group); ObjectTypeDB::bind_method(_MD("get_root:Viewport"),&SceneTree::get_root); + ObjectTypeDB::bind_method(_MD("has_group","name"),&SceneTree::has_group); ObjectTypeDB::bind_method(_MD("set_auto_accept_quit","enabled"),&SceneTree::set_auto_accept_quit); diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h index 8d9021d24e..c6fc124345 100644 --- a/scene/main/scene_main_loop.h +++ b/scene/main/scene_main_loop.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -279,6 +279,8 @@ public: void set_editor_hint(bool p_enabled); bool is_editor_hint() const; + bool is_node_being_edited(const Node* p_node) const; + void set_pause(bool p_enabled); bool is_paused() const; @@ -318,6 +320,8 @@ public: void queue_delete(Object *p_object); void get_nodes_in_group(const StringName& p_group,List<Node*> *p_list); + bool has_group(const StringName& p_identifier) const; + void set_screen_stretch(StretchMode p_mode,StretchAspect p_aspect,const Size2 p_minsize); diff --git a/scene/main/scene_singleton.cpp b/scene/main/scene_singleton.cpp index 69eb6e24d9..3dcc6b1204 100644 --- a/scene/main/scene_singleton.cpp +++ b/scene/main/scene_singleton.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/scene_singleton.h b/scene/main/scene_singleton.h index 25157a26ac..0b209f7944 100644 --- a/scene/main/scene_singleton.h +++ b/scene/main/scene_singleton.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index 1bd22a9db1..2c23b62b12 100644 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/timer.h b/scene/main/timer.h index 4b9cecba84..0baea76fad 100644 --- a/scene/main/timer.h +++ b/scene/main/timer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index d19b5767c2..330f855006 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -577,7 +577,7 @@ void Viewport::_notification(int p_what) { PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space()); if (space) { - bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF); + bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF,true); ObjectID new_collider=0; if (col) { @@ -617,7 +617,7 @@ void Viewport::_notification(int p_what) { PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space()); if (space) { - bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF); + bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF,true); ObjectID new_collider=0; if (col) { if (result.collider) { @@ -1456,7 +1456,7 @@ void Viewport::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_as_audio_listener_2d","enable"), &Viewport::set_as_audio_listener_2d); ObjectTypeDB::bind_method(_MD("is_audio_listener_2d","enable"), &Viewport::is_audio_listener_2d); - ObjectTypeDB::bind_method(_MD("set_render_target_to_screen_rect"), &Viewport::set_render_target_to_screen_rect); + ObjectTypeDB::bind_method(_MD("set_render_target_to_screen_rect","rect"), &Viewport::set_render_target_to_screen_rect); ObjectTypeDB::bind_method(_MD("get_mouse_pos"), &Viewport::get_mouse_pos); ObjectTypeDB::bind_method(_MD("warp_mouse","to_pos"), &Viewport::warp_mouse); diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 843a1fd9b7..7d86c5f334 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index b3a9ab922e..6c4fe1be79 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -221,7 +221,7 @@ static ResourceFormatLoaderImage *resource_loader_image=NULL; static ResourceFormatLoaderWAV *resource_loader_wav=NULL; -static ResourceFormatLoaderBitMap *resource_loader_bitmap=NULL; + #ifdef TOOLS_ENABLED @@ -249,8 +249,6 @@ void register_scene_types() { resource_loader_wav = memnew( ResourceFormatLoaderWAV ); ResourceLoader::add_resource_format_loader( resource_loader_wav ); - resource_loader_bitmap = memnew( ResourceFormatLoaderBitMap ); - ResourceLoader::add_resource_format_loader( resource_loader_bitmap ); #ifdef TOOLS_ENABLED @@ -631,7 +629,6 @@ void unregister_scene_types() { memdelete( resource_loader_image ); memdelete( resource_loader_wav ); - memdelete( resource_loader_bitmap ); #ifdef TOOLS_ENABLED diff --git a/scene/register_scene_types.h b/scene/register_scene_types.h index 7d36dbc101..15e1eb2980 100644 --- a/scene/register_scene_types.h +++ b/scene/register_scene_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index afd4dc5304..e8bd6c14ad 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/animation.h b/scene/resources/animation.h index 256826a4bb..405b8b6a05 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/audio_stream.cpp b/scene/resources/audio_stream.cpp index 569ed8620d..1dd702abd2 100644 --- a/scene/resources/audio_stream.cpp +++ b/scene/resources/audio_stream.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/audio_stream.h b/scene/resources/audio_stream.h index b16e62b8c7..a4a2ad7599 100644 --- a/scene/resources/audio_stream.h +++ b/scene/resources/audio_stream.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/audio_stream_resampled.cpp b/scene/resources/audio_stream_resampled.cpp index edbca60bd3..3e10048f57 100644 --- a/scene/resources/audio_stream_resampled.cpp +++ b/scene/resources/audio_stream_resampled.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/audio_stream_resampled.h b/scene/resources/audio_stream_resampled.h index 570c311878..64f9d17d88 100644 --- a/scene/resources/audio_stream_resampled.h +++ b/scene/resources/audio_stream_resampled.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/bit_mask.cpp b/scene/resources/bit_mask.cpp index 9a6452797a..f5bfce3ef8 100644 --- a/scene/resources/bit_mask.cpp +++ b/scene/resources/bit_mask.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -204,57 +204,3 @@ BitMap::BitMap() { ////////////////////////////////////// - -RES ResourceFormatLoaderBitMap::load(const String &p_path, const String& p_original_path, Error *r_error) { - - if (r_error) - *r_error=ERR_FILE_CANT_OPEN; - - BitMap* ptr = memnew(BitMap); - Ref<BitMap> bitmap( ptr ); - - - Image image; - - Error err = ImageLoader::load_image(p_path,&image); - - ERR_EXPLAIN("Failed loading image for BitMap: "+p_path); - ERR_FAIL_COND_V(err, RES()); - - bitmap->create_from_image_alpha(image); - if (r_error) - *r_error=OK; - - return bitmap; - -} - -bool ResourceFormatLoaderBitMap::handles_type(const String& p_type) const { - - return (p_type=="BitMap"); -} - -void ResourceFormatLoaderBitMap::get_recognized_extensions(List<String> *p_extensions) const { - - ImageLoader::get_recognized_extensions(p_extensions); -} - -String ResourceFormatLoaderBitMap::get_resource_type(const String &p_path) const { - - List<String> extensions; - ImageLoader::get_recognized_extensions(&extensions); - String ext=p_path.extension().to_lower(); - for(List<String>::Element *E=extensions.front();E;E=E->next()) { - if (E->get()==ext) - return "BitMap"; - } - return ""; -} - - -ResourceFormatLoaderBitMap::ResourceFormatLoaderBitMap() { - - -} - - diff --git a/scene/resources/bit_mask.h b/scene/resources/bit_mask.h index a6b29bb919..b245ea1542 100644 --- a/scene/resources/bit_mask.h +++ b/scene/resources/bit_mask.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -62,16 +62,5 @@ public: BitMap(); }; -class ResourceFormatLoaderBitMap : public ResourceFormatLoader { - -public: - - virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL); - virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual bool handles_type(const String& p_type) const; - virtual String get_resource_type(const String &p_path) const; - - ResourceFormatLoaderBitMap(); -}; #endif // BIT_MASK_H diff --git a/scene/resources/bounds.cpp b/scene/resources/bounds.cpp index 7382d60535..65ce5e49e8 100644 --- a/scene/resources/bounds.cpp +++ b/scene/resources/bounds.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/bounds.h b/scene/resources/bounds.h index 68aca6f6a0..a1610e2b57 100644 --- a/scene/resources/bounds.h +++ b/scene/resources/bounds.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/box_shape.cpp b/scene/resources/box_shape.cpp index ba29a1b601..9a6fedeb0b 100644 --- a/scene/resources/box_shape.cpp +++ b/scene/resources/box_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/box_shape.h b/scene/resources/box_shape.h index 9667515657..88fca65eea 100644 --- a/scene/resources/box_shape.h +++ b/scene/resources/box_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/canvas.cpp b/scene/resources/canvas.cpp index 51953d9683..0c87d0473d 100644 --- a/scene/resources/canvas.cpp +++ b/scene/resources/canvas.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/canvas.h b/scene/resources/canvas.h index 71dc080e64..5120301a67 100644 --- a/scene/resources/canvas.h +++ b/scene/resources/canvas.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/capsule_shape.cpp b/scene/resources/capsule_shape.cpp index 67ceed6be0..4c53645d2d 100644 --- a/scene/resources/capsule_shape.cpp +++ b/scene/resources/capsule_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/capsule_shape.h b/scene/resources/capsule_shape.h index e516d0e3c7..4263c3a554 100644 --- a/scene/resources/capsule_shape.h +++ b/scene/resources/capsule_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp index 923a509ad5..1887ec11d7 100644 --- a/scene/resources/capsule_shape_2d.cpp +++ b/scene/resources/capsule_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/capsule_shape_2d.h b/scene/resources/capsule_shape_2d.h index dc679966f9..18b5c12a52 100644 --- a/scene/resources/capsule_shape_2d.h +++ b/scene/resources/capsule_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp index c77395612c..7171af9670 100644 --- a/scene/resources/circle_shape_2d.cpp +++ b/scene/resources/circle_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/circle_shape_2d.h b/scene/resources/circle_shape_2d.h index a5902b189c..c36e00d106 100644 --- a/scene/resources/circle_shape_2d.h +++ b/scene/resources/circle_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/concave_polygon_shape.cpp b/scene/resources/concave_polygon_shape.cpp index 7aeac04a22..34bea038f4 100644 --- a/scene/resources/concave_polygon_shape.cpp +++ b/scene/resources/concave_polygon_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/concave_polygon_shape.h b/scene/resources/concave_polygon_shape.h index fae98ee046..a4845e9220 100644 --- a/scene/resources/concave_polygon_shape.h +++ b/scene/resources/concave_polygon_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/concave_polygon_shape_2d.cpp index 01b7531f14..2c66155cb8 100644 --- a/scene/resources/concave_polygon_shape_2d.cpp +++ b/scene/resources/concave_polygon_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/concave_polygon_shape_2d.h b/scene/resources/concave_polygon_shape_2d.h index 29666c88c1..89b8914741 100644 --- a/scene/resources/concave_polygon_shape_2d.h +++ b/scene/resources/concave_polygon_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/convex_polygon_shape.cpp b/scene/resources/convex_polygon_shape.cpp index 6a405c9c94..7fcc9e97c0 100644 --- a/scene/resources/convex_polygon_shape.cpp +++ b/scene/resources/convex_polygon_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/convex_polygon_shape.h b/scene/resources/convex_polygon_shape.h index 48454deb2b..a4e504ee24 100644 --- a/scene/resources/convex_polygon_shape.h +++ b/scene/resources/convex_polygon_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp index 86cf818ac3..5c0dadefc2 100644 --- a/scene/resources/convex_polygon_shape_2d.cpp +++ b/scene/resources/convex_polygon_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/convex_polygon_shape_2d.h b/scene/resources/convex_polygon_shape_2d.h index 1af7787f67..e1792a1075 100644 --- a/scene/resources/convex_polygon_shape_2d.h +++ b/scene/resources/convex_polygon_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index c1a389942f..7dec4029fc 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/curve.h b/scene/resources/curve.h index 4818632dc3..262f22b7d1 100644 --- a/scene/resources/curve.h +++ b/scene/resources/curve.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 68033b6682..f0b3519b4a 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ @@ -543,7 +543,11 @@ void make_default_theme() { t->set_constant("close_v_ofs","WindowDialog", 20 ); t->set_constant("titlebar_height","WindowDialog", 18 ); t->set_constant("title_height","WindowDialog", 20 ); - + + + // File Dialog + + t->set_icon("reload","FileDialog",make_icon( icon_reload_png )); // Popup @@ -713,6 +717,7 @@ void make_default_theme() { t->set_icon("increment_hilite","Tabs",make_icon( scroll_button_right_hl_png)); t->set_icon("decrement","Tabs",make_icon( scroll_button_left_png)); t->set_icon("decrement_hilite","Tabs",make_icon( scroll_button_left_hl_png)); + t->set_icon("close","Tabs",make_icon( tab_close_png)); t->set_font("font","Tabs", default_font ); diff --git a/scene/resources/default_theme/default_theme.h b/scene/resources/default_theme/default_theme.h index ddd8af46f0..44569ba192 100644 --- a/scene/resources/default_theme/default_theme.h +++ b/scene/resources/default_theme/default_theme.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/scene/resources/default_theme/icon_reload.png b/scene/resources/default_theme/icon_reload.png Binary files differnew file mode 100644 index 0000000000..f7c6530d77 --- /dev/null +++ b/scene/resources/default_theme/icon_reload.png diff --git a/scene/resources/default_theme/tab_close.png b/scene/resources/default_theme/tab_close.png Binary files differnew file mode 100644 index 0000000000..10e56d5bb8 --- /dev/null +++ b/scene/resources/default_theme/tab_close.png diff --git a/scene/resources/default_theme/theme_data.h b/scene/resources/default_theme/theme_data.h index c338126d3a..e0b5736d99 100644 --- a/scene/resources/default_theme/theme_data.h +++ b/scene/resources/default_theme/theme_data.h @@ -194,6 +194,11 @@ static const unsigned char icon_play_png[]={ }; +static const unsigned char icon_reload_png[]={ +0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,0x0,0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x1,0x94,0x49,0x44,0x41,0x54,0x38,0x8d,0x85,0xd3,0xbd,0x6a,0x55,0x41,0x14,0xc5,0xf1,0xdf,0xb9,0x1f,0x91,0x20,0x5a,0x89,0xd8,0x8,0x4b,0xd0,0x42,0x1f,0xc0,0x42,0x4,0x4b,0xb,0x1b,0x9b,0xbc,0x80,0x58,0x45,0xc5,0x56,0x51,0x50,0x6b,0x21,0x9d,0xa5,0x6f,0x20,0x88,0x20,0xa8,0xad,0xa8,0xa0,0x2f,0x60,0x21,0xe8,0x4e,0x63,0xa9,0x85,0x22,0x31,0x37,0x37,0xb1,0xb8,0x73,0xc2,0xf1,0x23,0x38,0xd5,0x9c,0x61,0xaf,0x3d,0x7b,0xfe,0x6b,0x9d,0xce,0x1e,0xab,0xaa,0xc6,0x18,0xa1,0xc3,0xe,0xb6,0x92,0xec,0xfc,0x59,0x37,0xda,0x43,0x8,0xc7,0x70,0x9,0x37,0xb0,0xd2,0xd7,0x56,0x55,0x57,0x55,0xbb,0xf5,0xdd,0x1f,0xe2,0xae,0x9,0x9f,0xe2,0x24,0xb6,0x6,0x97,0x8c,0xf0,0x32,0xc9,0xb9,0xaa,0x9a,0x62,0x96,0x64,0xd1,0xa0,0x75,0x1c,0xe3,0x2,0x9e,0x34,0xc1,0x2b,0x3c,0xc6,0x3a,0x8e,0xe3,0x76,0xab,0x59,0xc6,0x41,0xfc,0xc0,0xbc,0x6f,0x30,0xc6,0x61,0x7c,0x6e,0xe2,0x53,0x49,0xde,0x57,0xd5,0x12,0xb6,0xd1,0x25,0x99,0x55,0xd5,0x3,0xac,0x36,0x1e,0xd3,0x5d,0x6,0x49,0xe6,0x78,0xd4,0xc4,0xe7,0xf1,0xa9,0x9d,0x6f,0x26,0xd9,0xc2,0xac,0x7d,0x5f,0xc1,0x73,0xcc,0xab,0xea,0x7a,0x55,0x4d,0x7b,0x30,0x37,0x71,0x6,0xdf,0x70,0x34,0xc9,0xc6,0x90,0x4d,0x92,0x21,0xa3,0x15,0xec,0xc3,0x6a,0x92,0x59,0x57,0x55,0x13,0x4c,0xdb,0x9b,0x36,0x92,0x2c,0x57,0xd5,0xb8,0x4d,0xf5,0xcf,0x55,0x55,0x33,0x4c,0x92,0x74,0xa3,0x46,0x7a,0x8e,0x13,0x38,0xd8,0x1a,0xfe,0x53,0x3c,0xb0,0xef,0x4b,0xbf,0x19,0xb5,0xf1,0x36,0xf1,0x31,0xc9,0xcc,0x22,0x34,0xff,0x5b,0x87,0xf1,0x95,0xbf,0x73,0xb0,0x86,0x5b,0xf8,0x89,0xed,0xfe,0xed,0x83,0xdb,0x97,0x70,0x19,0x6b,0x78,0x88,0xab,0xbd,0x8d,0x13,0x9c,0xc6,0x6b,0xac,0x27,0x49,0xb3,0x70,0x96,0x64,0xa7,0xc1,0x9b,0xe0,0x90,0x66,0x75,0x92,0xae,0xaa,0xba,0xde,0xc6,0xad,0x24,0x6f,0xf0,0xc,0x47,0xaa,0xea,0x3b,0x2e,0xe,0xb2,0xbf,0xdf,0x22,0xd2,0x7d,0x4e,0xce,0xb7,0x34,0xee,0xec,0x26,0x71,0x60,0xd5,0x5d,0xdc,0xb1,0x0,0xd9,0xff,0x17,0x2c,0xb2,0x30,0xc5,0x59,0xbc,0xee,0xeb,0xfb,0x9,0x86,0x84,0xef,0xe1,0x0,0xee,0xe3,0x2d,0x3e,0xe0,0x5,0xae,0x25,0xe9,0xf0,0x6e,0xc8,0xe6,0x37,0x88,0x3,0x58,0x1d,0xc6,0x2d,0x85,0xfd,0xf9,0x92,0x85,0x5b,0x86,0xd,0x7e,0x1,0x82,0x4c,0xaa,0x69,0x77,0x3c,0x4b,0x15,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 +}; + + static const unsigned char icon_stop_png[]={ 0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xde,0x9,0xf,0x14,0x33,0x24,0x62,0xd4,0x2f,0x95,0x0,0x0,0x0,0x39,0x49,0x44,0x41,0x54,0x38,0x8d,0x63,0x60,0xa0,0x6,0xf8,0xf0,0xe1,0x3,0x33,0xb9,0x7a,0x18,0x61,0x2,0xf,0x1f,0x3e,0xfc,0x4f,0x8a,0x1,0xf2,0xf2,0xf2,0x8c,0xc,0xc,0xc,0xc,0x4c,0xa4,0xda,0x8c,0xe,0x46,0xd,0x18,0x35,0x60,0x70,0x18,0xc0,0xc0,0xc0,0x40,0x59,0x66,0xa2,0x18,0x0,0x0,0x2a,0xc7,0xf,0x64,0xd5,0xe,0x11,0x85,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 }; @@ -394,6 +399,11 @@ static const unsigned char tab_behind_png[]={ }; +static const unsigned char tab_close_png[]={ +0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,0x0,0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x1,0x1b,0x49,0x44,0x41,0x54,0x38,0x8d,0xcd,0x52,0xbb,0x4e,0xc4,0x40,0xc,0x9c,0x73,0xd2,0x50,0x38,0xd1,0x8a,0x82,0x36,0x3d,0x8,0xc4,0x43,0x88,0x13,0x12,0x20,0xf8,0x67,0x8a,0xfb,0x1,0xe,0x89,0x13,0x3d,0x47,0xb1,0x7f,0xb0,0x85,0x53,0x41,0xce,0xa6,0xd9,0x45,0xbe,0x24,0x1f,0x70,0x96,0x56,0x96,0xed,0x9d,0x91,0x3d,0x36,0x70,0x50,0x96,0x52,0xaa,0xbd,0x1f,0xd5,0xaa,0xb9,0x1a,0x79,0xb0,0x99,0x9d,0xc4,0x18,0x4d,0x55,0x2f,0xfd,0xc7,0x94,0x12,0xa9,0xea,0x53,0x8c,0xd1,0xcc,0xac,0xf1,0xb5,0x85,0x67,0x8b,0x31,0x1a,0x0,0x5,0x40,0xcc,0x7c,0x4b,0x44,0x9f,0x0,0x54,0x55,0x5f,0x44,0x64,0x5,0x60,0x7,0xa0,0xea,0xba,0x6e,0x31,0x21,0x48,0x29,0xd5,0xaa,0x7a,0x25,0x22,0xef,0x25,0xc7,0xcc,0x4b,0x33,0xb,0x7d,0xdf,0xbf,0xba,0xdc,0x29,0x11,0x7d,0x85,0x10,0x86,0x49,0x7,0x99,0xe4,0x5a,0x44,0xd6,0x73,0x1a,0x65,0xf0,0x77,0x8,0xe1,0x67,0xa2,0x1,0x0,0x84,0x10,0x6,0x22,0xda,0x30,0xf3,0x7d,0x4e,0x59,0x7e,0x60,0xe6,0xb,0x22,0xda,0x7a,0xf0,0x84,0x20,0x9b,0x9a,0x59,0xeb,0xe2,0xd2,0x65,0x53,0xc8,0x30,0x53,0x2c,0x23,0x54,0xaa,0xfa,0x9c,0x5,0x9b,0x1b,0xe1,0x8e,0x88,0x36,0x65,0xfe,0xbd,0xe,0x32,0xf8,0xd1,0x83,0x99,0xf9,0x9c,0x99,0x1f,0x4a,0x2c,0x22,0xeb,0xf1,0x8a,0xe7,0xd6,0xb8,0x3,0x50,0x65,0xc1,0xb6,0x0,0x4c,0x55,0x6f,0x44,0xe4,0xd,0xc0,0x0,0xa0,0xf6,0x6b,0xdc,0x3b,0xa4,0xa6,0x69,0x8e,0x33,0xf8,0x2c,0xab,0xfd,0x9b,0x85,0xfd,0x60,0xe6,0x25,0x80,0xaa,0x6d,0xdb,0xa3,0xb9,0x4b,0xfd,0x27,0xf1,0x7e,0xac,0x8f,0xf7,0x87,0x63,0x7f,0xc3,0xca,0xa9,0x49,0x35,0x25,0x97,0x14,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 +}; + + static const unsigned char tab_container_bg_png[]={ 0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0xa,0x45,0x69,0x43,0x43,0x50,0x49,0x43,0x43,0x20,0x70,0x72,0x6f,0x66,0x69,0x6c,0x65,0x0,0x0,0x78,0xda,0x9d,0x53,0x67,0x54,0x53,0xe9,0x16,0x3d,0xf7,0xde,0xf4,0x42,0x4b,0x88,0x80,0x94,0x4b,0x6f,0x52,0x15,0x8,0x20,0x52,0x42,0x8b,0x80,0x14,0x91,0x26,0x2a,0x21,0x9,0x10,0x4a,0x88,0x21,0xa1,0xd9,0x15,0x51,0xc1,0x11,0x45,0x45,0x4,0x1b,0xc8,0xa0,0x88,0x3,0x8e,0x8e,0x80,0x8c,0x15,0x51,0x2c,0xc,0x8a,0xa,0xd8,0x7,0xe4,0x21,0xa2,0x8e,0x83,0xa3,0x88,0x8a,0xca,0xfb,0xe1,0x7b,0xa3,0x6b,0xd6,0xbc,0xf7,0xe6,0xcd,0xfe,0xb5,0xd7,0x3e,0xe7,0xac,0xf3,0x9d,0xb3,0xcf,0x7,0xc0,0x8,0xc,0x96,0x48,0x33,0x51,0x35,0x80,0xc,0xa9,0x42,0x1e,0x11,0xe0,0x83,0xc7,0xc4,0xc6,0xe1,0xe4,0x2e,0x40,0x81,0xa,0x24,0x70,0x0,0x10,0x8,0xb3,0x64,0x21,0x73,0xfd,0x23,0x1,0x0,0xf8,0x7e,0x3c,0x3c,0x2b,0x22,0xc0,0x7,0xbe,0x0,0x1,0x78,0xd3,0xb,0x8,0x0,0xc0,0x4d,0x9b,0xc0,0x30,0x1c,0x87,0xff,0xf,0xea,0x42,0x99,0x5c,0x1,0x80,0x84,0x1,0xc0,0x74,0x91,0x38,0x4b,0x8,0x80,0x14,0x0,0x40,0x7a,0x8e,0x42,0xa6,0x0,0x40,0x46,0x1,0x80,0x9d,0x98,0x26,0x53,0x0,0xa0,0x4,0x0,0x60,0xcb,0x63,0x62,0xe3,0x0,0x50,0x2d,0x0,0x60,0x27,0x7f,0xe6,0xd3,0x0,0x80,0x9d,0xf8,0x99,0x7b,0x1,0x0,0x5b,0x94,0x21,0x15,0x1,0xa0,0x91,0x0,0x20,0x13,0x65,0x88,0x44,0x0,0x68,0x3b,0x0,0xac,0xcf,0x56,0x8a,0x45,0x0,0x58,0x30,0x0,0x14,0x66,0x4b,0xc4,0x39,0x0,0xd8,0x2d,0x0,0x30,0x49,0x57,0x66,0x48,0x0,0xb0,0xb7,0x0,0xc0,0xce,0x10,0xb,0xb2,0x0,0x8,0xc,0x0,0x30,0x51,0x88,0x85,0x29,0x0,0x4,0x7b,0x0,0x60,0xc8,0x23,0x23,0x78,0x0,0x84,0x99,0x0,0x14,0x46,0xf2,0x57,0x3c,0xf1,0x2b,0xae,0x10,0xe7,0x2a,0x0,0x0,0x78,0x99,0xb2,0x3c,0xb9,0x24,0x39,0x45,0x81,0x5b,0x8,0x2d,0x71,0x7,0x57,0x57,0x2e,0x1e,0x28,0xce,0x49,0x17,0x2b,0x14,0x36,0x61,0x2,0x61,0x9a,0x40,0x2e,0xc2,0x79,0x99,0x19,0x32,0x81,0x34,0xf,0xe0,0xf3,0xcc,0x0,0x0,0xa0,0x91,0x15,0x11,0xe0,0x83,0xf3,0xfd,0x78,0xce,0xe,0xae,0xce,0xce,0x36,0x8e,0xb6,0xe,0x5f,0x2d,0xea,0xbf,0x6,0xff,0x22,0x62,0x62,0xe3,0xfe,0xe5,0xcf,0xab,0x70,0x40,0x0,0x0,0xe1,0x74,0x7e,0xd1,0xfe,0x2c,0x2f,0xb3,0x1a,0x80,0x3b,0x6,0x80,0x6d,0xfe,0xa2,0x25,0xee,0x4,0x68,0x5e,0xb,0xa0,0x75,0xf7,0x8b,0x66,0xb2,0xf,0x40,0xb5,0x0,0xa0,0xe9,0xda,0x57,0xf3,0x70,0xf8,0x7e,0x3c,0x3c,0x45,0xa1,0x90,0xb9,0xd9,0xd9,0xe5,0xe4,0xe4,0xd8,0x4a,0xc4,0x42,0x5b,0x61,0xca,0x57,0x7d,0xfe,0x67,0xc2,0x5f,0xc0,0x57,0xfd,0x6c,0xf9,0x7e,0x3c,0xfc,0xf7,0xf5,0xe0,0xbe,0xe2,0x24,0x81,0x32,0x5d,0x81,0x47,0x4,0xf8,0xe0,0xc2,0xcc,0xf4,0x4c,0xa5,0x1c,0xcf,0x92,0x9,0x84,0x62,0xdc,0xe6,0x8f,0x47,0xfc,0xb7,0xb,0xff,0xfc,0x1d,0xd3,0x22,0xc4,0x49,0x62,0xb9,0x58,0x2a,0x14,0xe3,0x51,0x12,0x71,0x8e,0x44,0x9a,0x8c,0xf3,0x32,0xa5,0x22,0x89,0x42,0x92,0x29,0xc5,0x25,0xd2,0xff,0x64,0xe2,0xdf,0x2c,0xfb,0x3,0x3e,0xdf,0x35,0x0,0xb0,0x6a,0x3e,0x1,0x7b,0x91,0x2d,0xa8,0x5d,0x63,0x3,0xf6,0x4b,0x27,0x10,0x58,0x74,0xc0,0xe2,0xf7,0x0,0x0,0xf2,0xbb,0x6f,0xc1,0xd4,0x28,0x8,0x3,0x80,0x68,0x83,0xe1,0xcf,0x77,0xff,0xef,0x3f,0xfd,0x47,0xa0,0x25,0x0,0x80,0x66,0x49,0x92,0x71,0x0,0x0,0x5e,0x44,0x24,0x2e,0x54,0xca,0xb3,0x3f,0xc7,0x8,0x0,0x0,0x44,0xa0,0x81,0x2a,0xb0,0x41,0x1b,0xf4,0xc1,0x18,0x2c,0xc0,0x6,0x1c,0xc1,0x5,0xdc,0xc1,0xb,0xfc,0x60,0x36,0x84,0x42,0x24,0xc4,0xc2,0x42,0x10,0x42,0xa,0x64,0x80,0x1c,0x72,0x60,0x29,0xac,0x82,0x42,0x28,0x86,0xcd,0xb0,0x1d,0x2a,0x60,0x2f,0xd4,0x40,0x1d,0x34,0xc0,0x51,0x68,0x86,0x93,0x70,0xe,0x2e,0xc2,0x55,0xb8,0xe,0x3d,0x70,0xf,0xfa,0x61,0x8,0x9e,0xc1,0x28,0xbc,0x81,0x9,0x4,0x41,0xc8,0x8,0x13,0x61,0x21,0xda,0x88,0x1,0x62,0x8a,0x58,0x23,0x8e,0x8,0x17,0x99,0x85,0xf8,0x21,0xc1,0x48,0x4,0x12,0x8b,0x24,0x20,0xc9,0x88,0x14,0x51,0x22,0x4b,0x91,0x35,0x48,0x31,0x52,0x8a,0x54,0x20,0x55,0x48,0x1d,0xf2,0x3d,0x72,0x2,0x39,0x87,0x5c,0x46,0xba,0x91,0x3b,0xc8,0x0,0x32,0x82,0xfc,0x86,0xbc,0x47,0x31,0x94,0x81,0xb2,0x51,0x3d,0xd4,0xc,0xb5,0x43,0xb9,0xa8,0x37,0x1a,0x84,0x46,0xa2,0xb,0xd0,0x64,0x74,0x31,0x9a,0x8f,0x16,0xa0,0x9b,0xd0,0x72,0xb4,0x1a,0x3d,0x8c,0x36,0xa1,0xe7,0xd0,0xab,0x68,0xf,0xda,0x8f,0x3e,0x43,0xc7,0x30,0xc0,0xe8,0x18,0x7,0x33,0xc4,0x6c,0x30,0x2e,0xc6,0xc3,0x42,0xb1,0x38,0x2c,0x9,0x93,0x63,0xcb,0xb1,0x22,0xac,0xc,0xab,0xc6,0x1a,0xb0,0x56,0xac,0x3,0xbb,0x89,0xf5,0x63,0xcf,0xb1,0x77,0x4,0x12,0x81,0x45,0xc0,0x9,0x36,0x4,0x77,0x42,0x20,0x61,0x1e,0x41,0x48,0x58,0x4c,0x58,0x4e,0xd8,0x48,0xa8,0x20,0x1c,0x24,0x34,0x11,0xda,0x9,0x37,0x9,0x3,0x84,0x51,0xc2,0x27,0x22,0x93,0xa8,0x4b,0xb4,0x26,0xba,0x11,0xf9,0xc4,0x18,0x62,0x32,0x31,0x87,0x58,0x48,0x2c,0x23,0xd6,0x12,0x8f,0x13,0x2f,0x10,0x7b,0x88,0x43,0xc4,0x37,0x24,0x12,0x89,0x43,0x32,0x27,0xb9,0x90,0x2,0x49,0xb1,0xa4,0x54,0xd2,0x12,0xd2,0x46,0xd2,0x6e,0x52,0x23,0xe9,0x2c,0xa9,0x9b,0x34,0x48,0x1a,0x23,0x93,0xc9,0xda,0x64,0x6b,0xb2,0x7,0x39,0x94,0x2c,0x20,0x2b,0xc8,0x85,0xe4,0x9d,0xe4,0xc3,0xe4,0x33,0xe4,0x1b,0xe4,0x21,0xf2,0x5b,0xa,0x9d,0x62,0x40,0x71,0xa4,0xf8,0x53,0xe2,0x28,0x52,0xca,0x6a,0x4a,0x19,0xe5,0x10,0xe5,0x34,0xe5,0x6,0x65,0x98,0x32,0x41,0x55,0xa3,0x9a,0x52,0xdd,0xa8,0xa1,0x54,0x11,0x35,0x8f,0x5a,0x42,0xad,0xa1,0xb6,0x52,0xaf,0x51,0x87,0xa8,0x13,0x34,0x75,0x9a,0x39,0xcd,0x83,0x16,0x49,0x4b,0xa5,0xad,0xa2,0x95,0xd3,0x1a,0x68,0x17,0x68,0xf7,0x69,0xaf,0xe8,0x74,0xba,0x11,0xdd,0x95,0x1e,0x4e,0x97,0xd0,0x57,0xd2,0xcb,0xe9,0x47,0xe8,0x97,0xe8,0x3,0xf4,0x77,0xc,0xd,0x86,0x15,0x83,0xc7,0x88,0x67,0x28,0x19,0x9b,0x18,0x7,0x18,0x67,0x19,0x77,0x18,0xaf,0x98,0x4c,0xa6,0x19,0xd3,0x8b,0x19,0xc7,0x54,0x30,0x37,0x31,0xeb,0x98,0xe7,0x99,0xf,0x99,0x6f,0x55,0x58,0x2a,0xb6,0x2a,0x7c,0x15,0x91,0xca,0xa,0x95,0x4a,0x95,0x26,0x95,0x1b,0x2a,0x2f,0x54,0xa9,0xaa,0xa6,0xaa,0xde,0xaa,0xb,0x55,0xf3,0x55,0xcb,0x54,0x8f,0xa9,0x5e,0x53,0x7d,0xae,0x46,0x55,0x33,0x53,0xe3,0xa9,0x9,0xd4,0x96,0xab,0x55,0xaa,0x9d,0x50,0xeb,0x53,0x1b,0x53,0x67,0xa9,0x3b,0xa8,0x87,0xaa,0x67,0xa8,0x6f,0x54,0x3f,0xa4,0x7e,0x59,0xfd,0x89,0x6,0x59,0xc3,0x4c,0xc3,0x4f,0x43,0xa4,0x51,0xa0,0xb1,0x5f,0xe3,0xbc,0xc6,0x20,0xb,0x63,0x19,0xb3,0x78,0x2c,0x21,0x6b,0xd,0xab,0x86,0x75,0x81,0x35,0xc4,0x26,0xb1,0xcd,0xd9,0x7c,0x76,0x2a,0xbb,0x98,0xfd,0x1d,0xbb,0x8b,0x3d,0xaa,0xa9,0xa1,0x39,0x43,0x33,0x4a,0x33,0x57,0xb3,0x52,0xf3,0x94,0x66,0x3f,0x7,0xe3,0x98,0x71,0xf8,0x9c,0x74,0x4e,0x9,0xe7,0x28,0xa7,0x97,0xf3,0x7e,0x8a,0xde,0x14,0xef,0x29,0xe2,0x29,0x1b,0xa6,0x34,0x4c,0xb9,0x31,0x65,0x5c,0x6b,0xaa,0x96,0x97,0x96,0x58,0xab,0x48,0xab,0x51,0xab,0x47,0xeb,0xbd,0x36,0xae,0xed,0xa7,0x9d,0xa6,0xbd,0x45,0xbb,0x59,0xfb,0x81,0xe,0x41,0xc7,0x4a,0x27,0x5c,0x27,0x47,0x67,0x8f,0xce,0x5,0x9d,0xe7,0x53,0xd9,0x53,0xdd,0xa7,0xa,0xa7,0x16,0x4d,0x3d,0x3a,0xf5,0xae,0x2e,0xaa,0x6b,0xa5,0x1b,0xa1,0xbb,0x44,0x77,0xbf,0x6e,0xa7,0xee,0x98,0x9e,0xbe,0x5e,0x80,0x9e,0x4c,0x6f,0xa7,0xde,0x79,0xbd,0xe7,0xfa,0x1c,0x7d,0x2f,0xfd,0x54,0xfd,0x6d,0xfa,0xa7,0xf5,0x47,0xc,0x58,0x6,0xb3,0xc,0x24,0x6,0xdb,0xc,0xce,0x18,0x3c,0xc5,0x35,0x71,0x6f,0x3c,0x1d,0x2f,0xc7,0xdb,0xf1,0x51,0x43,0x5d,0xc3,0x40,0x43,0xa5,0x61,0x95,0x61,0x97,0xe1,0x84,0x91,0xb9,0xd1,0x3c,0xa3,0xd5,0x46,0x8d,0x46,0xf,0x8c,0x69,0xc6,0x5c,0xe3,0x24,0xe3,0x6d,0xc6,0x6d,0xc6,0xa3,0x26,0x6,0x26,0x21,0x26,0x4b,0x4d,0xea,0x4d,0xee,0x9a,0x52,0x4d,0xb9,0xa6,0x29,0xa6,0x3b,0x4c,0x3b,0x4c,0xc7,0xcd,0xcc,0xcd,0xa2,0xcd,0xd6,0x99,0x35,0x9b,0x3d,0x31,0xd7,0x32,0xe7,0x9b,0xe7,0x9b,0xd7,0x9b,0xdf,0xb7,0x60,0x5a,0x78,0x5a,0x2c,0xb6,0xa8,0xb6,0xb8,0x65,0x49,0xb2,0xe4,0x5a,0xa6,0x59,0xee,0xb6,0xbc,0x6e,0x85,0x5a,0x39,0x59,0xa5,0x58,0x55,0x5a,0x5d,0xb3,0x46,0xad,0x9d,0xad,0x25,0xd6,0xbb,0xad,0xbb,0xa7,0x11,0xa7,0xb9,0x4e,0x93,0x4e,0xab,0x9e,0xd6,0x67,0xc3,0xb0,0xf1,0xb6,0xc9,0xb6,0xa9,0xb7,0x19,0xb0,0xe5,0xd8,0x6,0xdb,0xae,0xb6,0x6d,0xb6,0x7d,0x61,0x67,0x62,0x17,0x67,0xb7,0xc5,0xae,0xc3,0xee,0x93,0xbd,0x93,0x7d,0xba,0x7d,0x8d,0xfd,0x3d,0x7,0xd,0x87,0xd9,0xe,0xab,0x1d,0x5a,0x1d,0x7e,0x73,0xb4,0x72,0x14,0x3a,0x56,0x3a,0xde,0x9a,0xce,0x9c,0xee,0x3f,0x7d,0xc5,0xf4,0x96,0xe9,0x2f,0x67,0x58,0xcf,0x10,0xcf,0xd8,0x33,0xe3,0xb6,0x13,0xcb,0x29,0xc4,0x69,0x9d,0x53,0x9b,0xd3,0x47,0x67,0x17,0x67,0xb9,0x73,0x83,0xf3,0x88,0x8b,0x89,0x4b,0x82,0xcb,0x2e,0x97,0x3e,0x2e,0x9b,0x1b,0xc6,0xdd,0xc8,0xbd,0xe4,0x4a,0x74,0xf5,0x71,0x5d,0xe1,0x7a,0xd2,0xf5,0x9d,0x9b,0xb3,0x9b,0xc2,0xed,0xa8,0xdb,0xaf,0xee,0x36,0xee,0x69,0xee,0x87,0xdc,0x9f,0xcc,0x34,0x9f,0x29,0x9e,0x59,0x33,0x73,0xd0,0xc3,0xc8,0x43,0xe0,0x51,0xe5,0xd1,0x3f,0xb,0x9f,0x95,0x30,0x6b,0xdf,0xac,0x7e,0x4f,0x43,0x4f,0x81,0x67,0xb5,0xe7,0x23,0x2f,0x63,0x2f,0x91,0x57,0xad,0xd7,0xb0,0xb7,0xa5,0x77,0xaa,0xf7,0x61,0xef,0x17,0x3e,0xf6,0x3e,0x72,0x9f,0xe3,0x3e,0xe3,0x3c,0x37,0xde,0x32,0xde,0x59,0x5f,0xcc,0x37,0xc0,0xb7,0xc8,0xb7,0xcb,0x4f,0xc3,0x6f,0x9e,0x5f,0x85,0xdf,0x43,0x7f,0x23,0xff,0x64,0xff,0x7a,0xff,0xd1,0x0,0xa7,0x80,0x25,0x1,0x67,0x3,0x89,0x81,0x41,0x81,0x5b,0x2,0xfb,0xf8,0x7a,0x7c,0x21,0xbf,0x8e,0x3f,0x3a,0xdb,0x65,0xf6,0xb2,0xd9,0xed,0x41,0x8c,0xa0,0xb9,0x41,0x15,0x41,0x8f,0x82,0xad,0x82,0xe5,0xc1,0xad,0x21,0x68,0xc8,0xec,0x90,0xad,0x21,0xf7,0xe7,0x98,0xce,0x91,0xce,0x69,0xe,0x85,0x50,0x7e,0xe8,0xd6,0xd0,0x7,0x61,0xe6,0x61,0x8b,0xc3,0x7e,0xc,0x27,0x85,0x87,0x85,0x57,0x86,0x3f,0x8e,0x70,0x88,0x58,0x1a,0xd1,0x31,0x97,0x35,0x77,0xd1,0xdc,0x43,0x73,0xdf,0x44,0xfa,0x44,0x96,0x44,0xde,0x9b,0x67,0x31,0x4f,0x39,0xaf,0x2d,0x4a,0x35,0x2a,0x3e,0xaa,0x2e,0x6a,0x3c,0xda,0x37,0xba,0x34,0xba,0x3f,0xc6,0x2e,0x66,0x59,0xcc,0xd5,0x58,0x9d,0x58,0x49,0x6c,0x4b,0x1c,0x39,0x2e,0x2a,0xae,0x36,0x6e,0x6c,0xbe,0xdf,0xfc,0xed,0xf3,0x87,0xe2,0x9d,0xe2,0xb,0xe3,0x7b,0x17,0x98,0x2f,0xc8,0x5d,0x70,0x79,0xa1,0xce,0xc2,0xf4,0x85,0xa7,0x16,0xa9,0x2e,0x12,0x2c,0x3a,0x96,0x40,0x4c,0x88,0x4e,0x38,0x94,0xf0,0x41,0x10,0x2a,0xa8,0x16,0x8c,0x25,0xf2,0x13,0x77,0x25,0x8e,0xa,0x79,0xc2,0x1d,0xc2,0x67,0x22,0x2f,0xd1,0x36,0xd1,0x88,0xd8,0x43,0x5c,0x2a,0x1e,0x4e,0xf2,0x48,0x2a,0x4d,0x7a,0x92,0xec,0x91,0xbc,0x35,0x79,0x24,0xc5,0x33,0xa5,0x2c,0xe5,0xb9,0x84,0x27,0xa9,0x90,0xbc,0x4c,0xd,0x4c,0xdd,0x9b,0x3a,0x9e,0x16,0x9a,0x76,0x20,0x6d,0x32,0x3d,0x3a,0xbd,0x31,0x83,0x92,0x91,0x90,0x71,0x42,0xaa,0x21,0x4d,0x93,0xb6,0x67,0xea,0x67,0xe6,0x66,0x76,0xcb,0xac,0x65,0x85,0xb2,0xfe,0xc5,0x6e,0x8b,0xb7,0x2f,0x1e,0x95,0x7,0xc9,0x6b,0xb3,0x90,0xac,0x5,0x59,0x2d,0xa,0xb6,0x42,0xa6,0xe8,0x54,0x5a,0x28,0xd7,0x2a,0x7,0xb2,0x67,0x65,0x57,0x66,0xbf,0xcd,0x89,0xca,0x39,0x96,0xab,0x9e,0x2b,0xcd,0xed,0xcc,0xb3,0xca,0xdb,0x90,0x37,0x9c,0xef,0x9f,0xff,0xed,0x12,0xc2,0x12,0xe1,0x92,0xb6,0xa5,0x86,0x4b,0x57,0x2d,0x1d,0x58,0xe6,0xbd,0xac,0x6a,0x39,0xb2,0x3c,0x71,0x79,0xdb,0xa,0xe3,0x15,0x5,0x2b,0x86,0x56,0x6,0xac,0x3c,0xb8,0x8a,0xb6,0x2a,0x6d,0xd5,0x4f,0xab,0xed,0x57,0x97,0xae,0x7e,0xbd,0x26,0x7a,0x4d,0x6b,0x81,0x5e,0xc1,0xca,0x82,0xc1,0xb5,0x1,0x6b,0xeb,0xb,0x55,0xa,0xe5,0x85,0x7d,0xeb,0xdc,0xd7,0xed,0x5d,0x4f,0x58,0x2f,0x59,0xdf,0xb5,0x61,0xfa,0x86,0x9d,0x1b,0x3e,0x15,0x89,0x8a,0xae,0x14,0xdb,0x17,0x97,0x15,0x7f,0xd8,0x28,0xdc,0x78,0xe5,0x1b,0x87,0x6f,0xca,0xbf,0x99,0xdc,0x94,0xb4,0xa9,0xab,0xc4,0xb9,0x64,0xcf,0x66,0xd2,0x66,0xe9,0xe6,0xde,0x2d,0x9e,0x5b,0xe,0x96,0xaa,0x97,0xe6,0x97,0xe,0x6e,0xd,0xd9,0xda,0xb4,0xd,0xdf,0x56,0xb4,0xed,0xf5,0xf6,0x45,0xdb,0x2f,0x97,0xcd,0x28,0xdb,0xbb,0x83,0xb6,0x43,0xb9,0xa3,0xbf,0x3c,0xb8,0xbc,0x65,0xa7,0xc9,0xce,0xcd,0x3b,0x3f,0x54,0xa4,0x54,0xf4,0x54,0xfa,0x54,0x36,0xee,0xd2,0xdd,0xb5,0x61,0xd7,0xf8,0x6e,0xd1,0xee,0x1b,0x7b,0xbc,0xf6,0x34,0xec,0xd5,0xdb,0x5b,0xbc,0xf7,0xfd,0x3e,0xc9,0xbe,0xdb,0x55,0x1,0x55,0x4d,0xd5,0x66,0xd5,0x65,0xfb,0x49,0xfb,0xb3,0xf7,0x3f,0xae,0x89,0xaa,0xe9,0xf8,0x96,0xfb,0x6d,0x5d,0xad,0x4e,0x6d,0x71,0xed,0xc7,0x3,0xd2,0x3,0xfd,0x7,0x23,0xe,0xb6,0xd7,0xb9,0xd4,0xd5,0x1d,0xd2,0x3d,0x54,0x52,0x8f,0xd6,0x2b,0xeb,0x47,0xe,0xc7,0x1f,0xbe,0xfe,0x9d,0xef,0x77,0x2d,0xd,0x36,0xd,0x55,0x8d,0x9c,0xc6,0xe2,0x23,0x70,0x44,0x79,0xe4,0xe9,0xf7,0x9,0xdf,0xf7,0x1e,0xd,0x3a,0xda,0x76,0x8c,0x7b,0xac,0xe1,0x7,0xd3,0x1f,0x76,0x1d,0x67,0x1d,0x2f,0x6a,0x42,0x9a,0xf2,0x9a,0x46,0x9b,0x53,0x9a,0xfb,0x5b,0x62,0x5b,0xba,0x4f,0xcc,0x3e,0xd1,0xd6,0xea,0xde,0x7a,0xfc,0x47,0xdb,0x1f,0xf,0x9c,0x34,0x3c,0x59,0x79,0x4a,0xf3,0x54,0xc9,0x69,0xda,0xe9,0x82,0xd3,0x93,0x67,0xf2,0xcf,0x8c,0x9d,0x95,0x9d,0x7d,0x7e,0x2e,0xf9,0xdc,0x60,0xdb,0xa2,0xb6,0x7b,0xe7,0x63,0xce,0xdf,0x6a,0xf,0x6f,0xef,0xba,0x10,0x74,0xe1,0xd2,0x45,0xff,0x8b,0xe7,0x3b,0xbc,0x3b,0xce,0x5c,0xf2,0xb8,0x74,0xf2,0xb2,0xdb,0xe5,0x13,0x57,0xb8,0x57,0x9a,0xaf,0x3a,0x5f,0x6d,0xea,0x74,0xea,0x3c,0xfe,0x93,0xd3,0x4f,0xc7,0xbb,0x9c,0xbb,0x9a,0xae,0xb9,0x5c,0x6b,0xb9,0xee,0x7a,0xbd,0xb5,0x7b,0x66,0xf7,0xe9,0x1b,0x9e,0x37,0xce,0xdd,0xf4,0xbd,0x79,0xf1,0x16,0xff,0xd6,0xd5,0x9e,0x39,0x3d,0xdd,0xbd,0xf3,0x7a,0x6f,0xf7,0xc5,0xf7,0xf5,0xdf,0x16,0xdd,0x7e,0x72,0x27,0xfd,0xce,0xcb,0xbb,0xd9,0x77,0x27,0xee,0xad,0xbc,0x4f,0xbc,0x5f,0xf4,0x40,0xed,0x41,0xd9,0x43,0xdd,0x87,0xd5,0x3f,0x5b,0xfe,0xdc,0xd8,0xef,0xdc,0x7f,0x6a,0xc0,0x77,0xa0,0xf3,0xd1,0xdc,0x47,0xf7,0x6,0x85,0x83,0xcf,0xfe,0x91,0xf5,0x8f,0xf,0x43,0x5,0x8f,0x99,0x8f,0xcb,0x86,0xd,0x86,0xeb,0x9e,0x38,0x3e,0x39,0x39,0xe2,0x3f,0x72,0xfd,0xe9,0xfc,0xa7,0x43,0xcf,0x64,0xcf,0x26,0x9e,0x17,0xfe,0xa2,0xfe,0xcb,0xae,0x17,0x16,0x2f,0x7e,0xf8,0xd5,0xeb,0xd7,0xce,0xd1,0x98,0xd1,0xa1,0x97,0xf2,0x97,0x93,0xbf,0x6d,0x7c,0xa5,0xfd,0xea,0xc0,0xeb,0x19,0xaf,0xdb,0xc6,0xc2,0xc6,0x1e,0xbe,0xc9,0x78,0x33,0x31,0x5e,0xf4,0x56,0xfb,0xed,0xc1,0x77,0xdc,0x77,0x1d,0xef,0xa3,0xdf,0xf,0x4f,0xe4,0x7c,0x20,0x7f,0x28,0xff,0x68,0xf9,0xb1,0xf5,0x53,0xd0,0xa7,0xfb,0x93,0x19,0x93,0x93,0xff,0x4,0x3,0x98,0xf3,0xfc,0xef,0x35,0x94,0x82,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xdf,0xa,0x15,0x0,0x5,0x21,0x33,0xd5,0x5f,0x4d,0x0,0x0,0x1,0x3a,0x49,0x44,0x41,0x54,0x38,0xcb,0xa5,0x93,0x41,0x4a,0x3,0x51,0xc,0x86,0xbf,0x37,0xef,0xd1,0x11,0x5d,0x74,0x40,0xc1,0x5a,0xea,0x45,0xc4,0xa5,0x27,0xf0,0x34,0x73,0x84,0xe2,0x61,0x3c,0x81,0xee,0xc4,0x8b,0x8,0x76,0xd3,0xea,0x14,0x5a,0xe8,0x74,0xde,0x4b,0x5c,0x4c,0x46,0x2a,0xd4,0x3a,0xc5,0x40,0x20,0x8b,0xe4,0x4f,0xfe,0xf0,0xff,0xe,0x8,0xc0,0x0,0xc8,0x81,0x13,0xab,0x3d,0x90,0xf1,0x33,0x4,0x48,0xc0,0x16,0xd8,0x0,0x35,0xb0,0xed,0x86,0xcf,0x80,0x2,0x18,0x5a,0x9d,0x3,0xce,0x12,0x40,0x2d,0x6b,0x60,0xd,0x2c,0x81,0xa,0xdb,0x9e,0x3,0xc5,0xed,0xcd,0xdd,0xfd,0xf8,0xea,0xba,0x8c,0x29,0x16,0xaa,0xec,0xd,0xe7,0x20,0xf8,0x50,0xbd,0xcf,0xde,0xa6,0x2f,0xaf,0x4f,0x8f,0x40,0xc,0x76,0xf6,0x70,0x3c,0x9a,0x94,0xd5,0xe7,0xa2,0x88,0x31,0xa2,0xec,0x47,0x70,0x38,0x42,0x8,0xc5,0x78,0x34,0x29,0x81,0x67,0x60,0xf5,0x4d,0xa1,0x89,0x4d,0xd1,0xc4,0xe6,0xd7,0xe1,0x96,0x87,0xd2,0xc4,0x86,0x26,0x36,0x85,0x51,0x1d,0x4,0x7b,0x58,0x2e,0x22,0x88,0xa,0x7f,0x85,0xa2,0x88,0x8,0x46,0xdd,0x7,0xfb,0xb6,0x53,0x51,0x54,0x94,0x3e,0x61,0x7d,0xe,0xc8,0x42,0x47,0x2f,0x69,0xea,0x75,0x1,0x40,0xd2,0xd4,0x1,0x10,0x76,0x51,0x55,0x8f,0xba,0x80,0x5d,0x0,0x55,0x3d,0x2,0xa0,0xed,0xd3,0xe,0x40,0x5a,0xd0,0x84,0xf6,0xa4,0x20,0x2d,0x5,0x5,0x24,0x98,0x3c,0x6b,0x84,0xde,0x4f,0xa4,0xdd,0x53,0x3,0x29,0x33,0x6d,0xaf,0x71,0x59,0x95,0x79,0x8f,0xa8,0x1e,0xcc,0xcc,0x7b,0x70,0x59,0x65,0x92,0xde,0x6,0x33,0xc6,0x72,0xbe,0x98,0x4d,0x2f,0xce,0x2f,0xcb,0x24,0xa9,0xe0,0x80,0x96,0x7d,0x16,0x3e,0xe6,0x8b,0xd9,0x83,0xf9,0x61,0xe3,0x80,0xd3,0x7f,0x98,0x69,0x1d,0x8c,0x2,0x40,0x4,0x56,0xc7,0xda,0xf9,0xb,0x57,0x2d,0xbb,0xf5,0x2d,0xe4,0x89,0x1b,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 }; diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index ffa02e819c..4551aff0ef 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/environment.h b/scene/resources/environment.h index bee45b78cd..4620bf567a 100644 --- a/scene/resources/environment.h +++ b/scene/resources/environment.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/event_stream.cpp b/scene/resources/event_stream.cpp index e8cd08c064..8667bcc5db 100644 --- a/scene/resources/event_stream.cpp +++ b/scene/resources/event_stream.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/event_stream.h b/scene/resources/event_stream.h index f9a5e3785a..6ee9b76717 100644 --- a/scene/resources/event_stream.h +++ b/scene/resources/event_stream.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index aad5e7cfdd..0aae6fd978 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -517,7 +517,7 @@ void Font::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_descent"),&Font::get_descent); ObjectTypeDB::bind_method(_MD("add_kerning_pair","char_a","char_b","kerning"),&Font::add_kerning_pair); - ObjectTypeDB::bind_method(_MD("get_kerning_pair"),&Font::get_kerning_pair); + ObjectTypeDB::bind_method(_MD("get_kerning_pair","char_a","char_b"),&Font::get_kerning_pair); ObjectTypeDB::bind_method(_MD("add_texture","texture:Texture"),&Font::add_texture); ObjectTypeDB::bind_method(_MD("add_char","character","texture","rect","align","advance"),&Font::add_char,DEFVAL(Point2()),DEFVAL(-1)); diff --git a/scene/resources/font.h b/scene/resources/font.h index 27e3045eaa..61f0352992 100644 --- a/scene/resources/font.h +++ b/scene/resources/font.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/gibberish_stream.cpp b/scene/resources/gibberish_stream.cpp index 7af81bd992..9d67069a6c 100644 --- a/scene/resources/gibberish_stream.cpp +++ b/scene/resources/gibberish_stream.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/gibberish_stream.h b/scene/resources/gibberish_stream.h index 77393db9f4..e06dc5eff2 100644 --- a/scene/resources/gibberish_stream.h +++ b/scene/resources/gibberish_stream.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/height_map_shape.cpp b/scene/resources/height_map_shape.cpp index 2c7c5384fa..e7b53c92c2 100644 --- a/scene/resources/height_map_shape.cpp +++ b/scene/resources/height_map_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/height_map_shape.h b/scene/resources/height_map_shape.h index 46d49dab08..5494075107 100644 --- a/scene/resources/height_map_shape.h +++ b/scene/resources/height_map_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 51d8be3294..e56314c1f8 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/material.h b/scene/resources/material.h index 7b7bc50567..96b33ce129 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 8cb0904415..9537fa269f 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -971,7 +971,7 @@ void Mesh::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_morph_target_mode","mode"),&Mesh::set_morph_target_mode); ObjectTypeDB::bind_method(_MD("get_morph_target_mode"),&Mesh::get_morph_target_mode); - ObjectTypeDB::bind_method(_MD("add_surface","primitive","arrays","morph_arrays"),&Mesh::add_surface,DEFVAL(Array())); + ObjectTypeDB::bind_method(_MD("add_surface","primitive","arrays","morph_arrays","alphasort"),&Mesh::add_surface,DEFVAL(Array()),DEFVAL(false)); ObjectTypeDB::bind_method(_MD("get_surface_count"),&Mesh::get_surface_count); ObjectTypeDB::bind_method(_MD("surface_remove","surf_idx"),&Mesh::surface_remove); ObjectTypeDB::bind_method(_MD("surface_get_array_len","surf_idx"),&Mesh::surface_get_array_len); diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index 50463ce80e..e0d9bdf7a8 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp index 42aaed39e1..fb0fc2a247 100644 --- a/scene/resources/mesh_data_tool.cpp +++ b/scene/resources/mesh_data_tool.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/mesh_data_tool.h b/scene/resources/mesh_data_tool.h index e7e7924e98..4a26fc2628 100644 --- a/scene/resources/mesh_data_tool.h +++ b/scene/resources/mesh_data_tool.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/mesh_library.cpp b/scene/resources/mesh_library.cpp index 5ebab9be76..8643e96303 100644 --- a/scene/resources/mesh_library.cpp +++ b/scene/resources/mesh_library.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/mesh_library.h b/scene/resources/mesh_library.h index a6a7b71669..9a468d5555 100644 --- a/scene/resources/mesh_library.h +++ b/scene/resources/mesh_library.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp index 0755d101b2..c5ade63124 100644 --- a/scene/resources/multimesh.cpp +++ b/scene/resources/multimesh.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -224,13 +224,13 @@ void MultiMesh::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_mesh","mesh:Mesh"),&MultiMesh::set_mesh); ObjectTypeDB::bind_method(_MD("get_mesh:Mesh"),&MultiMesh::get_mesh); - ObjectTypeDB::bind_method(_MD("set_instance_count"),&MultiMesh::set_instance_count); + ObjectTypeDB::bind_method(_MD("set_instance_count","count"),&MultiMesh::set_instance_count); ObjectTypeDB::bind_method(_MD("get_instance_count"),&MultiMesh::get_instance_count); - ObjectTypeDB::bind_method(_MD("set_instance_transform"),&MultiMesh::set_instance_transform); - ObjectTypeDB::bind_method(_MD("get_instance_transform"),&MultiMesh::get_instance_transform); - ObjectTypeDB::bind_method(_MD("set_instance_color"),&MultiMesh::set_instance_color); - ObjectTypeDB::bind_method(_MD("get_instance_color"),&MultiMesh::get_instance_color); - ObjectTypeDB::bind_method(_MD("set_aabb"),&MultiMesh::set_aabb); + ObjectTypeDB::bind_method(_MD("set_instance_transform","instance","transform"),&MultiMesh::set_instance_transform); + ObjectTypeDB::bind_method(_MD("get_instance_transform","instance"),&MultiMesh::get_instance_transform); + ObjectTypeDB::bind_method(_MD("set_instance_color","instance","color"),&MultiMesh::set_instance_color); + ObjectTypeDB::bind_method(_MD("get_instance_color","instance"),&MultiMesh::get_instance_color); + ObjectTypeDB::bind_method(_MD("set_aabb","visibility_aabb"),&MultiMesh::set_aabb); ObjectTypeDB::bind_method(_MD("get_aabb"),&MultiMesh::get_aabb); ObjectTypeDB::bind_method(_MD("generate_aabb"),&MultiMesh::generate_aabb); diff --git a/scene/resources/multimesh.h b/scene/resources/multimesh.h index c2736e3070..0cf9e92def 100644 --- a/scene/resources/multimesh.h +++ b/scene/resources/multimesh.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 443d1630a7..03127620f7 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1597,6 +1597,16 @@ Node *PackedScene::instance(bool p_gen_edit_state) const { return s; } +void PackedScene::replace_state(Ref<SceneState> p_by) { + + state=p_by; + state->set_path(get_path()); +#ifdef TOOLS_ENABLED + state->set_last_modified_time(get_last_modified_time()); +#endif + +} + void PackedScene::recreate_state() { state = Ref<SceneState>( memnew( SceneState )); diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index 67d0f4ba01..00a812f16a 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -50,7 +50,6 @@ class SceneState : public Reference { FLAG_INSTANCE_IS_PLACEHOLDER=(1<<30), FLAG_MASK=(1<<24)-1, NO_PARENT_SAVED=0x7FFFFFFF, - TYPE_INSTANCED=0x7FFFFFFF, }; @@ -106,6 +105,10 @@ class SceneState : public Reference { static bool disable_placeholders; public: + enum { + TYPE_INSTANCED=0x7FFFFFFF + }; + static void set_disable_placeholders(bool p_disable); int find_node_by_path(const NodePath& p_node) const; @@ -195,6 +198,7 @@ public: Node *instance(bool p_gen_edit_state=false) const; void recreate_state(); + void replace_state(Ref<SceneState> p_by); virtual void set_path(const String& p_path,bool p_take_over=false); #ifdef TOOLS_ENABLED diff --git a/scene/resources/plane_shape.cpp b/scene/resources/plane_shape.cpp index 760a36a91e..f551414f61 100644 --- a/scene/resources/plane_shape.cpp +++ b/scene/resources/plane_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/plane_shape.h b/scene/resources/plane_shape.h index dd285171c4..543c433965 100644 --- a/scene/resources/plane_shape.h +++ b/scene/resources/plane_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/ray_shape.cpp b/scene/resources/ray_shape.cpp index ee55cc6e37..73ce4de976 100644 --- a/scene/resources/ray_shape.cpp +++ b/scene/resources/ray_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/ray_shape.h b/scene/resources/ray_shape.h index edb29b83b5..0218045247 100644 --- a/scene/resources/ray_shape.h +++ b/scene/resources/ray_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/rectangle_shape_2d.cpp index 7903d88736..bc0f86f0a7 100644 --- a/scene/resources/rectangle_shape_2d.cpp +++ b/scene/resources/rectangle_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/rectangle_shape_2d.h b/scene/resources/rectangle_shape_2d.h index 96de02fb70..1ffbe1e356 100644 --- a/scene/resources/rectangle_shape_2d.h +++ b/scene/resources/rectangle_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/rich_text.cpp b/scene/resources/rich_text.cpp index 7e58a19ac3..8acf5ff39b 100644 --- a/scene/resources/rich_text.cpp +++ b/scene/resources/rich_text.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/rich_text.h b/scene/resources/rich_text.h index 9dfffbfeb3..c74a391b10 100644 --- a/scene/resources/rich_text.h +++ b/scene/resources/rich_text.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/room.cpp b/scene/resources/room.cpp index 3673b18394..0f9eb85244 100644 --- a/scene/resources/room.cpp +++ b/scene/resources/room.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/room.h b/scene/resources/room.h index f621d8f1bf..c5aaea311e 100644 --- a/scene/resources/room.h +++ b/scene/resources/room.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/sample.cpp b/scene/resources/sample.cpp index 0a785e7bf6..4b25a2c490 100644 --- a/scene/resources/sample.cpp +++ b/scene/resources/sample.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -210,11 +210,11 @@ void Sample::_bind_methods(){ ADD_PROPERTY( PropertyInfo( Variant::DICTIONARY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), _SCS("_set_data"), _SCS("_get_data") ); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "stereo"), _SCS(""), _SCS("is_stereo") ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "length"), _SCS(""), _SCS("get_length") ); + ADD_PROPERTY( PropertyInfo( Variant::INT, "length",PROPERTY_HINT_RANGE,"0,999999999"), _SCS(""), _SCS("get_length") ); ADD_PROPERTY( PropertyInfo( Variant::INT, "mix_rate", PROPERTY_HINT_RANGE,"1,192000,1" ), _SCS("set_mix_rate"), _SCS("get_mix_rate") ); ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_format", PROPERTY_HINT_ENUM,"None,Forward,PingPong" ), _SCS("set_loop_format"), _SCS("get_loop_format") ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_begin", PROPERTY_HINT_RANGE,"0,"+itos(99999999)+",1"), _SCS("set_loop_begin"), _SCS("get_loop_begin") ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_end", PROPERTY_HINT_RANGE,"0,"+itos(99999999)+",1"), _SCS("set_loop_end"), _SCS("get_loop_end") ); + ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_begin", PROPERTY_HINT_RANGE,"0,"+itos(999999999)+",1"), _SCS("set_loop_begin"), _SCS("get_loop_begin") ); + ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_end", PROPERTY_HINT_RANGE,"0,"+itos(999999999)+",1"), _SCS("set_loop_end"), _SCS("get_loop_end") ); BIND_CONSTANT( FORMAT_PCM8 ); BIND_CONSTANT( FORMAT_PCM16 ); diff --git a/scene/resources/sample.h b/scene/resources/sample.h index 4877e0b841..0a88167233 100644 --- a/scene/resources/sample.h +++ b/scene/resources/sample.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/sample_library.cpp b/scene/resources/sample_library.cpp index ffcaa1e675..5b70ee0e11 100644 --- a/scene/resources/sample_library.cpp +++ b/scene/resources/sample_library.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/sample_library.h b/scene/resources/sample_library.h index 88519e7035..8377967106 100644 --- a/scene/resources/sample_library.h +++ b/scene/resources/sample_library.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp index 851083aecf..5450b9e2ac 100644 --- a/scene/resources/scene_format_text.cpp +++ b/scene/resources/scene_format_text.cpp @@ -12,12 +12,6 @@ #define _printerr() ERR_PRINT(String(res_path+":"+itos(lines)+" - Parse Error: "+error_text).utf8().get_data()); -Error ResourceInteractiveLoaderText::parse_property(Variant& r_v, String &r_name) { - - return OK; -} - - /// @@ -308,6 +302,10 @@ Error ResourceInteractiveLoaderText::poll() { if (error) { if (error!=ERR_FILE_EOF) { _printerr(); + } else { + if (!ResourceCache::has(res_path)) { + resource->set_path(res_path); + } } return error; } @@ -368,18 +366,15 @@ Error ResourceInteractiveLoaderText::poll() { parent=packed_scene->get_state()->add_node_path(next_tag.fields["parent"]); } - if (next_tag.fields.has("owner")) { - owner=packed_scene->get_state()->add_node_path(next_tag.fields["owner"]); - } else { - if (parent!=-1) - owner=0; //if no owner, owner is root - } if (next_tag.fields.has("type")) { type=packed_scene->get_state()->add_name(next_tag.fields["type"]); + } else { + type=SceneState::TYPE_INSTANCED; //no type? assume this was instanced } + if (next_tag.fields.has("instance")) { instance=packed_scene->get_state()->add_value(next_tag.fields["instance"]); @@ -390,6 +385,13 @@ Error ResourceInteractiveLoaderText::poll() { } } + if (next_tag.fields.has("owner")) { + owner=packed_scene->get_state()->add_node_path(next_tag.fields["owner"]); + } else { + if (parent!=-1 && !(type==SceneState::TYPE_INSTANCED && instance==-1)) + owner=0; //if no owner, owner is root + } + int node_id = packed_scene->get_state()->add_node(parent,owner,type,name,instance); @@ -405,6 +407,9 @@ Error ResourceInteractiveLoaderText::poll() { _printerr(); } else { resource=packed_scene; + if (!ResourceCache::has(res_path)) { + packed_scene->set_path(res_path); + } } return error; } @@ -479,8 +484,8 @@ Error ResourceInteractiveLoaderText::poll() { } Vector<int> bind_ints; - for(int i=9;i<binds.size();i++) { - bind_ints.push_back( packed_scene->get_state()->add_value( bind_ints[i] ) ); + for(int i=0;i<binds.size();i++) { + bind_ints.push_back( packed_scene->get_state()->add_value( binds[i] ) ); } packed_scene->get_state()->add_connection( @@ -1026,431 +1031,37 @@ Error ResourceFormatLoaderText::rename_dependencies(const String &p_path,const M /*****************************************************************************************************/ -void ResourceFormatSaverTextInstance::write_property(const String& p_name,const Variant& p_property,bool *r_ok) { - - if (r_ok) - *r_ok=false; - - if (p_name!=String()) { - f->store_string(p_name+" = "); - } - - switch( p_property.get_type() ) { - - case Variant::NIL: { - f->store_string("null"); - } break; - case Variant::BOOL: { - - f->store_string(p_property.operator bool() ? "true":"false" ); - } break; - case Variant::INT: { - - f->store_string( itos(p_property.operator int()) ); - } break; - case Variant::REAL: { - - f->store_string( rtoss(p_property.operator real_t()) ); - } break; - case Variant::STRING: { - - String str=p_property; - - str="\""+str.c_escape()+"\""; - f->store_string( str ); - } break; - case Variant::VECTOR2: { - - Vector2 v = p_property; - f->store_string("Vector2( "+rtoss(v.x) +", "+rtoss(v.y)+" )" ); - } break; - case Variant::RECT2: { - - Rect2 aabb = p_property; - f->store_string("Rect2( "+rtoss(aabb.pos.x) +", "+rtoss(aabb.pos.y) +", "+rtoss(aabb.size.x) +", "+rtoss(aabb.size.y)+" )" ); - - } break; - case Variant::VECTOR3: { - - Vector3 v = p_property; - f->store_string("Vector3( "+rtoss(v.x) +", "+rtoss(v.y)+", "+rtoss(v.z)+" )"); - } break; - case Variant::PLANE: { - - Plane p = p_property; - f->store_string("Plane( "+rtoss(p.normal.x) +", "+rtoss(p.normal.y)+", "+rtoss(p.normal.z)+", "+rtoss(p.d)+" )" ); - - } break; - case Variant::_AABB: { - - AABB aabb = p_property; - f->store_string("AABB( "+rtoss(aabb.pos.x) +", "+rtoss(aabb.pos.y) +", "+rtoss(aabb.pos.z) +", "+rtoss(aabb.size.x) +", "+rtoss(aabb.size.y) +", "+rtoss(aabb.size.z)+" )" ); - - } break; - case Variant::QUAT: { - - Quat quat = p_property; - f->store_string("Quat( "+rtoss(quat.x)+", "+rtoss(quat.y)+", "+rtoss(quat.z)+", "+rtoss(quat.w)+" )"); - - } break; - case Variant::MATRIX32: { - - String s="Matrix32( "; - Matrix32 m3 = p_property; - for (int i=0;i<3;i++) { - for (int j=0;j<2;j++) { - - if (i!=0 || j!=0) - s+=", "; - s+=rtoss( m3.elements[i][j] ); - } - } - - f->store_string(s+" )"); - - } break; - case Variant::MATRIX3: { - - String s="Matrix3( "; - Matrix3 m3 = p_property; - for (int i=0;i<3;i++) { - for (int j=0;j<3;j++) { - - if (i!=0 || j!=0) - s+=", "; - s+=rtoss( m3.elements[i][j] ); - } - } - - f->store_string(s+" )"); - - } break; - case Variant::TRANSFORM: { - - String s="Transform( "; - Transform t = p_property; - Matrix3 &m3 = t.basis; - for (int i=0;i<3;i++) { - for (int j=0;j<3;j++) { - - if (i!=0 || j!=0) - s+=", "; - s+=rtoss( m3.elements[i][j] ); - } - } - - s=s+", "+rtoss(t.origin.x) +", "+rtoss(t.origin.y)+", "+rtoss(t.origin.z); - - f->store_string(s+" )"); - } break; - - // misc types - case Variant::COLOR: { - - Color c = p_property; - f->store_string("Color( "+rtoss(c.r) +", "+rtoss(c.g)+", "+rtoss(c.b)+", "+rtoss(c.a)+" )"); - - } break; - case Variant::IMAGE: { - - - Image img=p_property; - - if (img.empty()) { - f->store_string("Image()"); - break; - } - - String imgstr="Image( "; - imgstr+=itos(img.get_width()); - imgstr+=", "+itos(img.get_height()); - imgstr+=", "+itos(img.get_mipmaps()); - imgstr+=", "; - - switch(img.get_format()) { - - case Image::FORMAT_GRAYSCALE: imgstr+="GRAYSCALE"; break; - case Image::FORMAT_INTENSITY: imgstr+="INTENSITY"; break; - case Image::FORMAT_GRAYSCALE_ALPHA: imgstr+="GRAYSCALE_ALPHA"; break; - case Image::FORMAT_RGB: imgstr+="RGB"; break; - case Image::FORMAT_RGBA: imgstr+="RGBA"; break; - case Image::FORMAT_INDEXED : imgstr+="INDEXED"; break; - case Image::FORMAT_INDEXED_ALPHA: imgstr+="INDEXED_ALPHA"; break; - case Image::FORMAT_BC1: imgstr+="BC1"; break; - case Image::FORMAT_BC2: imgstr+="BC2"; break; - case Image::FORMAT_BC3: imgstr+="BC3"; break; - case Image::FORMAT_BC4: imgstr+="BC4"; break; - case Image::FORMAT_BC5: imgstr+="BC5"; break; - case Image::FORMAT_PVRTC2: imgstr+="PVRTC2"; break; - case Image::FORMAT_PVRTC2_ALPHA: imgstr+="PVRTC2_ALPHA"; break; - case Image::FORMAT_PVRTC4: imgstr+="PVRTC4"; break; - case Image::FORMAT_PVRTC4_ALPHA: imgstr+="PVRTC4_ALPHA"; break; - case Image::FORMAT_ETC: imgstr+="ETC"; break; - case Image::FORMAT_ATC: imgstr+="ATC"; break; - case Image::FORMAT_ATC_ALPHA_EXPLICIT: imgstr+="ATC_ALPHA_EXPLICIT"; break; - case Image::FORMAT_ATC_ALPHA_INTERPOLATED: imgstr+="ATC_ALPHA_INTERPOLATED"; break; - case Image::FORMAT_CUSTOM: imgstr+="CUSTOM"; break; - default: {} - } - - - String s; - - DVector<uint8_t> data = img.get_data(); - int len = data.size(); - DVector<uint8_t>::Read r = data.read(); - const uint8_t *ptr=r.ptr();; - for (int i=0;i<len;i++) { - - if (i>0) - s+=", "; - s+=itos(ptr[i]); - } - - imgstr+=", "; - f->store_string(imgstr); - f->store_string(s); - f->store_string(" )"); - } break; - case Variant::NODE_PATH: { - - String str=p_property; - - str="NodePath(\""+str.c_escape()+"\")"; - f->store_string(str); - - } break; - - case Variant::OBJECT: { - - RES res = p_property; - if (res.is_null()) { - f->store_string("null"); - if (r_ok) - *r_ok=true; - - break; // don't save it - } - - if (external_resources.has(res)) { - - f->store_string("ExtResource( "+itos(external_resources[res]+1)+" )"); - } else { - - if (internal_resources.has(res)) { - f->store_string("SubResource( "+itos(internal_resources[res])+" )"); - } else if (res->get_path().length() && res->get_path().find("::")==-1) { - - //external resource - String path=relative_paths?local_path.path_to_file(res->get_path()):res->get_path(); - f->store_string("Resource( \""+path+"\" )"); - } else { - f->store_string("null"); - ERR_EXPLAIN("Resource was not pre cached for the resource section, bug?"); - ERR_BREAK(true); - //internal resource - } - } - - } break; - case Variant::INPUT_EVENT: { - - f->store_string("InputEvent()"); //will be added later - } break; - case Variant::DICTIONARY: { - - Dictionary dict = p_property; - - List<Variant> keys; - dict.get_key_list(&keys); - keys.sort(); - - f->store_string("{ "); - for(List<Variant>::Element *E=keys.front();E;E=E->next()) { - - //if (!_check_type(dict[E->get()])) - // continue; - bool ok; - write_property("",E->get(),&ok); - ERR_CONTINUE(!ok); - - f->store_string(":"); - write_property("",dict[E->get()],&ok); - if (!ok) - write_property("",Variant()); //at least make the file consistent.. - if (E->next()) - f->store_string(", "); - } - - - f->store_string(" }"); - - - } break; - case Variant::ARRAY: { - - f->store_string("[ "); - Array array = p_property; - int len=array.size(); - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - write_property("",array[i]); - - - } - f->store_string(" ]"); - - } break; - - case Variant::RAW_ARRAY: { - - f->store_string("ByteArray( "); - String s; - DVector<uint8_t> data = p_property; - int len = data.size(); - DVector<uint8_t>::Read r = data.read(); - const uint8_t *ptr=r.ptr();; - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - - f->store_string(itos(ptr[i])); - - } - - f->store_string(" )"); - - } break; - case Variant::INT_ARRAY: { - - f->store_string("IntArray( "); - DVector<int> data = p_property; - int len = data.size(); - DVector<int>::Read r = data.read(); - const int *ptr=r.ptr();; - - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - - f->store_string(itos(ptr[i])); - } - - - f->store_string(" )"); +String ResourceFormatSaverTextInstance::_write_resources(void *ud,const RES& p_resource) { - } break; - case Variant::REAL_ARRAY: { - - f->store_string("FloatArray( "); - DVector<real_t> data = p_property; - int len = data.size(); - DVector<real_t>::Read r = data.read(); - const real_t *ptr=r.ptr();; - - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - f->store_string(rtoss(ptr[i])); - } - - f->store_string(" )"); - - } break; - case Variant::STRING_ARRAY: { - - f->store_string("StringArray( "); - DVector<String> data = p_property; - int len = data.size(); - DVector<String>::Read r = data.read(); - const String *ptr=r.ptr();; - String s; - //write_string("\n"); - - - - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - String str=ptr[i]; - f->store_string(""+str.c_escape()+"\""); - } - - f->store_string(" )"); - - } break; - case Variant::VECTOR2_ARRAY: { - - f->store_string("Vector2Array( "); - DVector<Vector2> data = p_property; - int len = data.size(); - DVector<Vector2>::Read r = data.read(); - const Vector2 *ptr=r.ptr();; - - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - f->store_string(rtoss(ptr[i].x)+", "+rtoss(ptr[i].y) ); - } - - f->store_string(" )"); - - } break; - case Variant::VECTOR3_ARRAY: { - - f->store_string("Vector3Array( "); - DVector<Vector3> data = p_property; - int len = data.size(); - DVector<Vector3>::Read r = data.read(); - const Vector3 *ptr=r.ptr();; + ResourceFormatSaverTextInstance *rsi=(ResourceFormatSaverTextInstance*)ud; + return rsi->_write_resource(p_resource); - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - f->store_string(rtoss(ptr[i].x)+", "+rtoss(ptr[i].y)+", "+rtoss(ptr[i].z) ); - } - - f->store_string(" )"); - - } break; - case Variant::COLOR_ARRAY: { - - f->store_string("ColorArray( "); - - DVector<Color> data = p_property; - int len = data.size(); - DVector<Color>::Read r = data.read(); - const Color *ptr=r.ptr();; - - for (int i=0;i<len;i++) { +} - if (i>0) - f->store_string(", "); +String ResourceFormatSaverTextInstance::_write_resource(const RES& res) { - f->store_string(rtoss(ptr[i].r)+", "+rtoss(ptr[i].g)+", "+rtoss(ptr[i].b)+", "+rtoss(ptr[i].a) ); + if (external_resources.has(res)) { - } - f->store_string(" )"); + return "ExtResource( "+itos(external_resources[res]+1)+" )"; + } else { - } break; - default: {} + if (internal_resources.has(res)) { + return "SubResource( "+itos(internal_resources[res])+" )"; + } else if (res->get_path().length() && res->get_path().find("::")==-1) { + //external resource + String path=relative_paths?local_path.path_to_file(res->get_path()):res->get_path(); + return "Resource( \""+path+"\" )"; + } else { + ERR_EXPLAIN("Resource was not pre cached for the resource section, bug?"); + ERR_FAIL_V("null"); + //internal resource + } } - if (r_ok) - *r_ok=true; - + return "null"; } - void ResourceFormatSaverTextInstance::_find_resources(const Variant& p_variant,bool p_main) { @@ -1584,11 +1195,18 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re } + Vector<RES> sorted_er; + sorted_er.resize(external_resources.size()); + for(Map<RES,int>::Element *E=external_resources.front();E;E=E->next()) { - String p = E->key()->get_path(); + sorted_er[E->get()]=E->key(); + } + + for(int i=0;i<sorted_er.size();i++) { + String p = sorted_er[i]->get_path(); - f->store_string("[ext_resource path=\""+p+"\" type=\""+E->key()->get_save_type()+"\" id="+itos(E->get()+1)+"]\n"); //bundled + f->store_string("[ext_resource path=\""+p+"\" type=\""+sorted_er[i]->get_save_type()+"\" id="+itos(i+1)+"]\n"); //bundled } if (external_resources.size()) @@ -1667,8 +1285,9 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re if (PE->get().type==Variant::OBJECT && value.is_zero()) continue; - write_property(name,value); - f->store_string("\n"); + String vars; + VariantWriter::write_to_string(value,vars,_write_resources,this); + f->store_string(name+" = "+vars+"\n"); } @@ -1719,17 +1338,22 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re f->store_string(header); if (instance.is_valid()) { + + String vars; f->store_string(" instance="); - write_property("",instance); + VariantWriter::write_to_string(instance,vars,_write_resources,this); + f->store_string(vars); + } f->store_line("]\n"); for(int j=0;j<state->get_node_property_count(i);j++) { - write_property(state->get_node_property_name(i,j),state->get_node_property_value(i,j)); - f->store_line(String()); + String vars; + VariantWriter::write_to_string(state->get_node_property_value(i,j),vars,_write_resources,this); + f->store_string(String(state->get_node_property_name(i,j))+" = "+vars+"\n"); } if (state->get_node_property_count(i)) { @@ -1754,8 +1378,10 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re Array binds=state->get_connection_binds(i); f->store_string(connstr); if (binds.size()) { - f->store_string(" binds="); - write_property("",binds); + String vars; + VariantWriter::write_to_string(binds,vars,_write_resources,this); + f->store_string(" binds= "+vars); + } f->store_line("]\n"); diff --git a/scene/resources/scene_format_text.h b/scene/resources/scene_format_text.h index 4f18af2b62..0e844c9165 100644 --- a/scene/resources/scene_format_text.h +++ b/scene/resources/scene_format_text.h @@ -60,7 +60,6 @@ class ResourceInteractiveLoaderText : public ResourceInteractiveLoader { friend class ResourceFormatLoaderText; List<RES> resource_cache; - Error parse_property(Variant& r_v, String &r_name); Error error; RES resource; @@ -117,7 +116,10 @@ class ResourceFormatSaverTextInstance { Map<RES,int> internal_resources; void _find_resources(const Variant& p_variant,bool p_main=false); - void write_property(const String& p_name,const Variant& p_property,bool *r_ok=NULL); + + static String _write_resources(void *ud,const RES& p_resource); + String _write_resource(const RES& res); + public: diff --git a/scene/resources/scene_preloader.cpp b/scene/resources/scene_preloader.cpp index 09001c1a94..c031f3c721 100644 --- a/scene/resources/scene_preloader.cpp +++ b/scene/resources/scene_preloader.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/scene_preloader.h b/scene/resources/scene_preloader.h index d60d08afd4..2317c9e0bd 100644 --- a/scene/resources/scene_preloader.h +++ b/scene/resources/scene_preloader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp index 88f7adcd9b..b8b14fd6fc 100644 --- a/scene/resources/segment_shape_2d.cpp +++ b/scene/resources/segment_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/segment_shape_2d.h b/scene/resources/segment_shape_2d.h index 37c68b6c92..6f7b2f2d38 100644 --- a/scene/resources/segment_shape_2d.h +++ b/scene/resources/segment_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp index f0a2721016..ee9f23dd2a 100644 --- a/scene/resources/shader.cpp +++ b/scene/resources/shader.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shader.h b/scene/resources/shader.h index 61a369c408..6ee8d4e793 100644 --- a/scene/resources/shader.h +++ b/scene/resources/shader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index f8a14e58a0..eabc84c41e 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -179,25 +179,25 @@ void ShaderGraph::_bind_methods() { ObjectTypeDB::bind_method(_MD("default_get_value","shader_type","id","param_id"), &ShaderGraph::default_get_value); ObjectTypeDB::bind_method(_MD("scalar_const_node_set_value","shader_type","id","value"),&ShaderGraph::scalar_const_node_set_value); - ObjectTypeDB::bind_method(_MD("scalar_const_node_get_value","shader_type","id"),&ShaderGraph::scalar_const_node_set_value); + ObjectTypeDB::bind_method(_MD("scalar_const_node_get_value","shader_type","id"),&ShaderGraph::scalar_const_node_get_value); ObjectTypeDB::bind_method(_MD("vec_const_node_set_value","shader_type","id","value"),&ShaderGraph::vec_const_node_set_value); - ObjectTypeDB::bind_method(_MD("vec_const_node_get_value","shader_type","id"),&ShaderGraph::vec_const_node_set_value); + ObjectTypeDB::bind_method(_MD("vec_const_node_get_value","shader_type","id"),&ShaderGraph::vec_const_node_get_value); ObjectTypeDB::bind_method(_MD("rgb_const_node_set_value","shader_type","id","value"),&ShaderGraph::rgb_const_node_set_value); - ObjectTypeDB::bind_method(_MD("rgb_const_node_get_value","shader_type","id"),&ShaderGraph::rgb_const_node_set_value); + ObjectTypeDB::bind_method(_MD("rgb_const_node_get_value","shader_type","id"),&ShaderGraph::rgb_const_node_get_value); ObjectTypeDB::bind_method(_MD("xform_const_node_set_value","shader_type","id","value"),&ShaderGraph::xform_const_node_set_value); - ObjectTypeDB::bind_method(_MD("xform_const_node_get_value","shader_type","id"),&ShaderGraph::xform_const_node_set_value); + ObjectTypeDB::bind_method(_MD("xform_const_node_get_value","shader_type","id"),&ShaderGraph::xform_const_node_get_value); // void get_node_list(ShaderType p_which,List<int> *p_node_list) const; ObjectTypeDB::bind_method(_MD("texture_node_set_filter_size","shader_type","id","filter_size"),&ShaderGraph::texture_node_set_filter_size); - ObjectTypeDB::bind_method(_MD("texture_node_get_filter_size","shader_type","id"),&ShaderGraph::texture_node_set_filter_size); + ObjectTypeDB::bind_method(_MD("texture_node_get_filter_size","shader_type","id"),&ShaderGraph::texture_node_get_filter_size); ObjectTypeDB::bind_method(_MD("texture_node_set_filter_strength","shader_type","id","filter_strength"),&ShaderGraph::texture_node_set_filter_strength); - ObjectTypeDB::bind_method(_MD("texture_node_get_filter_strength","shader_type","id"),&ShaderGraph::texture_node_set_filter_strength); + ObjectTypeDB::bind_method(_MD("texture_node_get_filter_strength","shader_type","id"),&ShaderGraph::texture_node_get_filter_strength); ObjectTypeDB::bind_method(_MD("scalar_op_node_set_op","shader_type","id","op"),&ShaderGraph::scalar_op_node_set_op); ObjectTypeDB::bind_method(_MD("scalar_op_node_get_op","shader_type","id"),&ShaderGraph::scalar_op_node_get_op); @@ -1533,7 +1533,7 @@ const ShaderGraph::NodeSlotInfo ShaderGraph::node_slot_info[]= { {NODE_CURVE_MAP,{SLOT_TYPE_SCALAR,SLOT_MAX},{SLOT_TYPE_SCALAR,SLOT_MAX}}, // vec3 interpolation (with optional curve) {NODE_SCALAR_INPUT,{SLOT_MAX},{SLOT_TYPE_SCALAR,SLOT_MAX}}, // scalar uniform (assignable in material) {NODE_VEC_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_MAX}}, // vec3 uniform (assignable in material) - {NODE_RGB_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_MAX}}, // color uniform (assignable in material) + {NODE_RGB_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // color uniform (assignable in material) {NODE_XFORM_INPUT,{SLOT_MAX},{SLOT_TYPE_XFORM,SLOT_MAX}}, // mat4 uniform (assignable in material) {NODE_TEXTURE_INPUT,{SLOT_TYPE_VEC,SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // texture input (assignable in material) {NODE_CUBEMAP_INPUT,{SLOT_TYPE_VEC,SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // cubemap input (assignable in material) @@ -2576,8 +2576,9 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vector<Str String name = p_node->param1; Color dv= p_node->param2; - code +="uniform color "+name+"=vec4("+rtos(dv.r)+","+rtos(dv.g)+","+rtos(dv.g)+","+rtos(dv.a)+");\n"; + code +="uniform color "+name+"=vec4("+rtos(dv.r)+","+rtos(dv.g)+","+rtos(dv.b)+","+rtos(dv.a)+");\n"; code += OUTNAME(p_node->id,0)+"="+name+".rgb;\n"; + code += OUTNAME(p_node->id,1)+"="+name+".a;\n"; }break; case NODE_XFORM_INPUT: { diff --git a/scene/resources/shader_graph.h b/scene/resources/shader_graph.h index f867ae0388..1e6fc3507c 100644 --- a/scene/resources/shader_graph.h +++ b/scene/resources/shader_graph.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shape.cpp b/scene/resources/shape.cpp index 143ef82d51..a71e414f61 100644 --- a/scene/resources/shape.cpp +++ b/scene/resources/shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shape.h b/scene/resources/shape.h index 1992ce51c3..bfd423a300 100644 --- a/scene/resources/shape.h +++ b/scene/resources/shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp index 56fd8e212e..6a9773bf14 100644 --- a/scene/resources/shape_2d.cpp +++ b/scene/resources/shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shape_2d.h b/scene/resources/shape_2d.h index 1737301d9d..4059af62c6 100644 --- a/scene/resources/shape_2d.h +++ b/scene/resources/shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shape_line_2d.cpp b/scene/resources/shape_line_2d.cpp index 97e9985754..4133d2218f 100644 --- a/scene/resources/shape_line_2d.cpp +++ b/scene/resources/shape_line_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shape_line_2d.h b/scene/resources/shape_line_2d.h index f32ad7fb7c..f6f75e7a95 100644 --- a/scene/resources/shape_line_2d.h +++ b/scene/resources/shape_line_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/space_2d.cpp b/scene/resources/space_2d.cpp index 6dbf7c4a73..d328ee3de4 100644 --- a/scene/resources/space_2d.cpp +++ b/scene/resources/space_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/space_2d.h b/scene/resources/space_2d.h index eb3e13ee62..270f8de3ea 100644 --- a/scene/resources/space_2d.h +++ b/scene/resources/space_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/sphere_shape.cpp b/scene/resources/sphere_shape.cpp index a7e28eb727..4764937371 100644 --- a/scene/resources/sphere_shape.cpp +++ b/scene/resources/sphere_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/sphere_shape.h b/scene/resources/sphere_shape.h index 2543d94439..50682f38bb 100644 --- a/scene/resources/sphere_shape.h +++ b/scene/resources/sphere_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 527fae5946..71a775ee24 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -83,7 +83,7 @@ void StyleBox::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_center_size"),&StyleBox::get_center_size); ObjectTypeDB::bind_method(_MD("get_offset"),&StyleBox::get_offset); - ObjectTypeDB::bind_method(_MD("draw"),&StyleBox::draw); + ObjectTypeDB::bind_method(_MD("draw","canvas_item","rect"),&StyleBox::draw); ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin/left", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_LEFT ); ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin/right", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_RIGHT ); @@ -182,10 +182,10 @@ void StyleBoxTexture::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_texture:Texture"),&StyleBoxTexture::get_texture); ObjectTypeDB::bind_method(_MD("set_margin_size","margin","size"),&StyleBoxTexture::set_margin_size); - ObjectTypeDB::bind_method(_MD("get_margin_size"),&StyleBoxTexture::get_margin_size); + ObjectTypeDB::bind_method(_MD("get_margin_size","margin"),&StyleBoxTexture::get_margin_size); ObjectTypeDB::bind_method(_MD("set_expand_margin_size","margin","size"),&StyleBoxTexture::set_expand_margin_size); - ObjectTypeDB::bind_method(_MD("get_expand_margin_size"),&StyleBoxTexture::get_expand_margin_size); + ObjectTypeDB::bind_method(_MD("get_expand_margin_size","margin"),&StyleBoxTexture::get_expand_margin_size); ObjectTypeDB::bind_method(_MD("set_draw_center","enable"),&StyleBoxTexture::set_draw_center); ObjectTypeDB::bind_method(_MD("get_draw_center"),&StyleBoxTexture::get_draw_center); @@ -392,7 +392,7 @@ void StyleBoxImageMask::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_expand","expand"),&StyleBoxImageMask::set_expand); ObjectTypeDB::bind_method(_MD("get_expand"),&StyleBoxImageMask::get_expand); ObjectTypeDB::bind_method(_MD("set_expand_margin_size","margin","size"),&StyleBoxImageMask::set_expand_margin_size); - ObjectTypeDB::bind_method(_MD("get_expand_margin_size"),&StyleBoxImageMask::get_expand_margin_size); + ObjectTypeDB::bind_method(_MD("get_expand_margin_size","margin"),&StyleBoxImageMask::get_expand_margin_size); ADD_PROPERTY( PropertyInfo(Variant::IMAGE, "image"), _SCS("set_image"), _SCS("get_image")); ADD_PROPERTY( PropertyInfo(Variant::BOOL, "expand"), _SCS("set_expand"), _SCS("get_expand")); diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h index 337bb54026..d0466ed5f1 100644 --- a/scene/resources/style_box.h +++ b/scene/resources/style_box.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 418df97f51..bf5070fd7d 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/surface_tool.h b/scene/resources/surface_tool.h index ed91b4df61..1d329f23c0 100644 --- a/scene/resources/surface_tool.h +++ b/scene/resources/surface_tool.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 5df3d64d1a..28754480f1 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -70,9 +70,9 @@ void Texture::_bind_methods() { ObjectTypeDB::bind_method(_MD("has_alpha"),&Texture::has_alpha); ObjectTypeDB::bind_method(_MD("set_flags","flags"),&Texture::set_flags); ObjectTypeDB::bind_method(_MD("get_flags"),&Texture::get_flags); - ObjectTypeDB::bind_method(_MD("draw","canvas_item","pos","modulate"),&Texture::draw,DEFVAL(Color(1,1,1)),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("draw_rect","canvas_item","rect","tile","modulate"),&Texture::draw_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("draw_rect_region","canvas_item","rect","src_rect","modulate"),&Texture::draw_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ObjectTypeDB::bind_method(_MD("draw","canvas_item","pos","modulate","transpose"),&Texture::draw,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ObjectTypeDB::bind_method(_MD("draw_rect","canvas_item","rect","tile","modulate","transpose"),&Texture::draw_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ObjectTypeDB::bind_method(_MD("draw_rect_region","canvas_item","rect","src_rect","modulate","transpose"),&Texture::draw_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false)); BIND_CONSTANT( FLAG_MIPMAPS ); BIND_CONSTANT( FLAG_REPEAT ); diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 3be13bf815..2627b9480a 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index 651e234b49..e2413f7d84 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -552,36 +552,36 @@ void Theme::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_icon:Texture","name","type"),&Theme::get_icon); ObjectTypeDB::bind_method(_MD("has_icon","name","type"),&Theme::has_icon); ObjectTypeDB::bind_method(_MD("clear_icon","name","type"),&Theme::clear_icon); - ObjectTypeDB::bind_method(_MD("get_icon_list"),&Theme::_get_icon_list); + ObjectTypeDB::bind_method(_MD("get_icon_list","type"),&Theme::_get_icon_list); ObjectTypeDB::bind_method(_MD("set_stylebox","name","type","texture:StyleBox"),&Theme::set_stylebox); ObjectTypeDB::bind_method(_MD("get_stylebox:StyleBox","name","type"),&Theme::get_stylebox); ObjectTypeDB::bind_method(_MD("has_stylebox","name","type"),&Theme::has_stylebox); ObjectTypeDB::bind_method(_MD("clear_stylebox","name","type"),&Theme::clear_stylebox); - ObjectTypeDB::bind_method(_MD("get_stylebox_list"),&Theme::_get_stylebox_list); + ObjectTypeDB::bind_method(_MD("get_stylebox_list","type"),&Theme::_get_stylebox_list); ObjectTypeDB::bind_method(_MD("set_font","name","type","font:Font"),&Theme::set_font); ObjectTypeDB::bind_method(_MD("get_font:Font","name","type"),&Theme::get_font); ObjectTypeDB::bind_method(_MD("has_font","name","type"),&Theme::has_font); ObjectTypeDB::bind_method(_MD("clear_font","name","type"),&Theme::clear_font); - ObjectTypeDB::bind_method(_MD("get_font_list"),&Theme::_get_font_list); + ObjectTypeDB::bind_method(_MD("get_font_list","type"),&Theme::_get_font_list); ObjectTypeDB::bind_method(_MD("set_color","name","type","color"),&Theme::set_color); ObjectTypeDB::bind_method(_MD("get_color","name","type"),&Theme::get_color); ObjectTypeDB::bind_method(_MD("has_color","name","type"),&Theme::has_color); ObjectTypeDB::bind_method(_MD("clear_color","name","type"),&Theme::clear_color); - ObjectTypeDB::bind_method(_MD("get_color_list"),&Theme::_get_color_list); + ObjectTypeDB::bind_method(_MD("get_color_list","type"),&Theme::_get_color_list); ObjectTypeDB::bind_method(_MD("set_constant","name","type","constant"),&Theme::set_constant); ObjectTypeDB::bind_method(_MD("get_constant","name","type"),&Theme::get_constant); ObjectTypeDB::bind_method(_MD("has_constant","name","type"),&Theme::has_constant); ObjectTypeDB::bind_method(_MD("clear_constant","name","type"),&Theme::clear_constant); - ObjectTypeDB::bind_method(_MD("get_constant_list"),&Theme::_get_constant_list); + ObjectTypeDB::bind_method(_MD("get_constant_list","type"),&Theme::_get_constant_list); ObjectTypeDB::bind_method(_MD("set_default_font","font"),&Theme::set_default_theme_font); ObjectTypeDB::bind_method(_MD("get_default_font"),&Theme::get_default_theme_font); - ObjectTypeDB::bind_method(_MD("get_type_list"),&Theme::_get_type_list); + ObjectTypeDB::bind_method(_MD("get_type_list","type"),&Theme::_get_type_list); ObjectTypeDB::bind_method("copy_default_theme",&Theme::copy_default_theme); diff --git a/scene/resources/theme.h b/scene/resources/theme.h index cfa0762595..f0747fb3c4 100644 --- a/scene/resources/theme.h +++ b/scene/resources/theme.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 28e179b34c..6f71287750 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index 96048bf06b..fb0e832c1e 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/video_stream.cpp b/scene/resources/video_stream.cpp index c957fd4c67..8e16f2e024 100644 --- a/scene/resources/video_stream.cpp +++ b/scene/resources/video_stream.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h index a23ef0c64f..b05a7cf773 100644 --- a/scene/resources/video_stream.h +++ b/scene/resources/video_stream.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/volume.cpp b/scene/resources/volume.cpp index a668a39c4f..8eb96cb4ad 100644 --- a/scene/resources/volume.cpp +++ b/scene/resources/volume.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/volume.h b/scene/resources/volume.h index f929792b74..be3cbddbbd 100644 --- a/scene/resources/volume.h +++ b/scene/resources/volume.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/world.cpp b/scene/resources/world.cpp index fb3469102c..0a88abf252 100644 --- a/scene/resources/world.cpp +++ b/scene/resources/world.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/world.h b/scene/resources/world.h index 165122124d..5a74f27235 100644 --- a/scene/resources/world.h +++ b/scene/resources/world.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index 3b1f1d2346..8cacc0fce7 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/world_2d.h b/scene/resources/world_2d.h index a3a79dee09..a939d935c4 100644 --- a/scene/resources/world_2d.h +++ b/scene/resources/world_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp index 9509878dc9..57bde00de4 100644 --- a/scene/scene_string_names.cpp +++ b/scene/scene_string_names.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index 48f17ed38b..b2c0e9abf0 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_driver_dummy.cpp b/servers/audio/audio_driver_dummy.cpp index dd5243e467..d0695451b9 100644 --- a/servers/audio/audio_driver_dummy.cpp +++ b/servers/audio/audio_driver_dummy.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_driver_dummy.h b/servers/audio/audio_driver_dummy.h index 04926b89eb..9421574f93 100644 --- a/servers/audio/audio_driver_dummy.h +++ b/servers/audio/audio_driver_dummy.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_filter_sw.cpp b/servers/audio/audio_filter_sw.cpp index 032d93b617..3fb8e8f734 100644 --- a/servers/audio/audio_filter_sw.cpp +++ b/servers/audio/audio_filter_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_filter_sw.h b/servers/audio/audio_filter_sw.h index e8540adea6..d4d225ce29 100644 --- a/servers/audio/audio_filter_sw.h +++ b/servers/audio/audio_filter_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_mixer_sw.cpp b/servers/audio/audio_mixer_sw.cpp index 033cd333d5..d1f36cb7b6 100644 --- a/servers/audio/audio_mixer_sw.cpp +++ b/servers/audio/audio_mixer_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_mixer_sw.h b/servers/audio/audio_mixer_sw.h index d8d9b7bacd..f5bd4cc5ba 100644 --- a/servers/audio/audio_mixer_sw.h +++ b/servers/audio/audio_mixer_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_server_sw.cpp b/servers/audio/audio_server_sw.cpp index 500886d73a..d634c348dc 100644 --- a/servers/audio/audio_server_sw.cpp +++ b/servers/audio/audio_server_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -360,7 +360,7 @@ void AudioServerSW::sample_set_description(RID p_sample, const String& p_descrip AUDIO_LOCK sample_manager->sample_set_description(p_sample,p_description); } -String AudioServerSW::sample_get_description(RID p_sample, const String& p_description) const { +String AudioServerSW::sample_get_description(RID p_sample) const { AUDIO_LOCK return sample_manager->sample_get_description(p_sample); diff --git a/servers/audio/audio_server_sw.h b/servers/audio/audio_server_sw.h index c566e129c1..bc6191729c 100644 --- a/servers/audio/audio_server_sw.h +++ b/servers/audio/audio_server_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -118,7 +118,7 @@ public: virtual RID sample_create(SampleFormat p_format, bool p_stereo, int p_length); virtual void sample_set_description(RID p_sample, const String& p_description); - virtual String sample_get_description(RID p_sample, const String& p_description) const; + virtual String sample_get_description(RID p_sample) const; virtual SampleFormat sample_get_format(RID p_sample) const; virtual bool sample_is_stereo(RID p_sample) const; diff --git a/servers/audio/reverb_buffers_sw.cpp b/servers/audio/reverb_buffers_sw.cpp index b840b9390b..04bc056313 100644 --- a/servers/audio/reverb_buffers_sw.cpp +++ b/servers/audio/reverb_buffers_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/reverb_buffers_sw.h b/servers/audio/reverb_buffers_sw.h index 817122b65d..f5885e6ee8 100644 --- a/servers/audio/reverb_buffers_sw.h +++ b/servers/audio/reverb_buffers_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/reverb_sw.cpp b/servers/audio/reverb_sw.cpp index cc4b4bd778..5721403ba3 100644 --- a/servers/audio/reverb_sw.cpp +++ b/servers/audio/reverb_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/reverb_sw.h b/servers/audio/reverb_sw.h index 937824f907..b028a245c8 100644 --- a/servers/audio/reverb_sw.h +++ b/servers/audio/reverb_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/sample_manager_sw.cpp b/servers/audio/sample_manager_sw.cpp index 375aa88cd2..60f4d16659 100644 --- a/servers/audio/sample_manager_sw.cpp +++ b/servers/audio/sample_manager_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/sample_manager_sw.h b/servers/audio/sample_manager_sw.h index 94254f99d5..bd7a11a3d2 100644 --- a/servers/audio/sample_manager_sw.h +++ b/servers/audio/sample_manager_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/voice_rb_sw.cpp b/servers/audio/voice_rb_sw.cpp index a385e15283..8d12e5085d 100644 --- a/servers/audio/voice_rb_sw.cpp +++ b/servers/audio/voice_rb_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/voice_rb_sw.h b/servers/audio/voice_rb_sw.h index cbebcdb86f..f785646577 100644 --- a/servers/audio/voice_rb_sw.h +++ b/servers/audio/voice_rb_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 6c5a2de97b..74f866afb7 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -88,7 +88,7 @@ void AudioServer::_bind_methods() { ObjectTypeDB::bind_method(_MD("sample_get_length","sample"), &AudioServer::sample_get_length ); ObjectTypeDB::bind_method(_MD("sample_set_signed_data","sample","data"), &AudioServer::sample_set_signed_data ); - ObjectTypeDB::bind_method(_MD("sample_set_data","sample"), &AudioServer::sample_set_data ); + ObjectTypeDB::bind_method(_MD("sample_set_data","sample","data"), &AudioServer::sample_set_data ); ObjectTypeDB::bind_method(_MD("sample_get_data","sample"), &AudioServer::sample_get_data ); ObjectTypeDB::bind_method(_MD("sample_set_mix_rate","sample","mix_rate"), &AudioServer::sample_set_mix_rate ); diff --git a/servers/audio_server.h b/servers/audio_server.h index cd3e920f31..c56820dcbb 100644 --- a/servers/audio_server.h +++ b/servers/audio_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -160,7 +160,7 @@ public: virtual RID sample_create(SampleFormat p_format, bool p_stereo, int p_length)=0; virtual void sample_set_description(RID p_sample, const String& p_description)=0; - virtual String sample_get_description(RID p_sample, const String& p_description) const=0; + virtual String sample_get_description(RID p_sample) const=0; virtual SampleFormat sample_get_format(RID p_sample) const=0; virtual bool sample_is_stereo(RID p_sample) const=0; diff --git a/servers/physics/area_pair_sw.cpp b/servers/physics/area_pair_sw.cpp index 3eb96fb681..c6bf6114a0 100644 --- a/servers/physics/area_pair_sw.cpp +++ b/servers/physics/area_pair_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/area_pair_sw.h b/servers/physics/area_pair_sw.h index 4f8087280a..09a2934467 100644 --- a/servers/physics/area_pair_sw.h +++ b/servers/physics/area_pair_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/area_sw.cpp b/servers/physics/area_sw.cpp index e78f0699cb..dbc82da316 100644 --- a/servers/physics/area_sw.cpp +++ b/servers/physics/area_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/area_sw.h b/servers/physics/area_sw.h index 40ccdaf370..622eeb5e23 100644 --- a/servers/physics/area_sw.h +++ b/servers/physics/area_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/body_pair_sw.cpp b/servers/physics/body_pair_sw.cpp index 7eab9eb86d..a971cdaad8 100644 --- a/servers/physics/body_pair_sw.cpp +++ b/servers/physics/body_pair_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/body_pair_sw.h b/servers/physics/body_pair_sw.h index 8ec7a9ccef..da637ade05 100644 --- a/servers/physics/body_pair_sw.h +++ b/servers/physics/body_pair_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp index 79d08b1e75..b0ed99cb48 100644 --- a/servers/physics/body_sw.cpp +++ b/servers/physics/body_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -380,6 +380,8 @@ void BodySW::set_space(SpaceSW *p_space){ } + first_integration=true; + } void BodySW::_compute_area_gravity_and_dampenings(const AreaSW *p_area) { @@ -479,7 +481,7 @@ void BodySW::integrate_forces(real_t p_step) { do_motion=true; } else { - if (!omit_force_integration) { + if (!omit_force_integration && !first_integration) { //overriden by direct state query Vector3 force=gravity*mass; @@ -512,6 +514,7 @@ void BodySW::integrate_forces(real_t p_step) { applied_force=Vector3(); applied_torque=Vector3(); + first_integration=false; //motion=linear_velocity*p_step; @@ -749,6 +752,7 @@ BodySW::BodySW() : CollisionObjectSW(TYPE_BODY), active_list(this), inertia_upda island_next=NULL; island_list_next=NULL; first_time_kinematic=false; + first_integration=false; _set_static(false); contact_count=0; diff --git a/servers/physics/body_sw.h b/servers/physics/body_sw.h index 4c4c7818c5..c958177a19 100644 --- a/servers/physics/body_sw.h +++ b/servers/physics/body_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -79,6 +79,8 @@ class BodySW : public CollisionObjectSW { bool omit_force_integration; bool active; + bool first_integration; + bool continuous_cd; bool can_sleep; bool first_time_kinematic; diff --git a/servers/physics/broad_phase_basic.cpp b/servers/physics/broad_phase_basic.cpp index c49caed795..0bed56d398 100644 --- a/servers/physics/broad_phase_basic.cpp +++ b/servers/physics/broad_phase_basic.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/broad_phase_basic.h b/servers/physics/broad_phase_basic.h index 9848c4b16e..6bf024044e 100644 --- a/servers/physics/broad_phase_basic.h +++ b/servers/physics/broad_phase_basic.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/broad_phase_octree.cpp b/servers/physics/broad_phase_octree.cpp index 874ae29755..bfe41f8423 100644 --- a/servers/physics/broad_phase_octree.cpp +++ b/servers/physics/broad_phase_octree.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/broad_phase_octree.h b/servers/physics/broad_phase_octree.h index 200878f6df..b87996a58c 100644 --- a/servers/physics/broad_phase_octree.h +++ b/servers/physics/broad_phase_octree.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/broad_phase_sw.cpp b/servers/physics/broad_phase_sw.cpp index 910be4e623..a382df6a46 100644 --- a/servers/physics/broad_phase_sw.cpp +++ b/servers/physics/broad_phase_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/broad_phase_sw.h b/servers/physics/broad_phase_sw.h index 2bf9f202e2..409c249865 100644 --- a/servers/physics/broad_phase_sw.h +++ b/servers/physics/broad_phase_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/collision_object_sw.cpp b/servers/physics/collision_object_sw.cpp index 19b3f28a2f..55c8c1b955 100644 --- a/servers/physics/collision_object_sw.cpp +++ b/servers/physics/collision_object_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/collision_object_sw.h b/servers/physics/collision_object_sw.h index c018ab6224..592c84e667 100644 --- a/servers/physics/collision_object_sw.h +++ b/servers/physics/collision_object_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp index 72e61f1456..8789663f63 100644 --- a/servers/physics/collision_solver_sat.cpp +++ b/servers/physics/collision_solver_sat.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/collision_solver_sat.h b/servers/physics/collision_solver_sat.h index 686b587243..57f5bdbbc0 100644 --- a/servers/physics/collision_solver_sat.h +++ b/servers/physics/collision_solver_sat.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/collision_solver_sw.cpp b/servers/physics/collision_solver_sw.cpp index b5a5c64660..716e724637 100644 --- a/servers/physics/collision_solver_sw.cpp +++ b/servers/physics/collision_solver_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/collision_solver_sw.h b/servers/physics/collision_solver_sw.h index 5ed5260b7d..abc50cae2c 100644 --- a/servers/physics/collision_solver_sw.h +++ b/servers/physics/collision_solver_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/constraint_sw.cpp b/servers/physics/constraint_sw.cpp index fb45485233..ce0e1e6963 100644 --- a/servers/physics/constraint_sw.cpp +++ b/servers/physics/constraint_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/constraint_sw.h b/servers/physics/constraint_sw.h index 1ec237f9c5..d61701ac07 100644 --- a/servers/physics/constraint_sw.h +++ b/servers/physics/constraint_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/gjk_epa.cpp b/servers/physics/gjk_epa.cpp index 9b5b3d4f67..229c6d3fb4 100644 --- a/servers/physics/gjk_epa.cpp +++ b/servers/physics/gjk_epa.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/servers/physics/gjk_epa.h b/servers/physics/gjk_epa.h index 08b0a65b15..23f51d66c4 100644 --- a/servers/physics/gjk_epa.h +++ b/servers/physics/gjk_epa.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/servers/physics/joints_sw.cpp b/servers/physics/joints_sw.cpp index aa9d3265d2..7f7df31534 100644 --- a/servers/physics/joints_sw.cpp +++ b/servers/physics/joints_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/joints_sw.h b/servers/physics/joints_sw.h index d7ba6ef925..c42baae961 100644 --- a/servers/physics/joints_sw.h +++ b/servers/physics/joints_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp index a9a8042c19..5eb14d80dc 100644 --- a/servers/physics/physics_server_sw.cpp +++ b/servers/physics/physics_server_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -517,7 +517,7 @@ void PhysicsServerSW::body_set_mode(RID p_body, BodyMode p_mode) { body->set_mode(p_mode); }; -PhysicsServer::BodyMode PhysicsServerSW::body_get_mode(RID p_body, BodyMode p_mode) const { +PhysicsServer::BodyMode PhysicsServerSW::body_get_mode(RID p_body) const { BodySW *body = body_owner.get(p_body); ERR_FAIL_COND_V(!body,BODY_MODE_STATIC); diff --git a/servers/physics/physics_server_sw.h b/servers/physics/physics_server_sw.h index abbb057616..2aadac2216 100644 --- a/servers/physics/physics_server_sw.h +++ b/servers/physics/physics_server_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -146,7 +146,7 @@ public: virtual RID body_get_space(RID p_body) const; virtual void body_set_mode(RID p_body, BodyMode p_mode); - virtual BodyMode body_get_mode(RID p_body, BodyMode p_mode) const; + virtual BodyMode body_get_mode(RID p_body) const; virtual void body_add_shape(RID p_body, RID p_shape, const Transform& p_transform=Transform()); virtual void body_set_shape(RID p_body, int p_shape_idx,RID p_shape); diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp index fabfa88ee5..5923f89120 100644 --- a/servers/physics/shape_sw.cpp +++ b/servers/physics/shape_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1354,6 +1354,10 @@ void ConcavePolygonShapeSW::_fill_bvh(_VolumeSW_BVH* p_bvh_tree,BVH* p_bvh_array void ConcavePolygonShapeSW::_setup(DVector<Vector3> p_faces) { int src_face_count=p_faces.size(); + if (src_face_count==0) { + configure(AABB()); + return; + } ERR_FAIL_COND(src_face_count%3); src_face_count/=3; diff --git a/servers/physics/shape_sw.h b/servers/physics/shape_sw.h index 4826eaea4f..39779bcda3 100644 --- a/servers/physics/shape_sw.h +++ b/servers/physics/shape_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp index 778d20d3f1..08f280a976 100644 --- a/servers/physics/space_sw.cpp +++ b/servers/physics/space_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -47,7 +47,7 @@ _FORCE_INLINE_ static bool _match_object_type_query(CollisionObjectSW *p_object, } -bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3& p_from, const Vector3& p_to,RayResult &r_result,const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { +bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3& p_from, const Vector3& p_to, RayResult &r_result, const Set<RID>& p_exclude, uint32_t p_layer_mask, uint32_t p_object_type_mask, bool p_pick_ray) { ERR_FAIL_COND_V(space->locked,false); @@ -77,7 +77,7 @@ bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3& p_from, const Vecto if (!_match_object_type_query(space->intersection_query_results[i],p_layer_mask,p_object_type_mask)) continue; - if (!(static_cast<CollisionObjectSW*>(space->intersection_query_results[i])->is_ray_pickable())) + if (p_pick_ray && !(static_cast<CollisionObjectSW*>(space->intersection_query_results[i])->is_ray_pickable())) continue; if (p_exclude.has( space->intersection_query_results[i]->get_self())) diff --git a/servers/physics/space_sw.h b/servers/physics/space_sw.h index ac788ba93f..6300c206d8 100644 --- a/servers/physics/space_sw.h +++ b/servers/physics/space_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -46,7 +46,7 @@ public: SpaceSW *space; - virtual bool intersect_ray(const Vector3& p_from, const Vector3& p_to,RayResult &r_result,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); + virtual bool intersect_ray(const Vector3& p_from, const Vector3& p_to,RayResult &r_result,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION,bool p_pick_ray=false); virtual int intersect_shape(const RID& p_shape, const Transform& p_xform,float p_margin,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); virtual bool cast_motion(const RID& p_shape, const Transform& p_xform,const Vector3& p_motion,float p_margin,float &p_closest_safe,float &p_closest_unsafe, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION,ShapeRestInfo *r_info=NULL); virtual bool collide_shape(RID p_shape, const Transform& p_shape_xform,float p_margin,Vector3 *r_results,int p_result_max,int &r_result_count, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); diff --git a/servers/physics/step_sw.cpp b/servers/physics/step_sw.cpp index 2424b36833..f10dadf81a 100644 --- a/servers/physics/step_sw.cpp +++ b/servers/physics/step_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/step_sw.h b/servers/physics/step_sw.h index f089c041fc..f6362f3777 100644 --- a/servers/physics/step_sw.h +++ b/servers/physics/step_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/area_2d_sw.cpp b/servers/physics_2d/area_2d_sw.cpp index a5a132020a..759a37e84f 100644 --- a/servers/physics_2d/area_2d_sw.cpp +++ b/servers/physics_2d/area_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/area_2d_sw.h b/servers/physics_2d/area_2d_sw.h index 6d99764c68..71192db1df 100644 --- a/servers/physics_2d/area_2d_sw.h +++ b/servers/physics_2d/area_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/area_pair_2d_sw.cpp b/servers/physics_2d/area_pair_2d_sw.cpp index 3b1705bd56..0682d8abdd 100644 --- a/servers/physics_2d/area_pair_2d_sw.cpp +++ b/servers/physics_2d/area_pair_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/area_pair_2d_sw.h b/servers/physics_2d/area_pair_2d_sw.h index 59113c9162..a03bdb572a 100644 --- a/servers/physics_2d/area_pair_2d_sw.h +++ b/servers/physics_2d/area_pair_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp index 8d82d4a920..f1f94f3485 100644 --- a/servers/physics_2d/body_2d_sw.cpp +++ b/servers/physics_2d/body_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,6 +29,7 @@ #include "body_2d_sw.h" #include "space_2d_sw.h" #include "area_2d_sw.h" +#include "physics_2d_server_sw.h" void Body2DSW::_update_inertia() { @@ -378,6 +379,7 @@ void Body2DSW::set_space(Space2DSW *p_space){ } + first_integration=false; } void Body2DSW::_compute_area_gravity_and_dampenings(const Area2DSW *p_area) { @@ -394,8 +396,7 @@ void Body2DSW::_compute_area_gravity_and_dampenings(const Area2DSW *p_area) { } area_linear_damp += p_area->get_linear_damp(); - area_angular_damp += p_area->get_angular_damp(); - printf("%f\n",gravity.y); + area_angular_damp += p_area->get_angular_damp(); } void Body2DSW::integrate_forces(real_t p_step) { @@ -472,7 +473,7 @@ void Body2DSW::integrate_forces(real_t p_step) { //} } else { - if (!omit_force_integration) { + if (!omit_force_integration && !first_integration) { //overriden by direct state query Vector2 force=gravity*mass; @@ -507,6 +508,7 @@ void Body2DSW::integrate_forces(real_t p_step) { //motion=linear_velocity*p_step; + first_integration=false; biased_angular_velocity=0; biased_linear_velocity=Vector2(); @@ -682,6 +684,7 @@ Body2DSW::Body2DSW() : CollisionObject2DSW(TYPE_BODY), active_list(this), inerti gravity_scale=1.0; using_one_way_cache=false; one_way_collision_max_depth=0.1; + first_integration=false; still_time=0; continuous_cd_mode=Physics2DServer::CCD_MODE_DISABLED; @@ -702,3 +705,24 @@ Physics2DDirectSpaceState* Physics2DDirectBodyStateSW::get_space_state() { return body->get_space()->get_direct_state(); } + + +Variant Physics2DDirectBodyStateSW::get_contact_collider_shape_metadata(int p_contact_idx) const { + + ERR_FAIL_INDEX_V(p_contact_idx,body->contact_count,Variant()); + + if (!Physics2DServerSW::singletonsw->body_owner.owns(body->contacts[p_contact_idx].collider)) { + + return Variant(); + } + Body2DSW *other = Physics2DServerSW::singletonsw->body_owner.get(body->contacts[p_contact_idx].collider); + + int sidx = body->contacts[p_contact_idx].collider_shape; + if (sidx<0 || sidx>=other->get_shape_count()) { + + return Variant(); + } + + + return other->get_shape_metadata(sidx); +} diff --git a/servers/physics_2d/body_2d_sw.h b/servers/physics_2d/body_2d_sw.h index 8418c5dcd7..4bd462ac00 100644 --- a/servers/physics_2d/body_2d_sw.h +++ b/servers/physics_2d/body_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -81,6 +81,7 @@ class Body2DSW : public CollisionObject2DSW { bool active; bool can_sleep; bool first_time_kinematic; + bool first_integration; bool using_one_way_cache; void _update_inertia(); virtual void _shapes_changed(); @@ -369,7 +370,7 @@ public: virtual Vector2 get_contact_collider_pos(int p_contact_idx) const { ERR_FAIL_INDEX_V(p_contact_idx,body->contact_count,Vector2()); return body->contacts[p_contact_idx].collider_pos; } virtual ObjectID get_contact_collider_id(int p_contact_idx) const { ERR_FAIL_INDEX_V(p_contact_idx,body->contact_count,0); return body->contacts[p_contact_idx].collider_instance_id; } virtual int get_contact_collider_shape(int p_contact_idx) const { ERR_FAIL_INDEX_V(p_contact_idx,body->contact_count,0); return body->contacts[p_contact_idx].collider_shape; } - virtual Variant get_contact_collider_shape_metadata(int p_contact_idx) const { ERR_FAIL_INDEX_V(p_contact_idx,body->contact_count,Variant()); return body->get_shape_metadata(body->contacts[p_contact_idx].collider_shape); } + virtual Variant get_contact_collider_shape_metadata(int p_contact_idx) const; virtual Vector2 get_contact_collider_velocity_at_pos(int p_contact_idx) const { ERR_FAIL_INDEX_V(p_contact_idx,body->contact_count,Vector2()); return body->contacts[p_contact_idx].collider_velocity_at_pos; } diff --git a/servers/physics_2d/body_pair_2d_sw.cpp b/servers/physics_2d/body_pair_2d_sw.cpp index eb3abbb267..db7869c6a6 100644 --- a/servers/physics_2d/body_pair_2d_sw.cpp +++ b/servers/physics_2d/body_pair_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -364,6 +364,9 @@ bool BodyPair2DSW::setup(float p_step) { real_t inv_dt = 1.0/p_step; + + bool do_process=false; + for (int i = 0; i < contact_count; i++) { Contact& c = contacts[i]; @@ -459,10 +462,11 @@ bool BodyPair2DSW::setup(float p_step) { c.bounce = c.bounce * dv.dot(c.normal); } + do_process=true; } - return true; + return do_process; } void BodyPair2DSW::solve(float p_step) { diff --git a/servers/physics_2d/body_pair_2d_sw.h b/servers/physics_2d/body_pair_2d_sw.h index a7fa287be4..a16320585e 100644 --- a/servers/physics_2d/body_pair_2d_sw.h +++ b/servers/physics_2d/body_pair_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/broad_phase_2d_basic.cpp b/servers/physics_2d/broad_phase_2d_basic.cpp index e61b4735b9..3a95bb2411 100644 --- a/servers/physics_2d/broad_phase_2d_basic.cpp +++ b/servers/physics_2d/broad_phase_2d_basic.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/broad_phase_2d_basic.h b/servers/physics_2d/broad_phase_2d_basic.h index cdee77ffd7..80aa423819 100644 --- a/servers/physics_2d/broad_phase_2d_basic.h +++ b/servers/physics_2d/broad_phase_2d_basic.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp index 4651d485c2..6a52d5fe5b 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.h b/servers/physics_2d/broad_phase_2d_hash_grid.h index a2eecf7bbf..bda5ea21cf 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.h +++ b/servers/physics_2d/broad_phase_2d_hash_grid.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/broad_phase_2d_sw.cpp b/servers/physics_2d/broad_phase_2d_sw.cpp index fd8e7254b6..0dead94ca1 100644 --- a/servers/physics_2d/broad_phase_2d_sw.cpp +++ b/servers/physics_2d/broad_phase_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/broad_phase_2d_sw.h b/servers/physics_2d/broad_phase_2d_sw.h index 283d6941e1..056ef664fd 100644 --- a/servers/physics_2d/broad_phase_2d_sw.h +++ b/servers/physics_2d/broad_phase_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/collision_object_2d_sw.cpp b/servers/physics_2d/collision_object_2d_sw.cpp index 7c8e223c57..7f9d3312b9 100644 --- a/servers/physics_2d/collision_object_2d_sw.cpp +++ b/servers/physics_2d/collision_object_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/collision_object_2d_sw.h b/servers/physics_2d/collision_object_2d_sw.h index f3432060b9..1f213d8444 100644 --- a/servers/physics_2d/collision_object_2d_sw.h +++ b/servers/physics_2d/collision_object_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/collision_solver_2d_sat.cpp b/servers/physics_2d/collision_solver_2d_sat.cpp index 2525c6e942..f22b676304 100644 --- a/servers/physics_2d/collision_solver_2d_sat.cpp +++ b/servers/physics_2d/collision_solver_2d_sat.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/collision_solver_2d_sat.h b/servers/physics_2d/collision_solver_2d_sat.h index 554f756738..91aeb53030 100644 --- a/servers/physics_2d/collision_solver_2d_sat.h +++ b/servers/physics_2d/collision_solver_2d_sat.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/collision_solver_2d_sw.cpp b/servers/physics_2d/collision_solver_2d_sw.cpp index 134ad04222..d9bf235c86 100644 --- a/servers/physics_2d/collision_solver_2d_sw.cpp +++ b/servers/physics_2d/collision_solver_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/collision_solver_2d_sw.h b/servers/physics_2d/collision_solver_2d_sw.h index 0cdd54f8b6..7e3542805c 100644 --- a/servers/physics_2d/collision_solver_2d_sw.h +++ b/servers/physics_2d/collision_solver_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/constraint_2d_sw.cpp b/servers/physics_2d/constraint_2d_sw.cpp index 24d56ce9fe..2f681e8590 100644 --- a/servers/physics_2d/constraint_2d_sw.cpp +++ b/servers/physics_2d/constraint_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/constraint_2d_sw.h b/servers/physics_2d/constraint_2d_sw.h index a9145c382f..f776dbfe2c 100644 --- a/servers/physics_2d/constraint_2d_sw.h +++ b/servers/physics_2d/constraint_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/joints_2d_sw.cpp b/servers/physics_2d/joints_2d_sw.cpp index 7c12000084..958780c2e6 100644 --- a/servers/physics_2d/joints_2d_sw.cpp +++ b/servers/physics_2d/joints_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/joints_2d_sw.h b/servers/physics_2d/joints_2d_sw.h index e43f8eee33..86a1397c53 100644 --- a/servers/physics_2d/joints_2d_sw.h +++ b/servers/physics_2d/joints_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp index 6a1c790da8..c571331498 100644 --- a/servers/physics_2d/physics_2d_server_sw.cpp +++ b/servers/physics_2d/physics_2d_server_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1322,8 +1322,11 @@ int Physics2DServerSW::get_process_info(ProcessInfo p_info) { } +Physics2DServerSW *Physics2DServerSW::singletonsw=NULL; + Physics2DServerSW::Physics2DServerSW() { + singletonsw=this; BroadPhase2DSW::create_func=BroadPhase2DHashGrid::_create; // BroadPhase2DSW::create_func=BroadPhase2DBasic::_create; diff --git a/servers/physics_2d/physics_2d_server_sw.h b/servers/physics_2d/physics_2d_server_sw.h index b2c58b788e..28acf4e2d1 100644 --- a/servers/physics_2d/physics_2d_server_sw.h +++ b/servers/physics_2d/physics_2d_server_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,6 +42,7 @@ class Physics2DServerSW : public Physics2DServer { OBJ_TYPE( Physics2DServerSW, Physics2DServer ); friend class Physics2DDirectSpaceStateSW; +friend class Physics2DDirectBodyStateSW; bool active; int iterations; bool doing_sync; @@ -65,7 +66,7 @@ friend class Physics2DDirectSpaceStateSW; mutable RID_Owner<Body2DSW> body_owner; mutable RID_Owner<Joint2DSW> joint_owner; - + static Physics2DServerSW *singletonsw; // void _clear_query(Query2DSW *p_query); diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp index d3591ec744..3054ba8d59 100644 --- a/servers/physics_2d/shape_2d_sw.cpp +++ b/servers/physics_2d/shape_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/shape_2d_sw.h b/servers/physics_2d/shape_2d_sw.h index 6d5473aa17..4164896696 100644 --- a/servers/physics_2d/shape_2d_sw.h +++ b/servers/physics_2d/shape_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 9f2f03baec..9ba6bdd5ba 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -192,7 +192,7 @@ int Physics2DDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Matri if (p_result_max<=0) return 0; - Shape2DSW *shape = static_cast<Physics2DServerSW*>(Physics2DServer::get_singleton())->shape_owner.get(p_shape); + Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.get(p_shape); ERR_FAIL_COND_V(!shape,0); Rect2 aabb = p_xform.xform(shape->get_aabb()); @@ -239,7 +239,7 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID& p_shape, const Matrix32 - Shape2DSW *shape = static_cast<Physics2DServerSW*>(Physics2DServer::get_singleton())->shape_owner.get(p_shape); + Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.get(p_shape); ERR_FAIL_COND_V(!shape,false); Rect2 aabb = p_xform.xform(shape->get_aabb()); @@ -367,7 +367,7 @@ bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Matrix32& p_s if (p_result_max<=0) return 0; - Shape2DSW *shape = static_cast<Physics2DServerSW*>(Physics2DServer::get_singleton())->shape_owner.get(p_shape); + Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.get(p_shape); ERR_FAIL_COND_V(!shape,0); Rect2 aabb = p_shape_xform.xform(shape->get_aabb()); @@ -474,7 +474,7 @@ static void _rest_cbk_result(const Vector2& p_point_A,const Vector2& p_point_B,v bool Physics2DDirectSpaceStateSW::rest_info(RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,float p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { - Shape2DSW *shape = static_cast<Physics2DServerSW*>(Physics2DServer::get_singleton())->shape_owner.get(p_shape); + Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.get(p_shape); ERR_FAIL_COND_V(!shape,0); Rect2 aabb = p_shape_xform.xform(shape->get_aabb()); diff --git a/servers/physics_2d/space_2d_sw.h b/servers/physics_2d/space_2d_sw.h index 97ad3d7f80..2bdbb8a881 100644 --- a/servers/physics_2d/space_2d_sw.h +++ b/servers/physics_2d/space_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/step_2d_sw.cpp b/servers/physics_2d/step_2d_sw.cpp index bc87789937..94e1d26329 100644 --- a/servers/physics_2d/step_2d_sw.cpp +++ b/servers/physics_2d/step_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -56,14 +56,29 @@ void Step2DSW::_populate_island(Body2DSW* p_body,Body2DSW** p_island,Constraint2 } } -void Step2DSW::_setup_island(Constraint2DSW *p_island,float p_delta) { +bool Step2DSW::_setup_island(Constraint2DSW *p_island,float p_delta) { Constraint2DSW *ci=p_island; + Constraint2DSW *prev_ci=NULL; + bool removed_root=false; while(ci) { bool process = ci->setup(p_delta); - //todo remove from island if process fails + + if (!process) { + //remove from island if process fails + if (prev_ci) { + prev_ci->set_island_next(ci->get_island_next()); + } else { + removed_root=true; + prev_ci=ci; + } + } else { + prev_ci=ci; + } ci=ci->get_island_next(); } + + return removed_root; } void Step2DSW::_solve_island(Constraint2DSW *p_island,int p_iterations,float p_delta){ @@ -195,9 +210,40 @@ void Step2DSW::step(Space2DSW* p_space,float p_delta,int p_iterations) { { Constraint2DSW *ci=constraint_island_list; + Constraint2DSW *prev_ci=NULL; while(ci) { - _setup_island(ci,p_delta); + if (_setup_island(ci,p_delta)==true) { + + //removed the root from the island graph because it is not to be processed + + Constraint2DSW *next = ci->get_island_next(); + + if (next) { + //root from list being deleted no longer exists, replace by next + next->set_island_list_next(ci->get_island_list_next()); + if (prev_ci) { + prev_ci->set_island_list_next(next); + } else { + constraint_island_list=next; + + } + prev_ci=next; + } else { + + //list is empty, just skip + if (prev_ci) { + prev_ci->set_island_list_next(ci->get_island_list_next()); + + } else { + constraint_island_list=ci->get_island_list_next(); + } + + } + } else { + prev_ci=ci; + } + ci=ci->get_island_list_next(); } } diff --git a/servers/physics_2d/step_2d_sw.h b/servers/physics_2d/step_2d_sw.h index d5e919836c..0c374d7e12 100644 --- a/servers/physics_2d/step_2d_sw.h +++ b/servers/physics_2d/step_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class Step2DSW { uint64_t _step; void _populate_island(Body2DSW* p_body,Body2DSW** p_island,Constraint2DSW **p_constraint_island); - void _setup_island(Constraint2DSW *p_island,float p_delta); + bool _setup_island(Constraint2DSW *p_island,float p_delta); void _solve_island(Constraint2DSW *p_island,int p_iterations,float p_delta); void _check_suspend(Body2DSW *p_island,float p_delta); public: diff --git a/servers/physics_2d_server.cpp b/servers/physics_2d_server.cpp index c18b32468a..2d267a5749 100644 --- a/servers/physics_2d_server.cpp +++ b/servers/physics_2d_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -548,7 +548,7 @@ void Physics2DServer::_bind_methods() { ObjectTypeDB::bind_method(_MD("area_attach_object_instance_ID","area","id"),&Physics2DServer::area_attach_object_instance_ID); ObjectTypeDB::bind_method(_MD("area_get_object_instance_ID","area"),&Physics2DServer::area_get_object_instance_ID); - ObjectTypeDB::bind_method(_MD("area_set_monitor_callback","receiver","method"),&Physics2DServer::area_set_monitor_callback); + ObjectTypeDB::bind_method(_MD("area_set_monitor_callback","area","receiver","method"),&Physics2DServer::area_set_monitor_callback); ObjectTypeDB::bind_method(_MD("body_create","mode","init_sleeping"),&Physics2DServer::body_create,DEFVAL(BODY_MODE_RIGID),DEFVAL(false)); @@ -606,17 +606,17 @@ void Physics2DServer::_bind_methods() { ObjectTypeDB::bind_method(_MD("body_set_max_contacts_reported","body","amount"),&Physics2DServer::body_set_max_contacts_reported); ObjectTypeDB::bind_method(_MD("body_get_max_contacts_reported","body"),&Physics2DServer::body_get_max_contacts_reported); - ObjectTypeDB::bind_method(_MD("body_set_one_way_collision_direction","normal"),&Physics2DServer::body_set_one_way_collision_direction); - ObjectTypeDB::bind_method(_MD("body_get_one_way_collision_direction"),&Physics2DServer::body_get_one_way_collision_direction); + ObjectTypeDB::bind_method(_MD("body_set_one_way_collision_direction","body","normal"),&Physics2DServer::body_set_one_way_collision_direction); + ObjectTypeDB::bind_method(_MD("body_get_one_way_collision_direction","body"),&Physics2DServer::body_get_one_way_collision_direction); - ObjectTypeDB::bind_method(_MD("body_set_one_way_collision_max_depth","normal"),&Physics2DServer::body_set_one_way_collision_max_depth); - ObjectTypeDB::bind_method(_MD("body_get_one_way_collision_max_depth"),&Physics2DServer::body_get_one_way_collision_max_depth); + ObjectTypeDB::bind_method(_MD("body_set_one_way_collision_max_depth","body","depth"),&Physics2DServer::body_set_one_way_collision_max_depth); + ObjectTypeDB::bind_method(_MD("body_get_one_way_collision_max_depth","body"),&Physics2DServer::body_get_one_way_collision_max_depth); ObjectTypeDB::bind_method(_MD("body_set_omit_force_integration","body","enable"),&Physics2DServer::body_set_omit_force_integration); ObjectTypeDB::bind_method(_MD("body_is_omitting_force_integration","body"),&Physics2DServer::body_is_omitting_force_integration); - ObjectTypeDB::bind_method(_MD("body_set_force_integration_callback","body","receiver","method"),&Physics2DServer::body_set_force_integration_callback); + ObjectTypeDB::bind_method(_MD("body_set_force_integration_callback","body","receiver","method","userdata"),&Physics2DServer::body_set_force_integration_callback,DEFVAL(Variant())); ObjectTypeDB::bind_method(_MD("body_test_motion","body","motion","margin","result:Physics2DTestMotionResult"),&Physics2DServer::_body_test_motion,DEFVAL(0.08),DEFVAL(Variant())); @@ -638,7 +638,7 @@ void Physics2DServer::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_active","active"),&Physics2DServer::set_active); - ObjectTypeDB::bind_method(_MD("get_process_info"),&Physics2DServer::get_process_info); + ObjectTypeDB::bind_method(_MD("get_process_info","process_info"),&Physics2DServer::get_process_info); // ObjectTypeDB::bind_method(_MD("init"),&Physics2DServer::init); // ObjectTypeDB::bind_method(_MD("step"),&Physics2DServer::step); diff --git a/servers/physics_2d_server.h b/servers/physics_2d_server.h index a53cfae752..08f69f98b1 100644 --- a/servers/physics_2d_server.h +++ b/servers/physics_2d_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_server.cpp b/servers/physics_server.cpp index bc2b37d92c..89fcffe7ed 100644 --- a/servers/physics_server.cpp +++ b/servers/physics_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -467,7 +467,7 @@ void PhysicsServer::_bind_methods() { ObjectTypeDB::bind_method(_MD("area_attach_object_instance_ID","area","id"),&PhysicsServer::area_attach_object_instance_ID); ObjectTypeDB::bind_method(_MD("area_get_object_instance_ID","area"),&PhysicsServer::area_get_object_instance_ID); - ObjectTypeDB::bind_method(_MD("area_set_monitor_callback","receiver","method"),&PhysicsServer::area_set_monitor_callback); + ObjectTypeDB::bind_method(_MD("area_set_monitor_callback","area","receiver","method"),&PhysicsServer::area_set_monitor_callback); ObjectTypeDB::bind_method(_MD("area_set_ray_pickable","area","enable"),&PhysicsServer::area_set_ray_pickable); ObjectTypeDB::bind_method(_MD("area_is_ray_pickable","area"),&PhysicsServer::area_is_ray_pickable); @@ -671,7 +671,7 @@ void PhysicsServer::_bind_methods() { //ObjectTypeDB::bind_method(_MD("flush_queries"),&PhysicsServer::flush_queries); - ObjectTypeDB::bind_method(_MD("get_process_info"),&PhysicsServer::get_process_info); + ObjectTypeDB::bind_method(_MD("get_process_info","process_info"),&PhysicsServer::get_process_info); BIND_CONSTANT( SHAPE_PLANE ); BIND_CONSTANT( SHAPE_RAY ); diff --git a/servers/physics_server.h b/servers/physics_server.h index 66296fa15d..8e302bf363 100644 --- a/servers/physics_server.h +++ b/servers/physics_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -170,7 +170,7 @@ public: int shape; }; - virtual bool intersect_ray(const Vector3& p_from, const Vector3& p_to,RayResult &r_result,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; + virtual bool intersect_ray(const Vector3& p_from, const Vector3& p_to,RayResult &r_result,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION,bool p_pick_ray=false)=0; struct ShapeResult { @@ -372,7 +372,7 @@ public: virtual RID body_get_space(RID p_body) const=0; virtual void body_set_mode(RID p_body, BodyMode p_mode)=0; - virtual BodyMode body_get_mode(RID p_body, BodyMode p_mode) const=0; + virtual BodyMode body_get_mode(RID p_body) const=0; virtual void body_add_shape(RID p_body, RID p_shape, const Transform& p_transform=Transform())=0; virtual void body_set_shape(RID p_body, int p_shape_idx,RID p_shape)=0; diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index 2af2a79d07..4752210b5f 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/register_server_types.h b/servers/register_server_types.h index d3d6c6b566..a62af905b3 100644 --- a/servers/register_server_types.h +++ b/servers/register_server_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/spatial_sound/spatial_sound_server_sw.cpp b/servers/spatial_sound/spatial_sound_server_sw.cpp index d00deb3912..1ce56a5cdd 100644 --- a/servers/spatial_sound/spatial_sound_server_sw.cpp +++ b/servers/spatial_sound/spatial_sound_server_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/servers/spatial_sound/spatial_sound_server_sw.h b/servers/spatial_sound/spatial_sound_server_sw.h index 82b1b5fa8e..8a4dabdc3e 100644 --- a/servers/spatial_sound/spatial_sound_server_sw.h +++ b/servers/spatial_sound/spatial_sound_server_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp index 439149b1a2..d27b322c21 100644 --- a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp +++ b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.h b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.h index ed305d25de..619b11f376 100644 --- a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.h +++ b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/spatial_sound_2d_server.cpp b/servers/spatial_sound_2d_server.cpp index 574c3d761f..cfe40a0937 100644 --- a/servers/spatial_sound_2d_server.cpp +++ b/servers/spatial_sound_2d_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/spatial_sound_2d_server.h b/servers/spatial_sound_2d_server.h index 9917b36be1..2d388feb49 100644 --- a/servers/spatial_sound_2d_server.h +++ b/servers/spatial_sound_2d_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/spatial_sound_server.cpp b/servers/spatial_sound_server.cpp index f5f5925483..5f93c55a91 100644 --- a/servers/spatial_sound_server.cpp +++ b/servers/spatial_sound_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/spatial_sound_server.h b/servers/spatial_sound_server.h index 1cc323b370..5037ee6e2f 100644 --- a/servers/spatial_sound_server.h +++ b/servers/spatial_sound_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/particle_system_sw.cpp b/servers/visual/particle_system_sw.cpp index aa9b737459..00c06b9e3c 100644 --- a/servers/visual/particle_system_sw.cpp +++ b/servers/visual/particle_system_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/particle_system_sw.h b/servers/visual/particle_system_sw.h index b7ff5e9bb5..9a176ba0d4 100644 --- a/servers/visual/particle_system_sw.h +++ b/servers/visual/particle_system_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/rasterizer.cpp b/servers/visual/rasterizer.cpp index 5984e6e35c..26eca478fd 100644 --- a/servers/visual/rasterizer.cpp +++ b/servers/visual/rasterizer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index d94067961f..b84e83cb0c 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/rasterizer_dummy.cpp b/servers/visual/rasterizer_dummy.cpp index c05438aef3..3b12b503dd 100644 --- a/servers/visual/rasterizer_dummy.cpp +++ b/servers/visual/rasterizer_dummy.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/rasterizer_dummy.h b/servers/visual/rasterizer_dummy.h index 2c503249fe..efa843839a 100644 --- a/servers/visual/rasterizer_dummy.h +++ b/servers/visual/rasterizer_dummy.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/shader_compiler.cpp b/servers/visual/shader_compiler.cpp index d7b171f5a7..ee5dae5ae2 100644 --- a/servers/visual/shader_compiler.cpp +++ b/servers/visual/shader_compiler.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/shader_compiler.h b/servers/visual/shader_compiler.h index 69d9eedf9c..29561b2145 100644 --- a/servers/visual/shader_compiler.h +++ b/servers/visual/shader_compiler.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/shader_graph.cpp b/servers/visual/shader_graph.cpp index 1346ec9253..07bbf9f7b4 100644 --- a/servers/visual/shader_graph.cpp +++ b/servers/visual/shader_graph.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/shader_graph.h b/servers/visual/shader_graph.h index 807dbb3719..07e4bb3540 100644 --- a/servers/visual/shader_graph.h +++ b/servers/visual/shader_graph.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 0e10c7dfe4..d0e8bfccd6 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/shader_language.h b/servers/visual/shader_language.h index 9fd070ee2e..31e9fcda5b 100644 --- a/servers/visual/shader_language.h +++ b/servers/visual/shader_language.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 79911121f5..3675194325 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -7182,6 +7182,8 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ for(Set<Rasterizer::CanvasLightOccluderInstance*>::Element *F=E->get().canvas->occluders.front();F;F=F->next()) { + if (!F->get()->enabled) + continue; F->get()->xform_cache = xf * F->get()->xform; if (shadow_rect.intersects_transformed(F->get()->xform_cache,F->get()->aabb_cache)) { diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index e0127faf41..459dc60e81 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/visual_server_wrap_mt.cpp b/servers/visual/visual_server_wrap_mt.cpp index 19dff3d36c..478a31806c 100644 --- a/servers/visual/visual_server_wrap_mt.cpp +++ b/servers/visual/visual_server_wrap_mt.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index 57d691ae68..fb502d8a6e 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index 52381cf096..fd2913cc7e 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/visual_server.h b/servers/visual_server.h index c5100b8d30..4841720f41 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/Godot.app/Contents/Info.plist b/tools/Godot.app/Contents/Info.plist index 8a89993fb9..cb2db17807 100755 --- a/tools/Godot.app/Contents/Info.plist +++ b/tools/Godot.app/Contents/Info.plist @@ -9,7 +9,7 @@ <key>CFBundleName</key> <string>Godot</string> <key>CFBundleGetInfoString</key> - <string>(c) 2007-2014 Juan Linietsky, Ariel Manzur</string> + <string>(c) 2007-2016 Juan Linietsky, Ariel Manzur</string> <key>CFBundleIconFile</key> <string>Godot.icns</string> <key>CFBundleIdentifier</key> @@ -25,7 +25,7 @@ <key>CFBundleVersion</key> <string>1.0.0</string> <key>NSHumanReadableCopyright</key> - <string>© 2007-2014 Juan Linietsky, Ariel Manzur</string> + <string>© 2007-2016 Juan Linietsky, Ariel Manzur</string> <key>LSMinimumSystemVersion</key> <string>10.6.0</string> <key>LSMinimumSystemVersionByArchitecture</key> diff --git a/tools/addheader/addheader.py b/tools/addheader/addheader.py index 038cec96d0..0252eb396d 100644 --- a/tools/addheader/addheader.py +++ b/tools/addheader/addheader.py @@ -6,7 +6,7 @@ header="""\ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/addheader/header.txt b/tools/addheader/header.txt index 359949cc3b..e4efb2dcfc 100644 --- a/tools/addheader/header.txt +++ b/tools/addheader/header.txt @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/tools/collada/collada.cpp b/tools/collada/collada.cpp index 107ffac626..07da72718e 100644 --- a/tools/collada/collada.cpp +++ b/tools/collada/collada.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/collada/collada.h b/tools/collada/collada.h index 81f51a1f3d..8983b8faf0 100644 --- a/tools/collada/collada.h +++ b/tools/collada/collada.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp index 3161e380b9..11e4797747 100644 --- a/tools/doc/doc_data.cpp +++ b/tools/doc/doc_data.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -190,10 +190,10 @@ void DocData::generate(bool p_basic_types) { #ifdef DEBUG_METHODS_ENABLED if (m && m->get_return_type()!=StringName()) method.return_type=m->get_return_type(); - else if (arginfo.type!=Variant::NIL) { + else if (arginfo.type!=Variant::NIL) // { #endif method.return_type=(arginfo.hint==PROPERTY_HINT_RESOURCE_TYPE)?arginfo.hint_string:Variant::get_type_name(arginfo.type); - } +// } } else { @@ -584,7 +584,10 @@ void DocData::generate(bool p_basic_types) { md.name=mi.name; if (mi.return_val.name!="") md.return_type=mi.return_val.name; - else + else if (mi.name.find(":")!=-1) { + md.return_type=mi.name.get_slice(":",1); + md.name=mi.name.get_slice(":",0); + } else md.return_type=Variant::get_type_name(mi.return_val.type); for(int i=0;i<mi.arguments.size();i++) { @@ -594,8 +597,9 @@ void DocData::generate(bool p_basic_types) { ArgumentDoc ad; ad.name=pi.name; + if (pi.type==Variant::NIL) - ad.type="var"; + ad.type="Variant"; else ad.type=Variant::get_type_name( pi.type ); diff --git a/tools/doc/doc_data.h b/tools/doc/doc_data.h index b62eb21b4a..877f30defb 100644 --- a/tools/doc/doc_data.h +++ b/tools/doc/doc_data.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/docdump/doc_dump.cpp b/tools/docdump/doc_dump.cpp index 5f108ee9c8..f8e035e3fa 100644 --- a/tools/docdump/doc_dump.cpp +++ b/tools/docdump/doc_dump.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/docdump/doc_dump.h b/tools/docdump/doc_dump.h index cb18289e31..372f5e0969 100644 --- a/tools/docdump/doc_dump.h +++ b/tools/docdump/doc_dump.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp index b8aa5874d1..9a0dde783b 100644 --- a/tools/editor/animation_editor.cpp +++ b/tools/editor/animation_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1702,7 +1702,7 @@ bool AnimationKeyEditor::_edit_if_single_selection() { if (selection.size()==0) { curve_edit->set_mode(AnimationCurveEdit::MODE_DISABLED); - print_line("disable"); + //print_line("disable"); } else { curve_edit->set_mode(AnimationCurveEdit::MODE_MULTIPLE); @@ -1713,13 +1713,13 @@ bool AnimationKeyEditor::_edit_if_single_selection() { curve_edit->set_multiple(animation->track_get_key_transition(E->key().track,E->key().key)); } - print_line("multiple"); + //print_line("multiple"); } return false; } curve_edit->set_mode(AnimationCurveEdit::MODE_SINGLE); - print_line("regular"); + //print_line("regular"); int idx = selection.front()->key().track; int key = selection.front()->key().key; @@ -3017,7 +3017,7 @@ void AnimationKeyEditor::set_keying(bool p_enabled) { keying=p_enabled; _update_menu(); - emit_signal("keying_changed",p_enabled); + emit_signal("keying_changed"); } diff --git a/tools/editor/animation_editor.h b/tools/editor/animation_editor.h index 743242fe94..65d0fb70f8 100644 --- a/tools/editor/animation_editor.h +++ b/tools/editor/animation_editor.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/array_property_edit.cpp b/tools/editor/array_property_edit.cpp index 64a2762095..66c2782da5 100644 --- a/tools/editor/array_property_edit.cpp +++ b/tools/editor/array_property_edit.cpp @@ -72,6 +72,15 @@ bool ArrayPropertyEdit::_set(const StringName& p_name, const Variant& p_value){ ur->add_undo_method(this,"_set_value",i,arr.get(i)); } + } else if (newsize>size && size) { + + Variant init; + Variant::CallError ce; + init = Variant::construct(arr.get(size-1).get_type(),NULL,0,ce); + for(int i=size;i<newsize;i++) { + ur->add_do_method(this,"_set_value",i,init); + } + } ur->add_do_method(this,"_notif_change"); ur->add_undo_method(this,"_notif_change"); @@ -83,6 +92,7 @@ bool ArrayPropertyEdit::_set(const StringName& p_name, const Variant& p_value){ _change_notify(); return true; } + } else if (pn.begins_with("indices")) { if (pn.find("_")!=-1) { diff --git a/tools/editor/call_dialog.cpp b/tools/editor/call_dialog.cpp index 0e3abcf4ef..edcd7371f2 100644 --- a/tools/editor/call_dialog.cpp +++ b/tools/editor/call_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/call_dialog.h b/tools/editor/call_dialog.h index fe69847796..2d04e7b6cd 100644 --- a/tools/editor/call_dialog.h +++ b/tools/editor/call_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index 0728b3b7c1..fe863bfebc 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -612,6 +612,7 @@ CodeTextEditor::CodeTextEditor() { if (!font_overrode) text_editor->add_font_override("font",get_font("source","Fonts")); + text_editor->set_show_line_numbers(true); text_editor->set_brace_matching(true); text_editor->set_auto_indent(true); diff --git a/tools/editor/code_editor.h b/tools/editor/code_editor.h index 0c32aeb68f..5ed7ce9052 100644 --- a/tools/editor/code_editor.h +++ b/tools/editor/code_editor.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp index d4937d7114..e94bc78f5d 100644 --- a/tools/editor/connections_dialog.cpp +++ b/tools/editor/connections_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/connections_dialog.h b/tools/editor/connections_dialog.h index 4a1c3f189c..d5e228e799 100644 --- a/tools/editor/connections_dialog.h +++ b/tools/editor/connections_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/console.cpp b/tools/editor/console.cpp deleted file mode 100644 index 0c98f05706..0000000000 --- a/tools/editor/console.cpp +++ /dev/null @@ -1,386 +0,0 @@ -/*************************************************************************/ -/* console.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "console.h" -#include "os/os.h" -#include "os/keyboard.h" - -#include "editor_icons.h" -#include "scene/gui/label.h" -#include "globals.h" - - -void Console::_stats_update_timer_callback() { - - if (!status->is_visible()) - return; - - VisualServer *vs = VisualServer::get_singleton(); - - stats.render_objects_in_frame->set_text(1,String::num(vs->get_render_info( VisualServer::INFO_OBJECTS_IN_FRAME ) ) ); - stats.material_changes_in_frame->set_text(1,String::num(vs->get_render_info( VisualServer::INFO_MATERIAL_CHANGES_IN_FRAME ) ) ); - - int64_t total_vmem = vs->get_render_info( VisualServer::INFO_USAGE_VIDEO_MEM_TOTAL ); - if (total_vmem<0) - stats.usage_video_mem_total->set_text(1, "Unknown"); - else - stats.usage_video_mem_total->set_text(1,String::humanize_size( total_vmem ) ); - - stats.usage_video_mem_used->set_text(1,String::humanize_size( vs->get_render_info( VisualServer::INFO_VIDEO_MEM_USED ) ) ); - stats.usage_texture_mem_used->set_text(1,String::humanize_size( vs->get_render_info( VisualServer::INFO_TEXTURE_MEM_USED ) ) ); - stats.usage_vertex_mem_used->set_text(1,String::humanize_size( vs->get_render_info( VisualServer::INFO_VERTEX_MEM_USED ) ) ); - - - stats.usage_static_memory_total->set_text(1,String::humanize_size( Memory::get_static_mem_available() ) ); - stats.usage_static_memory->set_text(1,String::humanize_size( Memory::get_static_mem_usage() ) ); - stats.usage_dynamic_memory_total->set_text(1,String::humanize_size( Memory::get_dynamic_mem_available() ) ); - stats.usage_dynamic_memory->set_text(1,String::humanize_size( Memory::get_dynamic_mem_usage() ) ); - stats.usage_objects_instanced->set_text(1,String::num( ObjectDB::get_object_count()) ); - - -} - -void Console::_print_handle(void *p_this,const String& p_string) { - - - return; - Console *self = (Console*)p_this; - - OutputQueue oq; - oq.text=p_string; - oq.type=OutputStrings::LINE_NORMAL; - - - if (self->output_queue_mutex) - self->output_queue_mutex->lock(); - - self->output_queue.push_back(oq); - - if (self->output_queue_mutex) - self->output_queue_mutex->unlock(); - -} -void Console::_error_handle(void *p_this,const char*p_function,const char* p_file,int p_line,const char *p_error, const char *p_explanation,ErrorHandlerType p_type) { - - - Console *self = (Console*)p_this; - - OutputQueue oq; - oq.text="ERROR: "+String(p_file)+":"+itos(p_line)+", in function: "+String(p_function); - oq.text+="\n "+String(p_error)+"."; - if (p_explanation && p_explanation[0]) - oq.text+="\n Reason: "+String(p_explanation); - oq.text+="\n"; - oq.type=OutputStrings::LINE_ERROR; - - - if (self->output_queue_mutex) - self->output_queue_mutex->lock(); - - self->output_queue.push_back(oq); - - if (self->output_queue_mutex) - self->output_queue_mutex->unlock(); - - -} - -void Console::_window_input_event(InputEvent p_event) { - - Control::_window_input_event(p_event); - - if (p_event.type==InputEvent::KEY && p_event.key.pressed) { - - if (p_event.key.scancode==KEY_QUOTELEFT && p_event.key.mod.control) { - - if (is_visible()) - hide(); - else { - globals_property_editor->edit( NULL ); - globals_property_editor->edit( Globals::get_singleton() ); - show(); - }; - } - - if (p_event.key.scancode==KEY_ESCAPE && !window_has_modal_stack() && is_visible()) { - hide(); - get_tree()->call_group(0,"windows","_cancel_input_ID",p_event.ID); - } - - - } -} - -void Console::_window_resize_event() { - -// Control::_window_resize_event(); - _resized(); -} - - -void Console::_resized() { - - set_pos( Point2( 0, OS::get_singleton()->get_video_mode().height-height) ); - set_size( Size2( OS::get_singleton()->get_video_mode().width, height) ); -} - -void Console::_notification(int p_what) { - - switch(p_what) { - - case NOTIFICATION_ENTER_TREE: { - - _resized(); - show(); - globals_property_editor->edit( Globals::get_singleton() ); - - } break; - - case NOTIFICATION_PROCESS: { - //pop messies - - if (output_queue_mutex) - output_queue_mutex->lock(); - - while(output_queue.size()) { - - OutputQueue q = output_queue.front()->get(); - if (q.type==OutputStrings::LINE_ERROR || q.type==OutputStrings::LINE_WARNING) - errors->add_line(q.text,q.meta,q.type); - output->add_line(q.text,q.meta,q.type); - output_queue.pop_front(); - } - - if (output_queue_mutex) - output_queue_mutex->unlock(); - - } break; - case NOTIFICATION_DRAW: { - - RID ci = get_canvas_item(); - get_stylebox("panel","Panel")->draw(ci,Rect2(Point2(),get_size())); - - } break; - } -} - - -void Console::_close_pressed() { - - hide(); -} - -void Console::_inspector_node_selected() { - - - Node *node = inspect_tree_editor->get_selected(); - - if (!node) - inspect_property_editor->edit(NULL); - else { - - inspect_history.add_object(node->get_instance_ID()); - - inspect_property_editor->edit(node); - } - -} - -void Console::_bind_methods() { - - ObjectTypeDB::bind_method("_stats_update_timer_callback",&Console::_stats_update_timer_callback); - ObjectTypeDB::bind_method("_close_pressed",&Console::_close_pressed); - ObjectTypeDB::bind_method("_inspector_node_selected",&Console::_inspector_node_selected); -} - - -Console::Console() { - - Ref<Theme> theme( memnew( Theme ) ); - set_theme( theme ); - editor_register_icons(theme); - - height=300; - tabs = memnew( TabContainer ); - tabs->set_tab_align(TabContainer::ALIGN_LEFT); - add_child(tabs); - tabs->set_area_as_parent_rect(); - - output = memnew( OutputStrings ); - output->set_name("Output"); - tabs->add_child(output); - errors = memnew( OutputStrings ); - errors->set_name("Errors"); - tabs->add_child(errors); - status = memnew( Control ); - status->set_name("Stats"); - tabs->add_child(status); - inspect = memnew( Control ); - inspect->set_name("Inspect"); - tabs->add_child(inspect); - globals = memnew( Control ); - globals->set_name("Globals"); - tabs->add_child(globals); - - // stats - - stats_tree = memnew( Tree ); - stats_tree->set_hide_root(true); - stats_tree->set_columns(2); - status->add_child(stats_tree); - stats_tree->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - stats_tree->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO ); - stats_tree->set_margin( MARGIN_RIGHT, 0.5 ); - stats_tree->set_begin( Point2( 20,25 ) ); - stats_tree->set_end( Point2( 0.5,5 ) ); - - Label *stats_label = memnew( Label ); - stats_label->set_text("Engine Statistics:"); - stats_label->set_pos( Point2( 5,5 ) ); - status->add_child(stats_label); - - TreeItem *stats_tree_root = stats_tree->create_item(NULL); - - { - //system items - TreeItem *system_item = stats_tree->create_item(stats_tree_root); - system_item->set_text(0,"System"); - - stats.usage_static_memory_total = stats_tree->create_item(system_item); - stats.usage_static_memory_total->set_text(0,"Total Static Mem");; - stats.usage_static_memory = stats_tree->create_item(system_item); - stats.usage_static_memory->set_text(0,"Static Mem Usage");; - stats.usage_dynamic_memory_total = stats_tree->create_item(system_item); - stats.usage_dynamic_memory_total->set_text(0,"Total Dynamic Mem");; - stats.usage_dynamic_memory = stats_tree->create_item(system_item); - stats.usage_dynamic_memory->set_text(0,"Dynamic Mem Usage"); - stats.usage_objects_instanced = stats_tree->create_item(system_item); - stats.usage_objects_instanced->set_text(0,"Instanced Objects"); - - //render items - TreeItem *render_item = stats_tree->create_item(stats_tree_root); - render_item->set_text(0,"Render"); - stats.render_objects_in_frame = stats_tree->create_item(render_item); - stats.render_objects_in_frame->set_text(0,"Visible Objects"); - stats.material_changes_in_frame = stats_tree->create_item(render_item); - stats.material_changes_in_frame->set_text(0,"Material Changes"); - stats.usage_video_mem_total = stats_tree->create_item(render_item); - stats.usage_video_mem_total->set_text(0,"Total Video Mem"); - stats.usage_texture_mem_used = stats_tree->create_item(render_item); - stats.usage_texture_mem_used->set_text(0,"Texture Mem Usage"); - stats.usage_vertex_mem_used = stats_tree->create_item(render_item); - stats.usage_vertex_mem_used->set_text(0,"Vertex Mem Usage"); - stats.usage_video_mem_used = stats_tree->create_item(render_item); - stats.usage_video_mem_used->set_text(0,"Combined Mem Usage"); - } - - { - - inspect_tree_editor = memnew( SceneTreeEditor ); - inspect_tree_editor->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO ); - inspect_tree_editor->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - inspect_tree_editor->set_begin( Point2( 20, 5 ) ); - inspect_tree_editor->set_end( Point2( 0.49, 5 ) ); - inspect->add_child(inspect_tree_editor); - - inspect_property_editor = memnew( PropertyEditor ); - inspect_property_editor->set_anchor( MARGIN_LEFT, ANCHOR_RATIO ); - inspect_property_editor->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - inspect_property_editor->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - inspect_property_editor->set_begin( Point2( 0.51, 5 ) ); - inspect_property_editor->set_end( Point2( 5, 5 ) ); - inspect->add_child(inspect_property_editor); - } - - - { //globals - - globals_property_editor = memnew( PropertyEditor ); - globals_property_editor->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - globals_property_editor->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - globals_property_editor->set_begin( Point2( 15, 5 ) ); - globals_property_editor->set_end( Point2( 5, 5 ) ); - globals_property_editor->get_top_label()->set_text("Globals Editor:"); - globals->add_child(globals_property_editor); - - } - - -#ifndef NO_THREADS - output_queue_mutex = Mutex::create(); -#else - output_queue_mutex = NULL; -#endif - - - hide(); - set_process(true); - - close = memnew( Button ); - add_child(close); - close->set_anchor( MARGIN_LEFT, ANCHOR_END); - close->set_anchor( MARGIN_RIGHT, ANCHOR_END); - close->set_begin( Point2( 25, 3 ) ); - close->set_end( Point2( 5, 3 ) ); - close->set_flat(true); - close->connect("pressed", this,"_close_pressed"); - - - close->set_icon( get_icon("close","Icons") ); -// force_top_viewport(true); - - - err_handler.userdata=this; - err_handler.errfunc=_error_handle; - add_error_handler(&err_handler); - - print_handler.userdata=this; - print_handler.printfunc=_print_handle; - add_print_handler(&print_handler); - - Timer *timer = memnew( Timer ); - add_child(timer); - timer->set_wait_time(1); - timer->start(); - timer->connect("timeout", this,"_stats_update_timer_callback"); - inspect_tree_editor->connect("node_selected", this,"_inspector_node_selected"); - - - -} - - -Console::~Console() { - - if (output_queue_mutex) - memdelete(output_queue_mutex); - - remove_error_handler(&err_handler); - remove_print_handler(&print_handler); - -} diff --git a/tools/editor/console.h b/tools/editor/console.h deleted file mode 100644 index aff425fcde..0000000000 --- a/tools/editor/console.h +++ /dev/null @@ -1,116 +0,0 @@ -/*************************************************************************/ -/* console.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef CONSOLE_H -#define CONSOLE_H - -#include "scene/gui/popup.h" -#include "scene/gui/button.h" -#include "scene/gui/tab_container.h" -#include "scene/gui/tree.h" -#include "scene/main/timer.h" -#include "output_strings.h" -#include "property_editor.h" -#include "scene_tree_editor.h" -#include "editor_data.h" - -class Console : public Popup { - - OBJ_TYPE( Console, Popup ); - - TabContainer *tabs; - OutputStrings *output; - OutputStrings *errors; - Control *status; - Control *inspect; - Control *globals; - Button *close; - int height; - - EditorHistory inspect_history; - SceneTreeEditor *inspect_tree_editor; - PropertyEditor *inspect_property_editor; - PropertyEditor *globals_property_editor; - - Tree *stats_tree; - - struct StatsItems { - - TreeItem *render_objects_in_frame; - TreeItem *material_changes_in_frame; - - TreeItem *usage_video_mem_total; - TreeItem *usage_video_mem_used; - TreeItem *usage_texture_mem_used; - TreeItem *usage_vertex_mem_used; - - TreeItem *usage_static_memory_total; - TreeItem *usage_static_memory; - TreeItem *usage_dynamic_memory_total; - TreeItem *usage_dynamic_memory; - TreeItem *usage_objects_instanced; - - } stats; - - struct OutputQueue { - - OutputStrings::LineType type; - Variant meta; - String text; - }; - - Mutex *output_queue_mutex; - List<OutputQueue> output_queue; - - - ErrorHandlerList err_handler; - PrintHandlerList print_handler; - - void _inspector_node_selected(); - - static void _error_handle(void *p_this,const char*p_function,const char* p_file,int p_line,const char *p_error, const char *p_explanation,ErrorHandlerType p_type); - static void _print_handle(void *p_this,const String& p_string); - -protected: - - virtual void _window_input_event(InputEvent p_event); - virtual void _window_resize_event(); - - void _stats_update_timer_callback(); - void _resized(); - void _close_pressed(); - - void _notification(int p_what); - - static void _bind_methods(); -public: - Console(); - ~Console(); -}; - -#endif // CONSOLE_H diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp index a9119349c8..0f39d72308 100644 --- a/tools/editor/create_dialog.cpp +++ b/tools/editor/create_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/create_dialog.h b/tools/editor/create_dialog.h index f200e1caf5..6f959fd467 100644 --- a/tools/editor/create_dialog.h +++ b/tools/editor/create_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/default_saver.cpp b/tools/editor/default_saver.cpp index c865adb1eb..611232e04b 100644 --- a/tools/editor/default_saver.cpp +++ b/tools/editor/default_saver.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/default_saver.h b/tools/editor/default_saver.h index 4e11ff5592..2b1a1edb23 100644 --- a/tools/editor/default_saver.h +++ b/tools/editor/default_saver.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/doc_code_font.h b/tools/editor/doc_code_font.h index 91f67c4a41..879c873ea1 100644 --- a/tools/editor/doc_code_font.h +++ b/tools/editor/doc_code_font.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/doc_font.h b/tools/editor/doc_font.h index f2e5e7950b..a3c3b58b21 100644 --- a/tools/editor/doc_font.h +++ b/tools/editor/doc_font.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/doc_title_font.h b/tools/editor/doc_title_font.h index fb6b4eaf5b..75a3f049f0 100644 --- a/tools/editor/doc_title_font.h +++ b/tools/editor/doc_title_font.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp index e9f9e09acd..5e613c658b 100644 --- a/tools/editor/editor_data.cpp +++ b/tools/editor/editor_data.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -499,8 +499,8 @@ void EditorData::remove_scene(int p_idx){ bool EditorData::_find_updated_instances(Node* p_root,Node *p_node,Set<String> &checked_paths) { - if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner())) - return false; +// if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner())) +// return false; Ref<SceneState> ss; diff --git a/tools/editor/editor_data.h b/tools/editor/editor_data.h index 51af7d41bd..7dafeeea04 100644 --- a/tools/editor/editor_data.h +++ b/tools/editor/editor_data.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_dir_dialog.cpp b/tools/editor/editor_dir_dialog.cpp index 1f3b5eed65..8512154485 100644 --- a/tools/editor/editor_dir_dialog.cpp +++ b/tools/editor/editor_dir_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_dir_dialog.h b/tools/editor/editor_dir_dialog.h index 8ac83b86e8..1c2593219c 100644 --- a/tools/editor/editor_dir_dialog.h +++ b/tools/editor/editor_dir_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp index fc7ee2bde7..22cd3845e1 100644 --- a/tools/editor/editor_file_dialog.cpp +++ b/tools/editor/editor_file_dialog.cpp @@ -53,13 +53,52 @@ void EditorFileDialog::_notification(int p_what) { //RID ci = get_canvas_item(); //get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size())); + } else if (p_what==NOTIFICATION_POPUP_HIDE) { + + set_process_unhandled_input(false); + } else if (p_what==EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - set_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files")); + bool show_hidden=EditorSettings::get_singleton()->get("file_dialog/show_hidden_files"); + if (show_hidden_files!=show_hidden) + set_show_hidden_files(show_hidden); set_display_mode((DisplayMode)EditorSettings::get_singleton()->get("file_dialog/display_mode").operator int()); } } +void EditorFileDialog::_unhandled_input(const InputEvent& p_event) { + + if (p_event.type==InputEvent::KEY && is_window_modal_on_top()) { + + const InputEventKey &k=p_event.key; + + if (k.pressed) { + + bool handled=true; + + switch (k.scancode) { + + case KEY_H: { + + if (k.mod.command) { + + bool show=!show_hidden_files; + set_show_hidden_files(show); + EditorSettings::get_singleton()->set("file_dialog/show_hidden_files",show); + } else { + handled=false; + } + + } break; + default: { handled=false; } + } + + if (handled) + accept_event(); + } + } +} + void EditorFileDialog::set_enable_multiple_selection(bool p_enable) { item_list->set_select_mode(p_enable?ItemList::SELECT_MULTI:ItemList::SELECT_SINGLE); @@ -151,6 +190,8 @@ void EditorFileDialog::_post_popup() { _update_favorites(); } + set_process_unhandled_input(true); + } void EditorFileDialog::_thumbnail_result(const String& p_path,const Ref<Texture>& p_preview, const Variant& p_udata) { @@ -1049,6 +1090,8 @@ EditorFileDialog::DisplayMode EditorFileDialog::get_display_mode() const{ void EditorFileDialog::_bind_methods() { + ObjectTypeDB::bind_method(_MD("_unhandled_input"),&EditorFileDialog::_unhandled_input); + ObjectTypeDB::bind_method(_MD("_item_selected"),&EditorFileDialog::_item_selected); ObjectTypeDB::bind_method(_MD("_item_db_selected"),&EditorFileDialog::_item_dc_selected); ObjectTypeDB::bind_method(_MD("_dir_entered"),&EditorFileDialog::_dir_entered); @@ -1071,7 +1114,7 @@ void EditorFileDialog::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_vbox:VBoxContainer"),&EditorFileDialog::get_vbox); ObjectTypeDB::bind_method(_MD("set_access","access"),&EditorFileDialog::set_access); ObjectTypeDB::bind_method(_MD("get_access"),&EditorFileDialog::get_access); - ObjectTypeDB::bind_method(_MD("set_show_hidden_files"),&EditorFileDialog::set_show_hidden_files); + ObjectTypeDB::bind_method(_MD("set_show_hidden_files","show"),&EditorFileDialog::set_show_hidden_files); ObjectTypeDB::bind_method(_MD("is_showing_hidden_files"),&EditorFileDialog::is_showing_hidden_files); ObjectTypeDB::bind_method(_MD("_select_drive"),&EditorFileDialog::_select_drive); ObjectTypeDB::bind_method(_MD("_make_dir"),&EditorFileDialog::_make_dir); diff --git a/tools/editor/editor_file_dialog.h b/tools/editor/editor_file_dialog.h index b72b1fa4ef..3590964a51 100644 --- a/tools/editor/editor_file_dialog.h +++ b/tools/editor/editor_file_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -176,6 +176,8 @@ private: void _thumbnail_done(const String& p_path,const Ref<Texture>& p_preview, const Variant& p_udata); void _request_single_thumbnail(const String& p_path); + void _unhandled_input(const InputEvent& p_event); + protected: void _notification(int p_what); diff --git a/tools/editor/editor_file_system.cpp b/tools/editor/editor_file_system.cpp index 33e4a15c85..c7c1a48e34 100644 --- a/tools/editor/editor_file_system.cpp +++ b/tools/editor/editor_file_system.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,6 +37,31 @@ EditorFileSystem *EditorFileSystem::singleton=NULL; +void EditorFileSystemDirectory::sort_files() { + + files.sort_custom<FileInfoSort>(); +} + +int EditorFileSystemDirectory::find_file_index(const String& p_file) const { + + for(int i=0;i<files.size();i++) { + if (files[i]->file==p_file) + return i; + } + return -1; + +} +int EditorFileSystemDirectory::find_dir_index(const String& p_dir) const{ + + + for(int i=0;i<subdirs.size();i++) { + if (subdirs[i]->name==p_dir) + return i; + } + + return -1; +} + int EditorFileSystemDirectory::get_subdir_count() const { @@ -59,7 +84,7 @@ String EditorFileSystemDirectory::get_file(int p_idx) const{ ERR_FAIL_INDEX_V(p_idx,files.size(),""); - return files[p_idx].file; + return files[p_idx]->file; } String EditorFileSystemDirectory::get_path() const { @@ -91,22 +116,22 @@ String EditorFileSystemDirectory::get_file_path(int p_idx) const { bool EditorFileSystemDirectory::get_file_meta(int p_idx) const { ERR_FAIL_INDEX_V(p_idx,files.size(),""); - return files[p_idx].meta.enabled; + return files[p_idx]->meta.enabled; } Vector<String> EditorFileSystemDirectory::get_file_deps(int p_idx) const { ERR_FAIL_INDEX_V(p_idx,files.size(),Vector<String>()); - return files[p_idx].meta.deps; + return files[p_idx]->meta.deps; } Vector<String> EditorFileSystemDirectory::get_missing_sources(int p_idx) const { ERR_FAIL_INDEX_V(p_idx,files.size(),Vector<String>()); Vector<String> missing; - for(int i=0;i<files[p_idx].meta.sources.size();i++) { - if (files[p_idx].meta.sources[i].missing) - missing.push_back(files[p_idx].meta.sources[i].path); + for(int i=0;i<files[p_idx]->meta.sources.size();i++) { + if (files[p_idx]->meta.sources[i].missing) + missing.push_back(files[p_idx]->meta.sources[i].path); } return missing; @@ -116,8 +141,8 @@ Vector<String> EditorFileSystemDirectory::get_missing_sources(int p_idx) const { bool EditorFileSystemDirectory::is_missing_sources(int p_idx) const { ERR_FAIL_INDEX_V(p_idx,files.size(),false); - for(int i=0;i<files[p_idx].meta.sources.size();i++) { - if (files[p_idx].meta.sources[i].missing) + for(int i=0;i<files[p_idx]->meta.sources.size();i++) { + if (files[p_idx]->meta.sources[i].missing) return true; } @@ -127,7 +152,7 @@ bool EditorFileSystemDirectory::is_missing_sources(int p_idx) const { StringName EditorFileSystemDirectory::get_file_type(int p_idx) const { ERR_FAIL_INDEX_V(p_idx,files.size(),""); - return files[p_idx].type; + return files[p_idx]->type; } String EditorFileSystemDirectory::get_name() { @@ -157,11 +182,17 @@ void EditorFileSystemDirectory::_bind_methods() { EditorFileSystemDirectory::EditorFileSystemDirectory() { + modified_time=0; parent=NULL; } EditorFileSystemDirectory::~EditorFileSystemDirectory() { + for(int i=0;i<files.size();i++) { + + memdelete(files[i]); + } + for(int i=0;i<subdirs.size();i++) { memdelete(subdirs[i]); @@ -173,19 +204,6 @@ EditorFileSystemDirectory::~EditorFileSystemDirectory() { - - -EditorFileSystem::DirItem::~DirItem() { - - for(int i=0;i<dirs.size();i++) { - memdelete(dirs[i]); - } - - for(int i=0;i<files.size();i++) { - memdelete(files[i]); - } -} - EditorFileSystemDirectory::ImportMeta EditorFileSystem::_get_meta(const String& p_path) { Ref<ResourceImportMetadata> imd = ResourceLoader::load_import_metadata(p_path); @@ -214,160 +232,16 @@ EditorFileSystemDirectory::ImportMeta EditorFileSystem::_get_meta(const String& return m; } -EditorFileSystem::DirItem* EditorFileSystem::_scan_dir(DirAccess *da,Set<String> &extensions,String p_name,float p_from,float p_range,const String& p_path,HashMap<String,FileCache> &file_cache,HashMap<String,DirCache> &dir_cache,EditorProgressBG& p_prog) { - if (abort_scan) - return NULL; - - if (p_path!=String()) { - if (FileAccess::exists(("res://"+p_path).plus_file("engine.cfg"))) { - return NULL; - } - } - - List<String> dirs; - List<String> files; - Set<String> pngs; - - String path=p_path; - if (path.ends_with("/")) - path=path.substr(0,path.length()-1); - String global_path = Globals::get_singleton()->get_resource_path().plus_file(path); - - path="res://"+path; - uint64_t mtime = FileAccess::get_modified_time(global_path); - - DirCache *dc = dir_cache.getptr(path); - - - if (false && dc && dc->modification_time==mtime) { - //use the cached files, since directory did not change - for (Set<String>::Element *E=dc->subdirs.front();E;E=E->next()) { - dirs.push_back(E->get()); - } - for (Set<String>::Element *E=dc->files.front();E;E=E->next()) { - files.push_back(E->get()); - } - - } else { - //use the filesystem, some files may have changed - Error err = da->change_dir(global_path); - if (err!=OK) { - print_line("Can't change to: "+path); - ERR_FAIL_COND_V(err!=OK,NULL); - } +void EditorFileSystem::_scan_filesystem() { - - da->list_dir_begin(); - while (true) { - - bool isdir; - String f = da->get_next(&isdir); - if (f=="") - break; - if (isdir) { - dirs.push_back(f); - } else { - String ext = f.extension().to_lower(); - if (extensions.has(ext)) - files.push_back(f); - - } - - } - - da->list_dir_end(); - files.sort(); - dirs.sort(); - - } - - - - //print_line(da->get_current_dir()+": dirs: "+itos(dirs.size())+" files:"+itos(files.size()) ); - - //find subdirs - Vector<DirItem*> subdirs; - - //String current = da->get_current_dir(); - float idx=0; - for (List<String>::Element *E=dirs.front();E;E=E->next(),idx+=1.0) { - - String d = E->get(); - if (d.begins_with(".")) //ignore hidden and . / .. - continue; - - //ERR_CONTINUE( da->change_dir(d)!= OK ); - DirItem *sdi = _scan_dir(da,extensions,d,p_from+(idx/dirs.size())*p_range,p_range/dirs.size(),p_path+d+"/",file_cache,dir_cache,p_prog); - if (sdi) { - subdirs.push_back(sdi); - } - //da->change_dir(current); - } - - - if (subdirs.empty() && files.empty()) { - total=p_from+p_range; - p_prog.step(total*100); - return NULL; //give up, nothing to do here - } - - DirItem *di = memnew( DirItem ); - di->path=path; - di->name=p_name; - di->dirs=subdirs; - di->modified_time=mtime; - - //add files - for (List<String>::Element *E=files.front();E;E=E->next()) { - - SceneItem * si = memnew( SceneItem ); - si->file=E->get(); - si->path="res://"+p_path+si->file; - FileCache *fc = file_cache.getptr(si->path); - uint64_t mt = FileAccess::get_modified_time(si->path); - - if (fc && fc->modification_time == mt) { - - si->meta=fc->meta; - si->type=fc->type; - si->modified_time=fc->modification_time; - } else { - si->meta=_get_meta(si->path); - si->type=ResourceLoader::get_resource_type(si->path); - si->modified_time=mt; - - } - - if (si->meta.enabled) { - md_count++; - if (_check_meta_sources(si->meta)) { - sources_changed.push_back(si->path); - } - } - di->files.push_back(si); - } - - total=p_from+p_range; - p_prog.step(total*100); - - return di; -} - - -void EditorFileSystem::_scan_scenes() { - - ERR_FAIL_COND(!scanning || scandir); + ERR_FAIL_COND(!scanning || new_filesystem); //read .fscache - HashMap<String,FileCache> file_cache; - HashMap<String,DirCache> dir_cache; - DirCache *dc=NULL; String cpath; sources_changed.clear(); - - + file_cache.clear(); String project=Globals::get_singleton()->get_resource_path(); @@ -387,26 +261,7 @@ void EditorFileSystem::_scan_scenes() { ERR_CONTINUE( split.size() != 3); String name = split[1]; - dir_cache[name]=DirCache(); - dc=&dir_cache[name]; - dc->modification_time=split[2].to_int64(); - - if (name!="res://") { - - cpath=name+"/"; - - int sp=name.find_last("/"); - if (sp==5) - sp=6; - String pd = name.substr(0,sp); - DirCache *dcp = dir_cache.getptr(pd); - ERR_CONTINUE(!dcp); - dcp->subdirs.insert(name.get_file()); - } else { - - cpath=name; - } - + cpath=name; } else { Vector<String> split = l.split("::"); @@ -414,12 +269,8 @@ void EditorFileSystem::_scan_scenes() { String name = split[0]; String file; - if (!name.begins_with("res://")) { - file=name; - name=cpath+name; - } else { - file=name.get_file(); - } + file=name; + name=cpath.plus_file(name); FileCache fc; fc.type=split[1]; @@ -453,8 +304,6 @@ void EditorFileSystem::_scan_scenes() { file_cache[name]=fc; - ERR_CONTINUE(!dc); - dc->files.insert(file); } } @@ -465,39 +314,31 @@ void EditorFileSystem::_scan_scenes() { + EditorProgressBG scan_progress("efs","ScanFS",1000); + ScanProgress sp; + sp.low=0; + sp.hi=1; + sp.progress=&scan_progress; - total=0; - DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - //da->change_dir( Globals::get_singleton()->get_resource_path() ); + new_filesystem = memnew( EditorFileSystemDirectory ); + new_filesystem->parent=NULL; + DirAccess *d = DirAccess::create(DirAccess::ACCESS_RESOURCES); + d->change_dir("res://"); + _scan_new_dir(new_filesystem,d,sp); - List<String> extensionsl; - ResourceLoader::get_recognized_extensions_for_type("",&extensionsl); - Set<String> extensions; - for(List<String>::Element *E = extensionsl.front();E;E=E->next()) { + file_cache.clear(); //clear caches, no longer needed - extensions.insert(E->get()); - } - - EditorProgressBG scan_progress("efs","ScanFS",100); - - md_count=0; - scandir=_scan_dir(da,extensions,"",0,1,"",file_cache,dir_cache,scan_progress); - memdelete(da); - if (abort_scan && scandir) { - memdelete(scandir); - scandir=NULL; - - } + memdelete(d); //save back the findings // String fscache = EditorSettings::get_singleton()->get_project_settings_path().plus_file("file_cache"); f=FileAccess::open(fscache,FileAccess::WRITE); - _save_type_cache_fs(scandir,f); + _save_filesystem_cache(new_filesystem,f); f->close(); memdelete(f); @@ -510,7 +351,95 @@ void EditorFileSystem::_scan_scenes() { void EditorFileSystem::_thread_func(void *_userdata) { EditorFileSystem *sd = (EditorFileSystem*)_userdata; - sd->_scan_scenes(); + sd->_scan_filesystem(); + +} + +bool EditorFileSystem::_update_scan_actions() { + + sources_changed.clear(); + + bool fs_changed=false; + + for (List<ItemAction>::Element *E=scan_actions.front();E;E=E->next()) { + + ItemAction&ia = E->get(); + + switch(ia.action) { + case ItemAction::ACTION_NONE: { + + } break; + case ItemAction::ACTION_DIR_ADD: { + + //print_line("*ACTION ADD DIR: "+ia.new_dir->get_name()); + int idx=0; + for(int i=0;i<ia.dir->subdirs.size();i++) { + + if (ia.new_dir->name<ia.dir->subdirs[i]->name) + break; + idx++; + } + if (idx==ia.dir->subdirs.size()) { + ia.dir->subdirs.push_back(ia.new_dir); + } else { + ia.dir->subdirs.insert(idx,ia.new_dir); + } + + fs_changed=true; + } break; + case ItemAction::ACTION_DIR_REMOVE: { + + ERR_CONTINUE(!ia.dir->parent); + //print_line("*ACTION REMOVE DIR: "+ia.dir->get_name()); + ia.dir->parent->subdirs.erase(ia.dir); + memdelete( ia.dir ); + fs_changed=true; + } break; + case ItemAction::ACTION_FILE_ADD: { + + int idx=0; + for(int i=0;i<ia.dir->files.size();i++) { + + if (ia.new_file->file<ia.dir->files[i]->file) + break; + idx++; + } + if (idx==ia.dir->files.size()) { + ia.dir->files.push_back(ia.new_file); + } else { + ia.dir->files.insert(idx,ia.new_file); + } + + fs_changed=true; + //print_line("*ACTION ADD FILE: "+ia.new_file->file); + + } break; + case ItemAction::ACTION_FILE_REMOVE: { + + int idx = ia.dir->find_file_index(ia.file); + ERR_CONTINUE(idx==-1); + memdelete( ia.dir->files[idx] ); + ia.dir->files.remove(idx); + + fs_changed=true; + //print_line("*ACTION REMOVE FILE: "+ia.file); + + } break; + case ItemAction::ACTION_FILE_SOURCES_CHANGED: { + + int idx = ia.dir->find_file_index(ia.file); + ERR_CONTINUE(idx==-1); + String full_path = ia.dir->get_file_path(idx); + sources_changed.push_back(full_path); + + } break; + + } + } + + scan_actions.clear(); + + return fs_changed; } @@ -526,19 +455,15 @@ void EditorFileSystem::scan() { abort_scan=false; if (!use_threads) { scanning=true; - _scan_scenes(); - if (rootdir) - memdelete(rootdir); - rootdir=scandir; + scan_total=0; + _scan_filesystem(); if (filesystem) memdelete(filesystem); // file_type_cache.clear(); - filesystem=_update_tree(rootdir); - - if (rootdir) - memdelete(rootdir); - rootdir=NULL; - scanning=false; + filesystem=new_filesystem; + new_filesystem=NULL; + _update_scan_actions(); + scanning=false; emit_signal("filesystem_changed"); emit_signal("sources_changed",sources_changed.size()>0); @@ -548,6 +473,7 @@ void EditorFileSystem::scan() { set_process(true); Thread::Settings s; scanning=true; + scan_total=0; s.priority=Thread::PRIORITY_LOW; thread = Thread::create(_thread_func,this,s); //tree->hide(); @@ -559,14 +485,10 @@ void EditorFileSystem::scan() { } -bool EditorFileSystem::_check_meta_sources(EditorFileSystemDirectory::ImportMeta & p_meta,EditorProgressBG *ep) { +bool EditorFileSystem::_check_meta_sources(EditorFileSystemDirectory::ImportMeta & p_meta) { if (p_meta.enabled) { - if (ep) { - ep->step(ss_amount++); - } - for(int j=0;j<p_meta.sources.size();j++) { @@ -584,9 +506,9 @@ bool EditorFileSystem::_check_meta_sources(EditorFileSystemDirectory::ImportMeta if (mt!=p_meta.sources[j].modified_time) { //scan String md5 = FileAccess::get_md5(src); - print_line("checking: "+src); - print_line("md5: "+md5); - print_line("vs: "+p_meta.sources[j].md5); + //print_line("checking: "+src); + //print_line("md5: "+md5); + //print_line("vs: "+p_meta.sources[j].md5); if (md5!=p_meta.sources[j].md5) { //really changed return true; @@ -599,18 +521,300 @@ bool EditorFileSystem::_check_meta_sources(EditorFileSystemDirectory::ImportMeta return false; } -void EditorFileSystem::_scan_sources(EditorFileSystemDirectory *p_dir,EditorProgressBG *ep) { +void EditorFileSystem::ScanProgress::update(int p_current,int p_total) const { + + float ratio = low + ((hi-low)/p_total)*p_current; + progress->step(ratio*1000); + EditorFileSystem::singleton->scan_total=ratio; +} + +EditorFileSystem::ScanProgress EditorFileSystem::ScanProgress::get_sub(int p_current,int p_total) const{ + + ScanProgress sp=*this; + float slice = (sp.hi-sp.low)/p_total; + sp.low+=slice*p_current; + sp.hi=slice; + return sp; + + +} + + +void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir,DirAccess *da,const ScanProgress& p_progress) { + + List<String> dirs; + List<String> files; + + String cd = da->get_current_dir(); + + p_dir->modified_time = FileAccess::get_modified_time(cd); + + + da->list_dir_begin(); + while (true) { + + bool isdir; + String f = da->get_next(&isdir); + if (f=="") + break; + + if (isdir) { + + if (f.begins_with(".")) //ignore hidden and . / .. + continue; + + if (FileAccess::exists(cd.plus_file(f).plus_file("engine.cfg"))) // skip if another project inside this + continue; + + dirs.push_back(f); + + } else { + + files.push_back(f); + } + + } + + da->list_dir_end(); + + dirs.sort(); + files.sort(); + + int total = dirs.size()+files.size(); + int idx=0; + + for (List<String>::Element *E=dirs.front();E;E=E->next(),idx++) { + + if (da->change_dir(E->get())==OK) { + + EditorFileSystemDirectory *efd = memnew( EditorFileSystemDirectory ); + + efd->parent=p_dir; + efd->name=E->get(); + + _scan_new_dir(efd,da,p_progress.get_sub(idx,total)); + + int idx=0; + for(int i=0;i<p_dir->subdirs.size();i++) { + + if (efd->name<p_dir->subdirs[i]->name) + break; + idx++; + } + if (idx==p_dir->subdirs.size()) { + p_dir->subdirs.push_back(efd); + } else { + p_dir->subdirs.insert(idx,efd); + } + + da->change_dir(".."); + } else { + ERR_PRINTS("Can't go into subdir: "+E->get()); + } + + p_progress.update(idx,total); + + } + + for (List<String>::Element*E=files.front();E;E=E->next(),idx++) { + + String ext = E->get().extension().to_lower(); + if (!valid_extensions.has(ext)) + continue; //invalid + + EditorFileSystemDirectory::FileInfo *fi = memnew( EditorFileSystemDirectory::FileInfo ); + fi->file=E->get(); + + String path = cd.plus_file(fi->file); + + FileCache *fc = file_cache.getptr(path); + uint64_t mt = FileAccess::get_modified_time(path); + + if (fc && fc->modification_time == mt) { + + fi->meta=fc->meta; + fi->type=fc->type; + fi->modified_time=fc->modification_time; + } else { + fi->meta=_get_meta(path); + fi->type=ResourceLoader::get_resource_type(path); + fi->modified_time=mt; + + } + + if (fi->meta.enabled) { + if (_check_meta_sources(fi->meta)) { + ItemAction ia; + ia.action=ItemAction::ACTION_FILE_SOURCES_CHANGED; + ia.dir=p_dir; + ia.file=E->get(); + scan_actions.push_back(ia); + } + } + + p_dir->files.push_back(fi); + p_progress.update(idx,total); + } + +} + + +void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir,const ScanProgress& p_progress) { + + uint64_t current_mtime = FileAccess::get_modified_time(p_dir->get_path()); + + bool updated_dir=false; + + //print_line("dir: "+p_dir->get_path()+" MODTIME: "+itos(p_dir->modified_time)+" CTIME: "+itos(current_mtime)); + + if (current_mtime!=p_dir->modified_time) { + + updated_dir=true; + p_dir->modified_time=current_mtime; + //ooooops, dir changed, see what's going on + + //first mark everything as veryfied + + for(int i=0;i<p_dir->files.size();i++) { + + p_dir->files[i]->verified=false; + } + + for(int i=0;i<p_dir->subdirs.size();i++) { + + p_dir->get_subdir(i)->verified=false; + } + + //then scan files and directories and check what's different + + DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); + String cd = p_dir->get_path(); + da->change_dir(cd); + da->list_dir_begin(); + while (true) { + + bool isdir; + String f = da->get_next(&isdir); + if (f=="") + break; + + if (isdir) { + + if (f.begins_with(".")) //ignore hidden and . / .. + continue; + + int idx = p_dir->find_dir_index(f); + if (idx==-1) { + + if (FileAccess::exists(cd.plus_file(f).plus_file("engine.cfg"))) // skip if another project inside this + continue; + + EditorFileSystemDirectory *efd = memnew( EditorFileSystemDirectory ); + + efd->parent=p_dir; + efd->name=f; + DirAccess *d = DirAccess::create(DirAccess::ACCESS_RESOURCES); + d->change_dir(cd.plus_file(f)); + _scan_new_dir(efd,d,p_progress.get_sub(1,1)); + memdelete(d); + + + ItemAction ia; + ia.action=ItemAction::ACTION_DIR_ADD; + ia.dir=p_dir; + ia.file=f; + ia.new_dir=efd; + scan_actions.push_back(ia); + } else { + p_dir->subdirs[idx]->verified=true; + } + + + } else { + String ext = f.extension().to_lower(); + if (!valid_extensions.has(ext)) + continue; //invalid + + int idx = p_dir->find_file_index(f); + + if (idx==-1) { + //never seen this file, add actition to add it + EditorFileSystemDirectory::FileInfo *fi = memnew( EditorFileSystemDirectory::FileInfo ); + fi->file=f; + + String path = cd.plus_file(fi->file); + fi->modified_time=FileAccess::get_modified_time(path); + fi->meta=_get_meta(path); + fi->type=ResourceLoader::get_resource_type(path); + + { + ItemAction ia; + ia.action=ItemAction::ACTION_FILE_ADD; + ia.dir=p_dir; + ia.file=f; + ia.new_file=fi; + scan_actions.push_back(ia); + } + + //take the chance and scan sources + if (_check_meta_sources(fi->meta)) { + + ItemAction ia; + ia.action=ItemAction::ACTION_FILE_SOURCES_CHANGED; + ia.dir=p_dir; + ia.file=f; + scan_actions.push_back(ia); + } + + } else { + p_dir->files[idx]->verified=true; + } + + + } + + } + da->list_dir_end(); + memdelete(da); + + + + + } for(int i=0;i<p_dir->files.size();i++) { - if (_check_meta_sources(p_dir->files[i].meta,ep)) { - sources_changed.push_back(p_dir->get_file_path(i)); + if (updated_dir && !p_dir->files[i]->verified) { + //this file was removed, add action to remove it + ItemAction ia; + ia.action=ItemAction::ACTION_FILE_REMOVE; + ia.dir=p_dir; + ia.file=p_dir->files[i]->file; + scan_actions.push_back(ia); + continue; + + } + if (_check_meta_sources(p_dir->files[i]->meta)) { + ItemAction ia; + ia.action=ItemAction::ACTION_FILE_SOURCES_CHANGED; + ia.dir=p_dir; + ia.file=p_dir->files[i]->file; + scan_actions.push_back(ia); } } for(int i=0;i<p_dir->subdirs.size();i++) { - _scan_sources(p_dir->get_subdir(i),ep); + if (updated_dir && !p_dir->subdirs[i]->verified) { + //this directory was removed, add action to remove it + ItemAction ia; + ia.action=ItemAction::ACTION_DIR_REMOVE; + ia.dir=p_dir->subdirs[i]; + scan_actions.push_back(ia); + continue; + + } + _scan_fs_changes(p_dir->get_subdir(i),p_progress); } } @@ -619,9 +823,12 @@ void EditorFileSystem::_thread_func_sources(void *_userdata) { EditorFileSystem *efs = (EditorFileSystem*)_userdata; if (efs->filesystem) { - EditorProgressBG pr("sources","ScanSources",efs->md_count); - efs->ss_amount=0; - efs->_scan_sources(efs->filesystem,&pr); + EditorProgressBG pr("sources","ScanSources",1000); + ScanProgress sp; + sp.progress=≺ + sp.hi=1; + sp.low=0; + efs->_scan_fs_changes(efs->filesystem,sp); } efs->scanning_sources_done=true; } @@ -643,8 +850,17 @@ void EditorFileSystem::scan_sources() { abort_scan=false; if (!use_threads) { - if (filesystem) - _scan_sources(filesystem,NULL); + if (filesystem) { + EditorProgressBG pr("sources","ScanSources",1000); + ScanProgress sp; + sp.progress=≺ + sp.hi=1; + sp.low=0; + scan_total=0; + _scan_fs_changes(filesystem,sp); + if (_update_scan_actions()) + emit_signal("filesystem_changed"); + } scanning_sources=false; scanning_sources_done=true; emit_signal("sources_changed",sources_changed.size()>0); @@ -652,8 +868,8 @@ void EditorFileSystem::scan_sources() { ERR_FAIL_COND(thread_sources); set_process(true); + scan_total=0; Thread::Settings s; - ss_amount=0; s.priority=Thread::PRIORITY_LOW; thread_sources = Thread::create(_thread_func_sources,this,s); //tree->hide(); @@ -665,53 +881,14 @@ void EditorFileSystem::scan_sources() { } -EditorFileSystemDirectory* EditorFileSystem::_update_tree(DirItem *p_item) { - - EditorFileSystemDirectory *efd = memnew( EditorFileSystemDirectory ); - - if (!p_item) - return efd; //empty likely - efd->name=p_item->name; - - for(int i=0;i<p_item->files.size();i++) { - - String s = p_item->files[i]->type; - //if (p_item->files[i]->meta) - // s="*"+s; - -// file_type_cache[p_item->files[i]->path]=s; - if (p_item->files[i]->type=="") - continue; //ignore because it's invalid - EditorFileSystemDirectory::FileInfo fi; - fi.file=p_item->files[i]->file; - fi.type=p_item->files[i]->type; - fi.meta=p_item->files[i]->meta; - fi.modified_time=p_item->files[i]->modified_time; - - efd->files.push_back(fi); - - } - - for(int i=0;i<p_item->dirs.size();i++) { - - EditorFileSystemDirectory *efsd =_update_tree(p_item->dirs[i]); - efsd->parent=efd; - efd->subdirs.push_back( efsd ); - - } - - - return efd; -} - void EditorFileSystem::_notification(int p_what) { switch(p_what) { case NOTIFICATION_ENTER_TREE: { - _load_type_cache(); - scan(); + + scan(); } break; case NOTIFICATION_EXIT_TREE: { if (use_threads && thread) { @@ -727,13 +904,13 @@ void EditorFileSystem::_notification(int p_what) { set_process(false); } - if (rootdir) - memdelete(rootdir); - rootdir=NULL; if (filesystem) memdelete(filesystem); + if (new_filesystem) + memdelete(new_filesystem); filesystem=NULL; + new_filesystem=NULL; } break; case NOTIFICATION_PROCESS: { @@ -751,6 +928,8 @@ void EditorFileSystem::_notification(int p_what) { Thread::wait_to_finish(thread_sources); memdelete(thread_sources); thread_sources=NULL; + if (_update_scan_actions()) + emit_signal("filesystem_changed"); //print_line("sources changed: "+itos(sources_changed.size())); emit_signal("sources_changed",sources_changed.size()>0); } @@ -758,21 +937,14 @@ void EditorFileSystem::_notification(int p_what) { set_process(false); - if (rootdir) - memdelete(rootdir); if (filesystem) memdelete(filesystem); - rootdir=scandir; - scandir=NULL; -// file_type_cache.clear(); - filesystem=_update_tree(rootdir); - - if (rootdir) - memdelete(rootdir); - rootdir=NULL; + filesystem=new_filesystem; + new_filesystem=NULL; Thread::wait_to_finish(thread); memdelete(thread); thread=NULL; + _update_scan_actions(); emit_signal("filesystem_changed"); emit_signal("sources_changed",sources_changed.size()>0); //print_line("initial sources changed: "+itos(sources_changed.size())); @@ -794,7 +966,7 @@ bool EditorFileSystem::is_scanning() const { } float EditorFileSystem::get_scanning_progress() const { - return total; + return scan_total; } EditorFileSystemDirectory *EditorFileSystem::get_filesystem() { @@ -802,12 +974,12 @@ EditorFileSystemDirectory *EditorFileSystem::get_filesystem() { return filesystem; } -void EditorFileSystem::_save_type_cache_fs(DirItem *p_dir,FileAccess *p_file) { +void EditorFileSystem::_save_filesystem_cache(EditorFileSystemDirectory*p_dir,FileAccess *p_file) { if (!p_dir) return; //none - p_file->store_line("::"+p_dir->path+"::"+String::num(p_dir->modified_time)); + p_file->store_line("::"+p_dir->get_path()+"::"+String::num(p_dir->modified_time)); for(int i=0;i<p_dir->files.size();i++) { @@ -832,126 +1004,96 @@ void EditorFileSystem::_save_type_cache_fs(DirItem *p_dir,FileAccess *p_file) { p_file->store_line(s); } - for(int i=0;i<p_dir->dirs.size();i++) { + for(int i=0;i<p_dir->subdirs.size();i++) { - _save_type_cache_fs(p_dir->dirs[i],p_file); + _save_filesystem_cache(p_dir->subdirs[i],p_file); } } -void EditorFileSystem::_load_type_cache(){ - - GLOBAL_LOCK_FUNCTION - - -#if 0 - //this is not good, removed for now as it interferes with metadata stored in files - - String project=Globals::get_singleton()->get_resource_path(); - FileAccess *f =FileAccess::open(project+"/types.cache",FileAccess::READ); - - if (!f) { - - WARN_PRINT("Can't open types.cache."); - return; - } - - file_type_cache.clear(); - while(!f->eof_reached()) { - - String path=f->get_line(); - if (f->eof_reached()) - break; - String type=f->get_line(); - file_type_cache[path]=type; - } - - memdelete(f); -#endif -} bool EditorFileSystem::_find_file(const String& p_file,EditorFileSystemDirectory ** r_d, int &r_file_pos) const { //todo make faster - if (!filesystem || scanning) - return false; + if (!filesystem || scanning) + return false; - String f = Globals::get_singleton()->localize_path(p_file); + String f = Globals::get_singleton()->localize_path(p_file); - if (!f.begins_with("res://")) - return false; - f=f.substr(6,f.length()); - f=f.replace("\\","/"); + if (!f.begins_with("res://")) + return false; + f=f.substr(6,f.length()); + f=f.replace("\\","/"); - Vector<String> path = f.split("/"); + Vector<String> path = f.split("/"); - if (path.size()==0) - return false; - String file=path[path.size()-1]; - path.resize(path.size()-1); + if (path.size()==0) + return false; + String file=path[path.size()-1]; + path.resize(path.size()-1); - EditorFileSystemDirectory *fs=filesystem; + EditorFileSystemDirectory *fs=filesystem; - for(int i=0;i<path.size();i++) { + for(int i=0;i<path.size();i++) { - int idx=-1; - for(int j=0;j<fs->get_subdir_count();j++) { + int idx=-1; + for(int j=0;j<fs->get_subdir_count();j++) { - if (fs->get_subdir(j)->get_name()==path[i]) { - idx=j; - break; - } - } + if (fs->get_subdir(j)->get_name()==path[i]) { + idx=j; + break; + } + } - if (idx==-1) { - //does not exist, create i guess? - EditorFileSystemDirectory *efsd = memnew( EditorFileSystemDirectory ); - efsd->name=path[i]; - int idx2=0; - for(int j=0;j<fs->get_subdir_count();j++) { + if (idx==-1) { + //does not exist, create i guess? + EditorFileSystemDirectory *efsd = memnew( EditorFileSystemDirectory ); + efsd->name=path[i]; + int idx2=0; + for(int j=0;j<fs->get_subdir_count();j++) { - if (efsd->name<fs->get_subdir(j)->get_name()) - break; - idx2++; - } + if (efsd->name<fs->get_subdir(j)->get_name()) + break; + idx2++; + } - if (idx2==fs->get_subdir_count()) - fs->subdirs.push_back(efsd); - else - fs->subdirs.insert(idx2,efsd); - fs=efsd; - } else { + if (idx2==fs->get_subdir_count()) + fs->subdirs.push_back(efsd); + else + fs->subdirs.insert(idx2,efsd); + fs=efsd; + } else { - fs=fs->get_subdir(idx); + fs=fs->get_subdir(idx); + } } - } - int cpos=-1; - for(int i=0;i<fs->files.size();i++) { + int cpos=-1; + for(int i=0;i<fs->files.size();i++) { - if (fs->files[i].file==file) { - cpos=i; - break; + if (fs->files[i]->file==file) { + cpos=i; + break; + } } - } r_file_pos=cpos; *r_d=fs; - if (cpos!=-1) { + if (cpos!=-1) { - return true; - } else { + return true; + } else { - return false; - } + return false; + } } @@ -967,7 +1109,7 @@ String EditorFileSystem::get_file_type(const String& p_file) const { } - return fs->files[cpos].type; + return fs->files[cpos]->type; } @@ -1024,16 +1166,16 @@ EditorFileSystemDirectory *EditorFileSystem::get_path(const String& p_path) { void EditorFileSystem::_resource_saved(const String& p_path){ - print_line("resource saved: "+p_path); + //print_line("resource saved: "+p_path); EditorFileSystem::get_singleton()->update_file(p_path); } String EditorFileSystem::_find_first_from_source(EditorFileSystemDirectory* p_dir,const String &p_src) const { for(int i=0;i<p_dir->files.size();i++) { - for(int j=0;j<p_dir->files[i].meta.sources.size();j++) { + for(int j=0;j<p_dir->files[i]->meta.sources.size();j++) { - if (p_dir->files[i].meta.sources[j].path==p_src) + if (p_dir->files[i]->meta.sources[j].path==p_src) return p_dir->get_file_path(i); } } @@ -1070,6 +1212,7 @@ void EditorFileSystem::update_file(const String& p_file) { if (!FileAccess::exists(p_file)) { //was removed + memdelete( fs->files[cpos] ); fs->files.remove(cpos); call_deferred("emit_signal","filesystem_changed"); //update later return; @@ -1083,13 +1226,13 @@ void EditorFileSystem::update_file(const String& p_file) { int idx=0; for(int i=0;i<fs->files.size();i++) { - if (p_file<fs->files[i].file) + if (p_file<fs->files[i]->file) break; idx++; } - EditorFileSystemDirectory::FileInfo fi; - fi.file=p_file.get_file(); + EditorFileSystemDirectory::FileInfo *fi = memnew( EditorFileSystemDirectory::FileInfo ); + fi->file=p_file.get_file(); if (idx==fs->files.size()) { fs->files.push_back(fi); @@ -1102,10 +1245,10 @@ void EditorFileSystem::update_file(const String& p_file) { } - print_line("UPDATING: "+p_file); - fs->files[cpos].type=type; - fs->files[cpos].modified_time=FileAccess::get_modified_time(p_file); - fs->files[cpos].meta=_get_meta(p_file); + //print_line("UPDATING: "+p_file); + fs->files[cpos]->type=type; + fs->files[cpos]->modified_time=FileAccess::get_modified_time(p_file); + fs->files[cpos]->meta=_get_meta(p_file); call_deferred("emit_signal","filesystem_changed"); //update later @@ -1128,15 +1271,22 @@ EditorFileSystem::EditorFileSystem() { thread = NULL; scanning=false; - scandir=NULL; - rootdir=NULL; use_threads=true; thread_sources=NULL; + new_filesystem=NULL; scanning_sources=false; ResourceSaver::set_save_callback(_resource_saved); + List<String> extensionsl; + ResourceLoader::get_recognized_extensions_for_type("",&extensionsl); + for(List<String>::Element *E = extensionsl.front();E;E=E->next()) { + + valid_extensions.insert(E->get()); + } + + scan_total=0; } EditorFileSystem::~EditorFileSystem() { diff --git a/tools/editor/editor_file_system.h b/tools/editor/editor_file_system.h index f79dd209ef..d11fa0cfb1 100644 --- a/tools/editor/editor_file_system.h +++ b/tools/editor/editor_file_system.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,6 +42,8 @@ class EditorFileSystemDirectory : public Object { OBJ_TYPE( EditorFileSystemDirectory,Object ); String name; + uint64_t modified_time; + bool verified; //used for checking changes EditorFileSystemDirectory *parent; Vector<EditorFileSystemDirectory*> subdirs; @@ -68,11 +70,20 @@ class EditorFileSystemDirectory : public Object { String file; StringName type; uint64_t modified_time; - ImportMeta meta; + bool verified; //used for checking changes + + }; + + struct FileInfoSort { + bool operator()(const FileInfo *p_a,const FileInfo *p_b) const { + return p_a->file<p_b->file; + } }; - Vector<FileInfo> files; + void sort_files(); + + Vector<FileInfo*> files; static void _bind_methods(); @@ -96,6 +107,9 @@ public: EditorFileSystemDirectory *get_parent(); + int find_file_index(const String& p_file) const; + int find_dir_index(const String& p_dir) const; + EditorFileSystemDirectory(); ~EditorFileSystemDirectory(); @@ -107,45 +121,47 @@ class EditorFileSystem : public Node { _THREAD_SAFE_CLASS_ - struct SceneItem { + + struct ItemAction { + + enum Action { + ACTION_NONE, + ACTION_DIR_ADD, + ACTION_DIR_REMOVE, + ACTION_FILE_ADD, + ACTION_FILE_REMOVE, + ACTION_FILE_SOURCES_CHANGED + }; + + Action action; + EditorFileSystemDirectory *dir; String file; - String path; - String type; - uint64_t modified_time; - EditorFileSystemDirectory::ImportMeta meta; - }; + EditorFileSystemDirectory *new_dir; + EditorFileSystemDirectory::FileInfo *new_file; - struct DirItem { + ItemAction() { action=ACTION_NONE; dir=NULL; new_dir=NULL; new_file=NULL; } - uint64_t modified_time; - String path; - String name; - Vector<DirItem*> dirs; - Vector<SceneItem*> files; - ~DirItem(); }; - float total; bool use_threads; Thread *thread; static void _thread_func(void *_userdata); - DirItem *scandir; - DirItem *rootdir; + EditorFileSystemDirectory *new_filesystem; bool abort_scan; bool scanning; + float scan_total; - EditorFileSystemDirectory* _update_tree(DirItem *p_item); - void _scan_scenes(); - void _load_type_cache(); + void _scan_filesystem(); EditorFileSystemDirectory *filesystem; static EditorFileSystem *singleton; + /* Used for reading the filesystem cache file */ struct FileCache { String type; @@ -154,34 +170,43 @@ class EditorFileSystem : public Node { Vector<String> deps; }; - struct DirCache { + HashMap<String,FileCache> file_cache; - uint64_t modification_time; - Set<String> files; - Set<String> subdirs; - }; + struct ScanProgress { + float low; + float hi; + mutable EditorProgressBG *progress; + void update(int p_current,int p_total) const; + ScanProgress get_sub(int p_current,int p_total) const; + }; static EditorFileSystemDirectory::ImportMeta _get_meta(const String& p_path); - bool _check_meta_sources(EditorFileSystemDirectory::ImportMeta & p_meta,EditorProgressBG *ep=NULL); + bool _check_meta_sources(EditorFileSystemDirectory::ImportMeta & p_meta); - DirItem* _scan_dir(DirAccess *da,Set<String> &extensions,String p_name,float p_from,float p_range,const String& p_path,HashMap<String,FileCache> &file_cache,HashMap<String,DirCache> &dir_cache,EditorProgressBG& p_prog); - void _save_type_cache_fs(DirItem *p_dir,FileAccess *p_file); + void _save_filesystem_cache(EditorFileSystemDirectory *p_dir,FileAccess *p_file); bool _find_file(const String& p_file,EditorFileSystemDirectory ** r_d, int &r_file_pos) const; - void _scan_sources(EditorFileSystemDirectory *p_dir,EditorProgressBG *ep); + void _scan_fs_changes(EditorFileSystemDirectory *p_dir, const ScanProgress &p_progress); int md_count; + Set<String> valid_extensions; + + void _scan_new_dir(EditorFileSystemDirectory *p_dir,DirAccess *da,const ScanProgress& p_progress); Thread *thread_sources; bool scanning_sources; bool scanning_sources_done; - int ss_amount; + static void _thread_func_sources(void *_userdata); + List<String> sources_changed; + List<ItemAction> scan_actions; + + bool _update_scan_actions(); static void _resource_saved(const String& p_path); String _find_first_from_source(EditorFileSystemDirectory* p_dir,const String &p_src) const; diff --git a/tools/editor/editor_fonts.cpp b/tools/editor/editor_fonts.cpp index f145f1ddef..b12b041f16 100644 --- a/tools/editor/editor_fonts.cpp +++ b/tools/editor/editor_fonts.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_fonts.h b/tools/editor/editor_fonts.h index cc990a560c..3b2422c3e3 100644 --- a/tools/editor/editor_fonts.h +++ b/tools/editor/editor_fonts.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp index 1905ab731f..2ece518f8d 100644 --- a/tools/editor/editor_help.cpp +++ b/tools/editor/editor_help.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_help.h b/tools/editor/editor_help.h index 04ac4d35ff..059a7ae11d 100644 --- a/tools/editor/editor_help.h +++ b/tools/editor/editor_help.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_icons.h b/tools/editor/editor_icons.h index 910febc895..191b908682 100644 --- a/tools/editor/editor_icons.h +++ b/tools/editor/editor_icons.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp index c50a95a93d..5203ace125 100644 --- a/tools/editor/editor_import_export.cpp +++ b/tools/editor/editor_import_export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -455,6 +455,9 @@ bool EditorExportPlatformPC::_set(const StringName& p_name, const Variant& p_val } else if (n=="resources/pack_mode") { export_mode=ExportMode(int(p_value)); + } else if (n=="resources/bundle_dependencies_(for_optical_disc)") { + + bundle=p_value; } else if (n=="binary/64_bits") { use64=p_value; @@ -478,6 +481,9 @@ bool EditorExportPlatformPC::_get(const StringName& p_name,Variant &r_ret) const } else if (n=="resources/pack_mode") { r_ret=export_mode; + } else if (n=="resources/bundle_dependencies_(for_optical_disc)") { + + r_ret=bundle; } else if (n=="binary/64_bits") { r_ret=use64; @@ -492,7 +498,8 @@ void EditorExportPlatformPC::_get_property_list( List<PropertyInfo> *p_list) con p_list->push_back( PropertyInfo( Variant::STRING, "custom_binary/debug", PROPERTY_HINT_GLOBAL_FILE,binary_extension)); p_list->push_back( PropertyInfo( Variant::STRING, "custom_binary/release", PROPERTY_HINT_GLOBAL_FILE,binary_extension)); - p_list->push_back( PropertyInfo( Variant::INT, "resources/pack_mode", PROPERTY_HINT_ENUM,"Single Exec.,Exec+Pack (.pck),Copy,Bundles (Optical)")); + p_list->push_back( PropertyInfo( Variant::INT, "resources/pack_mode", PROPERTY_HINT_ENUM,"Pack into executable,Pack into binary file (.pck),Pack into archive file (.zip)")); + p_list->push_back( PropertyInfo( Variant::BOOL, "resources/bundle_dependencies_(for_optical_disc)")); p_list->push_back( PropertyInfo( Variant::BOOL, "binary/64_bits")); } @@ -1274,26 +1281,32 @@ Error EditorExportPlatformPC::export_project(const String& p_path, bool p_debug, } } + String dstfile = p_path.replace_first("res://","").replace("\\","/"); if (export_mode!=EXPORT_EXE) { - String dstfile=p_path.replace_first("res://","").replace("\\","/"); + String dstfile_extension=export_mode==EXPORT_ZIP?".zip":".pck"; if (dstfile.find("/")!=-1) - dstfile=dstfile.get_base_dir()+"/data.pck"; + dstfile=dstfile.get_base_dir()+"/data"+dstfile_extension; else - dstfile="data.pck"; + dstfile="data"+dstfile_extension; + if (export_mode==EXPORT_PACK) { + + memdelete(dst); - memdelete(dst); - dst=FileAccess::open(dstfile,FileAccess::WRITE); - if (!dst) { + dst=FileAccess::open(dstfile,FileAccess::WRITE); + if (!dst) { - EditorNode::add_io_error("Can't write data pack to:\n "+p_path); - return ERR_FILE_CANT_WRITE; + EditorNode::add_io_error("Can't write data pack to:\n "+p_path); + return ERR_FILE_CANT_WRITE; + } } } + + memdelete(src_exe); - Error err = save_pack(dst,export_mode==EXPORT_BUNDLES); + Error err = export_mode==EXPORT_ZIP?save_zip(dstfile,bundle):save_pack(dst,bundle); memdelete(dst); return err; } @@ -1836,6 +1849,15 @@ void EditorImportExport::load_config() { if (cf->has_section("convert_samples")) { + if (cf->has_section_key("convert_samples","action")) { + String action = cf->get_value("convert_samples","action"); + if (action=="none") { + sample_action=SAMPLE_ACTION_NONE; + } else if (action=="compress_ram") { + sample_action=SAMPLE_ACTION_COMPRESS_RAM; + } + } + if (cf->has_section_key("convert_samples","max_hz")) sample_action_max_hz=cf->get_value("convert_samples","max_hz"); diff --git a/tools/editor/editor_import_export.h b/tools/editor/editor_import_export.h index 940a41bafd..1a0686fb50 100644 --- a/tools/editor/editor_import_export.h +++ b/tools/editor/editor_import_export.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -175,8 +175,7 @@ public: enum ExportMode { EXPORT_EXE, EXPORT_PACK, - EXPORT_COPY, - EXPORT_BUNDLES + EXPORT_ZIP }; @@ -198,6 +197,7 @@ private: Ref<Texture> logo; ExportMode export_mode; + bool bundle; protected: bool _set(const StringName& p_name, const Variant& p_value); diff --git a/tools/editor/editor_log.cpp b/tools/editor/editor_log.cpp index 264117eecd..601e53eabb 100644 --- a/tools/editor/editor_log.cpp +++ b/tools/editor/editor_log.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -243,7 +243,7 @@ EditorLog::EditorLog() { log->set_selection_enabled(true); log->set_focus_mode(FOCUS_CLICK); pc->add_child(log); - add_message(VERSION_FULL_NAME" (c) 2008-2015 Juan Linietsky, Ariel Manzur."); + add_message(VERSION_FULL_NAME" (c) 2008-2016 Juan Linietsky, Ariel Manzur."); //log->add_text("Initialization Complete.\n"); //because it looks cool. add_style_override("panel",get_stylebox("panelf","Panel")); diff --git a/tools/editor/editor_log.h b/tools/editor/editor_log.h index 93044f9a2d..d7d46b70d3 100644 --- a/tools/editor/editor_log.h +++ b/tools/editor/editor_log.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_name_dialog.cpp b/tools/editor/editor_name_dialog.cpp index 82050e0a56..c221b908e0 100644 --- a/tools/editor/editor_name_dialog.cpp +++ b/tools/editor/editor_name_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_name_dialog.h b/tools/editor/editor_name_dialog.h index 85f4f772e6..9e66908899 100644 --- a/tools/editor/editor_name_dialog.h +++ b/tools/editor/editor_name_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index b30c875866..d664a91c47 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -143,6 +143,7 @@ void EditorNode::_update_scene_tabs() { } scene_tabs->set_current_tab(editor_data.get_edited_scene()); + scene_tabs->ensure_tab_visible(editor_data.get_edited_scene()); } @@ -415,7 +416,7 @@ void EditorNode::_rebuild_import_menu() { PopupMenu* p = import_menu->get_popup(); p->clear(); - p->add_item("Sub-Scene", FILE_IMPORT_SUBSCENE); + p->add_item("Node from scene", FILE_IMPORT_SUBSCENE); p->add_separator(); for (int i = 0; i < editor_import_export->get_import_plugin_count(); i++) { p->add_item(editor_import_export->get_import_plugin(i)->get_visible_name(), IMPORT_PLUGIN_BASE + i); @@ -511,13 +512,21 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource) { file->set_mode(EditorFileDialog::MODE_SAVE_FILE); bool relpaths = (p_resource->has_meta("__editor_relpaths__") && p_resource->get_meta("__editor_relpaths__").operator bool()); + current_option=RESOURCE_SAVE_AS; List<String> extensions; Ref<PackedScene> sd = memnew( PackedScene ); ResourceSaver::get_recognized_extensions(p_resource,&extensions); file->clear_filters(); + + List<String> preferred; for(int i=0;i<extensions.size();i++) { + if (p_resource->is_type("Script") && (extensions[i]=="tres" || extensions[i]=="res" || extensions[i]=="xml")) { + //this serves no purpose and confused people + continue; + } file->add_filter("*."+extensions[i]+" ; "+extensions[i].to_upper()); + preferred.push_back(extensions[i]); } //file->set_current_path(current_path); @@ -529,11 +538,11 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource) { file->set_current_path(p_resource->get_path().replacen("."+ext,"."+extensions.front()->get())); } } - } else { + } else if (preferred.size()) { String existing; if (extensions.size()) { - existing="new_"+p_resource->get_type().to_lower()+"."+extensions.front()->get().to_lower(); + existing="new_"+p_resource->get_type().to_lower()+"."+preferred.front()->get().to_lower(); } file->set_current_path(existing); @@ -584,59 +593,66 @@ void EditorNode::_dialog_display_file_error(String p_file,Error p_error) { } -void EditorNode::_get_scene_metadata() { +void EditorNode::_get_scene_metadata(const String& p_file) { Node *scene = editor_data.get_edited_scene_root(); if (!scene) return; + String path = EditorSettings::get_singleton()->get_project_settings_path().plus_file(p_file.get_file()+"-editstate-"+p_file.md5_text()+".cfg"); - if (scene->has_meta("__editor_plugin_states__")) { + Ref<ConfigFile> cf; + cf.instance(); - Dictionary md = scene->get_meta("__editor_plugin_states__"); - editor_data.set_editor_states(md); + Error err = cf->load(path); + if (err!=OK) + return; //must not exist - } + List<String> esl; + cf->get_section_keys("editor_states",&esl); - if (scene->has_meta("__editor_run_settings__")) { + Dictionary md; + for (List<String>::Element *E=esl.front();E;E=E->next()) { - Dictionary md = scene->get_meta("__editor_run_settings__"); - if (md.has("run_mode")) - run_settings_dialog->set_run_mode(md["run_mode"]); - if (md.has("custom_args")) - run_settings_dialog->set_custom_arguments(md["custom_args"]); + Variant st=cf->get_value("editor_states",E->get()); + if (st.get_type()) { + md[E->get()]=st; + } } + + editor_data.set_editor_states(md); + } -void EditorNode::_set_scene_metadata() { +void EditorNode::_set_scene_metadata(const String& p_file) { Node *scene = editor_data.get_edited_scene_root(); if (!scene) return; - { /* Editor States */ - Dictionary md = editor_data.get_editor_states(); - - if (!md.empty()) { - scene->set_meta("__editor_plugin_states__",md); - } - } + scene->set_meta("__editor_run_settings__",Variant()); //clear it (no point in keeping it) + scene->set_meta("__editor_plugin_states__",Variant()); - { /* Run Settings */ + String path = EditorSettings::get_singleton()->get_project_settings_path().plus_file(p_file.get_file()+"-editstate-"+p_file.md5_text()+".cfg"); + Ref<ConfigFile> cf; + cf.instance(); - Dictionary md; - md["run_mode"]=run_settings_dialog->get_run_mode(); - md["custom_args"]=run_settings_dialog->get_custom_arguments(); - scene->set_meta("__editor_run_settings__",md); - } + Dictionary md = editor_data.get_editor_states(); + List<Variant> keys; + md.get_key_list(&keys); + for(List<Variant>::Element *E=keys.front();E;E=E->next()) { + cf->set_value("editor_states",E->get(),md[E->get()]); + } + Error err = cf->save(path); + ERR_FAIL_COND(err!=OK); } @@ -954,7 +970,7 @@ void EditorNode::_save_scene(String p_file) { } - _set_scene_metadata(); + _set_scene_metadata(p_file); Ref<PackedScene> sdata; @@ -1178,75 +1194,6 @@ void EditorNode::_dialog_action(String p_file) { save_translatable_strings(p_file); } break; - case FILE_SAVE_SUBSCENE: { - - List<Node*> selection = editor_selection->get_selected_node_list(); - - if (selection.size()!=1) { - - current_option=-1; - //confirmation->get_cancel()->hide(); - accept->get_ok()->set_text("I see.."); - accept->set_text("This operation requieres a single selected node."); - accept->popup_centered_minsize(); - break; - } - - Node *base = selection.front()->get(); - - Map<Node*,Node*> reown; - reown[editor_data.get_edited_scene_root()]=base; - Node *copy = base->duplicate_and_reown(reown); - if (copy) { - - Ref<PackedScene> sdata = memnew( PackedScene ); - Error err = sdata->pack(copy); - memdelete(copy); - - if (err!=OK) { - - - current_option=-1; - //accept->get_cancel()->hide(); - accept->get_ok()->set_text("I see.."); - accept->set_text("Couldn't save subscene. Likely dependencies (instances) couldn't be satisfied."); - accept->popup_centered_minsize(); - return; - } - - int flg=0; - if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources")) - flg|=ResourceSaver::FLAG_COMPRESS; - if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative")) - flg|=ResourceSaver::FLAG_RELATIVE_PATHS; - - - err = ResourceSaver::save(p_file,sdata,flg); - if (err!=OK) { - - current_option=-1; - //confirmation->get_cancel()->hide(); - accept->get_ok()->set_text("I see.."); - accept->set_text("Error saving scene."); - accept->popup_centered_minsize(); - break; - } - //EditorFileSystem::get_singleton()->update_file(p_file,sdata->get_type()); - - } else { - - current_option=-1; - //confirmation->get_cancel()->hide(); - accept->get_ok()->set_text("I see.."); - accept->set_text("Error duplicating scene to save it."); - accept->popup_centered_minsize(); - break; - - } - - - } break; - case FILE_SAVE_SCENE: case FILE_SAVE_AS_SCENE: { @@ -1306,10 +1253,18 @@ void EditorNode::_dialog_action(String p_file) { case FILE_EXPORT_TILESET: { Ref<TileSet> ml; - if (file_export_lib_merge->is_pressed() && FileAccess::exists(p_file)) { + if (FileAccess::exists(p_file)) { ml=ResourceLoader::load(p_file,"TileSet"); - if (ml.is_null()) { + if (!file_export_lib_merge->is_pressed()) { + ml->clear(); + } + + } + + if (ml.is_null()) { + + if (file_export_lib_merge->is_pressed()) { current_option=-1; //accept->get_cancel()->hide(); accept->get_ok()->set_text("I see.."); @@ -1318,9 +1273,6 @@ void EditorNode::_dialog_action(String p_file) { return; } - } - - if (ml.is_null()) { ml = Ref<TileSet>( memnew( TileSet )); } @@ -1430,17 +1382,15 @@ void EditorNode::_dialog_action(String p_file) { if (p_file.empty()) return; - if (p_file=="Default") { - confirm_error->set_text("Cannot overwrite default layout!"); - confirm_error->popup_centered_minsize(); - return; - } - Ref<ConfigFile> config; config.instance(); Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg")); - if (err!=OK && err!=ERR_FILE_NOT_FOUND) { - return; //no config + + if (err==ERR_CANT_OPEN) { + config.instance(); // new config + } else if (err!=OK) { + show_warning("Error trying to save layout!"); + return; } _save_docks_to_config(config, p_file); @@ -1450,28 +1400,22 @@ void EditorNode::_dialog_action(String p_file) { layout_dialog->hide(); _update_layouts_menu(); + if (p_file=="Default") { + show_warning("Default editor layout overridden."); + } + } break; case SETTINGS_LAYOUT_DELETE: { if (p_file.empty()) return; - if (p_file=="Default") { - confirm_error->set_text("Cannot delete default layout!"); - confirm_error->popup_centered_minsize(); - return; - } - Ref<ConfigFile> config; config.instance(); Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg")); - if (err!=OK) { - return; //no config - } - if (!config->has_section(p_file)) { - confirm_error->set_text("Layout name not found!"); - confirm_error->popup_centered_minsize(); + if (err!=OK || !config->has_section(p_file)) { + show_warning("Layout name not found!"); return; } @@ -1487,6 +1431,10 @@ void EditorNode::_dialog_action(String p_file) { layout_dialog->hide(); _update_layouts_menu(); + if (p_file=="Default") { + show_warning("Restored Default layout to base settings."); + } + } break; default: { //save scene? @@ -2059,21 +2007,21 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } break; case FILE_QUICK_OPEN_SCENE: { - quick_open->popup("PackedScene"); + quick_open->popup("PackedScene", true); quick_open->set_title("Quick Open Scene.."); } break; case FILE_QUICK_OPEN_SCRIPT: { - quick_open->popup("Script"); + quick_open->popup("Script", true); quick_open->set_title("Quick Open Script.."); } break; case FILE_QUICK_OPEN_FILE: { - quick_open->popup("Resource",false,true); + quick_open->popup("Resource", false, true); quick_open->set_title("Quick Search File.."); } break; @@ -2091,7 +2039,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } break; case FILE_CLOSE: { - if (!p_confirmed) { + if (!p_confirmed && unsaved_cache) { confirmation->get_ok()->set_text("Yes"); //confirmation->get_cancel()->show(); confirmation->set_text("Close scene? (Unsaved changes will be lost)"); @@ -2224,70 +2172,6 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { file->set_title("Save Translatable Strings"); file->popup_centered_ratio(); - - } break; - - case FILE_SAVE_SUBSCENE: { - - Node *scene = editor_data.get_edited_scene_root(); - - if (!scene) { - - current_option=-1; - //confirmation->get_cancel()->hide(); - accept->get_ok()->set_text("I see.."); - accept->set_text("This operation can't be done without a scene."); - accept->popup_centered_minsize(); - break; - } - - - List<Node*> selection = editor_selection->get_selected_node_list(); - - if (selection.size()!=1) { - - current_option=-1; - //confirmation->get_cancel()->hide(); - accept->get_ok()->set_text("I see.."); - accept->set_text("This operation requieres a single selected node."); - accept->popup_centered_minsize(); - break; - } - - Node *tocopy = selection.front()->get(); - - if (tocopy!=editor_data.get_edited_scene_root() && tocopy->get_filename()!="") { - - - current_option=-1; - //confirmation->get_cancel()->hide(); - accept->get_ok()->set_text("I see.."); - accept->set_text("This operation can't be done on instanced scenes."); - accept->popup_centered_minsize(); - break; - } - - file->set_mode(EditorFileDialog::MODE_SAVE_FILE); - - List<String> extensions; - Ref<PackedScene> sd = memnew( PackedScene ); - ResourceSaver::get_recognized_extensions(sd,&extensions); - file->clear_filters(); - for(int i=0;i<extensions.size();i++) { - - file->add_filter("*."+extensions[i]+" ; "+extensions[i].to_upper()); - } - - - String existing; - if (extensions.size()) { - existing="new_scene."+extensions.front()->get().to_lower(); - } - file->set_current_path(existing); - - - file->popup_centered_ratio(); - file->set_title("Save Sub-Scene As.."); } break; case FILE_SAVE_OPTIMIZED: { Node *scene = editor_data.get_edited_scene_root(); @@ -3152,7 +3036,7 @@ Error EditorNode::save_translatable_strings(const String& p_to_file) { OS::Time time = OS::get_singleton()->get_time(); f->store_line("# Translation Strings Dump."); f->store_line("# Created By."); - f->store_line("# \t" VERSION_FULL_NAME " (c) 2008-2015 Juan Linietsky, Ariel Manzur."); + f->store_line("# \t" VERSION_FULL_NAME " (c) 2008-2016 Juan Linietsky, Ariel Manzur."); f->store_line("# From Scene: "); f->store_line("# \t"+get_edited_scene()->get_filename()); f->store_line(""); @@ -3518,11 +3402,13 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo } - for(int i=0;i<editor_data.get_edited_scene_count();i++) { + if(!p_set_inherited) { + for(int i=0;i<editor_data.get_edited_scene_count();i++) { - if (editor_data.get_scene_path(i)==p_scene) { - _scene_tab_changed(i); - return OK; + if (editor_data.get_scene_path(i)==p_scene) { + _scene_tab_changed(i); + return OK; + } } } @@ -3604,7 +3490,18 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo add_io_error(txt); } - sdata->set_path(lpath,true); //take over path + if (ResourceCache::has(lpath)) { + //used from somewhere else? no problem! update state and replace sdata + Ref<PackedScene> ps = Ref<PackedScene>( ResourceCache::get(lpath)->cast_to<PackedScene>() ); + if (ps.is_valid()) { + ps->replace_state( sdata->get_state() ); + ps->set_last_modified_time( sdata->get_last_modified_time() ); + sdata=ps; + } + + } else { + sdata->set_path(lpath,true); //take over path + } Node*new_scene=sdata->instance(true); @@ -3652,7 +3549,7 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo new_scene->set_scene_instance_state(Ref<SceneState>()); set_edited_scene(new_scene); - _get_scene_metadata(); + _get_scene_metadata(p_scene); /* editor_data.set_edited_scene_root(new_scene); @@ -3807,7 +3704,6 @@ void EditorNode::animation_editor_make_visible(bool p_visible) { } animation_editor->set_keying(p_visible); - _update_keying(); } @@ -3908,19 +3804,26 @@ void EditorNode::hide_animation_player_editors() { emit_signal("hide_animation_player_editors"); } -void EditorNode::_quick_opened(const String& p_resource) { +void EditorNode::_quick_opened() { if (current_option==FILE_QUICK_OPEN_FILE) { - scenes_dock->open(p_resource); + String res_path = quick_open->get_selected(); + + scenes_dock->open(res_path); return; } - if (quick_open->get_base_type()=="PackedScene") { - open_request(p_resource); - } else { - load_resource(p_resource); - } + Vector<String> files = quick_open->get_selected_files(); + + for (int i = 0; i < files.size(); i++) { + String res_path = files[i]; + if (quick_open->get_base_type()=="PackedScene") { + open_request(res_path); + } else { + load_resource(res_path); + } + } } void EditorNode::_quick_run(const String& p_resource) { @@ -4488,7 +4391,11 @@ void EditorNode::_load_docks() { config.instance(); Error err = config->load(EditorSettings::get_singleton()->get_project_settings_path().plus_file("editor_layout.cfg")); if (err!=OK) { - return; //no config + //no config + if (overridden_default_layout>=0) { + _layout_menu_option(overridden_default_layout); + } + return; } _load_docks_from_config(config, "docks"); @@ -4590,6 +4497,8 @@ void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String& void EditorNode::_update_layouts_menu() { editor_layouts->clear(); + overridden_default_layout=-1; + editor_layouts->set_size(Vector2()); editor_layouts->add_item("Save Layout", SETTINGS_LAYOUT_SAVE); editor_layouts->add_item("Delete Layout", SETTINGS_LAYOUT_DELETE); @@ -4610,8 +4519,12 @@ void EditorNode::_update_layouts_menu() { String layout=E->get(); - if (layout!="Default") - editor_layouts->add_item(layout); + if (layout=="Default") { + editor_layouts->remove_item(editor_layouts->get_item_index(SETTINGS_LAYOUT_DEFAULT)); + overridden_default_layout=editor_layouts->get_item_count(); + } + + editor_layouts->add_item(layout); } } @@ -4636,7 +4549,7 @@ void EditorNode::_layout_menu_option(int p_id) { } break; case SETTINGS_LAYOUT_DEFAULT: { - _load_docks_from_config(default_theme, "docks"); + _load_docks_from_config(default_layout, "docks"); _save_docks(); } break; default: { @@ -4650,7 +4563,6 @@ void EditorNode::_layout_menu_option(int p_id) { _load_docks_from_config(config, editor_layouts->get_item_text(p_id)); _save_docks(); - } } @@ -4700,11 +4612,13 @@ void EditorNode::_scene_tab_changed(int p_tab) { editor_data.get_undo_redo().add_do_method(this,"set_current_version",unsaved?saved_version:0); editor_data.get_undo_redo().add_do_method(this,"set_current_scene",p_tab); editor_data.get_undo_redo().add_do_method(scene_tabs,"set_current_tab",p_tab); + editor_data.get_undo_redo().add_do_method(scene_tabs,"ensure_tab_visible",p_tab); editor_data.get_undo_redo().add_do_method(this,"set_current_version",next_scene_version==0?editor_data.get_undo_redo().get_version()+1:next_scene_version); editor_data.get_undo_redo().add_undo_method(this,"set_current_version",next_scene_version); editor_data.get_undo_redo().add_undo_method(this,"set_current_scene",editor_data.get_edited_scene()); editor_data.get_undo_redo().add_undo_method(scene_tabs,"set_current_tab",editor_data.get_edited_scene()); + editor_data.get_undo_redo().add_undo_method(scene_tabs,"ensure_tab_visible",p_tab,editor_data.get_edited_scene()); editor_data.get_undo_redo().add_undo_method(this,"set_current_version",saved_version); editor_data.get_undo_redo().commit_action(); @@ -5020,7 +4934,7 @@ EditorNode::EditorNode() { scene_tabs=memnew( Tabs ); scene_tabs->add_tab("unsaved"); scene_tabs->set_tab_align(Tabs::ALIGN_CENTER); - scene_tabs->set_tab_close_display_policy(Tabs::SHOW_ACTIVE_ONLY); + scene_tabs->set_tab_close_display_policy(Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY); scene_tabs->connect("tab_changed",this,"_scene_tab_changed"); scene_tabs->connect("right_button_pressed",this,"_scene_tab_script_edited"); scene_tabs->connect("tab_close", this, "_scene_tab_closed"); @@ -5155,7 +5069,6 @@ EditorNode::EditorNode() { pm_export->set_name("Export"); p->add_child(pm_export); p->add_submenu_item("Convert To..","Export"); - pm_export->add_item("Subscene..",FILE_SAVE_SUBSCENE); pm_export->add_item("Translatable Strings..",FILE_DUMP_STRINGS); pm_export->add_separator(); pm_export->add_item("MeshLibrary..",FILE_EXPORT_MESH_LIBRARY); @@ -5172,7 +5085,11 @@ EditorNode::EditorNode() { p->add_separator(); p->add_item("Revert Scene",EDIT_REVERT); p->add_separator(); - p->add_item("Quit to Project List",RUN_PROJECT_MANAGER,KEY_MASK_SHIFT+KEY_MASK_CMD+KEY_Q); +#ifdef OSX_ENABLED + p->add_item("Quit to Project List",RUN_PROJECT_MANAGER,KEY_MASK_SHIFT+KEY_MASK_ALT+KEY_Q); +#else + p->add_item("Quit to Project List",RUN_PROJECT_MANAGER,KEY_MASK_SHIFT+KEY_MASK_CTRL+KEY_Q); +#endif p->add_item("Quit",FILE_QUIT,KEY_MASK_CMD+KEY_Q); recent_scenes = memnew( PopupMenu ); @@ -5429,8 +5346,6 @@ EditorNode::EditorNode() { gui_base->add_child(layout_dialog); layout_dialog->set_hide_on_ok(false); layout_dialog->set_size(Size2(175, 70)); - confirm_error = memnew( AcceptDialog ); - layout_dialog->add_child(confirm_error); layout_dialog->connect("name_confirmed", this,"_dialog_action"); sources_button = memnew( ToolButton ); @@ -5621,15 +5536,16 @@ EditorNode::EditorNode() { const String docks_section = "docks"; - default_theme.instance(); - default_theme->set_value(docks_section, "dock_3", "Scene"); - default_theme->set_value(docks_section, "dock_4", "FileSystem"); - default_theme->set_value(docks_section, "dock_5", "Inspector"); + overridden_default_layout=-1; + default_layout.instance(); + default_layout->set_value(docks_section, "dock_3", "Scene"); + default_layout->set_value(docks_section, "dock_4", "FileSystem"); + default_layout->set_value(docks_section, "dock_5", "Inspector"); for(int i=0;i<DOCK_SLOT_MAX/2;i++) - default_theme->set_value(docks_section, "dock_hsplit_"+itos(i+1), 0); + default_layout->set_value(docks_section, "dock_hsplit_"+itos(i+1), 0); for(int i=0;i<DOCK_SLOT_MAX/2;i++) - default_theme->set_value(docks_section, "dock_split_"+itos(i+1), 0); + default_layout->set_value(docks_section, "dock_split_"+itos(i+1), 0); _update_layouts_menu(); @@ -5772,7 +5688,7 @@ EditorNode::EditorNode() { about->get_ok()->set_text("Thanks!"); about->set_hide_on_ok(true); Label *about_text = memnew( Label ); - about_text->set_text(VERSION_FULL_NAME"\n(c) 2008-2015 Juan Linietsky, Ariel Manzur.\n"); + about_text->set_text(VERSION_FULL_NAME"\n(c) 2008-2016 Juan Linietsky, Ariel Manzur.\n"); about_text->set_pos(Point2(gui_base->get_icon("Logo","EditorIcons")->get_size().width+30,20)); gui_base->add_child(about); about->add_child(about_text); @@ -5925,7 +5841,8 @@ EditorNode::EditorNode() { add_editor_plugin( memnew( Polygon2DEditorPlugin(this) ) ); add_editor_plugin( memnew( LightOccluder2DEditorPlugin(this) ) ); add_editor_plugin( memnew( NavigationPolygonEditorPlugin(this) ) ); - add_editor_plugin( memnew( ColorRampEditorPlugin(this) ) ); + add_editor_plugin( memnew( ColorRampEditorPlugin(this,true) ) ); + add_editor_plugin( memnew( ColorRampEditorPlugin(this,false) ) ); add_editor_plugin( memnew( CollisionShape2DEditorPlugin(this) ) ); for(int i=0;i<EditorPlugins::get_plugin_count();i++) @@ -5938,6 +5855,7 @@ EditorNode::EditorNode() { resource_preview->add_preview_generator( Ref<EditorScriptPreviewPlugin>( memnew(EditorScriptPreviewPlugin ))); resource_preview->add_preview_generator( Ref<EditorSamplePreviewPlugin>( memnew(EditorSamplePreviewPlugin ))); resource_preview->add_preview_generator( Ref<EditorMeshPreviewPlugin>( memnew(EditorMeshPreviewPlugin ))); + resource_preview->add_preview_generator( Ref<EditorBitmapPreviewPlugin>( memnew(EditorBitmapPreviewPlugin ))); circle_step_msec=OS::get_singleton()->get_ticks_msec(); circle_step_frame=OS::get_singleton()->get_frames_drawn(); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 0a087eb1ed..976c55a924 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -100,13 +100,12 @@ typedef void (*EditorNodeInitCallback)(); class EditorNode : public Node { OBJ_TYPE( EditorNode, Node ); - + enum { - - HISTORY_SIZE=64 + HISTORY_SIZE=64 }; + enum MenuOptions { - FILE_NEW_SCENE, FILE_NEW_INHERITED_SCENE, FILE_OPEN_SCENE, @@ -119,7 +118,6 @@ class EditorNode : public Node { FILE_EXPORT_MESH_LIBRARY, FILE_EXPORT_TILESET, FILE_SAVE_OPTIMIZED, - FILE_SAVE_SUBSCENE, FILE_DUMP_STRINGS, FILE_OPEN_RECENT, FILE_OPEN_OLD_SCENE, @@ -288,10 +286,10 @@ class EditorNode : public Node { AcceptDialog *about; AcceptDialog *warning; - Ref<ConfigFile> default_theme; + int overridden_default_layout; + Ref<ConfigFile> default_layout; PopupMenu *editor_layouts; EditorNameDialog *layout_dialog; - AcceptDialog *confirm_error; //OptimizedPresetsDialog *optimized_presets; EditorSettingsDialog *settings_config_dialog; @@ -420,8 +418,8 @@ class EditorNode : public Node { void _node_renamed(); void _editor_select(int p_which); - void _set_scene_metadata(); - void _get_scene_metadata(); + void _set_scene_metadata(const String &p_file); + void _get_scene_metadata(const String& p_file); void _update_title(); void _update_scene_tabs(); void _close_messages(); @@ -440,7 +438,7 @@ class EditorNode : public Node { void _update_keying(); void _hide_top_editors(); - void _quick_opened(const String& p_resource); + void _quick_opened(); void _quick_run(const String& p_resource); void _run(bool p_current=false, const String &p_custom=""); diff --git a/tools/editor/editor_path.cpp b/tools/editor/editor_path.cpp index 94e2efe346..4cf98e832c 100644 --- a/tools/editor/editor_path.cpp +++ b/tools/editor/editor_path.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_path.h b/tools/editor/editor_path.h index 2edaeb92a3..11e1005ba3 100644 --- a/tools/editor/editor_path.h +++ b/tools/editor/editor_path.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_plugin.cpp b/tools/editor/editor_plugin.cpp index 7417d707bb..b7ccb452e9 100644 --- a/tools/editor/editor_plugin.cpp +++ b/tools/editor/editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_plugin.h b/tools/editor/editor_plugin.h index 6850be2eaa..bf1e185a37 100644 --- a/tools/editor/editor_plugin.h +++ b/tools/editor/editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_reimport_dialog.cpp b/tools/editor/editor_reimport_dialog.cpp index 8842a485b3..eab5a5e32d 100644 --- a/tools/editor/editor_reimport_dialog.cpp +++ b/tools/editor/editor_reimport_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_reimport_dialog.h b/tools/editor/editor_reimport_dialog.h index 9726bac805..0c2d0eb52c 100644 --- a/tools/editor/editor_reimport_dialog.h +++ b/tools/editor/editor_reimport_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_run.cpp b/tools/editor/editor_run.cpp index b635cea84b..fb0f24c084 100644 --- a/tools/editor/editor_run.cpp +++ b/tools/editor/editor_run.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_run.h b/tools/editor/editor_run.h index e1b0b081c7..0b96a2c91c 100644 --- a/tools/editor/editor_run.h +++ b/tools/editor/editor_run.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_run_native.cpp b/tools/editor/editor_run_native.cpp index 2eedba93dc..234dd03087 100644 --- a/tools/editor/editor_run_native.cpp +++ b/tools/editor/editor_run_native.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_run_native.h b/tools/editor/editor_run_native.h index 77d6dc198e..04dad6b6aa 100644 --- a/tools/editor/editor_run_native.h +++ b/tools/editor/editor_run_native.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_selection.cpp b/tools/editor/editor_selection.cpp index d8fd8735fc..f3fbdba907 100644 --- a/tools/editor/editor_selection.cpp +++ b/tools/editor/editor_selection.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_selection.h b/tools/editor/editor_selection.h index f10f313a4e..d238d86567 100644 --- a/tools/editor/editor_selection.h +++ b/tools/editor/editor_selection.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index 5c36b842c7..4195ba97e6 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_settings.h b/tools/editor/editor_settings.h index bdfa5160d6..d1a11360af 100644 --- a/tools/editor/editor_settings.h +++ b/tools/editor/editor_settings.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_sub_scene.cpp b/tools/editor/editor_sub_scene.cpp index d7d79e5cc7..e58e2c1351 100644 --- a/tools/editor/editor_sub_scene.cpp +++ b/tools/editor/editor_sub_scene.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_sub_scene.h b/tools/editor/editor_sub_scene.h index dfd6c531e2..3dd86eefda 100644 --- a/tools/editor/editor_sub_scene.h +++ b/tools/editor/editor_sub_scene.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_vu.cpp b/tools/editor/editor_vu.cpp index ac11aceb21..7a133c9736 100644 --- a/tools/editor/editor_vu.cpp +++ b/tools/editor/editor_vu.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_vu.h b/tools/editor/editor_vu.h index 4c51ac31c0..78fe3eda86 100644 --- a/tools/editor/editor_vu.h +++ b/tools/editor/editor_vu.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/file_type_cache.cpp b/tools/editor/file_type_cache.cpp index a86400a560..7044a9900c 100644 --- a/tools/editor/file_type_cache.cpp +++ b/tools/editor/file_type_cache.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/file_type_cache.h b/tools/editor/file_type_cache.h index efc6d22b25..18451cbe19 100644 --- a/tools/editor/file_type_cache.h +++ b/tools/editor/file_type_cache.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/groups_editor.cpp b/tools/editor/groups_editor.cpp index bb5e93da34..6840a8b205 100644 --- a/tools/editor/groups_editor.cpp +++ b/tools/editor/groups_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/groups_editor.h b/tools/editor/groups_editor.h index 3a9cc77727..b5bccb2766 100644 --- a/tools/editor/groups_editor.h +++ b/tools/editor/groups_editor.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/icons/icon_create_new_scene_from.png b/tools/editor/icons/icon_create_new_scene_from.png Binary files differnew file mode 100644 index 0000000000..e747c4f59f --- /dev/null +++ b/tools/editor/icons/icon_create_new_scene_from.png diff --git a/tools/editor/icons/icon_edit_pivot.png b/tools/editor/icons/icon_edit_pivot.png Binary files differnew file mode 100644 index 0000000000..d68f7bbf25 --- /dev/null +++ b/tools/editor/icons/icon_edit_pivot.png diff --git a/tools/editor/import_settings.cpp b/tools/editor/import_settings.cpp index 36d7828be0..2bbd1e3805 100644 --- a/tools/editor/import_settings.cpp +++ b/tools/editor/import_settings.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/import_settings.h b/tools/editor/import_settings.h index 31237dd8cf..5a383a1a1a 100644 --- a/tools/editor/import_settings.h +++ b/tools/editor/import_settings.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_atlas.cpp b/tools/editor/io_plugins/editor_atlas.cpp index 7e9acd193d..f894e7e8b2 100644 --- a/tools/editor/io_plugins/editor_atlas.cpp +++ b/tools/editor/io_plugins/editor_atlas.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_atlas.h b/tools/editor/io_plugins/editor_atlas.h index 716faff0c6..0135e76622 100644 --- a/tools/editor/io_plugins/editor_atlas.h +++ b/tools/editor/io_plugins/editor_atlas.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp index 5ba0669f1d..9b4ca246e7 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -621,6 +621,7 @@ public: source->get_file_dialog()->set_mode(EditorFileDialog::MODE_OPEN_FILE); source->get_file_dialog()->add_filter("*.ttf;TrueType"); source->get_file_dialog()->add_filter("*.otf;OpenType"); + source->get_file_dialog()->add_filter("*.fnt;BMFont"); source->get_line_edit()->connect("text_entered",this,"_src_changed"); vbl->add_margin_child("Source Font:",source); @@ -876,10 +877,31 @@ static unsigned char get_SDF_radial( Ref<Font> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMetadata>& p_from, const String &p_existing) { + + Ref<ResourceImportMetadata> from = p_from; ERR_FAIL_COND_V(from->get_source_count()!=1,Ref<Font>()); String src_path = EditorImportPlugin::expand_source_path(from->get_source_path(0)); + + if (src_path.extension().to_lower()=="fnt") { + + if (ResourceLoader::load(src_path).is_valid()) { + EditorNode::get_singleton()->show_warning("Path: "+src_path+"\nIs a Godot font file, please supply a BMFont type file instead."); + return Ref<Font>(); + } + + Ref<Font> font; + font.instance(); + Error err = font->create_from_fnt(src_path); + if (err) { + EditorNode::get_singleton()->show_warning("Path: "+src_path+"\nFailed opening as BMFont file."); + return Ref<Font>(); + } + + return font; + } + int size = from->get_option("font/size"); #ifdef FREETYPE_ENABLED diff --git a/tools/editor/io_plugins/editor_font_import_plugin.h b/tools/editor/io_plugins/editor_font_import_plugin.h index 451f01080e..814897c5f0 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.h +++ b/tools/editor/io_plugins/editor_font_import_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp index ffc2d057e3..7de9d978f2 100644 --- a/tools/editor/io_plugins/editor_import_collada.cpp +++ b/tools/editor/io_plugins/editor_import_collada.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_import_collada.h b/tools/editor/io_plugins/editor_import_collada.h index 243cd043a0..de45dc38f4 100644 --- a/tools/editor/io_plugins/editor_import_collada.h +++ b/tools/editor/io_plugins/editor_import_collada.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.cpp b/tools/editor/io_plugins/editor_sample_import_plugin.cpp index 28eeb56b4b..b81c88c817 100644 --- a/tools/editor/io_plugins/editor_sample_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_sample_import_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.h b/tools/editor/io_plugins/editor_sample_import_plugin.h index 89319affa0..b31562af76 100644 --- a/tools/editor/io_plugins/editor_sample_import_plugin.h +++ b/tools/editor/io_plugins/editor_sample_import_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp index ca44df269b..a3b6827cd4 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.h b/tools/editor/io_plugins/editor_scene_import_plugin.h index 71efab9503..1f3b73fe7f 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.h +++ b/tools/editor/io_plugins/editor_scene_import_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp index 92ef57a69e..29273ebd06 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.h b/tools/editor/io_plugins/editor_texture_import_plugin.h index 38fd671e9d..cb63ba98c8 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.h +++ b/tools/editor/io_plugins/editor_texture_import_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.cpp b/tools/editor/io_plugins/editor_translation_import_plugin.cpp index d152d71af4..1edfe697b6 100644 --- a/tools/editor/io_plugins/editor_translation_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.h b/tools/editor/io_plugins/editor_translation_import_plugin.h index f3c2884534..cadcdc03b3 100644 --- a/tools/editor/io_plugins/editor_translation_import_plugin.h +++ b/tools/editor/io_plugins/editor_translation_import_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/optimized_save_dialog.cpp b/tools/editor/optimized_save_dialog.cpp index 687d3675fc..4814b3b021 100644 --- a/tools/editor/optimized_save_dialog.cpp +++ b/tools/editor/optimized_save_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/optimized_save_dialog.h b/tools/editor/optimized_save_dialog.h index 739d0e1506..bdc36eddc1 100644 --- a/tools/editor/optimized_save_dialog.h +++ b/tools/editor/optimized_save_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/output_strings.cpp b/tools/editor/output_strings.cpp index 30569d11b0..a19352f4ec 100644 --- a/tools/editor/output_strings.cpp +++ b/tools/editor/output_strings.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/output_strings.h b/tools/editor/output_strings.h index ad893534fa..3d5deb1646 100644 --- a/tools/editor/output_strings.h +++ b/tools/editor/output_strings.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/pane_drag.cpp b/tools/editor/pane_drag.cpp index fb137de5ce..8e8c2941ec 100644 --- a/tools/editor/pane_drag.cpp +++ b/tools/editor/pane_drag.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/pane_drag.h b/tools/editor/pane_drag.h index a6cd9b6662..24f2ef7ed8 100644 --- a/tools/editor/pane_drag.h +++ b/tools/editor/pane_drag.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/animation_data_editor_plugin.cpp b/tools/editor/plugins/animation_data_editor_plugin.cpp index d8d65b875a..a73c75056b 100644 --- a/tools/editor/plugins/animation_data_editor_plugin.cpp +++ b/tools/editor/plugins/animation_data_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/animation_data_editor_plugin.h b/tools/editor/plugins/animation_data_editor_plugin.h index 0daa67d0a5..0a12638474 100644 --- a/tools/editor/plugins/animation_data_editor_plugin.h +++ b/tools/editor/plugins/animation_data_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index dc2c241d2f..12a707b2ca 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/animation_player_editor_plugin.h b/tools/editor/plugins/animation_player_editor_plugin.h index 839df3ddcc..9fbd92e4f0 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.h +++ b/tools/editor/plugins/animation_player_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/animation_tree_editor_plugin.cpp b/tools/editor/plugins/animation_tree_editor_plugin.cpp index 382bc44726..609b1ccb63 100644 --- a/tools/editor/plugins/animation_tree_editor_plugin.cpp +++ b/tools/editor/plugins/animation_tree_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/animation_tree_editor_plugin.h b/tools/editor/plugins/animation_tree_editor_plugin.h index bd29530c7a..fb7eb58f8d 100644 --- a/tools/editor/plugins/animation_tree_editor_plugin.h +++ b/tools/editor/plugins/animation_tree_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/camera_editor_plugin.cpp b/tools/editor/plugins/camera_editor_plugin.cpp index 08ed2c745d..7433264b16 100644 --- a/tools/editor/plugins/camera_editor_plugin.cpp +++ b/tools/editor/plugins/camera_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/camera_editor_plugin.h b/tools/editor/plugins/camera_editor_plugin.h index afb8f9415d..ea016ecb4d 100644 --- a/tools/editor/plugins/camera_editor_plugin.h +++ b/tools/editor/plugins/camera_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index 0946383c8d..2eaf017d08 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -152,9 +152,49 @@ public: } }; +void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) { + List<Node*> &selection = editor_selection->get_selected_node_list(); + + undo_redo->create_action("Move Pivot"); + + for(List<Node*>::Element *E=selection.front();E;E=E->next()) { + + Node2D *n2d = E->get()->cast_to<Node2D>(); + + if (n2d && n2d->edit_has_pivot()) { + + Vector2 offset = n2d->edit_get_pivot(); + Vector2 gpos = n2d->get_global_pos(); + + Vector2 local_mouse_pos = n2d->get_canvas_transform().affine_inverse().xform(mouse_pos); + + Vector2 motion_ofs = gpos-local_mouse_pos; + + undo_redo->add_do_method(n2d,"set_global_pos",local_mouse_pos); + undo_redo->add_do_method(n2d,"edit_set_pivot",offset+n2d->get_global_transform().affine_inverse().basis_xform(motion_ofs)); + undo_redo->add_undo_method(n2d,"set_global_pos",gpos); + undo_redo->add_undo_method(n2d,"edit_set_pivot",offset); + for(int i=0;i<n2d->get_child_count();i++) { + Node2D *n2dc = n2d->get_child(i)->cast_to<Node2D>(); + if (!n2dc) + continue; + + undo_redo->add_do_method(n2dc,"set_global_pos",n2dc->get_global_pos()); + undo_redo->add_undo_method(n2dc,"set_global_pos",n2dc->get_global_pos()); + + } + + } + + } + + undo_redo->commit_action(); + +} + void CanvasItemEditor::_unhandled_key_input(const InputEvent& p_ev) { - if (!is_visible()) + if (!is_visible() || window_has_modal_stack()) return; if (p_ev.key.mod.control) // prevent to change tool mode when control key is pressed @@ -179,38 +219,7 @@ void CanvasItemEditor::_unhandled_key_input(const InputEvent& p_ev) { mouse_pos=transform.affine_inverse().xform(mouse_pos); mouse_pos=snap_point(mouse_pos); - undo_redo->create_action("Move Pivot"); - - for(List<Node*>::Element *E=selection.front();E;E=E->next()) { - - Node2D *n2d = E->get()->cast_to<Node2D>(); - - if (n2d && n2d->edit_has_pivot()) { - - Vector2 offset = n2d->edit_get_pivot(); - Vector2 gpos = n2d->get_global_pos(); - - Vector2 motion_ofs = gpos-mouse_pos; - - undo_redo->add_do_method(n2d,"set_global_pos",mouse_pos); - undo_redo->add_do_method(n2d,"edit_set_pivot",offset+n2d->get_global_transform().affine_inverse().basis_xform(motion_ofs)); - undo_redo->add_undo_method(n2d,"set_global_pos",gpos); - undo_redo->add_undo_method(n2d,"edit_set_pivot",offset); - for(int i=0;i<n2d->get_child_count();i++) { - Node2D *n2dc = n2d->get_child(i)->cast_to<Node2D>(); - if (!n2dc) - continue; - - undo_redo->add_do_method(n2dc,"set_global_pos",n2dc->get_global_pos()); - undo_redo->add_undo_method(n2dc,"set_global_pos",n2dc->get_global_pos()); - - } - - } - - } - - undo_redo->commit_action(); + _edit_set_pivot(mouse_pos); } } @@ -221,7 +230,7 @@ void CanvasItemEditor::_unhandled_key_input(const InputEvent& p_ev) { void CanvasItemEditor::_tool_select(int p_index) { - ToolButton *tb[TOOL_MAX]={select_button,list_select_button,move_button,rotate_button,pan_button}; + ToolButton *tb[TOOL_MAX]={select_button,list_select_button,move_button,rotate_button,pivot_button,pan_button}; for(int i=0;i<TOOL_MAX;i++) { tb[i]->set_pressed(i==p_index); @@ -396,9 +405,9 @@ void CanvasItemEditor::_node_removed(Node *p_node) { #endif } -void CanvasItemEditor::_keying_changed(bool p_changed) { +void CanvasItemEditor::_keying_changed() { - if (p_changed) + if (editor->get_animation_editor()->has_keying()) animation_hb->show(); else animation_hb->hide(); @@ -1130,6 +1139,20 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { return; } + + if (b.button_index==BUTTON_LEFT && tool==TOOL_EDIT_PIVOT) { + if (b.pressed) { + + Point2 mouse_pos(b.x,b.y); + mouse_pos=transform.affine_inverse().xform(mouse_pos); + mouse_pos=snap_point(mouse_pos); + _edit_set_pivot(mouse_pos); + } + return; + } + + + if (tool==TOOL_PAN || b.button_index!=BUTTON_LEFT || Input::get_singleton()->is_key_pressed(KEY_SPACE)) return; @@ -1518,6 +1541,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { continue; } + dfrom = drag_point_from; dto = snap_point(dto - (drag == DRAG_ALL ? drag_from - drag_point_from : Vector2(0, 0)), drag_point_from); @@ -1525,30 +1549,35 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { canvas_item->get_global_transform_with_canvas().affine_inverse().xform(dto) - canvas_item->get_global_transform_with_canvas().affine_inverse().xform(dfrom); - Rect2 local_rect = canvas_item->get_item_rect(); - - if (false && drag!=DRAG_ALL && m.mod.alt) { - float aspect = local_rect.size.get_aspect(); - if (aspect!=0) { - if (ABS(drag_vector.x) > ABS(drag_vector.y)) { - - drag_vector.y = ABS(drag_vector.x)/aspect * SGN(drag_vector.y); - } else { - - drag_vector.x = ABS(drag_vector.y)*aspect * SGN(drag_vector.x); - } - } - } - - - Vector2 begin=local_rect.pos; Vector2 end=local_rect.pos+local_rect.size; Vector2 minsize = canvas_item->edit_get_minimum_size(); bool uniform = m.mod.shift; bool symmetric=m.mod.alt; + if (uniform) { + float aspect = local_rect.size.get_aspect(); + switch(drag) { + case DRAG_BOTTOM_LEFT: + case DRAG_TOP_RIGHT: { + if (aspect > 1.0) { // width > height, take x as reference + drag_vector.y = -drag_vector.x/aspect; + } else { // height > width, take y as reference + drag_vector.x = -drag_vector.y*aspect; + } + } break; + case DRAG_BOTTOM_RIGHT: + case DRAG_TOP_LEFT: { + if (aspect > 1.0) { // width > height, take x as reference + drag_vector.y = drag_vector.x/aspect; + } else { // height > width, take y as reference + drag_vector.x = drag_vector.y*aspect; + } + } break; + default: {} + } + } switch(drag) { case DRAG_ALL: { @@ -1567,19 +1596,11 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { } break; case DRAG_BOTTOM_RIGHT: { - if (uniform) { - drag_vector.y=drag_vector.x; - minsize.y=minsize.x; - } incend(begin.x,end.x,drag_vector.x,minsize.x,symmetric); incend(begin.y,end.y,drag_vector.y,minsize.y,symmetric); - } break; + } break; case DRAG_TOP_LEFT: { - if (uniform) { - drag_vector.y=drag_vector.x; - minsize.y=minsize.x; - } incbeg(begin.x,end.x,drag_vector.x,minsize.x,symmetric); incbeg(begin.y,end.y,drag_vector.y,minsize.y,symmetric); } break; @@ -1595,20 +1616,12 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { } break; case DRAG_TOP_RIGHT: { - if (uniform) { - drag_vector.x=-drag_vector.y; - minsize.x=minsize.y; - } incbeg(begin.y,end.y,drag_vector.y,minsize.y,symmetric); incend(begin.x,end.x,drag_vector.x,minsize.x,symmetric); } break; case DRAG_BOTTOM_LEFT: { - if (uniform) { - drag_vector.x=-drag_vector.y; - minsize.x=minsize.y; - } incbeg(begin.x,end.x,drag_vector.x,minsize.x,symmetric); incend(begin.y,end.y,drag_vector.y,minsize.y,symmetric); } break; @@ -1858,6 +1871,8 @@ void CanvasItemEditor::_viewport_draw() { CanvasItem *single_item=NULL; + bool pivot_found=false; + for(Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) { @@ -1899,7 +1914,7 @@ void CanvasItemEditor::_viewport_draw() { viewport->draw_line(endpoints[i],endpoints[(i+1)%4],c,2); } - if (single && (tool==TOOL_SELECT || tool == TOOL_MOVE || tool == TOOL_ROTATE)) { //kind of sucks + if (single && (tool==TOOL_SELECT || tool == TOOL_MOVE || tool == TOOL_ROTATE || tool==TOOL_EDIT_PIVOT)) { //kind of sucks if (canvas_item->cast_to<Node2D>()) { @@ -1907,6 +1922,7 @@ void CanvasItemEditor::_viewport_draw() { if (canvas_item->cast_to<Node2D>()->edit_has_pivot()) { viewport->draw_texture(pivot,xform.get_origin()+(-pivot->get_size()/2).floor()); can_move_pivot=true; + pivot_found=true; } } @@ -1941,6 +1957,7 @@ void CanvasItemEditor::_viewport_draw() { //E->get().last_rect = rect; } + pivot_button->set_disabled(!pivot_found); VisualServer::get_singleton()->canvas_item_add_set_transform(ci,Matrix32()); @@ -2149,6 +2166,7 @@ void CanvasItemEditor::_notification(int p_what) { move_button->set_icon( get_icon("ToolMove","EditorIcons")); rotate_button->set_icon( get_icon("ToolRotate","EditorIcons")); pan_button->set_icon( get_icon("ToolPan", "EditorIcons")); + pivot_button->set_icon( get_icon("EditPivot", "EditorIcons")); select_handle=get_icon("EditorHandle","EditorIcons"); lock_button->set_icon(get_icon("Lock","EditorIcons")); unlock_button->set_icon(get_icon("Unlock","EditorIcons")); @@ -3206,6 +3224,12 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { list_select_button->connect("pressed",this,"_tool_select",make_binds(TOOL_LIST_SELECT)); list_select_button->set_tooltip("Show a list of all objects at the position clicked\n(same as Alt+RMB in selet mode)."); + pivot_button = memnew( ToolButton ); + pivot_button->set_toggle_mode(true); + hb->add_child(pivot_button); + pivot_button->connect("pressed",this,"_tool_select",make_binds(TOOL_EDIT_PIVOT)); + pivot_button->set_tooltip("Click to change object's rotation pivot"); + pan_button = memnew( ToolButton ); pan_button->set_toggle_mode(true); hb->add_child(pan_button); diff --git a/tools/editor/plugins/canvas_item_editor_plugin.h b/tools/editor/plugins/canvas_item_editor_plugin.h index 2376e9f842..df24734fd7 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.h +++ b/tools/editor/plugins/canvas_item_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -70,6 +70,7 @@ class CanvasItemEditor : public VBoxContainer { TOOL_LIST_SELECT, TOOL_MOVE, TOOL_ROTATE, + TOOL_EDIT_PIVOT, TOOL_PAN, TOOL_MAX }; @@ -245,6 +246,7 @@ class CanvasItemEditor : public VBoxContainer { ToolButton *move_button; ToolButton *rotate_button; + ToolButton *pivot_button; ToolButton *pan_button; ToolButton *lock_button; @@ -266,6 +268,7 @@ class CanvasItemEditor : public VBoxContainer { PopupMenu *selection_menu; + //PopupMenu *popup; DragType drag; Point2 drag_from; @@ -306,6 +309,7 @@ class CanvasItemEditor : public VBoxContainer { CanvasItem *ref_item; + void _edit_set_pivot(const Vector2& mouse_pos); void _add_canvas_item(CanvasItem *p_canvas_item); void _remove_canvas_item(CanvasItem *p_canvas_item); void _clear_canvas_items(); @@ -340,7 +344,7 @@ class CanvasItemEditor : public VBoxContainer { CanvasItem *get_single_item(); int get_item_count(); - void _keying_changed(bool p_changed); + void _keying_changed(); void _unhandled_key_input(const InputEvent& p_ev); diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_editor_plugin.cpp index 60683f4eda..d4198f3166 100644 --- a/tools/editor/plugins/collision_polygon_editor_plugin.cpp +++ b/tools/editor/plugins/collision_polygon_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.h b/tools/editor/plugins/collision_polygon_editor_plugin.h index 20a0b3c3f6..45e287ef00 100644 --- a/tools/editor/plugins/collision_polygon_editor_plugin.h +++ b/tools/editor/plugins/collision_polygon_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/color_ramp_editor_plugin.cpp b/tools/editor/plugins/color_ramp_editor_plugin.cpp index df50535402..42ff1b1de9 100644 --- a/tools/editor/plugins/color_ramp_editor_plugin.cpp +++ b/tools/editor/plugins/color_ramp_editor_plugin.cpp @@ -3,14 +3,20 @@ */ #include "color_ramp_editor_plugin.h" +#include "spatial_editor_plugin.h" +#include "canvas_item_editor_plugin.h" -ColorRampEditorPlugin::ColorRampEditorPlugin(EditorNode *p_node) { +ColorRampEditorPlugin::ColorRampEditorPlugin(EditorNode *p_node, bool p_2d) { editor=p_node; ramp_editor = memnew( ColorRampEdit ); - add_custom_control(CONTAINER_CANVAS_EDITOR_BOTTOM,ramp_editor); - //add_custom_control(CONTAINER_SPATIAL_EDITOR_BOTTOM,ramp_editor); + _2d=p_2d; + if (p_2d) + add_custom_control(CONTAINER_CANVAS_EDITOR_BOTTOM,ramp_editor); + else + add_custom_control(CONTAINER_SPATIAL_EDITOR_BOTTOM,ramp_editor); + ramp_editor->set_custom_minimum_size(Size2(100, 48)); ramp_editor->hide(); ramp_editor->connect("ramp_changed", this, "ramp_changed"); @@ -27,7 +33,10 @@ void ColorRampEditorPlugin::edit(Object *p_object) { bool ColorRampEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("ColorRamp"); + if (_2d) + return p_object->is_type("ColorRamp") && CanvasItemEditor::get_singleton()->is_visible() == true; + else + return p_object->is_type("ColorRamp") && SpatialEditor::get_singleton()->is_visible() == true; } void ColorRampEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/color_ramp_editor_plugin.h b/tools/editor/plugins/color_ramp_editor_plugin.h index e39a5d65fe..f07dbabeb3 100644 --- a/tools/editor/plugins/color_ramp_editor_plugin.h +++ b/tools/editor/plugins/color_ramp_editor_plugin.h @@ -13,6 +13,7 @@ class ColorRampEditorPlugin : public EditorPlugin { OBJ_TYPE( ColorRampEditorPlugin, EditorPlugin ); + bool _2d; Ref<ColorRamp> color_ramp_ref; ColorRampEdit *ramp_editor; EditorNode *editor; @@ -29,7 +30,7 @@ public: virtual bool handles(Object *p_node) const; virtual void make_visible(bool p_visible); - ColorRampEditorPlugin(EditorNode *p_node); + ColorRampEditorPlugin(EditorNode *p_node, bool p_2d); ~ColorRampEditorPlugin(); }; diff --git a/tools/editor/plugins/control_editor_plugin.cpp b/tools/editor/plugins/control_editor_plugin.cpp index 7348a69665..375622a89c 100644 --- a/tools/editor/plugins/control_editor_plugin.cpp +++ b/tools/editor/plugins/control_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/control_editor_plugin.h b/tools/editor/plugins/control_editor_plugin.h index 074298d0df..94cffc8d8d 100644 --- a/tools/editor/plugins/control_editor_plugin.h +++ b/tools/editor/plugins/control_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp b/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp index c118485083..c861a5841a 100644 --- a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp +++ b/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/cube_grid_theme_editor_plugin.h b/tools/editor/plugins/cube_grid_theme_editor_plugin.h index 583ddf6e14..72ee171e19 100644 --- a/tools/editor/plugins/cube_grid_theme_editor_plugin.h +++ b/tools/editor/plugins/cube_grid_theme_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/editor_preview_plugins.cpp b/tools/editor/plugins/editor_preview_plugins.cpp index 5f52d4c3e7..a0ce294219 100644 --- a/tools/editor/plugins/editor_preview_plugins.cpp +++ b/tools/editor/plugins/editor_preview_plugins.cpp @@ -6,6 +6,7 @@ #include "scene/resources/material.h" #include "scene/resources/sample.h" #include "scene/resources/mesh.h" +#include "scene/resources/bit_mask.h" bool EditorTexturePreviewPlugin::handles(const String& p_type) const { @@ -58,6 +59,81 @@ EditorTexturePreviewPlugin::EditorTexturePreviewPlugin() { } +//////////////////////////////////////////////////////////////////////////// + +bool EditorBitmapPreviewPlugin::handles(const String& p_type) const { + + return ObjectTypeDB::is_type(p_type,"BitMap"); +} + +Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES& p_from) { + + Ref<BitMap> bm =p_from; + + if (bm->get_size()==Size2()) { + return Ref<Texture>(); + } + + DVector<uint8_t> data; + + data.resize(bm->get_size().width*bm->get_size().height); + + { + DVector<uint8_t>::Write w=data.write(); + + for(int i=0;i<bm->get_size().width;i++) { + for(int j=0;j<bm->get_size().height;j++) { + if (bm->get_bit(Point2i(i,j))) { + w[j*bm->get_size().width+i]=255; + } else { + w[j*bm->get_size().width+i]=0; + + } + } + + } + } + + + Image img(bm->get_size().width,bm->get_size().height,0,Image::FORMAT_GRAYSCALE,data); + + int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); + if (img.is_compressed()) { + if (img.decompress()!=OK) + return Ref<Texture>(); + } else if (img.get_format()!=Image::FORMAT_RGB && img.get_format()!=Image::FORMAT_RGBA) { + img.convert(Image::FORMAT_RGBA); + } + + int width,height; + if (img.get_width() > thumbnail_size && img.get_width() >= img.get_height()) { + + width=thumbnail_size; + height = img.get_height() * thumbnail_size / img.get_width(); + } else if (img.get_height() > thumbnail_size && img.get_height() >= img.get_width()) { + + height=thumbnail_size; + width = img.get_width() * thumbnail_size / img.get_height(); + } else { + + width=img.get_width(); + height=img.get_height(); + } + + img.resize(width,height); + + Ref<ImageTexture> ptex = Ref<ImageTexture>( memnew( ImageTexture )); + + ptex->create_from_image(img,0); + return ptex; + +} + +EditorBitmapPreviewPlugin::EditorBitmapPreviewPlugin() { + + +} + /////////////////////////////////////////////////////////////////////////// diff --git a/tools/editor/plugins/editor_preview_plugins.h b/tools/editor/plugins/editor_preview_plugins.h index 98071e2a0e..b3bfda8045 100644 --- a/tools/editor/plugins/editor_preview_plugins.h +++ b/tools/editor/plugins/editor_preview_plugins.h @@ -13,6 +13,17 @@ public: }; +class EditorBitmapPreviewPlugin : public EditorResourcePreviewGenerator { +public: + + virtual bool handles(const String& p_type) const; + virtual Ref<Texture> generate(const RES& p_from); + + EditorBitmapPreviewPlugin(); +}; + + + class EditorPackedScenePreviewPlugin : public EditorResourcePreviewGenerator { Ref<Texture> _gen_from_imd(Ref<ResourceImportMetadata> p_imd); diff --git a/tools/editor/plugins/item_list_editor_plugin.cpp b/tools/editor/plugins/item_list_editor_plugin.cpp index 9c53c73afd..6f0db959ba 100644 --- a/tools/editor/plugins/item_list_editor_plugin.cpp +++ b/tools/editor/plugins/item_list_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/item_list_editor_plugin.h b/tools/editor/plugins/item_list_editor_plugin.h index b40a2c22f8..95d316b199 100644 --- a/tools/editor/plugins/item_list_editor_plugin.h +++ b/tools/editor/plugins/item_list_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/multimesh_editor_plugin.cpp b/tools/editor/plugins/multimesh_editor_plugin.cpp index a5c823f8bd..3f63ef706b 100644 --- a/tools/editor/plugins/multimesh_editor_plugin.cpp +++ b/tools/editor/plugins/multimesh_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/multimesh_editor_plugin.h b/tools/editor/plugins/multimesh_editor_plugin.h index edc3dfd55f..245da1eeb7 100644 --- a/tools/editor/plugins/multimesh_editor_plugin.h +++ b/tools/editor/plugins/multimesh_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/particles_2d_editor_plugin.cpp b/tools/editor/plugins/particles_2d_editor_plugin.cpp index dadfa8bfdc..2488c4cdd9 100644 --- a/tools/editor/plugins/particles_2d_editor_plugin.cpp +++ b/tools/editor/plugins/particles_2d_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/particles_2d_editor_plugin.h b/tools/editor/plugins/particles_2d_editor_plugin.h index dba0bb4dae..f70a0e7b76 100644 --- a/tools/editor/plugins/particles_2d_editor_plugin.h +++ b/tools/editor/plugins/particles_2d_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/particles_editor_plugin.cpp b/tools/editor/plugins/particles_editor_plugin.cpp index 5c84d9a86a..2df6d3ea90 100644 --- a/tools/editor/plugins/particles_editor_plugin.cpp +++ b/tools/editor/plugins/particles_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/particles_editor_plugin.h b/tools/editor/plugins/particles_editor_plugin.h index 92756af1f6..ff80bffc29 100644 --- a/tools/editor/plugins/particles_editor_plugin.h +++ b/tools/editor/plugins/particles_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/path_2d_editor_plugin.cpp b/tools/editor/plugins/path_2d_editor_plugin.cpp index d037adc555..509edbe5f8 100644 --- a/tools/editor/plugins/path_2d_editor_plugin.cpp +++ b/tools/editor/plugins/path_2d_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -534,6 +534,7 @@ void Path2DEditor::edit(Node *p_path2d) { if (!node->is_connected("visibility_changed", this, "_node_visibility_changed")) node->connect("visibility_changed", this, "_node_visibility_changed"); + } else { if (canvas_item_editor->get_viewport_control()->is_connected("draw",this,"_canvas_draw")) @@ -614,6 +615,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) { editor=p_editor; undo_redo = editor->get_undo_redo(); + mode=MODE_EDIT; action=ACTION_NONE; #if 0 diff --git a/tools/editor/plugins/path_2d_editor_plugin.h b/tools/editor/plugins/path_2d_editor_plugin.h index 9f15c0669f..973c17464e 100644 --- a/tools/editor/plugins/path_2d_editor_plugin.h +++ b/tools/editor/plugins/path_2d_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/path_editor_plugin.cpp b/tools/editor/plugins/path_editor_plugin.cpp index f4bdf50fe9..b99e632604 100644 --- a/tools/editor/plugins/path_editor_plugin.cpp +++ b/tools/editor/plugins/path_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/path_editor_plugin.h b/tools/editor/plugins/path_editor_plugin.h index fcd4241e59..18bad23bd1 100644 --- a/tools/editor/plugins/path_editor_plugin.h +++ b/tools/editor/plugins/path_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.cpp b/tools/editor/plugins/polygon_2d_editor_plugin.cpp index cd82297365..3e9c58d604 100644 --- a/tools/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/tools/editor/plugins/polygon_2d_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -755,7 +755,6 @@ void Polygon2DEditor::edit(Node *p_collision_polygon) { canvas_item_editor=CanvasItemEditor::get_singleton(); } - if (p_collision_polygon) { node=p_collision_polygon->cast_to<Polygon2D>(); diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.cpp b/tools/editor/plugins/resource_preloader_editor_plugin.cpp index 9cd20ac53a..403a919f5d 100644 --- a/tools/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/tools/editor/plugins/resource_preloader_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.h b/tools/editor/plugins/resource_preloader_editor_plugin.h index 88272bc603..49ef86b4c2 100644 --- a/tools/editor/plugins/resource_preloader_editor_plugin.h +++ b/tools/editor/plugins/resource_preloader_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/rich_text_editor_plugin.cpp b/tools/editor/plugins/rich_text_editor_plugin.cpp index a0daad854f..08374d6624 100644 --- a/tools/editor/plugins/rich_text_editor_plugin.cpp +++ b/tools/editor/plugins/rich_text_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/rich_text_editor_plugin.h b/tools/editor/plugins/rich_text_editor_plugin.h index 478dc0d308..ae1d04be01 100644 --- a/tools/editor/plugins/rich_text_editor_plugin.h +++ b/tools/editor/plugins/rich_text_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/sample_editor_plugin.cpp b/tools/editor/plugins/sample_editor_plugin.cpp index d88f2adc73..ffa39bd010 100644 --- a/tools/editor/plugins/sample_editor_plugin.cpp +++ b/tools/editor/plugins/sample_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/sample_editor_plugin.h b/tools/editor/plugins/sample_editor_plugin.h index e615667914..22dc75b53b 100644 --- a/tools/editor/plugins/sample_editor_plugin.h +++ b/tools/editor/plugins/sample_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/sample_library_editor_plugin.cpp b/tools/editor/plugins/sample_library_editor_plugin.cpp index b497458a2a..493ae405ba 100644 --- a/tools/editor/plugins/sample_library_editor_plugin.cpp +++ b/tools/editor/plugins/sample_library_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/sample_library_editor_plugin.h b/tools/editor/plugins/sample_library_editor_plugin.h index 2770ca2d9a..6627d8d6de 100644 --- a/tools/editor/plugins/sample_library_editor_plugin.h +++ b/tools/editor/plugins/sample_library_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/sample_player_editor_plugin.cpp b/tools/editor/plugins/sample_player_editor_plugin.cpp index f1c7ca8c98..3085ad87d8 100644 --- a/tools/editor/plugins/sample_player_editor_plugin.cpp +++ b/tools/editor/plugins/sample_player_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/sample_player_editor_plugin.h b/tools/editor/plugins/sample_player_editor_plugin.h index cdd1a99c17..013b042487 100644 --- a/tools/editor/plugins/sample_player_editor_plugin.h +++ b/tools/editor/plugins/sample_player_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 59f5d89073..8adfe9d2cf 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -327,7 +327,11 @@ void ScriptTextEditor::_load_theme_settings() { for(List<StringName>::Element *E=types.front();E;E=E->next()) { - get_text_edit()->add_keyword_color(E->get(),type_color); + String n = E->get(); + if (n.begins_with("_")) + n = n.substr(1, n.length()); + + get_text_edit()->add_keyword_color(n,type_color); } //colorize comments @@ -2043,6 +2047,15 @@ void ScriptEditor::_editor_settings_changed() { autosave_timer->stop(); } + for(int i=0;i<tab_container->get_child_count();i++) { + + ScriptTextEditor *ste = tab_container->get_child(i)->cast_to<ScriptTextEditor>(); + if (!ste) + continue; + + ste->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete")); + } + } void ScriptEditor::_autosave_scripts() { @@ -2318,7 +2331,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { script_list = memnew( ItemList ); script_split->add_child(script_list); - script_list->set_custom_minimum_size(Size2(70,0)); + script_list->set_custom_minimum_size(Size2(0,0)); script_split->set_split_offset(70); tab_container = memnew( TabContainer ); @@ -2404,7 +2417,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { debug_menu->get_popup()->add_item("Continue",DEBUG_CONTINUE); debug_menu->get_popup()->add_separator(); debug_menu->get_popup()->add_check_item("Show Debugger",DEBUG_SHOW); - debug_menu->get_popup()->add_check_item("Keep Debuger Open",DEBUG_SHOW_KEEP_OPEN); + debug_menu->get_popup()->add_check_item("Keep Debugger Open",DEBUG_SHOW_KEEP_OPEN); debug_menu->get_popup()->connect("item_pressed", this,"_menu_option"); debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true); diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h index 32c1e7e1c8..b829d4e0e5 100644 --- a/tools/editor/plugins/script_editor_plugin.h +++ b/tools/editor/plugins/script_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index 848073af3e..65b5365b50 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -172,11 +172,8 @@ ShaderTextEditor::ShaderTextEditor() { void ShaderEditor::_menu_option(int p_option) { - int selected = tab_container->get_current_tab(); - if (selected<0 || selected>=tab_container->get_child_count()) - return; - ShaderTextEditor *current = tab_container->get_child(selected)->cast_to<ShaderTextEditor>(); + ShaderTextEditor *current = tab_container->get_current_tab_control()->cast_to<ShaderTextEditor>(); if (!current) return; @@ -235,7 +232,7 @@ void ShaderEditor::_menu_option(int p_option) { void ShaderEditor::_tab_changed(int p_which) { - ShaderTextEditor *shader_editor = tab_container->get_child(p_which)->cast_to<ShaderTextEditor>(); + ShaderTextEditor *shader_editor = tab_container->get_tab_control(p_which)->cast_to<ShaderTextEditor>(); if (shader_editor) shader_editor->get_text_edit()->grab_focus(); diff --git a/tools/editor/plugins/shader_editor_plugin.h b/tools/editor/plugins/shader_editor_plugin.h index 4ead2ba94e..26d20b80b4 100644 --- a/tools/editor/plugins/shader_editor_plugin.h +++ b/tools/editor/plugins/shader_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index 3a7dc26466..c6677b6883 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/shader_graph_editor_plugin.h b/tools/editor/plugins/shader_graph_editor_plugin.h index 39e9b29d45..5ac9db3650 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.h +++ b/tools/editor/plugins/shader_graph_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 92ad991d96..e47dcbf30f 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1617,6 +1617,8 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { case InputEvent::KEY: { const InputEventKey &k = p_event.key; + if (!k.pressed) + break; switch(k.scancode) { case KEY_S: { @@ -1677,7 +1679,8 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { } break; case KEY_KP_5: { - orthogonal = !orthogonal; + + //orthogonal = !orthogonal; _menu_option(orthogonal?VIEW_PERSPECTIVE:VIEW_ORTHOGONAL); _update_name(); @@ -2626,6 +2629,13 @@ Dictionary SpatialEditor::get_state() const { Dictionary d; + d["snap_enabled"]=snap_enabled; + d["translate_snap"]=get_translate_snap(); + d["rotate_snap"]=get_rotate_snap(); + d["scale_snap"]=get_scale_snap(); + + int local_coords_index=transform_menu->get_popup()->get_item_index(MENU_TRANSFORM_LOCAL_COORDS); + d["local_coords"]=transform_menu->get_popup()->is_item_checked( local_coords_index ); int vc=0; if (view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT) )) @@ -2667,37 +2677,52 @@ void SpatialEditor::set_state(const Dictionary& p_state) { Dictionary d = p_state; - ERR_FAIL_COND(!d.has("viewport_mode")); - ERR_FAIL_COND(!d.has("viewports")); - ERR_FAIL_COND(!d.has("default_light")); - ERR_FAIL_COND(!d.has("show_grid")); - ERR_FAIL_COND(!d.has("show_origin")); - ERR_FAIL_COND(!d.has("fov")); - ERR_FAIL_COND(!d.has("znear")); - ERR_FAIL_COND(!d.has("zfar")); + if (d.has("snap_enabled")) { + snap_enabled=d["snap_enabled"]; + int snap_enabled_idx=transform_menu->get_popup()->get_item_index(MENU_TRANSFORM_USE_SNAP); + transform_menu->get_popup()->set_item_checked( snap_enabled_idx, snap_enabled ); + } - int vc = d["viewport_mode"]; + if (d.has("translate_snap")) + snap_translate->set_text(d["translate_snap"]); - if (vc==1) - _menu_item_pressed(MENU_VIEW_USE_1_VIEWPORT); - else if (vc==2) - _menu_item_pressed(MENU_VIEW_USE_2_VIEWPORTS); - else if (vc==3) - _menu_item_pressed(MENU_VIEW_USE_3_VIEWPORTS); - else if (vc==4) - _menu_item_pressed(MENU_VIEW_USE_4_VIEWPORTS); - else if (vc==5) - _menu_item_pressed(MENU_VIEW_USE_2_VIEWPORTS_ALT); - else if (vc==6) - _menu_item_pressed(MENU_VIEW_USE_3_VIEWPORTS_ALT); - - Array vp = d["viewports"]; - ERR_FAIL_COND(vp.size()>4); + if (d.has("rotate_snap")) + snap_rotate->set_text(d["rotate_snap"]); - for(int i=0;i<4;i++) { - viewports[i]->set_state(vp[i]); + if (d.has("scale_snap")) + snap_scale->set_text(d["scale_snap"]); + + if (d.has("local_coords")) { + int local_coords_idx=transform_menu->get_popup()->get_item_index(MENU_TRANSFORM_LOCAL_COORDS); + transform_menu->get_popup()->set_item_checked( local_coords_idx, d["local_coords"] ); + update_transform_gizmo(); + } + + if (d.has("viewport_mode")) { + int vc = d["viewport_mode"]; + + if (vc==1) + _menu_item_pressed(MENU_VIEW_USE_1_VIEWPORT); + else if (vc==2) + _menu_item_pressed(MENU_VIEW_USE_2_VIEWPORTS); + else if (vc==3) + _menu_item_pressed(MENU_VIEW_USE_3_VIEWPORTS); + else if (vc==4) + _menu_item_pressed(MENU_VIEW_USE_4_VIEWPORTS); + else if (vc==5) + _menu_item_pressed(MENU_VIEW_USE_2_VIEWPORTS_ALT); + else if (vc==6) + _menu_item_pressed(MENU_VIEW_USE_3_VIEWPORTS_ALT); } + if (d.has("viewports")) { + Array vp = d["viewports"]; + ERR_FAIL_COND(vp.size()>4); + + for(int i=0;i<4;i++) { + viewports[i]->set_state(vp[i]); + } + } if (d.has("zfar")) settings_zfar->set_val(float(d["zfar"])); @@ -3501,19 +3526,13 @@ void SpatialEditor::_instance_scene() { undo_redo->commit_action(); #endif } -/* -void SpatialEditor::_update_selection() { - - -} -*/ void SpatialEditor::_unhandled_key_input(InputEvent p_event) { - if (!is_visible()) + if (!is_visible() || window_has_modal_stack()) return; - { + { EditorNode *en = editor; EditorPlugin *over_plugin = en->get_editor_plugin_over(); @@ -3712,7 +3731,6 @@ void SpatialEditor::_bind_methods() { ObjectTypeDB::bind_method("_menu_item_pressed",&SpatialEditor::_menu_item_pressed); ObjectTypeDB::bind_method("_xform_dialog_action",&SpatialEditor::_xform_dialog_action); ObjectTypeDB::bind_method("_instance_scene",&SpatialEditor::_instance_scene); -// ObjectTypeDB::bind_method("_update_selection",&SpatialEditor::_update_selection); ObjectTypeDB::bind_method("_get_editor_data",&SpatialEditor::_get_editor_data); ObjectTypeDB::bind_method("_request_gizmo",&SpatialEditor::_request_gizmo); ObjectTypeDB::bind_method("_default_light_angle_input",&SpatialEditor::_default_light_angle_input); @@ -3814,7 +3832,6 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { editor=p_editor; editor_selection=editor->get_editor_selection(); editor_selection->add_editor_plugin(this); - editor_selection->connect("selection_changed",this,"_update_selection"); snap_enabled=false; tool_mode = TOOL_MODE_SELECT; diff --git a/tools/editor/plugins/spatial_editor_plugin.h b/tools/editor/plugins/spatial_editor_plugin.h index e7ea14ba6a..b0e366b140 100644 --- a/tools/editor/plugins/spatial_editor_plugin.h +++ b/tools/editor/plugins/spatial_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -137,7 +137,6 @@ private: Vector3 _get_screen_to_space(const Vector3& p_vector3); void _select_region(); - void _update_selection(); bool _gizmo_select(const Vector2& p_screenpos,bool p_hilite_only=false); float get_znear() const; diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp index e90087efda..048df2d682 100644 --- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -338,7 +338,6 @@ void SpriteFramesEditor::_update_library() { TreeItem *ti = tree->create_item(root); ti->set_cell_mode(0,TreeItem::CELL_MODE_STRING); - ti->set_editable(0,true); ti->set_selectable(0,true); if (frames->get_frame(i).is_null()) { @@ -346,7 +345,7 @@ void SpriteFramesEditor::_update_library() { ti->set_text(0,"Frame "+itos(i)+" (empty)"); } else { - ti->set_text(0,"Frame "+itos(i)); + ti->set_text(0,"Frame "+itos(i)+" ("+frames->get_frame(i)->get_name()+")"); ti->set_icon(0,frames->get_frame(i)); } if (frames->get_frame(i).is_valid()) diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.h b/tools/editor/plugins/sprite_frames_editor_plugin.h index 969d7b1ce3..e4088da297 100644 --- a/tools/editor/plugins/sprite_frames_editor_plugin.h +++ b/tools/editor/plugins/sprite_frames_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/sprite_region_editor_plugin.cpp b/tools/editor/plugins/sprite_region_editor_plugin.cpp index 35c53cf562..725de19dd7 100644 --- a/tools/editor/plugins/sprite_region_editor_plugin.cpp +++ b/tools/editor/plugins/sprite_region_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Author: Mariano Suligoy */ /* */ @@ -411,6 +411,7 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor) snap_step=Vector2(10,10); use_snap=false; snap_show_grid=false; + drag=false; add_child( memnew( VSeparator )); edit_node = memnew( ToolButton ); @@ -449,7 +450,7 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor) hb_tools->add_child( memnew( VSeparator )); hb_tools->add_child( memnew( Label("Grid Offset:") ) ); - SpinBox *sb_off_x = memnew( SpinBox ); + sb_off_x = memnew( SpinBox ); sb_off_x->set_min(-256); sb_off_x->set_max(256); sb_off_x->set_step(1); @@ -458,7 +459,7 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor) sb_off_x->connect("value_changed", this, "_set_snap_off_x"); hb_tools->add_child(sb_off_x); - SpinBox *sb_off_y = memnew( SpinBox ); + sb_off_y = memnew( SpinBox ); sb_off_y->set_min(-256); sb_off_y->set_max(256); sb_off_y->set_step(1); @@ -470,7 +471,7 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor) hb_tools->add_child( memnew( VSeparator )); hb_tools->add_child( memnew( Label("Grid Step:") ) ); - SpinBox *sb_step_x = memnew( SpinBox ); + sb_step_x = memnew( SpinBox ); sb_step_x->set_min(-256); sb_step_x->set_max(256); sb_step_x->set_step(1); @@ -479,7 +480,7 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor) sb_step_x->connect("value_changed", this, "_set_snap_step_x"); hb_tools->add_child(sb_step_x); - SpinBox *sb_step_y = memnew( SpinBox ); + sb_step_y = memnew( SpinBox ); sb_step_y->set_min(-256); sb_step_y->set_max(256); sb_step_y->set_step(1); @@ -488,8 +489,6 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor) sb_step_y->connect("value_changed", this, "_set_snap_step_y"); hb_tools->add_child(sb_step_y); -// MARIANOGNU::TODO: Add more tools? - HBoxContainer *main_hb = memnew( HBoxContainer ); main_vb->add_child(main_hb); edit_draw = memnew( Control ); @@ -554,6 +553,50 @@ void SpriteRegionEditorPlugin::make_visible(bool p_visible) } } + +Dictionary SpriteRegionEditorPlugin::get_state() const { + + Dictionary state; + state["zoom"]=region_editor->zoom->get_val(); + state["snap_offset"]=region_editor->snap_offset; + state["snap_step"]=region_editor->snap_step; + state["use_snap"]=region_editor->use_snap; + state["snap_show_grid"]=region_editor->snap_show_grid; + return state; +} + +void SpriteRegionEditorPlugin::set_state(const Dictionary& p_state){ + + Dictionary state=p_state; + if (state.has("zoom")) { + region_editor->zoom->set_val(p_state["zoom"]); + } + + if (state.has("snap_step")) { + Vector2 s = state["snap_step"]; + region_editor->sb_step_x->set_val(s.x); + region_editor->sb_step_y->set_val(s.y); + region_editor->snap_step = s; + } + + if (state.has("snap_offset")) { + Vector2 ofs = state["snap_offset"]; + region_editor->sb_off_x->set_val(ofs.x); + region_editor->sb_off_y->set_val(ofs.y); + region_editor->snap_offset = ofs; + } + + if (state.has("use_snap")) { + region_editor->use_snap=state["use_snap"]; + region_editor->b_snap_enable->set_pressed(state["use_snap"]); + } + + if (state.has("snap_show_grid")) { + region_editor->snap_show_grid=state["snap_show_grid"]; + region_editor->b_snap_grid->set_pressed(state["snap_show_grid"]); + } +} + SpriteRegionEditorPlugin::SpriteRegionEditorPlugin(EditorNode *p_node) { editor = p_node; diff --git a/tools/editor/plugins/sprite_region_editor_plugin.h b/tools/editor/plugins/sprite_region_editor_plugin.h index cf69395f40..47cb210863 100644 --- a/tools/editor/plugins/sprite_region_editor_plugin.h +++ b/tools/editor/plugins/sprite_region_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Author: Mariano Suligoy */ /* */ @@ -41,6 +41,8 @@ class SpriteRegionEditor : public HBoxContainer { OBJ_TYPE(SpriteRegionEditor, HBoxContainer ); + friend class SpriteRegionEditorPlugin; + ToolButton *edit_node; // Button *use_region; ToolButton *b_snap_enable; @@ -48,6 +50,10 @@ class SpriteRegionEditor : public HBoxContainer { TextureFrame *icon_zoom; HSlider *zoom; SpinBox *zoom_value; + SpinBox *sb_step_y; + SpinBox *sb_step_x; + SpinBox *sb_off_y; + SpinBox *sb_off_x; Control *edit_draw; VScrollBar *vscroll; @@ -113,11 +119,13 @@ class SpriteRegionEditorPlugin : public EditorPlugin EditorNode *editor; public: - virtual String get_name() const { return "Sprite"; } + virtual String get_name() const { return "SpriteRegion"; } bool has_main_screen() const { return false; } virtual void edit(Object *p_node); virtual bool handles(Object *p_node) const; virtual void make_visible(bool p_visible); + void set_state(const Dictionary &p_state); + Dictionary get_state() const; SpriteRegionEditorPlugin(EditorNode *p_node); }; diff --git a/tools/editor/plugins/stream_editor_plugin.cpp b/tools/editor/plugins/stream_editor_plugin.cpp index 81db7f2846..d896784074 100644 --- a/tools/editor/plugins/stream_editor_plugin.cpp +++ b/tools/editor/plugins/stream_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/stream_editor_plugin.h b/tools/editor/plugins/stream_editor_plugin.h index 7378bfad0c..5730612d61 100644 --- a/tools/editor/plugins/stream_editor_plugin.h +++ b/tools/editor/plugins/stream_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/style_box_editor_plugin.cpp b/tools/editor/plugins/style_box_editor_plugin.cpp index 898c69e1e0..58e9038840 100644 --- a/tools/editor/plugins/style_box_editor_plugin.cpp +++ b/tools/editor/plugins/style_box_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/style_box_editor_plugin.h b/tools/editor/plugins/style_box_editor_plugin.h index 00b0871572..3b3f8d8d0f 100644 --- a/tools/editor/plugins/style_box_editor_plugin.h +++ b/tools/editor/plugins/style_box_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/tools/editor/plugins/theme_editor_plugin.cpp index 63ba57bfc0..f67f049b36 100644 --- a/tools/editor/plugins/theme_editor_plugin.cpp +++ b/tools/editor/plugins/theme_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/theme_editor_plugin.h b/tools/editor/plugins/theme_editor_plugin.h index 40c7ad8186..f5e7192a73 100644 --- a/tools/editor/plugins/theme_editor_plugin.h +++ b/tools/editor/plugins/theme_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp index 66c7a39096..29326a2222 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.cpp +++ b/tools/editor/plugins/tile_map_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -218,7 +218,8 @@ struct _TileMapEditorCopyData { bool TileMapEditor::forward_input_event(const InputEvent& p_event) { - if (!node || !node->get_tileset().is_valid()) + + if (!node || !node->get_tileset().is_valid() || !node->is_visible()) return false; Matrix32 xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform(); @@ -675,12 +676,9 @@ void TileMapEditor::_canvas_draw() { Ref<Texture> t = ts->tile_get_texture(st); if (t.is_valid()) { Vector2 from = node->map_to_world(over_tile)+node->get_cell_draw_offset(); + Vector2 tile_ofs = ts->tile_get_texture_offset(st); Rect2 r = ts->tile_get_region(st); Size2 sc = xform.get_scale(); - if (mirror_x->is_pressed()) - sc.x*=-1.0; - if (mirror_y->is_pressed()) - sc.y*=-1.0; Rect2 rect; if (r==Rect2()) { @@ -690,23 +688,47 @@ void TileMapEditor::_canvas_draw() { rect=Rect2(from,r.get_size()); } + bool transp = transpose->is_pressed(); + bool flip_h = mirror_x->is_pressed(); + bool flip_v = mirror_y->is_pressed(); + + if (rect.size.y > rect.size.x) { + if ((flip_h && (flip_v || transp)) || (flip_v && !transp)) + tile_ofs.y += rect.size.y - rect.size.x; + } else if (rect.size.y < rect.size.x) { + if ((flip_v && (flip_h || transp)) || (flip_h && !transp)) + tile_ofs.x += rect.size.x - rect.size.y; + } + + if (transp) { + SWAP(tile_ofs.x, tile_ofs.y); + } + + if (flip_h) { + sc.x*=-1.0; + tile_ofs.x*=-1.0; + } + if (flip_v) { + sc.y*=-1.0; + tile_ofs.y*=-1.0; + } if (node->get_tile_origin()==TileMap::TILE_ORIGIN_TOP_LEFT) { - rect.pos+=ts->tile_get_texture_offset(st); + rect.pos+=tile_ofs; } else if (node->get_tile_origin()==TileMap::TILE_ORIGIN_CENTER) { rect.pos+=node->get_cell_size()/2; Vector2 s = r.size; - Vector2 center = (s/2) - ts->tile_get_texture_offset(st); + Vector2 center = (s/2) - tile_ofs; - if (mirror_x->is_pressed()) + if (flip_h) rect.pos.x-=s.x-center.x; else rect.pos.x-=center.x; - if (mirror_y->is_pressed()) + if (flip_v) rect.pos.y-=s.y-center.y; else rect.pos.y-=center.y; @@ -717,10 +739,10 @@ void TileMapEditor::_canvas_draw() { if (r==Rect2()) { - canvas_item_editor->draw_texture_rect(t,rect,false,Color(1,1,1,0.5),transpose->is_pressed()); + canvas_item_editor->draw_texture_rect(t,rect,false,Color(1,1,1,0.5),transp); } else { - canvas_item_editor->draw_texture_rect_region(t,rect,r,Color(1,1,1,0.5),transpose->is_pressed()); + canvas_item_editor->draw_texture_rect_region(t,rect,r,Color(1,1,1,0.5),transp); } } } diff --git a/tools/editor/plugins/tile_map_editor_plugin.h b/tools/editor/plugins/tile_map_editor_plugin.h index 74d1573d0f..3cbf5ff68d 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.h +++ b/tools/editor/plugins/tile_map_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/tile_set_editor_plugin.cpp b/tools/editor/plugins/tile_set_editor_plugin.cpp index b61fe6806b..06046b226a 100644 --- a/tools/editor/plugins/tile_set_editor_plugin.cpp +++ b/tools/editor/plugins/tile_set_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/tile_set_editor_plugin.h b/tools/editor/plugins/tile_set_editor_plugin.h index 0a646001ab..3f47520e2a 100644 --- a/tools/editor/plugins/tile_set_editor_plugin.h +++ b/tools/editor/plugins/tile_set_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/progress_dialog.cpp b/tools/editor/progress_dialog.cpp index 90398767ea..d072ce7f83 100644 --- a/tools/editor/progress_dialog.cpp +++ b/tools/editor/progress_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/progress_dialog.h b/tools/editor/progress_dialog.h index 8c75948fda..539eaa8737 100644 --- a/tools/editor/progress_dialog.h +++ b/tools/editor/progress_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index 29f9918e26..7690d31e7b 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -258,6 +258,7 @@ void ProjectExportDialog::_sample_convert_edited(int what) { EditorImportExport::get_singleton()->sample_set_action( EditorImportExport::SampleAction(sample_mode->get_selected())); EditorImportExport::get_singleton()->sample_set_max_hz( sample_max_hz->get_val() ); EditorImportExport::get_singleton()->sample_set_trim( sample_trim->is_pressed() ); + _save_export_cfg(); } diff --git a/tools/editor/project_export.h b/tools/editor/project_export.h index 09c8f10206..5a42a58e58 100644 --- a/tools/editor/project_export.h +++ b/tools/editor/project_export.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index 880df85c19..589d9d3d99 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -964,7 +964,7 @@ ProjectManager::ProjectManager() { String cp; cp.push_back(0xA9); cp.push_back(0); - l->set_text(cp+" 2008-2015 Juan Linietsky, Ariel Manzur."); + l->set_text(cp+" 2008-2016 Juan Linietsky, Ariel Manzur."); l->set_align(Label::ALIGN_CENTER); vb->add_child(l); diff --git a/tools/editor/project_manager.h b/tools/editor/project_manager.h index f8edb6dc10..80c34690f8 100644 --- a/tools/editor/project_manager.h +++ b/tools/editor/project_manager.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp index dd3c7552de..26e8919375 100644 --- a/tools/editor/project_settings.cpp +++ b/tools/editor/project_settings.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,6 +33,7 @@ #include "editor_node.h" #include "scene/gui/margin_container.h" #include "translation.h" +#include "global_constants.h" ProjectSettings *ProjectSettings::singleton=NULL; @@ -59,9 +60,6 @@ void ProjectSettings::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { - search_button->set_icon(get_icon("Zoom","EditorIcons")); - clear_button->set_icon(get_icon("Close","EditorIcons")); - translation_list->connect("button_pressed",this,"_translation_delete"); _update_actions(); popup_add->add_icon_item(get_icon("Keyboard","EditorIcons"),"Key",InputEvent::KEY); @@ -92,7 +90,9 @@ void ProjectSettings::_notification(int p_what) { autoload_file_open->add_filter("*."+E->get()); } + } else if (p_what==NOTIFICATION_POST_POPUP) { + globals_editor->clear_search_box(); } } @@ -106,6 +106,8 @@ void ProjectSettings::_action_persist_toggle() { String name="input/"+ti->get_text(0); bool prev = Globals::get_singleton()->is_persisting(name); + print_line("prev persist: "+itos(prev)); + print_line("new persist: "+itos(ti->is_checked(0))); if (prev==ti->is_checked(0)) return; @@ -155,12 +157,14 @@ void ProjectSettings::_device_input_add() { } break; case InputEvent::JOYSTICK_MOTION: { - ie.joy_motion.axis = device_index->get_selected(); + ie.joy_motion.axis = device_index->get_selected()>>1; + ie.joy_motion.axis_value = device_index->get_selected()&1?1:-1; + for(int i=0;i<arr.size();i++) { InputEvent aie=arr[i]; - if (aie.device == ie.device && aie.type==InputEvent::JOYSTICK_MOTION && aie.joy_motion.axis==ie.joy_motion.axis) { + if (aie.device == ie.device && aie.type==InputEvent::JOYSTICK_MOTION && aie.joy_motion.axis==ie.joy_motion.axis && aie.joy_motion.axis_value==ie.joy_motion.axis_value) { return; } } @@ -294,9 +298,10 @@ void ProjectSettings::_add_item(int p_item){ device_id->set_val(0); device_index_label->set_text("Joy Button Axis:"); device_index->clear(); - for(int i=0;i<8;i++) { + for(int i=0;i<24;i++) { + - device_index->add_item("Axis "+itos(i)); + device_index->add_item("Axis "+itos(i/2)+" "+(i&1?"+":"-")); } device_input->popup_centered(Size2(350,95)); @@ -424,7 +429,7 @@ void ProjectSettings::_update_actions() { continue; TreeItem *item=input_editor->create_item(root); - item->set_cell_mode(0,TreeItem::CELL_MODE_CHECK); + //item->set_cell_mode(0,TreeItem::CELL_MODE_CHECK); item->set_text(0,name); item->add_button(0,get_icon("Add","EditorIcons"),1); if (!Globals::get_singleton()->get_input_presets().find(pi.name)) { @@ -433,7 +438,7 @@ void ProjectSettings::_update_actions() { } item->set_custom_bg_color(0,get_color("prop_subsection","Editor")); item->set_editable(0,true); - item->set_checked(0,pi.usage&PROPERTY_USAGE_CHECKED); + //item->set_checked(0,pi.usage&PROPERTY_USAGE_CHECKED); @@ -493,7 +498,7 @@ void ProjectSettings::_update_actions() { } break; case InputEvent::JOYSTICK_MOTION: { - String str = "Device "+itos(ie.device)+", Axis "+itos(ie.joy_motion.axis)+"."; + String str = "Device "+itos(ie.device)+", Axis "+itos(ie.joy_motion.axis)+" "+(ie.joy_motion.axis_value<0?"-.":"+."); action->set_text(0,str); action->set_icon(0,get_icon("JoyAxis","EditorIcons")); } break; @@ -524,7 +529,7 @@ void ProjectSettings::_item_selected() { return; if (!ti->get_parent()) return; - category->set_text(ti->get_parent()->get_text(0)); + category->set_text(globals_editor->get_current_section()); property->set_text(ti->get_text(0)); popup_platform->set_disabled(false); @@ -563,7 +568,8 @@ void ProjectSettings::_item_add() { String name = catname+"/"+propname; Globals::get_singleton()->set(name,value); - globals_editor->get_property_editor()->update_tree(); + globals_editor->edit(NULL); + globals_editor->edit(Globals::get_singleton()); } void ProjectSettings::_item_del() { @@ -695,9 +701,20 @@ void ProjectSettings::_save() { void ProjectSettings::_settings_prop_edited(const String& p_name) { - if (!Globals::get_singleton()->is_persisting(p_name)) { - String full_item = globals_editor->get_full_item_path(p_name); + String full_item = globals_editor->get_full_item_path(p_name); + + if (!Globals::get_singleton()->is_persisting(full_item)) { Globals::get_singleton()->set_persisting(full_item,true); + + { + //small usability workaround, if anything related to resolution scaling or size is modified, change all of them together + if (full_item=="display/width" || full_item=="display/height" || full_item=="display/stretch_mode") { + Globals::get_singleton()->set_persisting("display/height",true); + Globals::get_singleton()->set_persisting("display/width",true); + } + } + + // globals_editor->update_property(p_name); globals_editor->get_property_editor()->update_tree(); } @@ -777,10 +794,11 @@ void ProjectSettings::_translation_file_open() { void ProjectSettings::_autoload_file_callback(const String& p_path) { autoload_add_path->set_text(p_path); - if (autoload_add_name->get_text().strip_edges()==String()) { + //if (autoload_add_name->get_text().strip_edges()==String()) { autoload_add_name->set_text( p_path.get_file().basename() ); - } + //} + //_translation_add(p_translation); } @@ -789,6 +807,40 @@ void ProjectSettings::_autoload_file_open() { autoload_file_open->popup_centered_ratio(); } +void ProjectSettings::_autoload_edited() { + + if (updating_autoload) + return; + + TreeItem *ti = autoload_list->get_edited(); + if (!ti || autoload_list->get_edited_column()!=2) + return; + + updating_autoload=true; + bool checked=ti->is_checked(2); + + String base="autoload/"+ti->get_text(0); + + String path = Globals::get_singleton()->get(base); + + if (path.begins_with("*")) + path=path.substr(1,path.length()); + + if (checked) + path="*"+path; + + undo_redo->create_action("Toggle Autoload GlobalVar"); + undo_redo->add_do_property(Globals::get_singleton(),base,path); + undo_redo->add_undo_property(Globals::get_singleton(),base,Globals::get_singleton()->get(base)); + undo_redo->add_do_method(this,"_update_autoload"); + undo_redo->add_undo_method(this,"_update_autoload"); + undo_redo->add_do_method(this,"_settings_changed"); + undo_redo->add_undo_method(this,"_settings_changed"); + undo_redo->commit_action(); + updating_autoload=false; + +} + void ProjectSettings::_autoload_add() { String name = autoload_add_name->get_text(); @@ -799,6 +851,35 @@ void ProjectSettings::_autoload_add() { } + if (ObjectTypeDB::type_exists(name)) { + + message->set_text("Invalid Name.Must not collide with an existing engine class name."); + message->popup_centered(Size2(300,100)); + return; + + } + + for(int i=0;i<Variant::VARIANT_MAX;i++) { + if (Variant::get_type_name(Variant::Type(i))==name) { + + message->set_text("Invalid Name.Must not collide with an existing buit-in type name."); + message->popup_centered(Size2(300,100)); + return; + + } + } + + for(int i=0;i<GlobalConstants::get_global_constant_count();i++) { + + if (GlobalConstants::get_global_constant_name(i)==name) { + + message->set_text("Invalid Name.Must not collide with an existing global constant name."); + message->popup_centered(Size2(300,100)); + return; + } + + } + String path = autoload_add_path->get_text(); if (!FileAccess::exists(path)) { message->set_text("Invalid Path.\nFile does not exist."); @@ -815,7 +896,7 @@ void ProjectSettings::_autoload_add() { undo_redo->create_action("Add Autoload"); name = "autoload/"+name; - undo_redo->add_do_property(Globals::get_singleton(),name,path); + undo_redo->add_do_property(Globals::get_singleton(),name,"*"+path); if (Globals::get_singleton()->has(name)) undo_redo->add_undo_property(Globals::get_singleton(),name,Globals::get_singleton()->get(name)); else @@ -865,11 +946,14 @@ void ProjectSettings::_autoload_delete(Object *p_item,int p_column, int p_button String swap_name= "autoload/"+swap->get_text(0); + int order = Globals::get_singleton()->get_order(name); + int swap_order = Globals::get_singleton()->get_order(swap_name); + undo_redo->create_action("Move Autoload"); - undo_redo->add_do_method(Globals::get_singleton(),"set_order",swap_name,Globals::get_singleton()->get_order(name)); - undo_redo->add_do_method(Globals::get_singleton(),"set_order",name,Globals::get_singleton()->get_order(swap_name)); - undo_redo->add_undo_method(Globals::get_singleton(),"set_order",swap_name,Globals::get_singleton()->get_order(swap_name)); - undo_redo->add_undo_method(Globals::get_singleton(),"set_order",name,Globals::get_singleton()->get_order(name)); + undo_redo->add_do_method(Globals::get_singleton(),"set_order",swap_name,order); + undo_redo->add_do_method(Globals::get_singleton(),"set_order",name,swap_order); + undo_redo->add_undo_method(Globals::get_singleton(),"set_order",swap_name,swap_order); + undo_redo->add_undo_method(Globals::get_singleton(),"set_order",name,order); undo_redo->add_do_method(this,"_update_autoload"); undo_redo->add_undo_method(this,"_update_autoload"); undo_redo->add_do_method(this,"_settings_changed"); @@ -1208,6 +1292,11 @@ void ProjectSettings::_update_translations() { void ProjectSettings::_update_autoload() { + if (updating_autoload) + return; + + updating_autoload=true; + autoload_list->clear(); TreeItem *root = autoload_list->create_item(); autoload_list->set_hide_root(true); @@ -1222,44 +1311,31 @@ void ProjectSettings::_update_autoload() { continue; String name = pi.name.get_slice("/",1); + String path = Globals::get_singleton()->get(pi.name); + if (name=="") continue; - + bool global=false; + if (path.begins_with("*")) { + path=path.substr(1,path.length()); + global=true; + } TreeItem *t = autoload_list->create_item(root); t->set_text(0,name); - t->set_text(1,Globals::get_singleton()->get(pi.name)); - t->add_button(1,get_icon("MoveUp","EditorIcons"),1); - t->add_button(1,get_icon("MoveDown","EditorIcons"),2); - t->add_button(1,get_icon("Del","EditorIcons"),0); + t->set_text(1,path); + t->set_cell_mode(2,TreeItem::CELL_MODE_CHECK); + t->set_editable(2,true); + t->set_text(2,"Enable"); + t->set_checked(2,global); + t->add_button(3,get_icon("MoveUp","EditorIcons"),1); + t->add_button(3,get_icon("MoveDown","EditorIcons"),2); + t->add_button(3,get_icon("Del","EditorIcons"),0); - } -} - -void ProjectSettings::_toggle_search_bar(bool p_pressed) { - - globals_editor->get_property_editor()->set_use_filter(p_pressed); - - if (p_pressed) { - - search_bar->show(); - add_prop_bar->hide(); - search_box->grab_focus(); - search_box->select_all(); - } else { - - search_bar->hide(); - add_prop_bar->show(); } -} -void ProjectSettings::_clear_search_box() { + updating_autoload=false; - if (search_box->get_text()=="") - return; - - search_box->clear(); - globals_editor->get_property_editor()->update_tree(); } void ProjectSettings::_bind_methods() { @@ -1302,9 +1378,7 @@ void ProjectSettings::_bind_methods() { ObjectTypeDB::bind_method(_MD("_autoload_file_callback"),&ProjectSettings::_autoload_file_callback); ObjectTypeDB::bind_method(_MD("_update_autoload"),&ProjectSettings::_update_autoload); ObjectTypeDB::bind_method(_MD("_autoload_delete"),&ProjectSettings::_autoload_delete); - - ObjectTypeDB::bind_method(_MD("_clear_search_box"),&ProjectSettings::_clear_search_box); - ObjectTypeDB::bind_method(_MD("_toggle_search_bar"),&ProjectSettings::_toggle_search_bar); + ObjectTypeDB::bind_method(_MD("_autoload_edited"),&ProjectSettings::_autoload_edited); } @@ -1336,77 +1410,50 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); props_base->add_child(hbc); - search_button = memnew( ToolButton ); - search_button->set_toggle_mode(true); - search_button->set_pressed(false); - search_button->set_text("Search"); - hbc->add_child(search_button); - search_button->connect("toggled",this,"_toggle_search_bar"); - - hbc->add_child( memnew( VSeparator ) ); - - add_prop_bar = memnew( HBoxContainer ); - add_prop_bar->set_h_size_flags(Control::SIZE_EXPAND_FILL); - hbc->add_child(add_prop_bar); - Label *l = memnew( Label ); - add_prop_bar->add_child(l); + hbc->add_child(l); l->set_text("Category:"); category = memnew( LineEdit ); category->set_h_size_flags(Control::SIZE_EXPAND_FILL); - add_prop_bar->add_child(category); + hbc->add_child(category); category->connect("text_entered",this,"_item_adds"); l = memnew( Label ); - add_prop_bar->add_child(l); + hbc->add_child(l); l->set_text("Property:"); property = memnew( LineEdit ); property->set_h_size_flags(Control::SIZE_EXPAND_FILL); - add_prop_bar->add_child(property); + hbc->add_child(property); property->connect("text_entered",this,"_item_adds"); l = memnew( Label ); - add_prop_bar->add_child(l); + hbc->add_child(l); l->set_text("Type:"); type = memnew( OptionButton ); type->set_h_size_flags(Control::SIZE_EXPAND_FILL); - add_prop_bar->add_child(type); + hbc->add_child(type); type->add_item("bool"); type->add_item("int"); type->add_item("float"); type->add_item("string"); Button *add = memnew( Button ); - add_prop_bar->add_child(add); + hbc->add_child(add); add->set_text("Add"); add->connect("pressed",this,"_item_add"); Button *del = memnew( Button ); - add_prop_bar->add_child(del); + hbc->add_child(del); del->set_text("Del"); del->connect("pressed",this,"_item_del"); - search_bar = memnew( HBoxContainer ); - search_bar->set_h_size_flags(Control::SIZE_EXPAND_FILL); - hbc->add_child(search_bar); - search_bar->hide(); - - search_box = memnew( LineEdit ); - search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); - search_bar->add_child(search_box); - - clear_button = memnew( ToolButton ); - search_bar->add_child(clear_button); - clear_button->connect("pressed",this,"_clear_search_box"); - globals_editor = memnew( SectionedPropertyEditor ); props_base->add_child(globals_editor); //globals_editor->hide_top_label(); globals_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); - globals_editor->get_property_editor()->register_text_enter(search_box); globals_editor->get_property_editor()->set_capitalize_paths(false); globals_editor->get_property_editor()->get_scene_tree()->connect("cell_selected",this,"_item_selected"); globals_editor->get_property_editor()->connect("property_toggled",this,"_item_checked",varray(),CONNECT_DEFERRED); @@ -1694,11 +1741,24 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { autoload_file_open->set_mode(EditorFileDialog::MODE_OPEN_FILE); autoload_file_open->connect("file_selected",this,"_autoload_file_callback"); - autoload_list->set_columns(2); + autoload_list->set_columns(4); autoload_list->set_column_titles_visible(true); - autoload_list->set_column_title(0,"name"); - autoload_list->set_column_title(1,"path"); + autoload_list->set_column_title(0,"Name"); + autoload_list->set_column_expand(0,true); + autoload_list->set_column_min_width(0,100); + autoload_list->set_column_title(1,"Path"); + autoload_list->set_column_expand(1,true); + autoload_list->set_column_min_width(1,100); + autoload_list->set_column_title(2,"Singleton"); + autoload_list->set_column_expand(2,false); + autoload_list->set_column_min_width(2,80); + autoload_list->set_column_expand(3,false); + autoload_list->set_column_min_width(3,80); + autoload_list->connect("button_pressed",this,"_autoload_delete"); + autoload_list->connect("item_edited",this,"_autoload_edited"); + + updating_autoload=false; } diff --git a/tools/editor/project_settings.h b/tools/editor/project_settings.h index f201f5c48f..cbf24e7bfd 100644 --- a/tools/editor/project_settings.h +++ b/tools/editor/project_settings.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,12 +48,6 @@ class ProjectSettings : public AcceptDialog { UndoRedo *undo_redo; SectionedPropertyEditor *globals_editor; - HBoxContainer *search_bar; - ToolButton *search_button; - LineEdit *search_box; - ToolButton *clear_button; - - HBoxContainer *add_prop_bar; ConfirmationDialog *message; LineEdit *category; LineEdit *property; @@ -95,8 +89,10 @@ class ProjectSettings : public AcceptDialog { void _update_autoload(); void _autoload_file_callback(const String& p_path); void _autoload_add(); + void _autoload_edited(); void _autoload_file_open(); void _autoload_delete(Object *p_item,int p_column, int p_button); + bool updating_autoload; void _item_selected(); @@ -140,9 +136,6 @@ class ProjectSettings : public AcceptDialog { void _translation_res_option_changed(); void _translation_res_option_delete(Object *p_item,int p_column, int p_button); - void _toggle_search_bar(bool p_pressed); - void _clear_search_box(); - ProjectSettings(); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 141f0c2943..cc7db57145 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -727,7 +727,17 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty RES cb=EditorSettings::get_singleton()->get_resource_clipboard(); - bool paste_valid=cb.is_valid() && (hint_text=="" || ObjectTypeDB::is_type(cb->get_type(),hint_text)); + bool paste_valid=false; + if (cb.is_valid()) { + if (hint_text=="") + paste_valid=true; + else + for (int i = 0; i < hint_text.get_slice_count(",");i++) + if (ObjectTypeDB::is_type(cb->get_type(),hint_text.get_slice(",",i))) { + paste_valid=true; + break; + } + } if (!RES(v).is_null() || paste_valid) { menu->add_separator(); @@ -927,6 +937,7 @@ void CustomPropertyEditor::_node_path_selected(NodePath p_path) { if (!node) { v=p_path; emit_signal("variant_changed"); + call_deferred("hide"); //to not mess with dialogs return; } @@ -938,6 +949,7 @@ void CustomPropertyEditor::_node_path_selected(NodePath p_path) { v=p_path; emit_signal("variant_changed"); + call_deferred("hide"); //to not mess with dialogs } @@ -1040,6 +1052,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) { v=NodePath(); emit_signal("variant_changed"); + hide(); } } break; case Variant::OBJECT: { @@ -2110,6 +2123,65 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p } +void PropertyEditor::_check_reload_status(const String&p_name, TreeItem* item) { + + bool has_reload=false; + int found=-1; + + for(int i=0;i<item->get_button_count(1);i++) { + + if (item->get_button_id(1,i)==3) { + found=i; + break; + } + } + + if (_might_be_in_instance()) { + + + Variant vorig; + Dictionary d=item->get_metadata(0); + int usage = d.has("usage")?int(int(d["usage"])&(PROPERTY_USAGE_STORE_IF_NONONE|PROPERTY_USAGE_STORE_IF_NONZERO)):0; + + + if (_get_instanced_node_original_property(p_name,vorig) || usage) { + Variant v = obj->get(p_name); + + bool changed = _is_property_different(v,vorig,usage); + + if ((found!=-1)!=changed) { + + if (changed) { + + has_reload=true; + } else { + + } + + } + + } + + + + } + + if (!has_reload && !obj->get_script().is_null()) { + Ref<Script> scr = obj->get_script(); + Variant orig_value; + if (scr->get_property_default_value(p_name,orig_value)) { + if (orig_value!=obj->get(p_name)) { + has_reload=true; + } + } + } + + if (found!=-1 && !has_reload) { + item->erase_button(1,found); + } else if (found==-1 && has_reload) { + item->add_button(1,get_icon("Reload","EditorIcons"),3); + } +} void PropertyEditor::_notification(int p_what) { @@ -2151,43 +2223,8 @@ void PropertyEditor::_notification(int p_what) { if (!item) continue; - if (_might_be_in_instance()) { - - - Variant vorig; - Dictionary d=item->get_metadata(0); - int usage = d.has("usage")?int(int(d["usage"])&(PROPERTY_USAGE_STORE_IF_NONONE|PROPERTY_USAGE_STORE_IF_NONZERO)):0; - - - if (_get_instanced_node_original_property(*k,vorig) || usage) { - Variant v = obj->get(*k); - - int found=-1; - for(int i=0;i<item->get_button_count(1);i++) { - - if (item->get_button_id(1,i)==3) { - found=i; - break; - } - } - - bool changed = _is_property_different(v,vorig,usage); - - if ((found!=-1)!=changed) { - - if (changed) { - - item->add_button(1,get_icon("Reload","EditorIcons"),3); - } else { - - item->erase_button(1,found); - } + _check_reload_status(*k,item); - } - - } - - } Dictionary d=item->get_metadata(0); set_item_text(item,d["type"],d["name"],d["hint"],d["hint_text"]); } @@ -2254,23 +2291,30 @@ void PropertyEditor::_refresh_item(TreeItem *p_item) { if (name!=String()) { + + _check_reload_status(name,p_item); +#if 0 + bool has_reload=false; + + int found=-1; + for(int i=0;i<p_item->get_button_count(1);i++) { + + if (p_item->get_button_id(1,i)==3) { + found=i; + break; + } + } + if (_might_be_in_instance()) { Variant vorig; Dictionary d=p_item->get_metadata(0); int usage = d.has("usage")?int(int(d["usage"])&(PROPERTY_USAGE_STORE_IF_NONONE|PROPERTY_USAGE_STORE_IF_NONZERO)):0; + if (_get_instanced_node_original_property(name,vorig) || usage) { Variant v = obj->get(name); - int found=-1; - for(int i=0;i<p_item->get_button_count(1);i++) { - - if (p_item->get_button_id(1,i)==3) { - found=i; - break; - } - } bool changed = _is_property_different(v,vorig,usage); @@ -2278,10 +2322,11 @@ void PropertyEditor::_refresh_item(TreeItem *p_item) { if (changed) { - p_item->add_button(1,get_icon("Reload","EditorIcons"),3); + has_reload=true; + } else { - p_item->erase_button(1,found); + //p_item->erase_button(1,found); } } @@ -2290,6 +2335,22 @@ void PropertyEditor::_refresh_item(TreeItem *p_item) { } + if (!has_reload && !obj->get_script().is_null()) { + Ref<Script> scr = obj->get_script(); + Variant orig_value; + if (scr->get_property_default_value(name,orig_value)) { + if (orig_value!=obj->get(name)) { + has_reload=true; + } + } + } + + if (!has_reload && found!=-1) { + p_item->erase_button(1,found); + } else if (has_reload && found==-1) { + p_item->add_button(1,get_icon("Reload","EditorIcons"),3); + } +#endif Dictionary d=p_item->get_metadata(0); set_item_text(p_item,d["type"],d["name"],d["hint"],d["hint_text"]); } @@ -3030,6 +3091,7 @@ void PropertyEditor::update_tree() { } } + bool has_reload=false; if (_might_be_in_instance()) { Variant vorig; @@ -3042,11 +3104,24 @@ void PropertyEditor::update_tree() { if (_is_property_different(v,vorig,usage)) { //print_line("FOR "+String(p.name)+" RELOAD WITH: "+String(v)+"("+Variant::get_type_name(v.get_type())+")=="+String(vorig)+"("+Variant::get_type_name(vorig.get_type())+")"); item->add_button(1,get_icon("Reload","EditorIcons"),3); + has_reload=true; } } } + if (!has_reload && !obj->get_script().is_null()) { + Ref<Script> scr = obj->get_script(); + Variant orig_value; + if (scr->get_property_default_value(p.name,orig_value)) { + if (orig_value!=obj->get(p.name)) { + item->add_button(1,get_icon("Reload","EditorIcons"),3); + } + } + } + + + } } @@ -3337,8 +3412,6 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) { call_deferred("_set_range_def",ti,prop,ti->get_range(p_column)+1.0); } else if (p_button==3) { - if (!_might_be_in_instance()) - return; if (!d.has("name")) return; @@ -3346,11 +3419,21 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) { Variant vorig; - if (_get_instanced_node_original_property(prop,vorig)) { + if (_might_be_in_instance() && _get_instanced_node_original_property(prop,vorig)) { _edit_set(prop,vorig); + return; } + if (!obj->get_script().is_null()) { + Ref<Script> scr = obj->get_script(); + Variant orig_value; + if (scr->get_property_default_value(prop,orig_value)) { + _edit_set(prop,orig_value); + } + } + + } else { Dictionary d = ti->get_metadata(0); @@ -3694,6 +3777,10 @@ class SectionedPropertyEditorFilter : public Object { for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { PropertyInfo pi=E->get(); + + if (section=="") + p_list->push_back(pi); + int sp = pi.name.find("/"); if (sp!=-1) { String ss = pi.name.substr(0,sp); @@ -3703,7 +3790,7 @@ class SectionedPropertyEditorFilter : public Object { p_list->push_back(pi); } } else { - if (section=="") + if (section=="global") p_list->push_back(pi); } } @@ -3728,10 +3815,18 @@ public: }; +void SectionedPropertyEditor::_notification(int p_what) { + + if (p_what==NOTIFICATION_ENTER_TREE) { + + clear_button->set_icon(get_icon("Close", "EditorIcons")); + } +} void SectionedPropertyEditor::_bind_methods() { ObjectTypeDB::bind_method("_section_selected",&SectionedPropertyEditor::_section_selected); + ObjectTypeDB::bind_method("_clear_search_box",&SectionedPropertyEditor::clear_search_box); } void SectionedPropertyEditor::_section_selected(int p_which) { @@ -3739,6 +3834,32 @@ void SectionedPropertyEditor::_section_selected(int p_which) { filter->set_section( sections->get_item_metadata(p_which) ); } +void SectionedPropertyEditor::clear_search_box() { + + if (search_box->get_text().strip_edges()=="") + return; + + search_box->clear(); + editor->update_tree(); +} + + +String SectionedPropertyEditor::get_current_section() const { + + String section = sections->get_item_metadata( sections->get_current() ); + + if (section=="") { + String name = editor->get_selected_path(); + + int sp = name.find("/"); + if (sp!=-1) + section = name.substr(0, sp); + + } + + return section; +} + String SectionedPropertyEditor::get_full_item_path(const String& p_item) { String base = sections->get_item_metadata( sections->get_current() ); @@ -3756,11 +3877,20 @@ void SectionedPropertyEditor::edit(Object* p_object) { sections->clear(); Set<String> existing_sections; + + existing_sections.insert(""); + sections->add_item("All"); + sections->set_item_metadata(0, ""); + for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { PropertyInfo pi=E->get(); + if (pi.usage&PROPERTY_USAGE_CATEGORY) continue; + if ( !(pi.usage&PROPERTY_USAGE_EDITOR) ) + continue; + if (pi.name.find(":")!=-1 || pi.name=="script/script") continue; int sp = pi.name.find("/"); @@ -3773,10 +3903,10 @@ void SectionedPropertyEditor::edit(Object* p_object) { } } else { - if (!existing_sections.has("")) { - existing_sections.insert(""); + if (!existing_sections.has("global")) { + existing_sections.insert("global"); sections->add_item("Global"); - sections->set_item_metadata(sections->get_item_count()-1,""); + sections->set_item_metadata(sections->get_item_count()-1,"global"); } } @@ -3801,6 +3931,8 @@ PropertyEditor *SectionedPropertyEditor::get_property_editor() { SectionedPropertyEditor::SectionedPropertyEditor() { + add_constant_override("separation", 8); + VBoxContainer *left_vb = memnew( VBoxContainer); left_vb->set_custom_minimum_size(Size2(160,0)); add_child(left_vb); @@ -3815,7 +3947,21 @@ SectionedPropertyEditor::SectionedPropertyEditor() { add_child(right_vb); filter = memnew( SectionedPropertyEditorFilter ); + + HBoxContainer *hbc = memnew( HBoxContainer ); + right_vb->add_margin_child("Search:",hbc); + + search_box = memnew( LineEdit ); + search_box->set_h_size_flags(SIZE_EXPAND_FILL); + hbc->add_child(search_box); + + clear_button = memnew( ToolButton ); + hbc->add_child(clear_button); + clear_button->connect("pressed", this, "_clear_search_box"); + editor = memnew( PropertyEditor ); + editor->register_text_enter(search_box); + editor->set_use_filter(true); editor->set_v_size_flags(SIZE_EXPAND_FILL); right_vb->add_margin_child("Properties:",editor,true); diff --git a/tools/editor/property_editor.h b/tools/editor/property_editor.h index 81fb078a11..5dc2f6d154 100644 --- a/tools/editor/property_editor.h +++ b/tools/editor/property_editor.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -114,6 +114,7 @@ class CustomPropertyEditor : public Popup { void _action_pressed(int p_which); void _type_create_selected(int p_idx); + void _color_changed(const Color& p_color); void _draw_easing(); void _menu_option(int p_which); @@ -192,6 +193,7 @@ class PropertyEditor : public Control { virtual void _changed_callback(Object *p_changed,const char * p_what); virtual void _changed_callbacks(Object *p_changed,const String& p_callback); + void _check_reload_status(const String&p_name,TreeItem* item); void _edit_button(Object *p_item, int p_column, int p_button); @@ -257,17 +259,24 @@ class SectionedPropertyEditor : public HBoxContainer { OBJ_TYPE(SectionedPropertyEditor,HBoxContainer); ItemList *sections; SectionedPropertyEditorFilter *filter; + LineEdit *search_box; + ToolButton *clear_button; PropertyEditor *editor; - - static void _bind_methods(); void _section_selected(int p_which); +protected: + + void _notification(int p_what); + static void _bind_methods(); public: PropertyEditor *get_property_editor(); void edit(Object* p_object); String get_full_item_path(const String& p_item); + String get_current_section() const; + + void clear_search_box(); SectionedPropertyEditor(); ~SectionedPropertyEditor(); diff --git a/tools/editor/pvrtc_compress.cpp b/tools/editor/pvrtc_compress.cpp index a2f98adbe0..c30aedc1dc 100644 --- a/tools/editor/pvrtc_compress.cpp +++ b/tools/editor/pvrtc_compress.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/pvrtc_compress.h b/tools/editor/pvrtc_compress.h index c4fb0bacb5..129faee080 100644 --- a/tools/editor/pvrtc_compress.h +++ b/tools/editor/pvrtc_compress.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/quick_open.cpp b/tools/editor/quick_open.cpp index 6135a4ab64..22f4a40c83 100644 --- a/tools/editor/quick_open.cpp +++ b/tools/editor/quick_open.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,7 +30,7 @@ #include "os/keyboard.h" -void EditorQuickOpen::popup(const StringName &p_base, bool p_dontclear, bool p_add_dirs) { +void EditorQuickOpen::popup(const StringName &p_base, bool p_enable_multi, bool p_add_dirs, bool p_dontclear) { add_directories=p_add_dirs; popup_centered_ratio(0.6); @@ -38,13 +38,38 @@ void EditorQuickOpen::popup(const StringName &p_base, bool p_dontclear, bool p_a search_box->select_all(); else search_box->clear(); + if (p_enable_multi) + search_options->set_select_mode(Tree::SELECT_MULTI); + else + search_options->set_select_mode(Tree::SELECT_SINGLE); search_box->grab_focus(); base_type=p_base; _update_search(); +} + +String EditorQuickOpen::get_selected() const { + TreeItem *ti = search_options->get_selected(); + if (!ti) + return String(); + return "res://" + ti->get_text(0); } +Vector<String> EditorQuickOpen::get_selected_files() const { + + Vector<String> files; + + TreeItem* item = search_options->get_next_selected(search_options->get_root()); + while (item) { + + files.push_back("res://"+item->get_text(0)); + + item = search_options->get_next_selected(item); + } + + return files; +} void EditorQuickOpen::_text_changed(const String& p_newtext) { @@ -132,7 +157,7 @@ void EditorQuickOpen::_confirmed() { TreeItem *ti = search_options->get_selected(); if (!ti) return; - emit_signal("quick_open","res://"+ti->get_text(0)); + emit_signal("quick_open"); hide(); } @@ -156,7 +181,7 @@ void EditorQuickOpen::_bind_methods() { ObjectTypeDB::bind_method(_MD("_confirmed"),&EditorQuickOpen::_confirmed); ObjectTypeDB::bind_method(_MD("_sbox_input"),&EditorQuickOpen::_sbox_input); - ADD_SIGNAL(MethodInfo("quick_open",PropertyInfo(Variant::STRING,"respath"))); + ADD_SIGNAL(MethodInfo("quick_open")); } diff --git a/tools/editor/quick_open.h b/tools/editor/quick_open.h index 8b38256d39..520f7e569d 100644 --- a/tools/editor/quick_open.h +++ b/tools/editor/quick_open.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -61,7 +61,10 @@ public: StringName get_base_type() const; - void popup(const StringName& p_base,bool p_dontclear=false,bool p_add_dirs=false); + String get_selected() const; + Vector<String> get_selected_files() const; + + void popup(const StringName& p_base,bool p_enable_multi=false,bool p_add_dirs=false,bool p_dontclear=false); EditorQuickOpen(); }; diff --git a/tools/editor/register_exporters.h b/tools/editor/register_exporters.h index 0e1ad2ca46..364ad5efc9 100644 --- a/tools/editor/register_exporters.h +++ b/tools/editor/register_exporters.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/reparent_dialog.cpp b/tools/editor/reparent_dialog.cpp index f024844731..97b27603b2 100644 --- a/tools/editor/reparent_dialog.cpp +++ b/tools/editor/reparent_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -62,7 +62,7 @@ void ReparentDialog::_reparent() { if (tree->get_selected()) { - emit_signal("reparent",tree->get_selected()->get_path(),node_only->is_pressed()); + emit_signal("reparent",tree->get_selected()->get_path(),keep_transform->is_pressed()); hide(); } } @@ -78,7 +78,7 @@ void ReparentDialog::_bind_methods() { ObjectTypeDB::bind_method("_reparent",&ReparentDialog::_reparent); ObjectTypeDB::bind_method("_cancel",&ReparentDialog::_cancel); - ADD_SIGNAL( MethodInfo("reparent",PropertyInfo(Variant::NODE_PATH,"path"),PropertyInfo(Variant::BOOL,"only_node"))); + ADD_SIGNAL( MethodInfo("reparent",PropertyInfo(Variant::NODE_PATH,"path"),PropertyInfo(Variant::BOOL,"keep_global_xform"))); } @@ -101,15 +101,18 @@ ReparentDialog::ReparentDialog() { //label->set_pos( Point2( 15,8) ); //label->set_text("Reparent Location (Select new Parent):"); - node_only = memnew( CheckButton ); - add_child(node_only); - node_only->hide(); + keep_transform = memnew( CheckBox ); + keep_transform->set_text("Keep Global Transform"); + keep_transform->set_pressed(true); + vbc->add_child(keep_transform); + //vbc->add_margin_child("Options:",node_only);; //cancel->connect("pressed", this,"_cancel"); get_ok()->set_text("Reparent"); + } diff --git a/tools/editor/reparent_dialog.h b/tools/editor/reparent_dialog.h index 78c0df9285..296102e4b9 100644 --- a/tools/editor/reparent_dialog.h +++ b/tools/editor/reparent_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,6 +32,7 @@ #include "scene/gui/dialogs.h" #include "scene/gui/button.h" #include "scene/gui/check_button.h" +#include "scene/gui/check_box.h" #include "tools/editor/scene_tree_editor.h" #include "scene/gui/line_edit.h" /** @@ -42,12 +43,14 @@ class ReparentDialog : public ConfirmationDialog { OBJ_TYPE( ReparentDialog, ConfirmationDialog ); SceneTreeEditor *tree; - CheckButton *node_only; + CheckBox *keep_transform; + void update_tree(); void _reparent(); void _cancel(); - + + protected: void _notification(int p_what); diff --git a/tools/editor/resources_dock.cpp b/tools/editor/resources_dock.cpp index b69eec4a51..5e44162c93 100644 --- a/tools/editor/resources_dock.cpp +++ b/tools/editor/resources_dock.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/resources_dock.h b/tools/editor/resources_dock.h index 933b457b29..978291fc3f 100644 --- a/tools/editor/resources_dock.h +++ b/tools/editor/resources_dock.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/run_settings_dialog.cpp b/tools/editor/run_settings_dialog.cpp index e883c69939..e8c509d79d 100644 --- a/tools/editor/run_settings_dialog.cpp +++ b/tools/editor/run_settings_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/run_settings_dialog.h b/tools/editor/run_settings_dialog.h index fdb8857f6b..09319702f3 100644 --- a/tools/editor/run_settings_dialog.h +++ b/tools/editor/run_settings_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 8b5bf8c1e1..0acd308fe6 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,6 +35,7 @@ #include "tools/editor/plugins/canvas_item_editor_plugin.h" #include "script_editor_debugger.h" #include "tools/editor/plugins/script_editor_plugin.h" +#include "core/io/resource_saver.h" #include "multi_node_edit.h" void SceneTreeDock::_unhandled_key_input(InputEvent p_event) { @@ -485,7 +486,54 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { delete_dialog->popup_centered_minsize(); } + } break; + case TOOL_NEW_SCENE_FROM: { + + Node *scene = editor_data->get_edited_scene_root(); + + if (!scene) { + accept->get_ok()->set_text("I see.."); + accept->set_text("This operation can't be done without a scene."); + accept->popup_centered_minsize(); + break; + } + + List<Node*> selection = editor_selection->get_selected_node_list(); + + if (selection.size()!=1) { + accept->get_ok()->set_text("I see.."); + accept->set_text("This operation requires a single selected node."); + accept->popup_centered_minsize(); + break; + } + + Node *tocopy = selection.front()->get(); + + if (tocopy!=editor_data->get_edited_scene_root() && tocopy->get_filename()!="") { + accept->get_ok()->set_text("I see.."); + accept->set_text("This operation can't be done on instanced scenes."); + accept->popup_centered_minsize(); + break; + } + + new_scene_from_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); + + List<String> extensions; + Ref<PackedScene> sd = memnew( PackedScene ); + ResourceSaver::get_recognized_extensions(sd,&extensions); + new_scene_from_dialog->clear_filters(); + for(int i=0;i<extensions.size();i++) { + new_scene_from_dialog->add_filter("*."+extensions[i]+" ; "+extensions[i].to_upper()); + } + String existing; + if (extensions.size()) { + existing="new_scene."+extensions.front()->get().to_lower(); + } + new_scene_from_dialog->set_current_path(existing); + + new_scene_from_dialog->popup_centered_ratio(); + new_scene_from_dialog->set_title("Save New Scene As.."); } break; @@ -520,6 +568,7 @@ void SceneTreeDock::_notification(int p_what) { "MoveDown", "Duplicate", "Reparent", + "CreateNewSceneFrom", "MultiNodeEdit", "Remove", }; @@ -889,7 +938,7 @@ bool SceneTreeDock::_validate_no_foreign() { return true; } -void SceneTreeDock::_node_reparent(NodePath p_path,bool p_node_only) { +void SceneTreeDock::_node_reparent(NodePath p_path,bool p_keep_global_xform) { Node *node = scene_tree->get_selected(); @@ -948,6 +997,23 @@ void SceneTreeDock::_node_reparent(NodePath p_path,bool p_node_only) { editor_data->get_undo_redo().add_do_method(sed,"live_debug_reparent_node",edited_scene->get_path_to(node),edited_scene->get_path_to(new_parent),new_name,-1); editor_data->get_undo_redo().add_undo_method(sed,"live_debug_reparent_node",NodePath(String(edited_scene->get_path_to(new_parent))+"/"+new_name),edited_scene->get_path_to(node->get_parent()),node->get_name(),node->get_index()); + if (p_keep_global_xform) { + if (node->cast_to<Node2D>()) + editor_data->get_undo_redo().add_do_method(node,"set_global_transform",node->cast_to<Node2D>()->get_global_transform()); + if (node->cast_to<Spatial>()) + editor_data->get_undo_redo().add_do_method(node,"set_global_transform",node->cast_to<Spatial>()->get_global_transform()); + if (node->cast_to<Control>()) { + bool can_do_it=false; + Control *c=node->cast_to<Control>(); + if (c->get_parent()->cast_to<Container>()) + can_do_it=false; + for(int i=0;i<4;i++) { + if (c->get_anchor(Margin(i))!=ANCHOR_BEGIN) + can_do_it=false; + } + editor_data->get_undo_redo().add_do_method(node,"set_global_pos",node->cast_to<Control>()->get_global_pos()); + } + } editor_data->get_undo_redo().add_do_method(this,"_set_owners",edited_scene,owners); @@ -982,6 +1048,26 @@ void SceneTreeDock::_node_reparent(NodePath p_path,bool p_node_only) { if (editor->get_animation_editor()->get_root()==node) editor_data->get_undo_redo().add_undo_method(editor->get_animation_editor(),"set_root",node); + if (p_keep_global_xform) { + if (node->cast_to<Node2D>()) + editor_data->get_undo_redo().add_undo_method(node,"set_transform",node->cast_to<Node2D>()->get_transform()); + if (node->cast_to<Spatial>()) + editor_data->get_undo_redo().add_undo_method(node,"set_transform",node->cast_to<Spatial>()->get_transform()); + if (node->cast_to<Control>()) { + bool can_do_it=false; + Control *c=node->cast_to<Control>(); + if (c->get_parent()->cast_to<Container>()) + can_do_it=false; + for(int i=0;i<4;i++) { + if (c->get_anchor(Margin(i))!=ANCHOR_BEGIN) + can_do_it=false; + } + editor_data->get_undo_redo().add_undo_method(node,"set_pos",node->cast_to<Control>()->get_pos()); + } + } + + + } perform_node_renames(NULL,&path_renames); @@ -1103,6 +1189,7 @@ void SceneTreeDock::_update_tool_buttons() { tool_buttons[TOOL_DUPLICATE]->set_disabled(disable_root); tool_buttons[TOOL_REPARENT]->set_disabled(disable_root); tool_buttons[TOOL_ERASE]->set_disabled(disable); + tool_buttons[TOOL_NEW_SCENE_FROM]->set_disabled(disable_root); tool_buttons[TOOL_MULTI_EDIT]->set_disabled(EditorNode::get_singleton()->get_editor_selection()->get_selection().size()<2); @@ -1231,6 +1318,11 @@ void SceneTreeDock::_create() { editor->set_edited_scene(newnode); } + //small hack to make collisionshapes and other kind of nodes to work + for(int i=0;i<newnode->get_child_count();i++) { + Node *c=newnode->get_child(i); + c->call("set_transform", c->call("get_transform") ); + } editor_data->get_undo_redo().clear_history(); newnode->set_name(newname); @@ -1284,6 +1376,59 @@ void SceneTreeDock::_import_subscene() { */ } +void SceneTreeDock::_new_scene_from(String p_file) { + + List<Node*> selection = editor_selection->get_selected_node_list(); + + if (selection.size()!=1) { + accept->get_ok()->set_text("I see.."); + accept->set_text("This operation requires a single selected node."); + accept->popup_centered_minsize(); + return; + } + + Node *base = selection.front()->get(); + + Map<Node*,Node*> reown; + reown[editor_data->get_edited_scene_root()]=base; + Node *copy = base->duplicate_and_reown(reown); + if (copy) { + + Ref<PackedScene> sdata = memnew( PackedScene ); + Error err = sdata->pack(copy); + memdelete(copy); + + if (err!=OK) { + accept->get_ok()->set_text("I see.."); + accept->set_text("Couldn't save new scene. Likely dependencies (instances) couldn't be satisfied."); + accept->popup_centered_minsize(); + return; + } + + int flg=0; + if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources")) + flg|=ResourceSaver::FLAG_COMPRESS; + if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative")) + flg|=ResourceSaver::FLAG_RELATIVE_PATHS; + + + err = ResourceSaver::save(p_file,sdata,flg); + if (err!=OK) { + accept->get_ok()->set_text("I see.."); + accept->set_text("Error saving scene."); + accept->popup_centered_minsize(); + return; + } + + } else { + accept->get_ok()->set_text("I see.."); + accept->set_text("Error duplicating scene to save it."); + accept->popup_centered_minsize(); + return; + } + +} + void SceneTreeDock::_bind_methods() { ObjectTypeDB::bind_method(_MD("_tool_selected"),&SceneTreeDock::_tool_selected); @@ -1301,6 +1446,7 @@ void SceneTreeDock::_bind_methods() { ObjectTypeDB::bind_method(_MD("_node_prerenamed"),&SceneTreeDock::_node_prerenamed); ObjectTypeDB::bind_method(_MD("_import_subscene"),&SceneTreeDock::_import_subscene); ObjectTypeDB::bind_method(_MD("_selection_changed"),&SceneTreeDock::_selection_changed); + ObjectTypeDB::bind_method(_MD("_new_scene_from"),&SceneTreeDock::_new_scene_from); ObjectTypeDB::bind_method(_MD("instance"),&SceneTreeDock::instance); } @@ -1373,9 +1519,10 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec scene_tree->set_undo_redo(&editor_data->get_undo_redo()); scene_tree->set_editor_selection(editor_selection); + HBoxContainer *hbc_bottom = memnew( HBoxContainer ); vbc->add_child(hbc_bottom); - + hbc_bottom->add_constant_override("separation", 0); tb = memnew( ToolButton ); tb->connect("pressed",this,"_tool_selected",make_binds(TOOL_MOVE_UP, false)); @@ -1404,6 +1551,12 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec hbc_bottom->add_spacer(); tb = memnew( ToolButton ); + tb->connect("pressed",this,"_tool_selected",make_binds(TOOL_NEW_SCENE_FROM, false)); + tb->set_tooltip("Create New Scene From Node(s)"); + hbc_bottom->add_child(tb); + tool_buttons[TOOL_NEW_SCENE_FROM]=tb; + + tb = memnew( ToolButton ); tb->connect("pressed",this,"_tool_selected",make_binds(TOOL_MULTI_EDIT, false)); tb->set_tooltip("Multi-Edit Selected Nodes"); hbc_bottom->add_child(tb); @@ -1423,12 +1576,15 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec groups_editor = memnew( GroupsEditor ); add_child(groups_editor); groups_editor->set_undo_redo(&editor_data->get_undo_redo()); + connect_dialog = memnew( ConnectionsDialog(p_editor) ); add_child(connect_dialog); connect_dialog->set_undoredo(&editor_data->get_undo_redo()); + script_create_dialog = memnew( ScriptCreateDialog ); add_child(script_create_dialog); script_create_dialog->connect("script_created",this,"_script_created"); + reparent_dialog = memnew( ReparentDialog ); add_child(reparent_dialog); reparent_dialog->connect("reparent",this,"_node_reparent"); @@ -1444,10 +1600,16 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec delete_dialog = memnew( ConfirmationDialog ); add_child(delete_dialog); delete_dialog->connect("confirmed",this,"_delete_confirm"); + import_subscene_dialog = memnew( EditorSubScene ); add_child(import_subscene_dialog); import_subscene_dialog->connect("subscene_selected",this,"_import_subscene"); + new_scene_from_dialog = memnew( EditorFileDialog ); + new_scene_from_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); + add_child(new_scene_from_dialog); + new_scene_from_dialog->connect("file_selected",this,"_new_scene_from"); + first_enter=true; diff --git a/tools/editor/scene_tree_dock.h b/tools/editor/scene_tree_dock.h index b1c53d2ff9..114e2c5c97 100644 --- a/tools/editor/scene_tree_dock.h +++ b/tools/editor/scene_tree_dock.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -62,6 +62,7 @@ class SceneTreeDock : public VBoxContainer { TOOL_MOVE_DOWN, TOOL_DUPLICATE, TOOL_REPARENT, + TOOL_NEW_SCENE_FROM, TOOL_MULTI_EDIT, TOOL_ERASE, TOOL_BUTTON_MAX @@ -90,6 +91,7 @@ class SceneTreeDock : public VBoxContainer { ReparentDialog *reparent_dialog; EditorFileDialog *file; EditorSubScene *import_subscene_dialog; + EditorFileDialog *new_scene_from_dialog; bool first_enter; @@ -99,7 +101,7 @@ class SceneTreeDock : public VBoxContainer { EditorNode *editor; Node *_duplicate(Node *p_node, Map<Node*,Node*> &duplimap); - void _node_reparent(NodePath p_path,bool p_node_only); + void _node_reparent(NodePath p_path, bool p_keep_global_xform); void _set_owners(Node *p_owner, const Array& p_nodes); void _load_request(const String& p_path); void _script_open_request(const Ref<Script>& p_script); @@ -119,6 +121,8 @@ class SceneTreeDock : public VBoxContainer { void _import_subscene(); + void _new_scene_from(String p_file); + bool _validate_no_foreign(); void _selection_changed(); diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index a164703e31..531fe83bc3 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/scene_tree_editor.h b/tools/editor/scene_tree_editor.h index 50cca4e24b..334debc148 100644 --- a/tools/editor/scene_tree_editor.h +++ b/tools/editor/scene_tree_editor.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/scenes.cpp b/tools/editor/scenes.cpp index ada5751b5a..e6569c98a9 100644 --- a/tools/editor/scenes.cpp +++ b/tools/editor/scenes.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/scenes.h b/tools/editor/scenes.h index 463c3b5e18..bae9ef65f0 100644 --- a/tools/editor/scenes.h +++ b/tools/editor/scenes.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp index 5880a6eef6..5abc4992df 100644 --- a/tools/editor/scenes_dock.cpp +++ b/tools/editor/scenes_dock.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1254,6 +1254,8 @@ ScenesDock::ScenesDock(EditorNode *p_editor) { history_pos=0; tree_mode=true; + path="res://"; + } diff --git a/tools/editor/scenes_dock.h b/tools/editor/scenes_dock.h index e5e0eafc24..a1978a3ca4 100644 --- a/tools/editor/scenes_dock.h +++ b/tools/editor/scenes_dock.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/script_create_dialog.cpp b/tools/editor/script_create_dialog.cpp index 622150ab68..409e8be870 100644 --- a/tools/editor/script_create_dialog.cpp +++ b/tools/editor/script_create_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/script_create_dialog.h b/tools/editor/script_create_dialog.h index 59fde8fbd5..181989402e 100644 --- a/tools/editor/script_create_dialog.h +++ b/tools/editor/script_create_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index d0bf4faf02..aad89d1272 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/tools/editor/script_editor_debugger.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -569,8 +569,8 @@ void ScriptEditorDebugger::_notification(int p_what) { ppeer->set_stream_peer(connection); - show(); + emit_signal("show_debugger",true); dobreak->set_disabled(false); tabs->set_current_tab(0); @@ -770,6 +770,7 @@ void ScriptEditorDebugger::_stack_dump_frame_selected() { void ScriptEditorDebugger::_hide_request() { + hide(); emit_signal("show_debugger",false); } diff --git a/tools/editor/script_editor_debugger.h b/tools/editor/script_editor_debugger.h index 43666b37d5..55c79ca3b3 100644 --- a/tools/editor/script_editor_debugger.h +++ b/tools/editor/script_editor_debugger.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/settings_config_dialog.cpp b/tools/editor/settings_config_dialog.cpp index d3c9e39cbb..3d30b3882d 100644 --- a/tools/editor/settings_config_dialog.cpp +++ b/tools/editor/settings_config_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -73,9 +73,6 @@ void EditorSettingsDialog::popup_edit_settings() { property_editor->edit(EditorSettings::get_singleton()); property_editor->get_property_editor()->update_tree(); - search_box->select_all(); - search_box->grab_focus(); - popup_centered_ratio(0.7); } @@ -248,22 +245,15 @@ void EditorSettingsDialog::_update_plugins() { } -void EditorSettingsDialog::_clear_search_box() { - - if (search_box->get_text()=="") - return; - - search_box->clear(); - property_editor->get_property_editor()->update_tree(); -} - void EditorSettingsDialog::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { rescan_plugins->set_icon(get_icon("Reload","EditorIcons")); - clear_button->set_icon(get_icon("Close","EditorIcons")); _update_plugins(); + } else if (p_what==NOTIFICATION_POST_POPUP) { + + property_editor->clear_search_box(); } } @@ -275,7 +265,6 @@ void EditorSettingsDialog::_bind_methods() { ObjectTypeDB::bind_method(_MD("_plugin_settings"),&EditorSettingsDialog::_plugin_settings); ObjectTypeDB::bind_method(_MD("_plugin_edited"),&EditorSettingsDialog::_plugin_edited); ObjectTypeDB::bind_method(_MD("_plugin_install"),&EditorSettingsDialog::_plugin_install); - ObjectTypeDB::bind_method(_MD("_clear_search_box"),&EditorSettingsDialog::_clear_search_box); } EditorSettingsDialog::EditorSettingsDialog() { @@ -286,38 +275,17 @@ EditorSettingsDialog::EditorSettingsDialog() { add_child(tabs); set_child_rect(tabs); - VBoxContainer *vbc = memnew( VBoxContainer ); - tabs->add_child(vbc); - vbc->set_name("General"); - - HBoxContainer *hbc = memnew( HBoxContainer ); - hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); - vbc->add_child(hbc); - - Label *l = memnew( Label ); - l->set_text("Search: "); - hbc->add_child(l); - - search_box = memnew( LineEdit ); - search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); - hbc->add_child(search_box); - - clear_button = memnew( ToolButton ); - hbc->add_child(clear_button); - clear_button->connect("pressed",this,"_clear_search_box"); - property_editor = memnew( SectionedPropertyEditor ); //property_editor->hide_top_label(); - property_editor->get_property_editor()->set_use_filter(true); - property_editor->get_property_editor()->register_text_enter(search_box); + property_editor->set_name("General"); property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); - vbc->add_child(property_editor); + tabs->add_child(property_editor); - vbc = memnew( VBoxContainer ); + VBoxContainer *vbc = memnew( VBoxContainer ); tabs->add_child(vbc); vbc->set_name("Plugins"); - hbc = memnew( HBoxContainer ); + HBoxContainer *hbc = memnew( HBoxContainer ); vbc->add_child(hbc); hbc->add_child( memnew( Label("Plugin List: "))); hbc->add_spacer(); diff --git a/tools/editor/settings_config_dialog.h b/tools/editor/settings_config_dialog.h index 4934c8c97b..119b4035ca 100644 --- a/tools/editor/settings_config_dialog.h +++ b/tools/editor/settings_config_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -51,8 +51,6 @@ class EditorSettingsDialog : public AcceptDialog { Button *rescan_plugins; Tree *plugins; - LineEdit *search_box; - ToolButton *clear_button; SectionedPropertyEditor *property_editor; Timer *timer; diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp index 04a6b1b437..320b0c3a70 100644 --- a/tools/editor/spatial_editor_gizmos.cpp +++ b/tools/editor/spatial_editor_gizmos.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/spatial_editor_gizmos.h b/tools/editor/spatial_editor_gizmos.h index bc7e8ad21d..669d3e2380 100644 --- a/tools/editor/spatial_editor_gizmos.h +++ b/tools/editor/spatial_editor_gizmos.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/export/blender25/io_scene_dae/export_dae.py b/tools/export/blender25/io_scene_dae/export_dae.py index b846f0e2d8..7ee0e179b8 100644 --- a/tools/export/blender25/io_scene_dae/export_dae.py +++ b/tools/export/blender25/io_scene_dae/export_dae.py @@ -921,7 +921,7 @@ class DaeExporter: if (node.parent.type=="ARMATURE"): armature=node.parent if (armcount>1): - self.operator.report({'WARNING'},'Object "'+node.name+'" refers to more than one armature! This is unsopported.') + self.operator.report({'WARNING'},'Object "'+node.name+'" refers to more than one armature! This is unsupported.') if (armcount==0): self.operator.report({'WARNING'},'Object "'+node.name+'" is child of an armature, but has no armature modifier.') diff --git a/tools/ios_xcode_template/godot_ios/main.m b/tools/ios_xcode_template/godot_ios/main.m index 6bb6bc2188..3e4ea5e129 100644 --- a/tools/ios_xcode_template/godot_ios/main.m +++ b/tools/ios_xcode_template/godot_ios/main.m @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m b/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m index 75e44659e0..d9fac0a250 100644 --- a/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m +++ b/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/pck/pck_packer.cpp b/tools/pck/pck_packer.cpp index d398fefb5f..228d37df7c 100644 --- a/tools/pck/pck_packer.cpp +++ b/tools/pck/pck_packer.cpp @@ -26,7 +26,7 @@ void PCKPacker::_bind_methods() { ObjectTypeDB::bind_method(_MD("pck_start","pck_name","alignment"),&PCKPacker::pck_start); ObjectTypeDB::bind_method(_MD("add_file","pck_path","source_path"),&PCKPacker::add_file); - ObjectTypeDB::bind_method(_MD("flush"),&PCKPacker::flush); + ObjectTypeDB::bind_method(_MD("flush","verbose"),&PCKPacker::flush); }; |